Package org.apache.lenya.cms.publication

Examples of org.apache.lenya.cms.publication.DocumentException


        SiteTree tree = null;
        tree = getPublication().getTree(area);
        SiteTreeNode node = tree.getNode(documentid);

        if (node == null) {
            throw new DocumentException(
                "Document-id " + documentid + " not found.");
        }
        //if node is visible change to fale and vice versa
        String visibility = "false";
View Full Code Here


                LoadQuartzServlet servlet = LoadQuartzServlet.getServlet(servletContext);
                servlet.deleteDocumentJobs(document);

            } catch (Exception e) {
                throw new DocumentException(e);
            }

        }
    }
View Full Code Here

        throws SiteTreeException, DocumentException {

        SiteTree tree = getPublication().getTree(area);
        SiteTreeNode node = tree.getNode(documentid);
        if (node == null) {
            throw new DocumentException(
                "Document-id " + documentid + " not found.");
        }
        Label label = node.getLabel(language);
        if (label == null) {
            throw new DocumentException(
                "Label for language " + language + " not found.");
        }
        if (href.equals("")) href = null;
          // FIXME: This is somewhat of a hack. See also RenameLabelTask.java
        tree.removeLabel(documentid, label);
View Full Code Here

        throws SiteTreeException, DocumentException {

        SiteTree tree = getPublication().getTree(area);
        SiteTreeNode node = tree.getNode(documentid);
        if (node == null) {
            throw new DocumentException(
                "Document-id " + documentid + " not found.");
        }
        Label label = node.getLabel(language);
        if (label == null) {
            throw new DocumentException(
                "Label for language " + language + " not found.");
        }
  // FIXME: This is somewhat of a hack. The change of the label
  // name should not be done by removing the label and readding
  // it. Instead the node should probably have a setLabel method
View Full Code Here

    /**
     * @see org.apache.lenya.modules.collection.Collection#remove(org.apache.lenya.cms.publication.Document)
     */
    public void remove(Document document) throws DocumentException {
        if (!documents().contains(document)) {
            throw new DocumentException("Collection [" + this + "] does not contain document ["
                    + document + "]");
        }
        documents().remove(document);
    }
View Full Code Here

        try {
            Element documentElement = helper.createElement(ELEMENT_DOCUMENT);
            documentElement.setAttributeNS(null, ATTRIBUTE_UUID, document.getUUID());
            return documentElement;
        } catch (final DOMException e) {
            throw new DocumentException(e);
        }
    }
View Full Code Here

     * @see org.apache.lenya.modules.collection.Collection#getFirstPosition(org.apache.lenya.cms.publication.Document)
     */
    public int getFirstPosition(Document document) throws DocumentException {
        load();
        if (!contains(document)) {
            throw new DocumentException("The collection [" + this
                    + "] does not contain the document [" + document + "]");
        }
        return documents().indexOf(document);
    }
View Full Code Here

     */
    public boolean exists() throws DocumentException {
        try {
            return getDelegate().exists();
        } catch (Exception e) {
            throw new DocumentException(e);
        }
    }
View Full Code Here

        throws SiteTreeException, DocumentException {

        SiteTree tree = getPublication().getTree(area);
        SiteTreeNode node = tree.getNode(documentid);
        if (node == null) {
            throw new DocumentException(
                "Document-id " + documentid + " not found.");
        }
        Label label = node.getLabel(language);
        if (label == null) {
            throw new DocumentException(
                "Label for language " + language + " not found.");
        }
  // FIXME: This is somewhat of a hack. The change of the label
  // name should not be done by removing the label and readding
  // it. Instead the node should probably have a setLabel method
View Full Code Here

                LoadQuartzServlet servlet = LoadQuartzServlet.getServlet(servletContext);
                servlet.deleteDocumentJobs(document);

            } catch (Exception e) {
                throw new DocumentException(e);
            }

        }
    }
View Full Code Here

TOP

Related Classes of org.apache.lenya.cms.publication.DocumentException

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.