Package org.exist.dom

Examples of org.exist.dom.NodeProxy


        } else if (item.getType() == Type.ELEMENT || item.getType() == Type.DOCUMENT) {
            LOG.debug("Streaming element or document node");

            if (item instanceof NodeProxy) {
                final NodeProxy np = (NodeProxy) item;
                final String url = "xmldb:exist://" + np.getDocument().getBaseURI();
                LOG.debug("Document detected, adding URL " + url);
                streamSource.setSystemId(url);
            }

            // Node provided
View Full Code Here


        } else if (item.getType() == Type.DOCUMENT || item.getType() == Type.NODE) {

            LOG.debug("Retreiving URL from (document) node");

            if (item instanceof NodeProxy) {
                final NodeProxy np = (NodeProxy) item;
                url = np.getDocument().getBaseURI();
                LOG.debug("Document detected, adding URL " + url);
            }

        }
View Full Code Here

        for (final SequenceIterator i = args[0].iterate(); i.hasNext(); ) {
            final NodeValue v = (NodeValue) i.nextItem();
            if (v.getImplementationType() == NodeValue.IN_MEMORY_NODE) {
                result.add(v);
            } else {
                final NodeProxy p = (NodeProxy) v;
                processText(builder, p, result, func, args[2]);
            }
        }
        context.popDocumentContext();
        return result;
View Full Code Here

    else {
      final NodeValue val = (NodeValue)args[0].itemAt(0);
      // Ranking cannot be applied to constructed nodes
      if(val.getImplementationType() == NodeValue.IN_MEMORY_NODE)
        {throw new XPathException(this, getName() + " cannot be applied to in-memory nodes.");}
      final NodeProxy proxy = (NodeProxy)val;  // this is a persistent node, so casting is safe
 
      int freq = 0;
      Match nextMatch = proxy.getMatches();
      // we just count the number of distinct terms matched
      while(nextMatch != null) {
        freq += nextMatch.getFrequency();
        nextMatch = nextMatch.getNextMatch();
      }
View Full Code Here

      DBBroker broker = null;
      try {
          broker = pool.get(user);
          final DocumentImpl document = getDocument(broker, Lock.NO_LOCK);
          // this XMLResource represents a document
      return new NodeProxy(document, NodeId.DOCUMENT_NODE);
      } catch (final EXistException e) {
            throw new XMLDBException(ErrorCodes.INVALID_RESOURCE, e.getMessage(), e);
        } finally {
          pool.release(broker);
      pool.setSubject(preserveSubject);
View Full Code Here

        final NodeValue docNode = (NodeValue) args[0].itemAt(0);
        if (docNode.getImplementationType() == NodeValue.IN_MEMORY_NODE) {
            return ((NodeImpl) docNode).getDocument().getNodeById(nodeId);
        } else {
            final DocumentImpl doc = ((NodeProxy)docNode).getDocument();
            return new NodeProxy(doc, nodeId);
        }
  }
View Full Code Here

                    if(lockOnLoad)
                    {
            // add the document to the list of locked documents
            context.addLockedDocument(doc);
          }
          document = new NodeProxy(doc);
        }
      }
      catch(final PermissionDeniedException e)
      {
        throw e;
View Full Code Here

        this.context = contextSet;
        this.contextId = contextId;
    }

    public NodeProxy match(DocumentImpl doc, NodeId nodeId) {
        final NodeProxy p = new NodeProxy(doc, nodeId);
        final NodeProxy contextNode = context.parentWithChild(doc, nodeId, false, false);
        if (contextNode == null)
            {return null;}
        if (Expression.NO_CONTEXT_ID != contextId) {
            p.deepCopyContext(contextNode, contextId);
        } else
View Full Code Here

        enhancer.setSuperclass(NodeProxy.class);
        enhancer.setInterfaces(clazzes);
        enhancer.setCallbackFilter(callbackFilter);
        enhancer.setCallbacks(callbacks);
       
        final NodeProxy enhancedNodeProxy = (NodeProxy)enhancer.create(
            new Class[] {
                DocumentImpl.class,
                NodeId.class,
                short.class,
                long.class,
View Full Code Here

    if (pos < 0 || pos >= resources.size())
      {return null;}
    final Object r = resources.get((int) pos);
    LocalXMLResource res = null;
    if (r instanceof NodeProxy) {
      final NodeProxy p = (NodeProxy) r;
      // the resource might belong to a different collection
      // than the one by which this resource set has been
      // generated: adjust if necessary.
      LocalCollection coll = collection;
      if (p.getDocument().getCollection() == null
        || coll.getCollection().getId() != p.getDocument().getCollection().getId()) {
        coll = new LocalCollection(user, brokerPool, null, p.getDocument().getCollection().getURI(), coll.getAccessContext());
        coll.properties = outputProperties;
      }
      res = new LocalXMLResource(user, brokerPool, coll, p);
    } else if (r instanceof Node) {
      res = new LocalXMLResource(user, brokerPool, collection, XmldbURI.EMPTY_URI);
View Full Code Here

TOP

Related Classes of org.exist.dom.NodeProxy

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.