Package org.exist.dom

Examples of org.exist.dom.NodeProxy$SingleNodeIterator


    DBBroker broker = null;
    try {
      broker = db.acquireBroker();
      Serializer serializer = broker.getSerializer();
      if (item instanceof NodeProxy) {
        NodeProxy proxy = (NodeProxy) item;
        if (proxy.isDocument()) {
          return serializer.serialize(proxy.getDocument());
        }
      }
      return serializer.serialize((NodeValue) item);
    } catch (SAXException e) {
      throw new DatabaseException(e);
View Full Code Here


                    continue;
                }
                //contextSet == null should be used to scan the whole index
                if (contextSet == null || refine_query_on_doc || contextSet.getDocumentSet().contains(doc.getDocId())) {
                    NodeId nodeId = new DLN(rs.getInt("NODE_ID_UNITS"), rs.getBytes("NODE_ID"), 0);
                    NodeProxy p = new NodeProxy(doc, nodeId);
                    //Node is in the context : check if it is accurate
                    //contextSet.contains(p) would have made more sense but there is a problem with
                    //VirtualNodeSet when on the DESCENDANT_OR_SELF axis
                    if (contextSet == null || contextSet.get(p) != null) {
                        boolean geometryMatches = false;
View Full Code Here

                    //Ignore since the broker has no right on the document
                    continue;
                }
                if (contextSet == null || refine_query_on_doc || contextSet.getDocumentSet().contains(doc.getDocId())) {
                    NodeId nodeId = new DLN(rs.getInt("NODE_ID_UNITS"), rs.getBytes("NODE_ID"), 0);
                    NodeProxy p = new NodeProxy(doc, nodeId);
                    //Node is in the context : check if it is accurate
                    //contextSet.contains(p) would have made more sense but there is a problem with
                    //VirtualNodeSet when on the DESCENDANT_OR_SELF axis
                    if (contextSet.get(p) != null) {
                        Geometry geometry = wkbReader.read(rs.getBytes(1));
View Full Code Here

                    //Ignore since the broker has no right on the document
                    continue;
                }
                if (contextSet.getDocumentSet().contains(doc.getDocId())) {
                    NodeId nodeId = new DLN(rs.getInt("NODE_ID_UNITS"), rs.getBytes("NODE_ID"), 0);
                    NodeProxy p = new NodeProxy(doc, nodeId);
                    //Node is in the context : check if it is accurate
                    //contextSet.contains(p) would have made more sense but there is a problem with
                    //VirtualNodeSet when on the DESCENDANT_OR_SELF axis
                    if (contextSet.get(p) != null) {
                        if (rs.getMetaData().getColumnClassName(1).equals(Boolean.class.getName())) {
View Full Code Here

                    //The broker has no right on the document
                    LOG.error(e);
                    return false;
                }
                NodeId nodeId = new DLN(rs.getInt("NODE_ID_UNITS"), rs.getBytes("NODE_ID"), 0);
                StoredNode node = broker.objectWith(new NodeProxy(doc, nodeId));
                if (node == null) {
                    LOG.info("Node " + nodeId + "doesn't exist");
                    return false;
                }
                if (!AbstractGMLJDBCIndexWorker.GML_NS.equals(node.getNamespaceURI())) {
View Full Code Here

            NodeValue nv = (NodeValue) args[0].itemAt(0);
            if (nv.getImplementationType() == NodeValue.IN_MEMORY_NODE) {
                NodeImpl node = (NodeImpl) nv;
                reader = new InMemoryXMLStreamReader(node.getDocument(), node.getDocument());
            } else {
                NodeProxy proxy = (NodeProxy) nv;
                reader = context.getBroker().newXMLStreamReader(new NodeProxy(proxy.getDocument(), NodeId.DOCUMENT_NODE, proxy.getDocument().getFirstChildAddress()), false);
            }

            nv = (NodeValue) args[1].itemAt(0);
            if (nv.getImplementationType() == NodeValue.IN_MEMORY_NODE)
                throw new XPathException("patch cannot be applied to in-memory documents");
            NodeProxy diffProxy = (NodeProxy) nv;
            DocumentImpl diff = diffProxy.getDocument();
       
            MemTreeBuilder builder = context.getDocumentBuilder();
            DocumentBuilderReceiver receiver = new DocumentBuilderReceiver(builder);
            Patch patch = new Patch(context.getBroker(), diff);
            if (isCalledAs("annotate"))
View Full Code Here

                if (annotate) {
                    if (onFirstNode)
                        attrs.addAttribute(ATTR_CHANGE, changeMessage);
                    else {
                        NodeId nodeId = (NodeId) reader.getProperty(EmbeddedXMLStreamReader.PROPERTY_NODE_ID);
                        NodeSet children = changeSet.selectParentChild(new NodeProxy(diffDoc, nodeId), NodeSet.ANCESTOR);
                        if (children != null && !children.isEmpty())
                            attrs.addAttribute(ATTR_CHANGE, "changed");
                    }
                    if (elementStack.size() == 0)
                        receiver.startPrefixMapping(StandardDiff.PREFIX, StandardDiff.NAMESPACE);
View Full Code Here

              Sequence.EMPTY_SEQUENCE, AccessContext.TEST);
    } catch (PermissionDeniedException e) {
      throw new XPathException(e);
    }
        for (SequenceIterator i = changes.iterate(); i.hasNext(); ) {
            NodeProxy p = (NodeProxy) i.nextItem();
            Element child = (Element) p.getNode();
            if (child.getNodeType() == Node.ELEMENT_NODE &&
                    child.getNamespaceURI().equals(StandardDiff.NAMESPACE)) {
               NodeId id = parseRef(broker, child, "ref");
               if (child.getLocalName().equals("delete")) {
                   String event = child.getAttribute("event");
View Full Code Here

    }

    private void buildChangeSet() {
        changeSet = new NewArrayNodeSet();
        for (NodeId nodeId : insertedNodes.keySet()) {
            changeSet.add(new NodeProxy(diffDoc, nodeId));
        }
        for (NodeId nodeId : appendedNodes.keySet()) {
            changeSet.add(new NodeProxy(diffDoc, nodeId));
        }
        for (NodeId nodeId : deletedNodes.keySet()) {
            changeSet.add(new NodeProxy(diffDoc, nodeId));
        }
    }
View Full Code Here

            try {
                int nodeNr = builder.getDocument().getLastNode();
                if (v.getImplementationType() == NodeValue.IN_MEMORY_NODE) {
                    ((NodeImpl)v).copyTo(context.getBroker(), docBuilder);
                } else {
                    NodeProxy p = (NodeProxy) v;
                    MatchListener ml = index.getMatchListener(context.getBroker(), p, matchCb);
                    Receiver receiver;
                    if (ml == null)
                        receiver = docBuilder;
                    else {
View Full Code Here

TOP

Related Classes of org.exist.dom.NodeProxy$SingleNodeIterator

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.