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());
            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

     * @see org.apache.lenya.cms.usecase.AbstractUsecase#getNodesToLock()
     */
    protected Node[] getNodesToLock() throws UsecaseException {
        try {
            List nodes = new ArrayList();
            DocumentSet set = new DocumentSet();

            Document doc = getSourceDocument();
            NodeSet subsite = SiteUtil.getSubSite(this.manager, doc.getLink().getNode());
            set.addAll(new DocumentSet(subsite.getDocuments()));

            Document[] documents = set.getDocuments();
            for (int i = 0; i < documents.length; i++) {
                nodes.add(documents[i].getRepositoryNode());
            }

            Area live = doc.getPublication().getArea(Publication.LIVE_AREA);
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

    /**
     * @see org.apache.lenya.cms.usecase.AbstractUsecase#doExecute()
     */
    protected void doExecute() throws Exception {
        DocumentSet set = SiteUtil.getSubSite(this.manager, getSourceDocument());
        WorkflowUtil.invoke(this.manager, getLogger(), set, getEvent(), true);
        super.doExecute();
    }
View Full Code Here

    protected Transactionable[] getObjectsToLock() throws UsecaseException {
        try {
            List nodes = new ArrayList();
            Document doc = getSourceDocument();
            Document liveVersion = doc.getIdentityMap().getAreaVersion(doc, Publication.LIVE_AREA);
            DocumentSet set = getInvolvedDocuments(liveVersion);
            Document[] documents = set.getDocuments();
            for (int i = 0; i < documents.length; i++) {
                nodes.addAll(Arrays.asList(documents[i].getRepositoryNodes()));
            }

            nodes.add(SiteUtil.getSiteStructure(this.manager,
View Full Code Here

        if (getLogger().isDebugEnabled()) {
            getLogger().debug("Deactivating document [" + document + "]");
            getLogger().debug("Subtree deactivation: [" + isSubtreeEnabled() + "]");
        }

        DocumentSet set = getInvolvedDocuments(document);
        try {
            set.visit(this);
        } catch (PublicationException e) {
            throw new RuntimeException(e);
        }

        if (getLogger().isDebugEnabled()) {
View Full Code Here

            getLogger().debug("Publishing completed.");
        }
    }

    protected DocumentSet getInvolvedDocuments(Document document) {
        DocumentSet set;
        ServiceSelector selector = null;
        SiteManager siteManager = null;
        try {
            selector = (ServiceSelector) this.manager.lookup(SiteManager.ROLE + "Selector");
            siteManager = (SiteManager) selector.select(document.getPublication()
                    .getSiteManagerHint());

            Document[] descendants = siteManager.getRequiringResources(document);
            set = new DocumentSet(descendants);
            set.add(document);
            siteManager.sortAscending(set);
            set.reverse();
        } catch (Exception e) {
            throw new RuntimeException(e);
        } finally {
            if (selector != null) {
                if (siteManager != null) {
View Full Code Here

    protected Transactionable[] getObjectsToLock() throws UsecaseException {

        try {
            List nodes = new ArrayList();
            Document doc = getSourceDocument();
            DocumentSet set = getInvolvedDocuments(doc);
            Document[] documents = set.getDocuments();
            for (int i = 0; i < documents.length; i++) {
                nodes.addAll(Arrays.asList(documents[i].getRepositoryNodes()));
                Document liveVersion = documents[i].getIdentityMap().getAreaVersion(documents[i],
                        Publication.LIVE_AREA);
                nodes.addAll(Arrays.asList(liveVersion.getRepositoryNodes()));
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.