Examples of NodePath


Examples of com.infoclinika.mssharing.fileserver.model.NodePath

    @RequestMapping(value = "/destination/{id}", method = RequestMethod.GET)
    @ResponseBody
    public UploadFilePathResponse composeExperimentAttachmentDestination(@PathVariable("id") long attachmentId, Principal principal) {
        final long userId = getUserId(principal);
        //TBD: should we verify attachment exists?
        final NodePath nodePath = storedObjectPaths.experimentAttachmentPath(userId, attachmentId);
        return new UploadFilePathResponse(nodePath.getPath());
    }
View Full Code Here

Examples of de.danielbechler.diff.path.NodePath

    final ObjectWithCircularReference modifiedObj2 = new ObjectWithCircularReference("2");
    final ObjectWithCircularReference modifiedObj3 = new ObjectWithCircularReference("4");
    modifiedObj1.setReference(modifiedObj2);
    modifiedObj2.setReference(modifiedObj3);

    final NodePath nodePath = NodePath.with("reference", "reference");

    // verify that the node can be found when it's not excluded
    ObjectDiffer objectDiffer = ObjectDifferBuilder.startBuilding().build();
    final DiffNode verification = objectDiffer.compare(obj1, modifiedObj1);
    verification.visit(new PrintingVisitor(obj1, modifiedObj1));
View Full Code Here

Examples of org.apache.geronimo.datastore.impl.remote.messaging.Topology.NodePath

       
        Topology topology = new Topology();
        InetAddress address = InetAddress.getLocalHost();
        NodeInfo node1 = new NodeInfo("node1", address, 8080);
        NodeInfo node2 = new NodeInfo("node2", address, 8080);
        NodePath path1 = new NodePath(node1, node2, weight10, weight10);
        topology.addPath(path1);
        NodeInfo[] path = topology.getPath(node1, node2);
        assertEquals(1, path.length);
       
        NodeInfo node3 = new NodeInfo("node3", address, 8080);
        NodePath path2 = new NodePath(node2, node3, weight10, weight10);
        topology.addPath(path2);
        path = topology.getPath(node1, node3);
        assertEquals(2, path.length);
       
        NodeInfo node4 = new NodeInfo("node4", address, 8080);
        NodePath path3 = new NodePath(node3, node4, weight10, weight10);
        topology.addPath(path3);
        path = topology.getPath(node1, node4);
        assertEquals(3, path.length);
       
        topology.removePath(path3);
        path = topology.getPath(node1, node4);
        assertNull(path);
       
        path3 = new NodePath(node3, node1, weight30, weight10);
        topology.addPath(path3);
        path = topology.getPath(node1, node3);
        assertEquals(1, path.length);
        path = topology.getPath(node3, node1);
        assertEquals(2, path.length);
View Full Code Here

