Package org.exist.numbering

Examples of org.exist.numbering.NodeId


                    result[index++] = null;
                    //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) {
View Full Code Here


                        throw new SQLException("Unable to make an atomic value from '" + rs.getMetaData().getColumnClassName(1) + "'");
                    //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) {
View Full Code Here

                } catch (PermissionDeniedException e) {
                    //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;
                }
View Full Code Here

                        }
                        int docId = (int) docIdValues.get(docsEnum.docID());
                        DocumentImpl storedDocument = docs.getDoc(docId);
                        if (storedDocument == null)
                            continue;
                        NodeId nodeId = null;
                        if (nodes != null) {
                            BytesRef nodeIdRef = new BytesRef(buf);
                            nodeIdValues.get(docsEnum.docID(), nodeIdRef);
                            int units = ByteConversion.byteToShort(nodeIdRef.bytes, nodeIdRef.offset);
                            nodeId = index.getBrokerPool().getNodeFactory().createFromData(units, nodeIdRef.bytes, nodeIdRef.offset + 2);
View Full Code Here

     * @throws DiffException
     */
    public void patch(ExtendedXMLStreamReader reader, Receiver receiver) throws DiffException {
        annotate = false;
        try {
            NodeId skipSubtree = null;
            while (reader.hasNext()) {
                int status = reader.next();
                NodeId nodeId = (NodeId) reader.getProperty(EmbeddedXMLStreamReader.PROPERTY_NODE_ID);
                if (status != XMLStreamReader.END_ELEMENT) {
                    ElementImpl insertedNode = insertedNodes.get(nodeId);
                    if (insertedNode != null) {
                        insertNode(insertedNode, receiver, null);
                    }
View Full Code Here

    public void annotate(ExtendedXMLStreamReader reader, Receiver receiver) throws DiffException {
        annotate = true;
        elementStack = new Stack<QName>();
        buildChangeSet();
        try {
            NodeId skipSubtree = null;
            while (reader.hasNext()) {
                int status = reader.next();
                NodeId nodeId = (NodeId) reader.getProperty(EmbeddedXMLStreamReader.PROPERTY_NODE_ID);
                if (status != XMLStreamReader.END_ELEMENT) {
                    ElementImpl insertedNode = insertedNodes.get(nodeId);
                    if (insertedNode != null) {
                        insertNode(insertedNode, receiver, CHANGE_INSERT);
                    }
View Full Code Here

                attrs = new AttrList();
                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);
                }

                for (int i = 0; i < reader.getAttributeCount(); i++) {
                    // check if an attribute has to be inserted before the current attribute
                    NodeId nodeId = reader.getAttributeId(i);

                    // check if an attribute has to be inserted before the current attribute
                    ElementImpl insertedNode = insertedNodes.get(nodeId);
                    if (insertedNode != null) {
                        StoredNode child = (StoredNode) insertedNode.getFirstChild();
View Full Code Here

        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");
                   if (event == null || event.length() == 0)
                       deletedNodes.put(id, D_SUBTREE);
                   else if ("both".equals(event))
View Full Code Here

                        break;
                    case XMLStreamReader.START_ELEMENT:
                        // check if there's a complete element to write, not just a start or end tag
                        // if yes, just copy the element, if no, write a start-tag node
                        boolean isClosed = false;
                        NodeId nodeId = nodes[i].nodeId;
                        for (int j = i; j < nodes.length; j++) {
                            if (nodes[j].nodeType == XMLStreamReader.END_ELEMENT &&
                                    nodes[j].nodeId.equals(nodeId)) {
                                isClosed = true;
                                NodeProxy proxy = new NodeProxy(otherDoc, nodes[i].nodeId);
View Full Code Here

                                }
                                int docId = (int) docIdValues.get(docsEnum.docID());
                                DocumentImpl storedDocument = docs.getDoc(docId);
                                if (storedDocument == null)
                                    continue;
                                NodeId nodeId = null;
                                if (nodes != null) {
                                    BytesRef nodeIdRef = new BytesRef(buf);
                                    nodeIdValues.get(docsEnum.docID(), nodeIdRef);
                                    int units = ByteConversion.byteToShort(nodeIdRef.bytes, nodeIdRef.offset);
                                    nodeId = index.getBrokerPool().getNodeFactory().createFromData(units, nodeIdRef.bytes, nodeIdRef.offset + 2);
View Full Code Here

TOP

Related Classes of org.exist.numbering.NodeId

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.