Package org.jahia.services.content

Examples of org.jahia.services.content.JCRNodeWrapper.addMixin()


        }

        if (parameters.containsKey(Constants.JCR_MIXINTYPES)) {
            for (Object o : ((ArrayList) parameters.get(Constants.JCR_MIXINTYPES))) {
                String mixin = (String) o;
                newNode.addMixin(mixin);
            }
        }
        Set<Map.Entry<String, List<String>>> set = parameters.entrySet();
        for (Map.Entry<String, List<String>> entry : set) {
            String key = entry.getKey();
View Full Code Here


            if(!node.isCheckedOut()) {
                session.checkout(node);
            }
            if (!actives.isEmpty()) {
                if (!node.isNodeType("jmix:workflowRulesable")) {
                    node.addMixin("jmix:workflowRulesable");
                }
                session.save();
            }
            if (node.hasNode(WorkflowService.WORKFLOWRULES_NODE_NAME)) {
                JCRNodeWrapper wfRulesNode = node.getNode(WorkflowService.WORKFLOWRULES_NODE_NAME);
View Full Code Here

            }
            propertyName = StringUtils.substringAfterLast(propertyName, "/");
        }
        parent = checkoutNode(parent);
        if (!StringUtils.isEmpty(mixinType) && !parent.isNodeType(mixinType)) {
            parent.addMixin(mixinType);
        }

        ExtendedPropertyDefinition propertyDefinition = null;
        propertyDefinition = parent.getApplicablePropertyDefinition(propertyName);
        if (propertyDefinition == null) {
View Full Code Here

            }
            propertyName = StringUtils.substringAfterLast(propertyName, "/");
        }
        parent = checkoutNode(parent);
        if (!StringUtils.isEmpty(mixinType) && !parent.isNodeType(mixinType)) {
            parent.addMixin(mixinType);
        }

        ExtendedPropertyDefinition propertyDefinition = null;
        propertyDefinition = parent.getApplicablePropertyDefinition(propertyName);
        if (propertyDefinition == null) {
View Full Code Here

            }
        }
        if (parameters.containsKey(Constants.JCR_MIXINTYPES)) {
            String[] mixinTypes = (String[]) parameters.get(Constants.JCR_MIXINTYPES);
            for (String mixinType : mixinTypes) {
                node.addMixin(mixinType);
            }
        }
        Set<Map.Entry<String, String[]>> set = parameters.entrySet();
        for (Map.Entry<String, String[]> entry : set) {
            String key = entry.getKey();
View Full Code Here

        testNodeInWorkspace(englishLiveSession, SITECONTENT_ROOT_NODE + "/home/page1",
                "Page 1 should have been published to live workspace !");

        //  Add mixin to a node already published once, publish it, and verify that the new mixin was properly added.
        englishEditSession.checkout(englishEditPage1);
        englishEditPage1.addMixin("jmix:sitemap");
        englishEditSession.save();
        assertTrue("Page 1 should now have the sitemap mixin type in edit workspace", englishEditPage1.isNodeType(
                "jmix:sitemap"));
        testPropertyInWorkspace(englishEditSession, SITECONTENT_ROOT_NODE + "/home/page1", "changefreq", "monthly",
                "Propery changefreq should have default value of 'monthly'");
View Full Code Here

        final JCRNodeWrapper event = node.addNode(name, "jnt:event");
        event.setProperty("jcr:title", name);
        event.setProperty("eventsType", eventType);
        event.setProperty("location", location);
        event.setProperty("startDate", calendar);
        event.addMixin("jmix:categorized");
        event.setProperty("j:defaultCategory", new Value[] { event.getSession().getValueFactory()
                .createValue(category) });
        return event;
    }
View Full Code Here

            Calendar calendar, JCRNodeWrapper category) throws RepositoryException {
        final JCRNodeWrapper event = node.addNode(name, "jnt:news");
        event.setProperty("jcr:title", name);
        event.setProperty("desc", desc);
        event.setProperty("date", calendar);
        event.addMixin("jmix:categorized");
        event.setProperty("j:defaultCategory", new Value[] { event.getSession().getValueFactory()
                .createValue(category) });
        return event;
    }
View Full Code Here

        final JCRNodeWrapper event = node.addNode(name, "jnt:event");
        event.setProperty("jcr:title", name);
        event.setProperty("eventsType", eventType);
        event.setProperty("location", location);
        event.setProperty("startDate", calendar);
        event.addMixin("jmix:categorized");
        event.setProperty("j:defaultCategory", new Value[] {event.getSession().getValueFactory().createValue(category)} );
    }


}
View Full Code Here

        JCRNodeWrapper convertedFilesNode = session.getNode(renderContext.getUser().getLocalPath() + "/files");
        JCRNodeWrapper convertedFileNode;
        if (conversionSucceeded) {
            FileInputStream iStream = new FileInputStream(convertedFile);
            convertedFileNode = convertedFilesNode.uploadFile(convertedFileName, iStream, returnedMimeType);
            convertedFileNode.addMixin("jmix:convertedFile");
            iStream.close();
        } else {
            convertedFileNode = convertedFilesNode.uploadFile(convertedFileName, inputFile.getInputStream(), inputFile.getContentType());
            convertedFileNode.addMixin("jmix:convertedFile");
            convertedFileNode.setProperty("conversionFailedMessage", failureMessage);
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.