-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3693 from inception-project/feature/3511-Add-empt…
…y-project-template #3511 - Add empty project template
- Loading branch information
Showing
2 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
...de/tudarmstadt/ukp/clarin/webanno/project/initializers/empty/EmptyProjectInitializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* Licensed to the Technische Universität Darmstadt under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The Technische Universität Darmstadt | ||
* licenses this file to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package de.tudarmstadt.ukp.clarin.webanno.project.initializers.empty; | ||
|
||
import static java.util.Arrays.asList; | ||
|
||
import java.io.IOException; | ||
import java.util.List; | ||
|
||
import de.tudarmstadt.ukp.clarin.webanno.api.project.ProjectInitializer; | ||
import de.tudarmstadt.ukp.clarin.webanno.model.Project; | ||
import de.tudarmstadt.ukp.clarin.webanno.project.initializers.QuickProjectInitializer; | ||
import de.tudarmstadt.ukp.clarin.webanno.project.initializers.SentenceLayerInitializer; | ||
import de.tudarmstadt.ukp.clarin.webanno.project.initializers.TokenLayerInitializer; | ||
import de.tudarmstadt.ukp.clarin.webanno.project.initializers.config.ProjectInitializersAutoConfiguration; | ||
|
||
/** | ||
* <p> | ||
* This class is exposed as a Spring Component via | ||
* {@link ProjectInitializersAutoConfiguration#emptyProjectInitializer}. | ||
* </p> | ||
*/ | ||
public class EmptyProjectInitializer | ||
implements QuickProjectInitializer | ||
{ | ||
@Override | ||
public String getName() | ||
{ | ||
return "Empty project (no layers)"; | ||
} | ||
|
||
@Override | ||
public boolean alreadyApplied(Project aProject) | ||
{ | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean applyByDefault() | ||
{ | ||
return false; | ||
} | ||
|
||
@Override | ||
public List<Class<? extends ProjectInitializer>> getDependencies() | ||
{ | ||
return asList( // | ||
TokenLayerInitializer.class, // | ||
SentenceLayerInitializer.class); | ||
} | ||
|
||
@Override | ||
public void configure(Project aProject) throws IOException | ||
{ | ||
aProject.setDescription("This project has no pre-defined layers. You will only be able to " | ||
+ "annotate after you have defined annotation layers in the project settings."); | ||
} | ||
} |