Tabnine Logo
ExportedAnnotationLayer
Code IndexAdd Tabnine to your IDE (free)

How to use
ExportedAnnotationLayer
in
de.tudarmstadt.ukp.clarin.webanno.export.model

Best Java code snippets using de.tudarmstadt.ukp.clarin.webanno.export.model.ExportedAnnotationLayer (Showing top 16 results out of 315)

origin: webanno/webanno

public void importLayer(AnnotationLayer aLayer, ExportedAnnotationLayer aExLayer,
    Project aProject)
  throws IOException
{
  aLayer.setAllowStacking(aExLayer.isAllowStacking());
  aLayer.setBuiltIn(aExLayer.isBuiltIn());
  aLayer.setReadonly(aExLayer.isReadonly());
  aLayer.setCrossSentence(aExLayer.isCrossSentence());
  aLayer.setDescription(aExLayer.getDescription());
  aLayer.setEnabled(aExLayer.isEnabled());
  if (aExLayer.getAnchoringMode() == null) {
    // This allows importing old projects which did not have the anchoring mode yet
    aLayer.setAnchoringMode(aExLayer.isLockToTokenOffset(), aExLayer.isMultipleTokens());
  }
  else {
    aLayer.setAnchoringMode(aExLayer.getAnchoringMode());
  }
  aLayer.setValidationMode(aExLayer.getValidationMode() != null ? aExLayer.getValidationMode()
      : ValidationMode.NEVER);
  aLayer.setLinkedListBehavior(aExLayer.isLinkedListBehavior());
  aLayer.setUiName(aExLayer.getUiName());
  aLayer.setName(aExLayer.getName());
  aLayer.setProject(aProject);
  aLayer.setType(aExLayer.getType());
  annotationService.createLayer(aLayer);
}
origin: webanno/webanno

  AnnotationLayer aLayer)
