Package org.apache.lenya.cms.publication.util

Examples of org.apache.lenya.cms.publication.util.DocumentSet


        try {
            selector = (ServiceSelector) this.manager.lookup(SiteManager.ROLE + "Selector");
            Publication pub = documents.getDocuments()[0].getPublication();
            siteManager = (SiteManager) selector.select(pub.getSiteManagerHint());

            DocumentSet set = new DocumentSet(documents.getDocuments());
            siteManager.sortAscending(set);
            set.reverse();

            DocumentVisitor visitor = new DeleteVisitor(this);
            set.visit(visitor);
        } catch (ServiceException e) {
            throw new PublicationException(e);
        } finally {
            if (selector != null) {
                if (siteManager != null) {
View Full Code Here


        } else {

            Document document = getSourceDocument();
            DocumentIdentityMap identityMap = getDocumentIdentityMap();

            DocumentSet set = SiteUtil.getSubSite(this.manager, document);
            Document[] documents = set.getDocuments();
            for (int i = 0; i < documents.length; i++) {
                Document liveVersion = identityMap.getAreaVersion(documents[i],
                        Publication.LIVE_AREA);
                if (liveVersion.exists()) {
                    addErrorMessage("delete-doc-live", new String[] { liveVersion.getId() });
View Full Code Here

     */
    protected Transactionable[] getObjectsToLock() throws UsecaseException {
        List nodes = new ArrayList();
        Document doc = getSourceDocument();
        try {
            DocumentSet sources = SiteUtil.getSubSite(this.manager, doc);
            Document[] docs = sources.getDocuments();
            for (int i = 0; i < docs.length; i++) {
                nodes.addAll(Arrays.asList(docs[i].getRepositoryNodes()));
            }

            DocumentSet targets = SiteUtil.getTransferedSubSite(this.manager,
                    doc,
                    getTargetArea(),
                    SiteUtil.MODE_CHANGE_ID);
            docs = targets.getDocuments();
            for (int i = 0; i < docs.length; i++) {
                nodes.addAll(Arrays.asList(docs[i].getRepositoryNodes()));
            }

            nodes.add(SiteUtil.getSiteStructure(this.manager, doc).getRepositoryNode());
            nodes.add(SiteUtil.getSiteStructure(this.manager, targets.getDocuments()[0])
                    .getRepositoryNode());
        } catch (Exception e) {
            throw new UsecaseException(e);
        }
        return (Transactionable[]) nodes.toArray(new Transactionable[nodes.size()]);
View Full Code Here

        Map source2target = new HashMap();
        for (int i = 0; i < sourceDocs.length; i++) {
            source2target.put(sourceDocs[i], targetDocs[i]);
        }

        DocumentSet sortedSources = new DocumentSet(sourceDocs);
        SiteUtil.sortAscending(this.manager, sortedSources);
        Document[] sortedSourceDocs = sortedSources.getDocuments();

        for (int i = 0; i < sortedSourceDocs.length; i++) {
            move(sortedSourceDocs[i], (Document) source2target.get(sortedSourceDocs[i]));
        }
    }
View Full Code Here

     * @see org.apache.lenya.cms.usecase.AbstractUsecase#doExecute()
     */
    protected void doExecute() throws Exception {

        Document doc = getSourceDocument();
        DocumentSet sources = SiteUtil.getSubSite(this.manager, doc);

        Document target = doc.getIdentityMap().getAreaVersion(doc, getTargetArea());
        target = SiteUtil.getAvailableDocument(this.manager, target);

        DocumentManager documentManager = null;
        try {
            WorkflowUtil.invoke(this.manager, getLogger(), sources, getEvent(), true);

            documentManager = (DocumentManager) this.manager.lookup(DocumentManager.ROLE);
            DocumentSet targets = SiteUtil.getTransferedSubSite(this.manager,
                    doc,
                    getTargetArea(),
                    SiteUtil.MODE_CHANGE_ID);
            documentManager.move(sources, targets);

View Full Code Here

        Map source2target = new HashMap();
        for (int i = 0; i < sourceDocs.length; i++) {
            source2target.put(sourceDocs[i], targetDocs[i]);
        }

        DocumentSet sortedSources = new DocumentSet(sourceDocs);
        SiteUtil.sortAscending(this.manager, sortedSources);
        Document[] sortedSourceDocs = sortedSources.getDocuments();

        for (int i = 0; i < sortedSourceDocs.length; i++) {
            copy(sortedSourceDocs[i], (Document) source2target.get(sortedSourceDocs[i]));
        }
    }
View Full Code Here

        try {
            selector = (ServiceSelector) this.manager.lookup(SiteManager.ROLE + "Selector");
            Publication pub = documents.getDocuments()[0].getPublication();
            siteManager = (SiteManager) selector.select(pub.getSiteManagerHint());

            DocumentSet set = new DocumentSet(documents.getDocuments());
            sortAscending(set);
            set.reverse();

            DocumentVisitor visitor = new DeleteVisitor(this);
            set.visit(visitor);
        } catch (ServiceException e) {
            throw new PublicationException(e);
        } finally {
            if (selector != null) {
                if (siteManager != null) {
View Full Code Here

        Map source2target = new HashMap();
        for (int i = 0; i < sourceDocs.length; i++) {
            source2target.put(sourceDocs[i], targetDocs[i]);
        }

        DocumentSet sortedSources = new DocumentSet(sourceDocs);
        sortAscending(sortedSources);
        Document[] sortedSourceDocs = sortedSources.getDocuments();

        for (int i = 0; i < sortedSourceDocs.length; i++) {
            copy(sortedSourceDocs[i], ((Document) source2target.get(sortedSourceDocs[i]))
                    .getLocator());
        }
View Full Code Here

        DocumentManager documentManager = null;
        try {
            documentManager = (DocumentManager) this.manager.lookup(DocumentManager.ROLE);
            Document[] documents = getTrashDocuments();
            DocumentSet set = new DocumentSet(documents);
            documentManager.delete(set);
        } finally {
            if (documentManager != null) {
                this.manager.release(documentManager);
            }
View Full Code Here

TOP

Related Classes of org.apache.lenya.cms.publication.util.DocumentSet

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.