Package org.apache.lenya.cms.repository

Examples of org.apache.lenya.cms.repository.Node


    public synchronized void save() throws RepositoryException {
        if (loading || !changed) {
            return;
        }
        try {
            Node repoNode = getRepositoryNode();
            NamespaceHelper helper = new NamespaceHelper(NAMESPACE, "", "site");

            int revision = getRevision(repoNode) + 1;
            helper.getDocument().getDocumentElement().setAttribute("revision",
                    Integer.toString(revision));

            saveNodes(getRoot(), helper, helper.getDocument().getDocumentElement());
            helper.save(repoNode.getOutputStream());
            this.lastModified = repoNode.getLastModified();
        } catch (RuntimeException e) {
            throw e;
        } catch (Exception e) {
            throw new RepositoryException(e);
        }
View Full Code Here


        targetNode.setVisible(sourceNode.isVisible());
    }

    protected void copyRevisions(Document sourceDoc, Document targetDoc) throws PublicationException {
        try {
            Node targetNode = targetDoc.getRepositoryNode();
            targetNode.copyRevisionsFrom(sourceDoc.getRepositoryNode());
        } catch (Exception e) {
            throw new PublicationException(e);
        }
    }
View Full Code Here

    public boolean exists(DocumentFactory factory, Publication pub, String area, String uuid,
            String language) throws PublicationException {
        String sourceUri = DocumentImpl.getSourceURI(pub, area, uuid, language);
        try {
            Node node = DocumentImpl.getRepositoryNode(this.manager, factory, sourceUri);
            return node.exists();
        } catch (RepositoryException e) {
            throw new PublicationException(e);
        }
    }
View Full Code Here

        Document doc = getSourceDocument();
        if (doc == null) {
            return;
        }
       
        Node node = doc.getRepositoryNode();
        if (!node.isCheckedOut()) {
            String[] params = { DublinCoreHelper.getTitle(doc, true) };
            addErrorMessage("not-checked-out", params);
        }
    }
View Full Code Here

            addErrorMessage("not-checked-out", params);
        }
    }

    protected void prepareView() throws Exception {
        Node node = getSourceDocument().getRepositoryNode();
        if (node.isCheckedOut()) {
            String userId = node.getCheckoutUserId();
            String[] params = { userId };
            if (isLoggedIn(userId)) {
                addInfoMessage("user-logged-in", params);
            }
            else {
View Full Code Here

    protected void doExecute() throws Exception {
        super.doExecute();

        Document doc = getSourceDocument();
        Node node = doc.getRepositoryNode();

        node.forceCheckIn();
    }
View Full Code Here

                    entry.setValue(KEY_WORKFLOW_STATE, state);
                } else {
                    entry.setValue(KEY_WORKFLOW_STATE, "");
                }

                Node node = documents[i].getRepositoryNode();
                if (node.isCheckedOut()) {
                    entry.setValue(KEY_CHECKED_OUT, node.getCheckoutUserId());
                } else {
                    entry.setValue(KEY_CHECKED_OUT, "");
                }
                entries.add(entry);
            }
View Full Code Here

        if (getSite().containsByUuid(uuid, language)) {
            return true;
        } else {
            String sourceUri = DocumentImpl.getSourceURI(pub, name, uuid, language);
            try {
                Node node = (Node) getPublication().getSession().getRepositoryItem(
                        getNodeFactory(), sourceUri);
                return node.exists();
            } catch (RepositoryException e) {
                throw new RuntimeException(e);
            }
        }
    }
View Full Code Here

        List nodes = new ArrayList();

        try {
            if(getSourceDocument() != null) {
                Node siteNode = getSourceDocument().area().getSite().getRepositoryNode();
                nodes.add(siteNode);

                Document sourceDocument = getSourceDocument();
 
                NodeSet subsite = SiteUtil.getSubSite(this.manager, sourceDocument.getLink().getNode());
View Full Code Here

        }
        return this.repositoryNode;
    }

    protected ContentHolder getContentHolder() {
        Node node = getRepositoryNode();
        if (isRevisionSpecified()) {
            try {
                return node.getHistory().getRevision(revision);
            } catch (RepositoryException e) {
                throw new RuntimeException(e);
            }
        } else {
            return node;
View Full Code Here

TOP

Related Classes of org.apache.lenya.cms.repository.Node

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.