ExportedAnnotationLayer exLayer = new ExportedAnnotationLayer();
exLayer.setAllowStacking(aLayer.isAllowStacking());
exLayer.setBuiltIn(aLayer.isBuiltIn());
exLayer.setReadonly(aLayer.isReadonly());
exLayer.setCrossSentence(aLayer.isCrossSentence());
exLayer.setDescription(aLayer.getDescription());
exLayer.setEnabled(aLayer.isEnabled());
exLayer.setLockToTokenOffset(AnchoringMode.SINGLE_TOKEN.equals(aLayer.getAnchoringMode()));
exLayer.setMultipleTokens(AnchoringMode.TOKENS.equals(aLayer.getAnchoringMode()));
exLayer.setAnchoringMode(aLayer.getAnchoringMode());
exLayer.setValidationMode(aLayer.getValidationMode());
exLayer.setLinkedListBehavior(aLayer.isLinkedListBehavior());
exLayer.setName(aLayer.getName());
exLayer.setProjectName(aLayer.getProject().getName());
exLayer.setType(aLayer.getType());
exLayer.setUiName(aLayer.getUiName());
exLayer.setFeatures(exFeatures);
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-ui-project

  if (exLayer.getAttachType() != null) {
    layer.setAttachType(layersMap.get(exLayer.getAttachType().getName()));
  if (exLayer.getAttachFeature() != null) {
    AnnotationLayer attachLayer = annotationService.getLayer(
        exLayer.getAttachType().getName(), project);
    AnnotationFeature attachFeature = annotationService
        .getFeature(exLayer.getAttachFeature().getName(), attachLayer);
    layer.setAttachFeature(attachFeature);
layerDetailForm.setModelObject(layersMap.get(exLayers[0].getName()));
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-api-dao

if (annotationService.existsLayer(exLayer.getName(), exLayer.getType(), aProject)) {
  AnnotationLayer layer = annotationService.getLayer(exLayer.getName(), aProject);
  importLayer(layer, exLayer, aProject);
  for (ExportedAnnotationFeature exfeature : exLayer.getFeatures()) {
    if (annotationService.existsFeature(exfeature.getName(), layer)) {
      AnnotationFeature feature = annotationService.getFeature(
  AnnotationLayer layer = new AnnotationLayer();
  importLayer(layer, exLayer, aProject);
  for (ExportedAnnotationFeature exfeature : exLayer.getFeatures()) {
    AnnotationFeature feature = new AnnotationFeature();
    feature.setLayer(layer);
if (exLayer.getAttachType() != null) {
  AnnotationLayer layer = annotationService.getLayer(exLayer.getName(), aProject);
  AnnotationLayer attachLayer = annotationService.getLayer(exLayer.getAttachType()
      .getName(), aProject);
  layer.setAttachType(attachLayer);
  if (exLayer.getAttachFeature() != null) {
    AnnotationFeature attachFeature = annotationService
        .getFeature(exLayer.getAttachFeature().getName(), attachLayer);
    layer.setAttachFeature(attachFeature);
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-ui-project

AnnotationLayer layer;
if (annotationService.existsLayer(aExLayer.getName(), aExLayer.getType(), project)) {
  layer = annotationService.getLayer(aExLayer.getName(), project);
  ImportUtil.setLayer(annotationService, layer, aExLayer, project, aUser);
for (ExportedAnnotationFeature exfeature : aExLayer.getFeatures()) {
  ExportedTagSet exTagset = exfeature.getTagSet();
  TagSet tagSet = null;
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-ui-project

private IResourceStream exportLayerJson()
{
  try {
    AnnotationLayer layer = getModelObject();
    List<ExportedAnnotationLayer> exLayers = new ArrayList<>();
    ExportedAnnotationLayer exMainLayer = ImportUtil.exportLayerDetails(null, null,
        layer, annotationService);
    exLayers.add(exMainLayer);
    // If the layer is attached to another layer, then we also have to export
    // that, otherwise we would be missing it during re-import.
    if (layer.getAttachType() != null) {
      AnnotationLayer attachLayer = layer.getAttachType();
      ExportedAnnotationLayer exAttachLayer = ImportUtil.exportLayerDetails(null,
          null, attachLayer, annotationService);
      exMainLayer.setAttachType(
          new ExportedAnnotationLayerReference(exAttachLayer.getName()));
      exLayers.add(exAttachLayer);
    }
    return new InputStreamResourceStream(new ByteArrayInputStream(
        JSONUtil.toPrettyJsonString(exLayers).getBytes("UTF-8")));
  }
  catch (Exception e) {
    error("Unable to generate the JSON file: " + ExceptionUtils.getRootCauseMessage(e));
    ProjectLayersPanel.LOG.error("Unable to generate the JSON file", e);
    RequestCycle.get().find(IPartialPageRequestHandler.class)
        .ifPresent(handler -> handler.addChildren(getPage(), IFeedback.class));
    return null;
  }
}
origin: webanno/webanno

if (annotationService.existsLayer(exLayer.getName(), exLayer.getType(), aProject)) {
  AnnotationLayer layer = annotationService.getLayer(exLayer.getName(), aProject);
  importLayer(layer, exLayer, aProject);
  for (ExportedAnnotationFeature exfeature : exLayer.getFeatures()) {
    if (annotationService.existsFeature(exfeature.getName(), layer)) {
      AnnotationFeature feature = annotationService.getFeature(
  AnnotationLayer layer = new AnnotationLayer();
  importLayer(layer, exLayer, aProject);
  for (ExportedAnnotationFeature exfeature : exLayer.getFeatures()) {
    AnnotationFeature feature = new AnnotationFeature();
    feature.setLayer(layer);
if (exLayer.getAttachType() != null) {
  AnnotationLayer layer = annotationService.getLayer(exLayer.getName(), aProject);
  AnnotationLayer attachLayer = annotationService.getLayer(exLayer.getAttachType()
      .getName(), aProject);
  layer.setAttachType(attachLayer);
  if (exLayer.getAttachFeature() != null) {
    AnnotationFeature attachFeature = annotationService
        .getFeature(exLayer.getAttachFeature().getName(), attachLayer);
    layer.setAttachFeature(attachFeature);
origin: webanno/webanno

AnnotationLayer layer;
if (annotationService.existsLayer(aExLayer.getName(), aExLayer.getType(), project)) {
  layer = annotationService.getLayer(aExLayer.getName(), project);
  ImportUtil.setLayer(annotationService, layer, aExLayer, project, aUser);
for (ExportedAnnotationFeature exfeature : aExLayer.getFeatures()) {
  ExportedTagSet exTagset = exfeature.getTagSet();
  TagSet tagSet = null;
origin: webanno/webanno

private IResourceStream exportLayerJson()
{
  try {
    AnnotationLayer layer = getModelObject();
    List<ExportedAnnotationLayer> exLayers = new ArrayList<>();
    ExportedAnnotationLayer exMainLayer = ImportUtil.exportLayerDetails(null, null,
        layer, annotationService);
    exLayers.add(exMainLayer);
    // If the layer is attached to another layer, then we also have to export
    // that, otherwise we would be missing it during re-import.
    if (layer.getAttachType() != null) {
      AnnotationLayer attachLayer = layer.getAttachType();
      ExportedAnnotationLayer exAttachLayer = ImportUtil.exportLayerDetails(null,
          null, attachLayer, annotationService);
      exMainLayer.setAttachType(
          new ExportedAnnotationLayerReference(exAttachLayer.getName()));
      exLayers.add(exAttachLayer);
    }
    return new InputStreamResourceStream(new ByteArrayInputStream(
        JSONUtil.toPrettyJsonString(exLayers).getBytes("UTF-8")));
  }
  catch (Exception e) {
    error("Unable to generate the JSON file: " + ExceptionUtils.getRootCauseMessage(e));
    ProjectLayersPanel.LOG.error("Unable to generate the JSON file", e);
    RequestCycle.get().find(IPartialPageRequestHandler.class)
        .ifPresent(handler -> handler.addChildren(getPage(), IFeedback.class));
    return null;
  }
}
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-api-dao

  AnnotationLayer aLayer)
ExportedAnnotationLayer exLayer = new ExportedAnnotationLayer();
exLayer.setAllowStacking(aLayer.isAllowStacking());
exLayer.setBuiltIn(aLayer.isBuiltIn());
exLayer.setReadonly(aLayer.isReadonly());
exLayer.setCrossSentence(aLayer.isCrossSentence());
exLayer.setDescription(aLayer.getDescription());
exLayer.setEnabled(aLayer.isEnabled());
exLayer.setLockToTokenOffset(AnchoringMode.SINGLE_TOKEN.equals(aLayer.getAnchoringMode()));
exLayer.setMultipleTokens(AnchoringMode.TOKENS.equals(aLayer.getAnchoringMode()));
exLayer.setAnchoringMode(aLayer.getAnchoringMode());
exLayer.setLinkedListBehavior(aLayer.isLinkedListBehavior());
exLayer.setName(aLayer.getName());
exLayer.setProjectName(aLayer.getProject().getName());
exLayer.setType(aLayer.getType());
exLayer.setUiName(aLayer.getUiName());
exLayer.setFeatures(exFeatures);
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-api-dao

public void importLayer(AnnotationLayer aLayer, ExportedAnnotationLayer aExLayer,
    Project aProject)
  throws IOException
{
  aLayer.setAllowStacking(aExLayer.isAllowStacking());
  aLayer.setBuiltIn(aExLayer.isBuiltIn());
  aLayer.setReadonly(aExLayer.isReadonly());
  aLayer.setCrossSentence(aExLayer.isCrossSentence());
  aLayer.setDescription(aExLayer.getDescription());
  aLayer.setEnabled(aExLayer.isEnabled());
  if (aExLayer.getAnchoringMode() == null) {
    // This allows importing old projects which did not have the anchoring mode yet
    aLayer.setAnchoringMode(aExLayer.isLockToTokenOffset(), aExLayer.isMultipleTokens());
  }
  else {
    aLayer.setAnchoringMode(aExLayer.getAnchoringMode());
  }
  aLayer.setLinkedListBehavior(aExLayer.isLinkedListBehavior());
  aLayer.setUiName(aExLayer.getUiName());
  aLayer.setName(aExLayer.getName());
  aLayer.setProject(aProject);
  aLayer.setType(aExLayer.getType());
  annotationService.createLayer(aLayer);
}
origin: webanno/webanno

  if (exLayer.getAttachType() != null) {
    layer.setAttachType(layersMap.get(exLayer.getAttachType().getName()));
  if (exLayer.getAttachFeature() != null) {
    AnnotationLayer attachLayer = annotationService.getLayer(
        exLayer.getAttachType().getName(), project);
    AnnotationFeature attachFeature = annotationService
        .getFeature(exLayer.getAttachFeature().getName(), attachLayer);
    layer.setAttachFeature(attachFeature);
layerDetailForm.setModelObject(layersMap.get(exLayers[0].getName()));
origin: webanno/webanno

  AnnotationLayer aLayer, AnnotationSchemaService aAnnotationService)
ExportedAnnotationLayer exLayer = new ExportedAnnotationLayer();
exLayer.setAllowStacking(aLayer.isAllowStacking());
exLayer.setBuiltIn(aLayer.isBuiltIn());
exLayer.setReadonly(aLayer.isReadonly());
exLayer.setCrossSentence(aLayer.isCrossSentence());
exLayer.setDescription(aLayer.getDescription());
exLayer.setEnabled(aLayer.isEnabled());
exLayer.setLockToTokenOffset(AnchoringMode.SINGLE_TOKEN.equals(aLayer.getAnchoringMode()));
exLayer.setMultipleTokens(AnchoringMode.TOKENS.equals(aLayer.getAnchoringMode()));
exLayer.setAnchoringMode(aLayer.getAnchoringMode());
exLayer.setValidationMode(aLayer.getValidationMode());
exLayer.setLinkedListBehavior(aLayer.isLinkedListBehavior());
exLayer.setName(aLayer.getName());
exLayer.setProjectName(aLayer.getProject().getName());
exLayer.setType(aLayer.getType());
exLayer.setUiName(aLayer.getUiName());
exLayer.setFeatures(exFeatures);
return exLayer;
origin: webanno/webanno

@Deprecated
public static void setLayer(AnnotationSchemaService aAnnotationService, AnnotationLayer aLayer,
    ExportedAnnotationLayer aExLayer,
    Project aProject, User aUser)
  throws IOException
{
  aLayer.setAllowStacking(aExLayer.isAllowStacking());
  aLayer.setBuiltIn(aExLayer.isBuiltIn());
  aLayer.setReadonly(aExLayer.isReadonly());
  aLayer.setCrossSentence(aExLayer.isCrossSentence());
  aLayer.setDescription(aExLayer.getDescription());
  aLayer.setEnabled(aExLayer.isEnabled());
  if (aExLayer.getAnchoringMode() == null) {
    // This allows importing old projects which did not have the anchoring mode yet
    aLayer.setAnchoringMode(aExLayer.isLockToTokenOffset(), aExLayer.isMultipleTokens());
  }
  else {
    aLayer.setAnchoringMode(aExLayer.getAnchoringMode());
  }
  aLayer.setValidationMode(aExLayer.getValidationMode() != null ? aExLayer.getValidationMode()
      : ValidationMode.NEVER);
  aLayer.setLinkedListBehavior(aExLayer.isLinkedListBehavior());
  aLayer.setUiName(aExLayer.getUiName());
  aLayer.setName(aExLayer.getName());
  aLayer.setProject(aProject);
  aLayer.setType(aExLayer.getType());
  aAnnotationService.createLayer(aLayer);
}
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-export

  AnnotationLayer aLayer, AnnotationSchemaService aAnnotationService)
ExportedAnnotationLayer exLayer = new ExportedAnnotationLayer();
exLayer.setAllowStacking(aLayer.isAllowStacking());
exLayer.setBuiltIn(aLayer.isBuiltIn());
exLayer.setReadonly(aLayer.isReadonly());
exLayer.setCrossSentence(aLayer.isCrossSentence());
exLayer.setDescription(aLayer.getDescription());
exLayer.setEnabled(aLayer.isEnabled());
exLayer.setLockToTokenOffset(AnchoringMode.SINGLE_TOKEN.equals(aLayer.getAnchoringMode()));
exLayer.setMultipleTokens(AnchoringMode.TOKENS.equals(aLayer.getAnchoringMode()));
exLayer.setAnchoringMode(aLayer.getAnchoringMode());
exLayer.setLinkedListBehavior(aLayer.isLinkedListBehavior());
exLayer.setName(aLayer.getName());
exLayer.setProjectName(aLayer.getProject().getName());
exLayer.setType(aLayer.getType());
exLayer.setUiName(aLayer.getUiName());
exLayer.setFeatures(exFeatures);
return exLayer;
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-export

@Deprecated
public static void setLayer(AnnotationSchemaService aAnnotationService, AnnotationLayer aLayer,
    ExportedAnnotationLayer aExLayer,
    Project aProject, User aUser)
  throws IOException
{
  aLayer.setAllowStacking(aExLayer.isAllowStacking());
  aLayer.setBuiltIn(aExLayer.isBuiltIn());
  aLayer.setReadonly(aExLayer.isReadonly());
  aLayer.setCrossSentence(aExLayer.isCrossSentence());
  aLayer.setDescription(aExLayer.getDescription());
  aLayer.setEnabled(aExLayer.isEnabled());
  if (aExLayer.getAnchoringMode() == null) {
    // This allows importing old projects which did not have the anchoring mode yet
    aLayer.setAnchoringMode(aExLayer.isLockToTokenOffset(), aExLayer.isMultipleTokens());
  }
  else {
    aLayer.setAnchoringMode(aExLayer.getAnchoringMode());
  }
  aLayer.setLinkedListBehavior(aExLayer.isLinkedListBehavior());
  aLayer.setUiName(aExLayer.getUiName());
  aLayer.setName(aExLayer.getName());
  aLayer.setProject(aProject);
  aLayer.setType(aExLayer.getType());
  aAnnotationService.createLayer(aLayer);
}
de.tudarmstadt.ukp.clarin.webanno.export.modelExportedAnnotationLayer

Javadoc

All required contents of a project to be exported.

Most used methods

  • getName
  • getType
  • <init>
  • getAnchoringMode
  • getAttachFeature
  • getAttachType
  • getDescription
  • getFeatures
  • getUiName
  • getValidationMode
  • isAllowStacking
  • isBuiltIn
  • isAllowStacking,
  • isBuiltIn,
  • isCrossSentence,
  • isEnabled,
  • isLinkedListBehavior,
  • isLockToTokenOffset,
  • isMultipleTokens,
  • isReadonly,
  • setAllowStacking,
  • setAnchoringMode

Popular in Java

  • Making http post requests using okhttp
  • getSystemService (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • setRequestProperty (URLConnection)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now