Package org.apache.lenya.cms.site

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


    protected void saveDocument() throws SiteException {
        try {
            DocumentHelper.writeDocument(this.document, getRepositoryNode().getOutputStream());
        } catch (Exception e) {
            throw new SiteException(e);
        }
    }
View Full Code Here


        }
        if (node != null) {
            treeNode = new SiteTreeNodeImpl(this.factory, this, (Element) node, getLogger());
            ContainerUtil.enableLogging(treeNode, getLogger());
        } else {
            throw new SiteException("No node contained for path [" + path + "]!");
        }

        return treeNode;
    }
View Full Code Here

     * @throws SiteException if the moving failed.
     */
    public synchronized void moveUp(String path) throws SiteException {
        Node node = this.getNodeInternal(path);
        if (node == null) {
            throw new SiteException("Node to move: " + path + " not found");
        }
        Node parentNode = node.getParentNode();
        if (parentNode == null) {
            throw new SiteException("Parentid of node with path: " + path + " not found");
        }

        Node previousNode;
        try {
            previousNode = XPathAPI.selectSingleNode(node,
                    "(preceding-sibling::*[local-name() = 'node'])[last()]");
        } catch (TransformerException e) {
            throw new SiteException(e);
        }

        if (previousNode == null) {
            getLogger().warn("Couldn't found a preceding sibling");
            return;
View Full Code Here

     * @throws SiteException if the moving failed.
     */
    public synchronized void moveDown(String path) throws SiteException {
        Node node = this.getNodeInternal(path);
        if (node == null) {
            throw new SiteException("Node to move: " + path + " not found");
        }
        Node parentNode = node.getParentNode();
        if (parentNode == null) {
            throw new SiteException("Parentid of node with path: " + path + " not found");
        }
        Node nextNode;
        try {
            nextNode = XPathAPI.selectSingleNode(node,
                    "following-sibling::*[local-name() = 'node'][position()=2]");
        } catch (TransformerException e) {
            throw new SiteException(e);
        }

        Node insertNode = parentNode.removeChild(node);

        if (nextNode == null) {
View Full Code Here

    }

    public Link getByUuid(String uuid, String language) throws SiteException {
        SiteNode node = getByUuidInternal(uuid, language);
        if (node == null) {
            throw new SiteException("The link for [" + uuid + ":" + language
                    + "] is not contained!");
        }
        return node.getLink(language);
    }
View Full Code Here

            throws SiteException {

        if (contains(path)) {
            SiteNode node = getNode(path);
            if (node.getLanguages().length > 0 && !node.getUuid().equals(doc.getUUID())) {
                throw new SiteException("Node for path [" + path + "] exists with different UUID!");
            }
        }

        SiteTreeNodeImpl node = addNode(path, doc.getUUID(), true, null, "", false);
        node.addLabel(doc.getLanguage(), "");
View Full Code Here

        DocumentStore store = getStore(document);
        try {
            store.add(document);
        } catch (DocumentException e) {
            throw new SiteException(e);
        }
    }
View Full Code Here

        }

        try {
            return getStore(resource).contains(resource);
        } catch (DocumentException e) {
            throw new SiteException(e);
        }
    }
View Full Code Here

                contains = contains || store.contains(doc);
            }

            return getStore(resource).contains(resource);
        } catch (Exception e) {
            throw new SiteException(e);
        }
    }
View Full Code Here

        try {
            if (!destinationStore.contains(destinationDocument)) {
                destinationStore.add(destinationDocument);
            }
        } catch (Exception e) {
            throw new SiteException(e);
        }
    }
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.