Package org.apache.lenya.cms.site

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


        Assert.isTrue("contains", this.children.contains(child));
        return this.children.indexOf(child);
    }

    public void moveDown(String name) {
        SiteNode child = getChild(name);
        int pos = getPosition(child);
        Assert.isTrue("not last", pos < this.children.size() - 1);
        this.children.remove(child);
        this.children.add(pos + 1, child);
        changed();
View Full Code Here


        this.children.add(pos + 1, child);
        changed();
    }

    public void moveUp(String name) {
        SiteNode child = getChild(name);
        int pos = getPosition(child);
        Assert.isTrue("not first", pos > 0);
        this.children.remove(child);
        this.children.add(pos - 1, child);
        changed();
View Full Code Here

        return parent;
    }

    public boolean contains(String path, String language) {
        if (contains(path)) {
            SiteNode node;
            try {
                node = getNode(path);
            } catch (SiteException e) {
                throw new RuntimeException(e);
            }
            return node.hasLink(language);
        }
        return false;
    }
View Full Code Here

     * @param document The document.
     * @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) {
                link = node.getLink(node.getLanguages()[0]);
            }
        }
        return link;
    }
View Full Code Here

            if (!doc.existsAreaVersion(Publication.LIVE_AREA)) {
                addErrorMessage("This usecase can only be invoked when the live version exists.");
            } else {
                Document liveDoc = doc.getAreaVersion(Publication.LIVE_AREA);
                NodeSet subSite = SiteUtil.getSubSite(this.manager, liveDoc.getLink().getNode());
                SiteNode node = liveDoc.getLink().getNode();
                subSite.remove(node);

                if (!subSite.isEmpty()) {
                    addErrorMessage("You can't deactivate this document because it has children.");
                }
View Full Code Here

    protected void removeChild(String name) {
        Assert.notNull("name", name);
        if (!this.name2child.containsKey(name)) {
            throw new RuntimeException("The node [" + name + "] is not contained!");
        }
        SiteNode node = (SiteNode) this.name2child.get(name);
        this.name2child.remove(node.getName());
        this.children.remove(node);
        getTree().nodeRemoved(getPath() + "/" + name);
        deleteIfEmpty();
    }
View Full Code Here

    }

    public SiteNode addChild(String name, String followingNodeName, boolean visible) {
        Assert.notNull("name", name);
        Assert.notNull("following node name", followingNodeName);
        SiteNode followingSibling = getChild(followingNodeName);
        int pos = this.children.indexOf(followingSibling);
        return addChild(name, pos, visible);
    }
View Full Code Here

        if (this.name2child.containsKey(name)) {
            throw new RuntimeException("The child [" + name + "] is already contained.");
        }

        SiteNode node = new TreeNodeImpl(this, name, visible, getLogger());
        this.children.add(pos, node);
        this.name2child.put(name, node);
        getTree().nodeAdded(node);
        getTree().changed();
        return node;
View Full Code Here

        Assert.isTrue("contains", this.children.contains(child));
        return this.children.indexOf(child);
    }

    public void moveDown(String name) {
        SiteNode child = getChild(name);
        int pos = getPosition(child);
        Assert.isTrue("not last", pos < this.children.size() - 1);
        this.children.remove(child);
        this.children.add(pos + 1, child);
        changed();
View Full Code Here

        this.children.add(pos + 1, child);
        changed();
    }

    public void moveUp(String name) {
        SiteNode child = getChild(name);
        int pos = getPosition(child);
        Assert.isTrue("not first", pos > 0);
        this.children.remove(child);
        this.children.add(pos - 1, child);
        changed();
View Full Code Here

TOP

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

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.