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

How to use
ImportUtil
in
de.tudarmstadt.ukp.clarin.webanno.export

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

origin: de.tudarmstadt.ukp.inception.app/inception-ui-core

if (!ImportUtil.isZipValidWebanno(tempFile)) {
  throw new IOException("ZIP file is not a valid project archive");
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: webanno/webanno

ImportUtil.setLayer(annotationService, layer, aExLayer, project, aUser);
ImportUtil.setLayer(annotationService, layer, aExLayer, project, aUser);
    && annotationService.existsTagSet(exTagset.getName(), project)) {
  tagSet = annotationService.getTagSet(exTagset.getName(), project);
  ImportUtil.createTagSet(tagSet, exTagset, project, aUser, annotationService);
  ImportUtil.createTagSet(tagSet, exTagset, project, aUser, annotationService);
      layer);
  feature.setTagset(tagSet);
  ImportUtil.setFeature(annotationService, feature, exfeature, project, aUser);
  continue;
feature.setLayer(layer);
feature.setTagset(tagSet);
ImportUtil.setFeature(annotationService, feature, exfeature, project, aUser);
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-ui-project

String text = IOUtils.toString(tagInputStream, "UTF-8");
Map<String, String> tabbedTagsetFromFile = ImportUtil
    .getTagSetFromFile(text);
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-ui-project

ImportUtil.setLayer(annotationService, layer, aExLayer, project, aUser);
ImportUtil.setLayer(annotationService, layer, aExLayer, project, aUser);
    && annotationService.existsTagSet(exTagset.getName(), project)) {
  tagSet = annotationService.getTagSet(exTagset.getName(), project);
  ImportUtil.createTagSet(tagSet, exTagset, project, aUser, annotationService);
  ImportUtil.createTagSet(tagSet, exTagset, project, aUser, annotationService);
      layer);
  feature.setTagset(tagSet);
  ImportUtil.setFeature(annotationService, feature, exfeature, project, aUser);
  continue;
feature.setLayer(layer);
feature.setTagset(tagSet);
ImportUtil.setFeature(annotationService, feature, exfeature, project, aUser);
origin: webanno/webanno

String text = IOUtils.toString(tagInputStream, "UTF-8");
Map<String, String> tabbedTagsetFromFile = ImportUtil
    .getTagSetFromFile(text);
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-remote

if (!ImportUtil.isZipValidWebanno(tempFile)) {
  throw new UnsupportedFormatException("Incompatible to webanno ZIP file");
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 (!ImportUtil.isZipValidWebanno(tempFile)) {
  throw new UnsupportedFormatException("Incompatible to webanno ZIP file");
origin: inception-project/inception

if (!ImportUtil.isZipValidWebanno(tempFile)) {
  throw new IOException("ZIP file is not a valid project archive");
origin: webanno/webanno

if (!ImportUtil.isZipValidWebanno(tempFile)) {
  throw new IOException("ZIP file is not a WebAnno project archive");
origin: de.tudarmstadt.ukp.clarin.webanno/webanno-ui-project

if (!ImportUtil.isZipValidWebanno(tempFile)) {
  throw new IOException("ZIP file is not a WebAnno project archive");
de.tudarmstadt.ukp.clarin.webanno.exportImportUtil

Javadoc

This class contains Utility methods that can be used in Project settings.

Most used methods

  • isZipValidWebanno
    Check if the zip file is webanno compatible
  • createTagSet
  • exportLayerDetails
  • getTagSetFromFile
    Read Tag and Tag Description. A line has a tag name and a tag description separated by a TAB
  • setFeature
  • setLayer

Popular in Java

  • Parsing JSON documents to java classes using gson
  • onCreateOptionsMenu (Activity)
  • requestLocationUpdates (LocationManager)
  • runOnUiThread (Activity)
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Best IntelliJ plugins
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