Package org.apache.lenya.cms.site

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


            throws SiteException {
        return new DocumentLocator[0];
    }

    public void move(SiteNode source, String destinationPath) throws SiteException {
        throw new SiteException("This operation is not supported by [" + getClass().getName()
                + "]!");
    }
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

                && parentNode.getLocalName().equals(NODE_NAME)) {
            parent = new SiteTreeNodeImpl(this.factory, getTree(), (Element) parentNode,
                    getLogger());
            ContainerUtil.enableLogging(parent, getLogger());
        } else {
            throw new SiteException("The node [" + this + "] has no parent.");
        }

        return parent;
    }
View Full Code Here

    }

    public Link getLink(String language) throws SiteException {
        Link link = getLinkInternal(language);
        if (link == null) {
            throw new SiteException("The node [" + this + "] doesn't contain the language ["
                    + language + "].");
        }
        return link;
    }
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

            else {
                getLogger().info("Empty sitetree will be created/initialized!");
                this.document = createDocument();
            }
        } 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.