Package org.apache.lenya.cms.site

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


        try {
            if (!store.contains(document)) {
                store.remove(document);
            }
        } catch (Exception e) {
            throw new SiteException(e);
        }
    }
View Full Code Here


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

            SiteTreeNode node = siteTree.getNode(this.documentid);
            if (this.getLogger().isDebugEnabled()) {
                this.getLogger().debug("Node with documentid " + this.documentid + " found.");
            }
            if (node == null)
                throw new SiteException("Node with documentid " + this.documentid + " not found.");

            SiteTreeNode[] children = node.getChildren();

            for (int i = 0; i < children.length; i++) {
                startNode(NODE_NODE, children[i]);
View Full Code Here

            this.document = SourceUtil.readDOM(this.sourceUri, this.manager);
            if (this.document == null) {
                this.document = createDocument();
            }
        } catch (Exception e) {
            throw new SiteException(e);
        }
    }
View Full Code Here

    protected void saveDocument() throws SiteException {
        try {
            SourceUtil.writeDOM(this.document, this.sourceUri, this.manager);
        } catch (Exception e) {
            throw new SiteException(e);
        }
    }
View Full Code Here

            String suffix, boolean link, String refDocumentId) throws SiteException {

        Node parentNode = getNodeInternal(parentid);

        if (parentNode == null) {
            throw new SiteException("Parentid: " + parentid + " in " + this.area
                    + " tree not found");
        }

        getLogger().debug("PARENT ELEMENT: " + parentNode);
View Full Code Here

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

        this.addNode(parentId, id, subtreeRoot.getLabels(), subtreeRoot.getHref(), subtreeRoot
                .getSuffix(), subtreeRoot.hasLink(), refDocumentId);
        newParent = this.getNode(parentId + "/" + id);
        if (newParent == null) {
            throw new SiteException("The added node was not found.");
        }
        SiteTreeNode[] children = subtreeRoot.getChildren();
        if (children == null) {
            getLogger().info("The node " + subtreeRoot.toString() + " has no children");
            return;
View Full Code Here

                            languages[i]);
                    ancestors.add(version);
                }
            }
        } catch (Exception e) {
            throw new SiteException(e);
        }
        if (parent != null) {
            ancestors.addAll(getAncestors(parent));
        }
        return ancestors;
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.