Examples of GWTJahiaNodeUsage


Examples of org.jahia.ajax.gwt.client.data.node.GWTJahiaNodeUsage

        String language = null;
        if (refNode.isNodeType(Constants.JAHIANT_TRANSLATION)) {
            language = refNode.getProperty("jcr:language").getString();
            refNode = refNode.getParent();
        }
        GWTJahiaNodeUsage usage = new GWTJahiaNodeUsage(refNode.getIdentifier(), refNode.getPath());
        usage.setNodeName(refNode.getName());
        usage.setPagePath(parent != null ? parent.getPath() : refNode.getPath());
        usage.setNodeTitle(refNode.hasProperty("jcr:title") ? refNode.getPropertyAsString("jcr:title") : "");
        if (parent != null) {
            usage.setPageTitle(parent.getPropertyAsString("jcr:title"));
        } else {
            String title = refNode.getPropertyAsString("jcr:title");
            if (title == null) {
                title = refNode.getName();
            }
            title += " (" + refNode.getPrimaryNodeType().getName() + ")";
            usage.setPageTitle(title);
        }

        usage.setLanguage(language);
        usage.setType(type);
        result.add(usage);
    }
View Full Code Here

Examples of org.jahia.ajax.gwt.client.data.node.GWTJahiaNodeUsage

            NavigationHelper navigationHelper = (NavigationHelper) SpringContextSingleton.getInstance().getContext().getBean("NavigationHelper");
            List<String> paths = new ArrayList<String>();
            paths.add(testFile1.getPath());
            List<GWTJahiaNodeUsage> usages = navigationHelper.getUsages(paths, session);
            assertEquals(providerRoot + " : Invalid number of file usages !", 1, usages.size());
            GWTJahiaNodeUsage firstUsage = usages.iterator().next();
            assertEquals(providerRoot + " : Expected path for node pointing to file is invalid !", refNode.getPath(), firstUsage.getPath());

            // now let's test property removal, to check if it works.
            refProperty = refNode.getProperty(SIMPLE_REFERENCE_PROPERTY_NAME);
            refProperty.remove();
            session.save();
View Full Code Here

Examples of org.jahia.ajax.gwt.client.data.node.GWTJahiaNodeUsage

                                            "message.remove.single.usage",
                                            "This node is still used by:");
                                }
                                int i = 0;
                                for (int j = 0; j < (size>4?4:size); j++) {
                                    GWTJahiaNodeUsage nodeUsage = result.get(j);
                                    if (!nodeUsage.getNodeName().equals(n)) {
                                        message += "<br/><span style=\"font-style:italic;\">" + nodeUsage.getNodeTitle() + " " + Messages.get(
                                                "label.remove.used", "is using this node in page(s)") + "<br/>" +nodeUsage.getPageTitle()+"</span>";
                                        i++;
                                    } else {
                                        message += "<br/><span style=\"font-style:italic;\">" + nodeUsage.getPageTitle()+"</span>";
                                    }
                                    n = nodeUsage.getNodeName();
                                }
                                if(i>4) {
                                    message+="<br/>.<br/>.<br/>.";
                                }
                                message+=Messages.get("message.remove.warning","<br/><span style=\"font-style:bold;color:red;\">Warning: this will erase the content definitively from the repository<br/>So it will not be displayed anymore anywere</span>");
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.