Examples of ResourceSetImpl


Examples of org.apache.xindice.client.xmldb.ResourceSetImpl

            dbf.setNamespaceAware(true);
            Document resultDoc = dbf.newDocumentBuilder().parse(
                new InputSource(new StringReader(result)));
           
            NodeList nodes = resultDoc.getDocumentElement().getChildNodes();
            ResourceSetImpl rs = new ResourceSetImpl(this, null);
           
            for (int i = 0; i < nodes.getLength(); i++) {
               
                Node n = nodes.item(i);
           
                String documentId = ((Element) n).getAttributeNS(
                        QUERY_NS, "key");          
                XMLResourceImpl resource = new XMLResourceImpl(null,
                        documentId, this, TextWriter.toString(n));
                rs.addResource(resource);
            }
        
            return rs;
        } catch (Exception e) {
           
View Full Code Here

Examples of org.apache.xindice.client.xmldb.ResourceSetImpl

            }
            else {
               result = col.queryCollection(queryLang, query, namespaces);
            }
           
            ResourceSetImpl rs = new ResourceSetImpl(this, null);

            while (result.hasMoreNodes()) {

               Node n = result.getNextNode();
               if ( n instanceof DBNode ) {
                  ( ( DBNode ) n ).expandSource();
               }

               String documentId = ((Element) n).getAttributeNS(QUERY_NS, "key");

               XMLResourceImpl resource = new XMLResourceImpl(null, documentId, this,
                    TextWriter.toString( n ));
               rs.addResource(resource);
            }
        
            return rs;
        } catch (Exception e) {           
            throw FaultCodes.createXMLDBException(FaultCodes.QRY_PROCESSING_ERROR, "Query error", e);
View Full Code Here

Examples of org.apache.xindice.client.xmldb.ResourceSetImpl

            String result = (String) runRemoteCommand("Query", params);
            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            dbf.setNamespaceAware(true);
            Document resultDoc = dbf.newDocumentBuilder().parse(new InputSource(new StringReader(result)));

            ResourceSetImpl rs = new ResourceSetImpl(this, resultDoc);

            return rs;
        } catch (Exception e) {
            e.printStackTrace();
            throw FaultCodes.createXMLDBException(FaultCodes.QRY_PROCESSING_ERROR, "Query error", e);
View Full Code Here

Examples of org.apache.xindice.client.xmldb.ResourceSetImpl

                result = col.queryDocument(queryLang, query, createNamespaceMap(nsMap), name);
            } else {
                result = col.queryCollection(queryLang, query, createNamespaceMap(nsMap));
            }

            return new ResourceSetImpl(this, nodesetToDocument(result));
        } catch (Exception e) {
            throw FaultCodes.createXMLDBException(FaultCodes.QRY_PROCESSING_ERROR,
                                                  "Query error: " + e.getMessage(), e);
        }
    }
View Full Code Here

Examples of org.eclipse.emf.ecore.resource.impl.ResourceSetImpl

      IRunnableWithProgress operation = new IRunnableWithProgress() {
        public void run(IProgressMonitor progressMonitor) {
            try {
              // Create a resource set
              //
              ResourceSet resourceSet = new ResourceSetImpl();

              // Create a resource for this file.
              //
              Resource resource = resourceSet.createResource(fileURI);

              // Add the initial model object to the contents.
              //
              EObject rootObject = createInitialModel();
              if (rootObject != null) {
View Full Code Here

Examples of org.eclipse.emf.ecore.resource.impl.ResourceSetImpl

      IRunnableWithProgress operation = new IRunnableWithProgress() {
        public void run(IProgressMonitor progressMonitor) {
            try {
              // Create a resource set
              //
              ResourceSet resourceSet = new ResourceSetImpl();

              // Create a resource for this file.
              //
              Resource resource = resourceSet.createResource(fileURI);

              // Add the initial model object to the contents.
              //
              EObject rootObject = createInitialModel();
              if (rootObject != null) {
View Full Code Here

Examples of org.eclipse.emf.ecore.resource.impl.ResourceSetImpl

    if (servers == null) {
      loadServers();
      if (servers == null) {
        Bundle bundle = Platform.getBundle(Activator.BUNDLE_ID);
        File serversFile = bundle.getBundleContext().getDataFile(MODEL_FILE_NAME);
        Resource resource = new ResourceSetImpl().createResource(URI.createFileURI(serversFile.getPath()));
        servers = HadoopFactory.eINSTANCE.createServers();
        resource.getContents().add(servers);
      }
    }
    return servers;
View Full Code Here

Examples of org.eclipse.emf.ecore.resource.impl.ResourceSetImpl

  private void loadServers() {
    Bundle bundle = Platform.getBundle(Activator.BUNDLE_ID);
    File serversFile = bundle.getBundleContext().getDataFile(MODEL_FILE_NAME);
    if (serversFile.exists()) {
      Resource resource = new ResourceSetImpl().getResource(URI.createFileURI(serversFile.getPath()), true);
      servers = (Servers) resource.getContents().get(0);
      HDFSManager.INSTANCE.loadServers();
      ZooKeeperManager.INSTANCE.loadServers();
    }
  }
View Full Code Here

Examples of org.eclipse.emf.ecore.resource.impl.ResourceSetImpl

    return (DataObject)EcoreUtil.create((EClass)type);
  }
 
  public static ResourceSet createResourceSet()
  {
    ResourceSet result = new ResourceSetImpl();
    configureResourceSet(result);
    return result;
  }
View Full Code Here

Examples of org.eclipse.emf.ecore.resource.impl.ResourceSetImpl

          throws URISyntaxException {
    // register default resource factory
    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("*",
            new XMIResourceFactoryImpl());
    // create resource set to hold the resource we're loading and its dependent resources
    ResourceSet resourceSet = new ResourceSetImpl();
    // convert file path to absolute path -- seems to be required for propery proxy resolution
    File inputFile = new File(aEcoreFilePath);
    URI absoluteInputURI = URI.createFileURI(inputFile.getAbsolutePath());
    // load the resource
    Resource resource = resourceSet.getResource(absoluteInputURI, true);
    // convert to UIMA TypeSystem
    return ecore2UimaTypeSystem(resource, aOptions);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.