Package org.apache.lenya.cms.site

Examples of org.apache.lenya.cms.site.Link


    }

    protected Link addLink(String lang, String label) {
        Assert.notNull("language", lang);
        Assert.notNull("label", label);
        Link link = addLinkInternal(lang, label);
        changed();
        return link;
    }
View Full Code Here


        Assert.notNull("label", label);
        if (this.language2link.containsKey(lang)) {
            throw new RuntimeException("The language [" + lang + "] is already contained.");
        }
        DocumentFactory factory = getTree().getPublication().getFactory();
        Link link = new SiteTreeLink(factory, this, label, lang);
        this.language2link.put(lang, link);
        getTree().linkAdded(link);
        return link;
    }
View Full Code Here

    public String getArea() {
        return this.area.getName();
    }

    public Link getByUuid(String uuid, String language) throws SiteException {
        Link delegate = getTree().getByUuid(uuid, language);
        return getLink(delegate);
    }
View Full Code Here

        Link delegate = getTree().getByUuid(uuid, language);
        return getLink(delegate);
    }

    protected Link getLink(Link delegate) {
        Link link = (Link) this.links.get(delegate);
        if (link == null) {
            link = new DelegatingLink(this.area.getPublication().getFactory(), getNode(delegate
                    .getNode()), delegate.getLabel(), delegate.getLanguage());
        }
        return link;
View Full Code Here

    protected void saveLinks(SiteNode node, NamespaceHelper helper, Element nodeElement)
            throws SiteException {
        String[] languages = node.getLanguages();
        for (int i = 0; i < languages.length; i++) {
            Link link = node.getLink(languages[i]);
            Element linkElement = helper.createElement("label", link.getLabel());
            linkElement.setAttribute("xml:lang", languages[i]);
            nodeElement.appendChild(linkElement);
        }
    }
View Full Code Here

                    DocumentLocator[] requiredNodes = siteManager
                            .getRequiredResources(map, liveLoc);
                    for (int i = 0; i < requiredNodes.length; i++) {
                        String path = requiredNodes[i].getPath();
                        if (!liveSite.contains(path)) {
                            Link link = getExistingLink(path, document);
                            if (link != null) {
                                missingDocuments.add(link.getDocument());
                            }
                        }

                    }
                }
View Full Code Here

     * @return A link or <code>null</code>.
     * @throws SiteException if an error occurs.
     */
    protected Link getExistingLink(String path, Document document) throws SiteException {
        SiteNode node = document.area().getSite().getNode(path);
        Link link = null;
        String uuid = node.getUuid();
        if (uuid != null && uuid.equals(document.getUUID())) {
            if (node.hasLink(document.getLanguage())) {
                link = node.getLink(document.getLanguage());
            } else if (node.getLanguages().length > 0) {
View Full Code Here

    }

    protected Link addLink(String lang, String label) {
        Assert.notNull("language", lang);
        Assert.notNull("label", label);
        Link link = addLinkInternal(lang, label);
        changed();
        return link;
    }
View Full Code Here

        Assert.notNull("label", label);
        if (this.language2link.containsKey(lang)) {
            throw new RuntimeException("The language [" + lang + "] is already contained.");
        }
        DocumentFactory factory = getTree().getPublication().getFactory();
        Link link = new SiteTreeLink(factory, this, label, lang);
        this.language2link.put(lang, link);
        getTree().linkAdded(link);
        return link;
    }
View Full Code Here

     */
    protected void addLabels(SiteNode node) throws SAXException {
        String[] languages = node.getLanguages();

        for (int i = 0; i < languages.length; i++) {
            Link link;
            try {
                link = node.getLink(languages[i]);
            } catch (SiteException e) {
                throw new RuntimeException(e);
            }
            addLabel(link.getLabel(), languages[i]);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.lenya.cms.site.Link

Copyright © 2018 www.massapicom. 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.