Package org.apache.uima.resource.metadata

Examples of org.apache.uima.resource.metadata.Import


      fileName = fileName.substring(i + 1);
    if (fileName.charAt(0) == '.')
      fileName = fileName.substring(1);
    int partStart = 0;

    Import imp = UIMAFramework.getResourceSpecifierFactory().createImport();
    ResourceManager rm = editor.createResourceManager();

    for (;;) {
      imp.setName(fileName.substring(partStart));
      try {
        imp.findAbsoluteUrl(rm);
      } catch (InvalidXMLException e) {
        partStart = fileName.indexOf('.', partStart) + 1;
        if (0 == partStart)
          return imp; // not found -outer code will catch error later
        continue;
View Full Code Here


      //try to find relative path from cpeDescSaveFile to descFile
      String relPath = FileUtils.findRelativePath(descFile, cpeDescSaveFile.getParentFile());
      if (relPath != null) {
        //update CPE descriptor
        descriptor.setInclude(null);
        Import newImport = UIMAFramework.getResourceSpecifierFactory().createImport();
        newImport.setLocation(relPath);
        descriptor.setImport(newImport);
      }
    }   
  }
View Full Code Here

        // get delegate component attributes
        InstallationDescriptor dlgInsD = dlgInstDescs[i];
        String dlgName = dlgInsD.getMainComponentId();
        String dlgDescPath = dlgInsD.getMainComponentDesc();
        // create Import for delegate component
        Import dlgImport = rsFactory.createImport();
        // set relative delegate descriptor location
        String dlgDescRelPath = dlgDescPath.replaceAll(PMControllerHelper.MAIN_ROOT_REGEX,
                StringUtil.toRegExpReplacement(".."));
        dlgImport.setLocation(dlgDescRelPath);
        // add delegate Import to the Map
        delegatesMap.put(dlgName, dlgImport);
      }
      // get AE metadata
      AnalysisEngineMetaData aggMetadata = aggDescription.getAnalysisEngineMetaData();
View Full Code Here

    // check pear PackageBrowser object
    Assert.assertNotNull(instPear);
    // import pear specifiers
    Import impPear = UIMAFramework.getResourceSpecifierFactory().createImport();
    File import1 = new File(instPear.getComponentPearDescPath());
    impPear.setLocation(import1.toURI().getPath());

    return impPear;
  }
View Full Code Here

      //try to find relative path from cpeDescSaveFile to descFile
      String relPath = FileUtils.findRelativePath(descFile, cpeDescSaveFile.getParentFile());
      if (relPath != null) {
        //update CPE descriptor
        descriptor.setInclude(null);
        Import newImport = UIMAFramework.getResourceSpecifierFactory().createImport();
        newImport.setLocation(relPath);
        descriptor.setImport(newImport);
      }
    }   
  }
View Full Code Here

    if (sDescriptorRelativePath.indexOf("file:/") == -1 //$NON-NLS-1$
            && sDescriptorRelativePath.indexOf(":/") > -1) { //$NON-NLS-1$
      sDescriptorRelativePath = "file:/" + sDescriptorRelativePath; //$NON-NLS-1$
    }

    Import imp = new Import_impl();
    // fails on unix? URL url = new URL("file:/" + getDescriptorDirectory());
    // Set relative Path Base
    // a version that might work on all platforms
    URL url = new File(editor.getDescriptorDirectory()).toURL();
    ((Import_impl) imp).setSourceUrl(url);

    imp.setLocation(sDescriptorRelativePath);
    return imp;
  }
View Full Code Here

      fileName = fileName.substring(i + 1);
    if (fileName.charAt(0) == '.')
      fileName = fileName.substring(1);
    int partStart = 0;

    Import imp = UIMAFramework.getResourceSpecifierFactory().createImport();
    ResourceManager rm = editor.createResourceManager();

    for (;;) {
      imp.setName(fileName.substring(partStart));
      try {
        imp.findAbsoluteUrl(rm);
      } catch (InvalidXMLException e) {
        partStart = fileName.indexOf('.', partStart) + 1;
        if (0 == partStart)
          return imp; // not found -outer code will catch error later
        continue;
View Full Code Here

              "Use Source tab below to specify a key name " +
              "in the <flowController> element, or the imported <flowController>");
    } else
      keyName = fcd.getKey();
    flowControllerKeyGUI.setText(keyName);
    Import fcdImport = fcd.getImport();
    String fileName = null;
    if (null != fcdImport) {
      fileName = fcdImport.getLocation();
      if (null == fileName || (0 == fileName.length()))
        fileName = fcdImport.getName();
    }
    flowControllerGUI.setText(null == fileName ?
            "Warning: no <import> in <flowController>" : fileName);
    flowControllerChoice.setText(USER_DEFINED_FLOW);
    // must follow label updates
View Full Code Here

    }
    flowControllerGUI.setToolTipText(sDesc);
  }

  private void handleContextMenuRequest(Event event) {
    Import imp = getFlowControllerDeclaration().getImport();

    bDisableToolTipHelp = true;
    requestPopUpOverImport(imp, flowControllerGUI, event);
    bDisableToolTipHelp = false;
  }
View Full Code Here

    }
  }

  private void produceKeyAddFlowController(String shortName, String fullPathFileName,
          boolean isImportByName) {
    Import imp = createImport(fullPathFileName, isImportByName);

    // key is shortName plus a suffix if needed to make it unique.
    // The set of existing keys is obtained from the model,
    // not from the GUI table (as was the case in earlier design)
    FlowControllerDeclaration oldFcd = getFlowControllerDeclaration();
View Full Code Here

TOP

Related Classes of org.apache.uima.resource.metadata.Import

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.