Examples of org.exist.storage.NodePath

        if (nodes == null || nodes.getLength() == 0)
            {return;}
        DBBroker broker = null;
        try {
            broker = ownerDocument.getBrokerPool().get(null);
            final NodePath path = getPath();
            StreamListener listener = null;
            //May help getReindexRoot() to make some useful things
            broker.getIndexController().setDocument(ownerDocument);
            StoredNode reindexRoot = broker.getIndexController().getReindexRoot(this, path, true, true);
            broker.getIndexController().setMode(StreamListener.STORE);
View Full Code Here

Examples of org.exist.storage.NodePath

        if (!(refChild instanceof StoredNode))
            {throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, "wrong node type");}
        DBBroker broker = null;
        try {
            broker = ownerDocument.getBrokerPool().get(null);
            final NodePath path = getPath();
            StreamListener listener = null;
            //May help getReindexRoot() to make some useful things
            broker.getIndexController().setDocument(ownerDocument);
            final StoredNode reindexRoot = broker.getIndexController().getReindexRoot(this, path, true, true);
            broker.getIndexController().setMode(StreamListener.STORE);
View Full Code Here

Examples of org.exist.storage.NodePath

        if (!(refChild instanceof StoredNode))
            {throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, "wrong node type: ");}
        DBBroker broker = null;
        try {
            broker = ownerDocument.getBrokerPool().get(null);
            final NodePath path = getPath();
            StreamListener listener = null;
            //May help getReindexRoot() to make some useful things
            broker.getIndexController().setDocument(ownerDocument);
            final StoredNode reindexRoot = broker.getIndexController().getReindexRoot(this, path, true, true);
            broker.getIndexController().setMode(StreamListener.STORE);
View Full Code Here

Examples of org.exist.storage.NodePath

     *
     * @param newContent
     * @throws DOMException
     */
    public void update(Txn transaction, NodeList newContent) throws DOMException {
        final NodePath path = getPath();
        // remove old child nodes
        final NodeList nodes = getChildNodes();
        StreamListener listener = null;
        DBBroker broker = null;
        //May help getReindexRoot() to make some useful things
        try {
            broker = ownerDocument.getBrokerPool().get(null);
            broker.getIndexController().setDocument(ownerDocument);
            final StoredNode reindexRoot = broker.getIndexController().getReindexRoot(this, path, true, true);
            broker.getIndexController().setMode(StreamListener.REMOVE_SOME_NODES);
            if (reindexRoot == null) {
                listener = broker.getIndexController().getStreamListener();
            } else {
                broker.getIndexController().reindex(transaction, reindexRoot, StreamListener.REMOVE_SOME_NODES);
            }
            // TODO: fix once range index has been moved to new architecture
            final StoredNode valueReindexRoot = broker.getValueIndex().getReindexRoot(this, path);
            broker.getValueIndex().reindex(valueReindexRoot);
            StoredNode last = this;
            int i = nodes.getLength();
            for (; i > 0; i--) {
                StoredNode child = (StoredNode) nodes.item(i - 1);
                if (child.getNodeType() == Node.ATTRIBUTE_NODE) {
                    last = child;
                    break;
                }
                if (child.getNodeType() == Node.ELEMENT_NODE)
                    {path.addComponent(child.getQName());}
                broker.removeAllNodes(transaction, child, path, listener);
                if (child.getNodeType() == Node.ELEMENT_NODE)
                    {path.removeLastComponent();}
            }
            broker.getIndexController().flush();
            broker.getIndexController().setMode(StreamListener.STORE);
            broker.getIndexController().getStreamListener();
            broker.endRemove(transaction);
View Full Code Here

Examples of org.exist.storage.NodePath

        StoredNode previousNode = (StoredNode) oldNode.getPreviousSibling();
        if (previousNode == null)
            {previousNode = this;}
        else
            {previousNode = getLastNode(previousNode);}
        final NodePath currentPath = getPath();
        final NodePath oldPath = oldNode.getPath(currentPath);
        DBBroker broker = null;
        try {
            broker = ownerDocument.getBrokerPool().get(null);
            //May help getReindexRoot() to make some useful things
            broker.getIndexController().setDocument(ownerDocument);
            //Check if the change affects any ancestor nodes, which then need to be reindexed later
            StoredNode reindexRoot = broker.getIndexController().getReindexRoot(oldNode, oldPath, false);
            //Remove indexes
            if (reindexRoot == null)
                {reindexRoot = oldNode;}
            broker.getIndexController().reindex(transaction, reindexRoot, StreamListener.REMOVE_SOME_NODES);
            //TODO: fix once range index has been moved to new architecture
            final StoredNode valueReindexRoot = broker.getValueIndex().getReindexRoot(this, oldPath);
            broker.getValueIndex().reindex(valueReindexRoot);
            //Remove the actual node data
            broker.removeNode(transaction, oldNode, oldPath, null);
            broker.endRemove(transaction);
            newNode.nodeId = oldNode.nodeId;
            //Reinsert the new node data
            broker.insertNodeAfter(transaction, previousNode, newNode);
            final NodePath path = newNode.getPath(currentPath);
            broker.indexNode(transaction, newNode, path);
            if (newNode.getNodeType() == Node.ELEMENT_NODE)
            {broker.endElement(newNode, path, null);}
            broker.updateNode(transaction, this, true);
            //Recreate indexes on ancestor nodes
View Full Code Here

Examples of org.exist.storage.NodePath

            {throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, "wrong node type");}
        final StoredNode oldNode = (StoredNode) oldChild;
        if (!oldNode.nodeId.getParentId().equals(nodeId))
            {throw new DOMException(DOMException.NOT_FOUND_ERR,
                "node is not a child of this element");}
        final NodePath oldPath = oldNode.getPath();
        StreamListener listener = null;
        DBBroker broker = null;
        try {
            //May help getReindexRoot() to make some useful things
            broker = ownerDocument.getBrokerPool().get(null);
View Full Code Here

Examples of org.exist.storage.NodePath

                        final StoredNode old = (StoredNode) oldChild;
                        if (!old.nodeId.isChildOf(nodeId))
                            {throw new DOMException(DOMException.NOT_FOUND_ERR, "node " +
                                old.nodeId.getParentId() +
                                " is not a child of element " + nodeId);}
                        final NodePath oldPath = old.getPath();
                        // remove old custom indexes
                        broker.getIndexController().reindex(transaction, old,
                            StreamListener.REMOVE_SOME_NODES);
                        broker.removeNode(transaction, old, oldPath, null);
                        children--;
                        attributes--;
                    }
                } finally {
                    broker.endRemove(transaction);
                }
            }
            final NodePath path = getPath();
            broker.getIndexController().setDocument(ownerDocument, StreamListener.STORE);
            final StreamListener listener = broker.getIndexController().getStreamListener();
            if (children == 0) {
                appendChildren(transaction, nodeId.newChild(), null,
                    new NodeImplRef(this), path, appendList, listener);
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.