Examples of addMixin()


Examples of javax.jcr.Node.addMixin()

    public void test_basename() throws Exception {
        // create another de lib with a basename set
        Node appsI18n = getSession().getRootNode().getNode("libs/i18n");
        Node de = appsI18n.addNode("de_basename", "nt:unstructured");
        de.addMixin("mix:language");
        de.setProperty("jcr:language", "de");
        de.setProperty("sling:basename", "FOO");
        for (Message msg : MESSAGES_DE_BASENAME.values()) {
            msg.add(de);
        }
View Full Code Here

Examples of javax.jcr.Node.addMixin()

      synchronized (this) {
          counter++;
          path = jobStoragePath + pathFormat.format(new Date()) + "/" + counter;
        }
      final Node result = new DeepNodeCreator().deepCreateNode(path, s, JOB_NODETYPE);
      result.addMixin(JobData.JOB_DATA_MIXIN);
      result.setProperty(BackgroundServletConstants.CREATION_TIME_PROPERTY, Calendar.getInstance());
      result.save();
      log.debug("Job node {} created", result.getPath());
      return result;
  }
View Full Code Here

Examples of javax.jcr.Node.addMixin()

            public Void doWithSession(Session session) throws RepositoryException {

                ValueFactory valueFactory = session.getValueFactory();
               
                Node contentNode = session.getNode("/content/test-root/file.txt/jcr:content");
                contentNode.addMixin("sling:chunks");

                Node chunkNode = contentNode.addNode("firstChunk", "sling:chunk");
                chunkNode.setProperty("sling:offset", valueFactory.createValue(0));
                chunkNode.setProperty( "jcr:data",
                        valueFactory.createValue( valueFactory.createBinary(
View Full Code Here

Examples of javax.jcr.Node.addMixin()

        }

        // create new node
        Node dst = dstParent.addNode(name, src.getPrimaryNodeType().getName());
        for (NodeType mix : src.getMixinNodeTypes()) {
            dst.addMixin(mix.getName());
        }

        // copy the properties
        for (PropertyIterator iter = src.getProperties(); iter.hasNext();) {
            copy(iter.nextProperty(), dst, null);
View Full Code Here

Examples of javax.jcr.Node.addMixin()

                        }
                    }

                    // add new mixins
                    for (String mixin : newMixins) {
                        node.addMixin(mixin);
                        // this is a bit of a cheat; there isn't a formal checkout, but assigning
                        // the mix:versionable mixin does an implicit checkout
                        if (mixin.equals("mix:versionable") &&
                                versioningConfiguration.isCheckinOnNewVersionableNode()) {
                            changes.add(Modification.onCheckout(path));
View Full Code Here

Examples of javax.jcr.Node.addMixin()

        saveMappings(session);

        //create new child with vanity path
        Node childNode = maybeCreateNode(rootNode, "rootChild", "nt:unstructured");
        childNode.setProperty("sling:vanityPath", "childVanity");
        childNode.addMixin("sling:VanityPath");
        saveMappings(session);

        path = ResourceUtil.normalize(ResourceUtil.getParent(rootPath)
                + "/childVanity.print.html");
View Full Code Here

Examples of javax.jcr.Node.addMixin()

            assertNotNull(res);
            assertTrue(res instanceof NonExistingResource);
            assertEquals("/childVanity.print.html", res.getPath());
           
            //add mixin
            childNode.addMixin("sling:VanityPath");
            saveMappings(session);
           
            path = ResourceUtil.normalize(ResourceUtil.getParent(rootPath)
                    + "/childVanity.print.html");
View Full Code Here

Examples of javax.jcr.Node.addMixin()

            assertTrue(childNode.isSame(res.adaptTo(Node.class)));
           
            //create another child with the same vanity path
            childNode2 = maybeCreateNode(rootNode, "rootChild2", "nt:unstructured");
            childNode2.setProperty("sling:vanityPath", "childVanity");
            childNode2.addMixin("sling:VanityPath");
            saveMappings(session);
            assertNotNull(res);
            assertEquals(childNode.getPath(), res.getPath());
            assertEquals(childNode.getPrimaryNodeType().getName(),
View Full Code Here

Examples of javax.jcr.Node.addMixin()

    @Test public void test_resolve_with_sling_vanity_path_order() throws Exception {
        final String vanityPath = "/ordering";

        // create two nodes - child2 with a higher order
        Node child1 = rootNode.addNode("child1");
        child1.addMixin("sling:VanityPath");
        child1.setProperty("sling:vanityPath", vanityPath);
        child1.setProperty("sling:vanityOrder", 100);
        Node child2 = rootNode.addNode("child2");
        child2.addMixin("sling:VanityPath");
        child2.setProperty("sling:vanityPath", vanityPath);
View Full Code Here

Examples of javax.jcr.Node.addMixin()

        Node child1 = rootNode.addNode("child1");
        child1.addMixin("sling:VanityPath");
        child1.setProperty("sling:vanityPath", vanityPath);
        child1.setProperty("sling:vanityOrder", 100);
        Node child2 = rootNode.addNode("child2");
        child2.addMixin("sling:VanityPath");
        child2.setProperty("sling:vanityPath", vanityPath);
        child2.setProperty("sling:vanityOrder", 200);

        try {
            saveMappings(session);
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.