Package org.apache.lenya.cms.site

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


    public void setVisibleInNav(Document document, boolean visibleInNav) throws SiteException {
        SiteTree tree = getTree(document);
        try {
            tree.getNode(document.getPath()).setVisible(visibleInNav);
        } catch (DocumentException e) {
            throw new SiteException(e);
        }
    }
View Full Code Here


        SiteTree siteTree = getTree(document);
        if (siteTree != null) {
            SiteTreeNode node = (SiteTreeNode) siteTree.getByUuid(document.getUUID(),
                    document.getLanguage()).getNode();
            if (node == null) {
                throw new SiteException("Node for document [" + document + "] does not exist!");
            }
            label = (Link) node.getLink(document.getLanguage());
        }

        if (label == null) {
            throw new SiteException("The label of document [" + document + "] is null!");
        }

        return label;
    }
View Full Code Here

                    documents.add(doc.getTranslation(languages[l]));
                }
            }
            return (Document[]) documents.toArray(new Document[documents.size()]);
        } catch (Exception e) {
            throw new SiteException(e);
        }
    }
View Full Code Here

    }

    public void add(String path, Document document) throws SiteException {

        if (contains(document)) {
            throw new SiteException("The document [" + document + "] is already contained!");
        }
        DefaultSiteTree tree = getTree(document);

        SiteTreeNode node;
        if (!tree.contains(path)) {
View Full Code Here

    }

    public void set(String path, Document document) throws SiteException {

        if (contains(document)) {
            throw new SiteException("The document [" + document + "] is already contained!");
        }
        DefaultSiteTree tree = getTree(document);
        SiteTreeNodeImpl node = (SiteTreeNodeImpl) tree.getNode(path);
        node.setUUID(document.getUUID());
        tree.changed();
View Full Code Here

        Publication pub;
        try {
            pub = factory.getPublication(locator.getPublicationId());
        } catch (PublicationException e) {
            throw new SiteException(e);
        }
        SiteTree tree = getTree(factory, pub, locator.getArea());

        String suffix = null;
        int version = 0;
View Full Code Here

    public boolean isVisibleInNav(Document document) throws SiteException {
        SiteTree tree = getTree(document);
        try {
            return tree.getNode(document.getPath()).isVisible();
        } catch (DocumentException e) {
            throw new SiteException(e);
        }
    }
View Full Code Here

    protected String getPath(DocumentFactory factory, Publication pub, String area, String uuid,
            String language) throws SiteException {
        SiteTree tree = getTree(factory, pub, area);
        SiteNode node = tree.getByUuid(uuid, language).getNode();
        if (node == null) {
            throw new SiteException("No node found for [" + pub.getId() + ":" + area + ":" + uuid
                    + ":" + language + "]");
        }
        return node.getPath();
    }
View Full Code Here

    protected String getUUID(DocumentFactory factory, Publication pub, String area, String path)
            throws SiteException {
        SiteTree tree = getTree(factory, pub, area);
        SiteNode node = tree.getNode(path);
        if (node == null) {
            throw new SiteException("No node found for [" + pub.getId() + ":" + area + ":" + path
                    + "]");
        }
        return node.getUuid();
    }
View Full Code Here

            throws SiteException {
        Publication pub;
        try {
            pub = factory.getPublication(locator.getPublicationId());
        } catch (PublicationException e) {
            throw new SiteException(e);
        }
        SiteTree tree = getTree(factory, pub, locator.getArea());
        if (tree.contains(locator.getPath())) {
            SiteNode node = tree.getNode(locator.getPath());
            return node.hasLink(locator.getLanguage());
View Full Code Here

TOP

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

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.