Package javax.jcr

Examples of javax.jcr.Node.addNode()


        Node map = mapRoot.addNode("map", "sling:Mapping");
        Node http = map.addNode("http", "sling:Mapping");
        Node aliasNode = map.addNode("alias", "nt:unstructured");
        Node localhost80 =http.addNode("localhost.80", "sling:Mapping");
        Node https = map.addNode("https", "sling:Mapping");
        https.addNode("localhost.443", "sling:Mapping");

        SecureRandom random = new SecureRandom();

        for (int j = 0; j < nodeCount; j++) {
            Node content = rootNode.addNode("a" + j, JcrConstants.NT_UNSTRUCTURED);
View Full Code Here


        Node map = mapRoot.addNode("map", "sling:Mapping");
        Node http = map.addNode("http", "sling:Mapping");
        Node aliasNode = map.addNode("alias", "nt:unstructured");
        Node localhost80 =http.addNode("localhost.80", "sling:Mapping");
        Node https = map.addNode("https", "sling:Mapping");
        https.addNode("localhost.443", "sling:Mapping");

        SecureRandom random = new SecureRandom();

        // creating <nodeCount> x <childNodeCount> nodes with vanity
        for (int j = 0; j < nodeCount; j++) {
View Full Code Here

        if(root.hasNode("libs")) {
           libs = root.getNode("libs");
        } else {
           libs = root.addNode("libs", "nt:unstructured");
        }
        i18nRoot = libs.addNode("i18n", "nt:unstructured");
        deRoot = addLanguageNode(i18nRoot, "de");
        frRoot = addLanguageNode(i18nRoot, "fr");
        session.save();
    }
View Full Code Here

            name = name.replaceAll(":", "_");
            if (name.length() == 0) {
                continue;
            }
            if (!node.hasNode(name)) {
                node.addNode(name, "nt:folder");
            }
            node = node.getNode(name);
        }
       
        log.debug("Retrieving document {}, will be stored at {}", currentURL, node.getPath() + "/" + filename);
View Full Code Here

    public void add(Node languageNode) throws RepositoryException {
        Node node = languageNode;
        String[] pathElements = path.split("/");
        for (String pathStep : pathElements) {
            if (pathStep != null && pathStep.length() > 0) {
                node = node.addNode(pathStep, "nt:folder");
            }
        }
        if (useNodeName) {
            node = node.addNode(key, "sling:MessageEntry");
        } else {
View Full Code Here

            if (pathStep != null && pathStep.length() > 0) {
                node = node.addNode(pathStep, "nt:folder");
            }
        }
        if (useNodeName) {
            node = node.addNode(key, "sling:MessageEntry");
        } else {
            node = node.addNode("node" + nodeNameCounter, "sling:MessageEntry");
            nodeNameCounter++;
            node.setProperty("sling:key", key);
        }
View Full Code Here

            }
        }
        if (useNodeName) {
            node = node.addNode(key, "sling:MessageEntry");
        } else {
            node = node.addNode("node" + nodeNameCounter, "sling:MessageEntry");
            nodeNameCounter++;
            node.setProperty("sling:key", key);
        }
        node.setProperty("sling:message", message);
    }
View Full Code Here

            if(parentPath.length() == 0) {
                parentPath = "/";
            }
            final String childPath = path.substring(slashPos + 1);
            final Node parent = deepCreateNode(parentPath, session, nodeType);
            result = parent.addNode(childPath, getNodeType(parent, childPath, nodeType));
            nodeCreated(result);
            session.save();
        }
        return result;
    }
View Full Code Here

            if (session.nodeExists(path)) {
                return;
            }

            Node parent = session.getNode(Text.getRelativeParent(path, 1));
            parent.addNode(Text.getName(path), primaryNodeType);
            session.save();
        } finally {
            session.logout();
        }
    }
View Full Code Here

                final StringTokenizer st = new StringTokenizer(relativePath.substring(0, pos), "/");
                while ( st.hasMoreTokens() ) {
                    final String token = st.nextToken();
                    if ( !node.hasNode(token) ) {
                        try {
                            node.addNode(token, FOLDER_NODE_TYPE);
                        } catch (RepositoryException re) {
                            // we ignore this as this folder might be created from a different task
                            node.refresh(false);
                        }
                    }
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.