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

        }

        Document doc = getSourceDocument();
        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

                newDoc = docManager.add(area.getPublication().getFactory(), resourceType,
                        contentUri, area.getPublication(), area.getName(), path, language, "xml",
                        navigationTitle, visibleInNav);
                newDoc.setMimeType(mimeType);
            } else {
                SiteNode node = site.getNode(path);
                Document doc = node.getLink(node.getLanguages()[0]).getDocument();
                newDoc = docManager.addVersion(doc, area.getName(), language, true);
                resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
                SourceUtil.copy(resolver, contentUri, newDoc.getOutputStream());
                newDoc.getLink().setLabel(navigationTitle);
            }
View Full Code Here

public class LanguagesSelector implements FragmentSelector {

    public void selectFragment(NodeGenerator generator, SiteStructure site, String path,
            String language) throws SAXException, SiteException {
        if (site.contains(path)) {
            SiteNode node = site.getNode(path);
            generator.startNode(node);
            String[] languages = node.getLanguages();
            for (int i = 0; i < languages.length; i++) {
                generator.generateLink(node, languages[i]);
            }
            generator.endNode(node);
        }
View Full Code Here

            throws SAXException, SiteException {
        if (path.equals("/") || path.equals("")) {
            SiteNode[] nodes = site.getTopLevelNodes();
            selectNodes(generator, nodes, lang);
        } else if (site.contains(path)) {
            SiteNode node = site.getNode(path);
            selectSubtree(generator, node, lang);
        }
    }
View Full Code Here

        while (tokens.hasMoreTokens()) {
            String name = tokens.nextToken();
            currentPath.append("/").append(name);
            String pathString = currentPath.toString();
            if (site.contains(pathString)) {
                SiteNode node = site.getNode(pathString);
                generator.startNode(node);
                generator.generateLink(node, lang);
                generator.endNode(node);
            } else {
                break;
View Full Code Here

            if (locator != null) {
                Publication pub = factory.getPublication(locator.getPublicationId());
                String path = locator.getPath();
                Area area = pub.getArea(locator.getArea());
                if (area.getSite().contains(path)) {
                    SiteNode node = area.getSite().getNode(path);
                    if (node.hasLink(locator.getLanguage())) {
                        return true;
                    }
                }
            }
        } catch (Exception e) {
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

        Publication alicePub = aliceFactory.getPublication(pubId);
       
        SiteStructure aliceSite = alicePub.getArea(area).getSite();
        aliceSite.getRepositoryNode().lock();
       
        SiteNode lenyaNode = lenyaSite.getNodes()[1];
        lenyaNode.setVisible(!lenyaNode.isVisible());
        lenyaSession.commit();
       
        SiteNode aliceNode = aliceSite.getNodes()[2];
        aliceNode.setVisible(!aliceNode.isVisible());
        try {
            aliceSession.commit();
            assertTrue("No exception raised", false);
        }
        catch (Exception ignore) {
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.