Package org.apache.uima.resource.metadata

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


          wholeModel.substring(start, end) + "\n" }));
      printWriter.close();
      clearModelBaseValue();

      setFileDirty(); // do as soon as file changes, in case later error aborts processing
      Import imp = createImport(dialog.genFilePath, dialog.isImportByName);
      setModelImportArray((Import[]) Utility.addElementToArray(getModelImportArray(), imp,
              Import.class));
      isValidImport("Error Exporting a part and Importing it",
              "An unexpected error was caused by the export operation");
      refresh();
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

    if (null == item) {
      return;
    }

    String thisKey = item.getText(1);
    Import imp = (Import) getDelegateAnalysisEngineSpecifiersWithImports().get(thisKey);

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

    filesTable.setToolTipText(sDesc);
  }

  private boolean addDelegate(String fileName, String shortName, String keyName,
          boolean isImportByName) {
    Import imp;
    Map delegatesWithImport = getDelegateAnalysisEngineSpecifiersWithImports();

    // if the delegate is not a remote, read / parse it and add ae to
    // the delegate hash map
    // -- also add the import
View Full Code Here

   *
   * @param fileName
   * @param keyName
   */
  private void addFile(Object o, String keyName) {
    Import impItem = (Import) o;
    String fileName = impItem.getLocation();
    if (null == fileName || (0 == fileName.length()))
      fileName = impItem.getName();
    // create new TableItem
    TableItem item = new TableItem(filesTable, SWT.NONE);
    item.setImage(TAEConfiguratorPlugin.getImage(TAEConfiguratorPlugin.IMAGE_ANNOTATOR));
    item.setText(0, fileName);
    item.setText(1, keyName);
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 imports should be done by name
   * @return false if any import caused an error, true of all OK
   */
  public boolean addImports(Object[] locations, boolean isByName) {
    Import[] currentImports = getModelImportArray();
    Import imp;

    int nCountCurrentImports = (currentImports == null) ? 0 : currentImports.length;
    int numberToAdd = locations.length;

    Import[] newImports = new Import[nCountCurrentImports + numberToAdd];
View Full Code Here

          System.err.println("***ERROR Item index hover out of range" + itemIndex
                  + ", size of array = " + importItems.length);
          System.err.println(this.getClass().getName());
          return;
        }
        Import importItem = getModelImportArray()[itemIndex];
        // if by location, it's relative to the descriptor.
        String absolutePath = editor.getAbsolutePathFromImport(importItem);

        String description = null;
        try {
View Full Code Here

          wholeModel.substring(start, end) + "\n" }));
      printWriter.close();
      clearModelBaseValue();

      setFileDirty(); // do as soon as file changes, in case later error aborts processing
      Import imp = createImport(dialog.genFilePath, dialog.isImportByName);
      setModelImportArray((Import[]) Utility.addElementToArray(getModelImportArray(), imp,
              Import.class));
      isValidImport("Error Exporting a part and Importing it",
              "An unexpected error was caused by the export operation");
      refresh();
View Full Code Here

      specifiers[inx++] = getResourceSpecifier(aeDescription);
      // UimaClassFactory.produceResourceSpecifier(aeDescription);
    }

    for (String aeDescription : descriptorPaths) {
      Import descriptorImport = new Import_impl();
      // If user provides a descriptor with .xml at the end, assume he
      // wants import by location
      if (aeDescription.endsWith(".xml")) {
        aeDescription = Utils.resolvePlaceholderIfExists(aeDescription,
            System.getProperties());
        if (!aeDescription.startsWith("file:")) {
          aeDescription = "file:" + aeDescription;
        }
        descriptorImport.setLocation(aeDescription);
      } else {
        // uima import by name expects dot separated path as in
        // a.b.descriptor and no .xml at the end
        descriptorImport.setName(aeDescription);
      }
      String key = new String(aeDescription);
      if (key.startsWith("file:")) {
        key = key.substring(5); // skip "file:"
      }
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.