Package org.apache.lenya.cms.site

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


            throws SiteException {
        DocumentStore store = getStore(identityMap, publication, area);
        try {
            return store.getDocuments();
        } catch (DocumentException e) {
            throw new SiteException(e);
        }
    }
View Full Code Here


    public void set(String path, Document document) throws SiteException {
        try {
            getStore(document).setPath(document, path);
        } catch (TransactionException e) {
            throw new SiteException(e);
        }
    }
View Full Code Here

    }

    public Link add(String path, Document doc) throws SiteException {

        if (containsByUuid(doc.getUUID(), doc.getLanguage())) {
            throw new SiteException("The document [" + doc + "] is already contained!");
        }

        TreeNodeImpl node;
        if (contains(path)) {
            node = getTreeNode(path);
            if (node.getUuid() == null) {
                node.setUuid(doc.getUUID());
            } else if (!node.getUuid().equals(doc.getUUID())) {
                throw new SiteException("The node already has a different UUID!");
            }
        } else {
            node = (TreeNodeImpl) add(path);
            node.setUuid(doc.getUUID());
        }
View Full Code Here

    public SiteNode add(String path, String followingSiblingPath) throws SiteException {
        String parentPath = getParentPath(path);
        String nodeName = path.substring(parentPath.length() + 1);

        if (!followingSiblingPath.startsWith(parentPath + "/")) {
            throw new SiteException("Invalid following sibling path [" + followingSiblingPath + "]");
        }

        String followingNodeName = followingSiblingPath.substring(parentPath.length() + 1);

        if (!contains(parentPath)) {
View Full Code Here

    public Link getByUuid(String uuid, String language) throws SiteException {
        Assert.notNull("uuid", uuid);
        Assert.notNull("language", language);
        String key = getKey(uuid, language);
        if (!getUuidLanguage2Link().containsKey(key)) {
            throw new SiteException("No link for [" + key + "]");
        }
        return (Link) getUuidLanguage2Link().get(key);
    }
View Full Code Here

    }

    public SiteNode getNode(String path) throws SiteException {
        Assert.notNull("path", path);
        if (!getPath2Node().containsKey(path)) {
            throw new SiteException("No node for path [" + path + "]");
        }
        return (SiteNode) this.path2node.get(path);
    }
View Full Code Here

    }

    public Link getLink(String language) throws SiteException {
        Assert.notNull("language", language);
        if (!this.language2link.containsKey(language)) {
            throw new SiteException("No link contained for language [" + language + "]");
        }
        return (Link) this.language2link.get(language);
    }
View Full Code Here

        return this.name;
    }

    public SiteNode getParent() throws SiteException {
        if (isTopLevel()) {
            throw new SiteException("This is a top level node.");
        }
        return (SiteNode) this.parent;
    }
View Full Code Here

                String type = this.publication.getArea(this.area)
                    .getDocument(node.getUuid(),this.publication.getDefaultLanguage())
                    .getMimeType();
                this.attributes.addAttribute("",ATTR_TYPE, ATTR_TYPE, "CDATA", type);
            } catch (PublicationException e) {
                throw new SiteException(e);
            }
        }
           
    }
View Full Code Here

    }

    public Link add(String path, Document doc) throws SiteException {

        if (containsByUuid(doc.getUUID(), doc.getLanguage())) {
            throw new SiteException("The document [" + doc + "] is already contained!");
        }

        TreeNodeImpl node;
        if (contains(path)) {
            node = getTreeNode(path);
            if (node.getUuid() == null) {
                node.setUuid(doc.getUUID());
            } else if (!node.getUuid().equals(doc.getUUID())) {
                throw new SiteException("The node already has a different UUID!");
            }
        } else {
            node = (TreeNodeImpl) add(path);
            node.setUuid(doc.getUUID());
        }
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.