Package org.apache.lenya.cms.publication

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


            DocumentType documentType = documentTypeBuilder
                    .buildDocumentType(getDocumentTypeName(), getSourceDocument().getPublication());

            documentManager = (DocumentManager) this.manager.lookup(DocumentManager.ROLE);

            DocumentIdentityMap map = (DocumentIdentityMap) getUnitOfWork().getIdentityMap();

            String documentId = getDocumentID();
            Document document = map.get(getSourceDocument().getPublication(), getSourceDocument()
                    .getArea(), documentId, language);

            documentManager.add(document,
                    documentType,
                    getParameterAsString(DublinCore.ELEMENT_TITLE),
View Full Code Here


            } else {
                setParameter(ALLOW_SINGLE_DOCUMENT, Boolean.toString(true));
            }

            Publication publication = document.getPublication();
            DocumentIdentityMap map = document.getIdentityMap();

            Document liveDocument = map.getAreaVersion(document, Publication.LIVE_AREA);

            List missingDocuments = new ArrayList();

            ServiceSelector selector = null;
            SiteManager siteManager = null;
            try {
                selector = (ServiceSelector) this.manager.lookup(SiteManager.ROLE + "Selector");
                siteManager = (SiteManager) selector.select(publication.getSiteManagerHint());
                Document[] requiredDocuments = siteManager.getRequiredResources(liveDocument);
                for (int i = 0; i < requiredDocuments.length; i++) {
                    if (!siteManager.containsInAnyLanguage(requiredDocuments[i])) {
                        Document authoringVersion = map.getAreaVersion(requiredDocuments[i],
                                Publication.AUTHORING_AREA);
                        missingDocuments.add(authoringVersion);
                    }
                }
            } catch (Exception e) {
View Full Code Here

     * @throws SiteException if an error occurs.
     */
    protected Document[] getTrashDocuments() throws PublicationException, SiteException {
        PublicationFactory factory = PublicationFactory.getInstance(getLogger());
        Publication publication = factory.getPublication(this.manager, getSourceURL());
        DocumentIdentityMap identityMap = getDocumentIdentityMap();
        Document[] documents;
       
        ServiceSelector selector = null;
        SiteManager siteManager = null;
        try {
View Full Code Here

     * @return The store of the document.
     */
    private DocumentStore getStore(Document document) {
        Publication publication = document.getPublication();
        String area = document.getArea();
        DocumentIdentityMap map = document.getIdentityMap();
        return getStore(map, publication, area);
    }
View Full Code Here

        System.out.println("    Destination area:        [" + destinationArea + "]");
        System.out.println("    Destination document ID: [" + _destinationDocumentId + "]");
        System.out.println("    Destination language:    [" + _destinationLanguage + "]");

        Publication publication = PublicationHelper.getPublication();
        DocumentIdentityMap map = new DocumentIdentityMap();

        Document sourceDocument = map.getFactory().get(publication,
                sourceArea,
                _sourceDocumentId,
                _sourceLanguage);
        Document destinationDocument = map.getFactory().get(publication,
                destinationArea,
                _destinationDocumentId,
                _destinationLanguage);

        publication.copyDocument(sourceDocument, destinationDocument);
View Full Code Here

        }

        Publication publication = getPublication(webappUrl);
        String url = null;
        try {
            DocumentIdentityMap map = new DocumentIdentityMap(getServiceManager(), getLogger());
            if (map.isDocument(webappUrl)) {
                Document document = map.getFromURL(webappUrl);
                if (document.existsInAnyLanguage()) {
                    url = "/" + document.getArea() + document.getId();
                    if (getLogger().isDebugEnabled()) {
                        getLogger().debug("    Document exists");
                        getLogger().debug("    Document ID: [" + document.getId() + "]");
View Full Code Here

        try {
            URLInformation info = new URLInformation(getSourceURL());
            setParameter(COMPLETE_AREA, info.getCompleteArea());

            DocumentIdentityMap map = (DocumentIdentityMap) getUnitOfWork().getIdentityMap();
            Document sourceDocument = map.getFromURL(getSourceURL());
            setParameter(DOCUMENT, sourceDocument);

            setParameter(SSL, Boolean.toString(isSSLProtected()));
            setParameter(ANCESTOR_SSL, Boolean.toString(isAncestorSSLProtected()));
View Full Code Here

        if (event != null) {

            try {
                resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
                DocumentIdentityMap map = new DocumentIdentityMap(this.manager, getLogger());
                if (map.isDocument(webappUrl)) {
                    Document document = map.getFromURL(webappUrl);
                    authorized = WorkflowUtil.canInvoke(this.manager, getLogger(), document, event);
                }
            } catch (final Exception e) {
                throw new AccessControlException(e);
            } finally {
View Full Code Here

     * @throws Exception when something went wrong.
     */
    public void testWorkflow() throws Exception {
        Publication publication = PublicationHelper.getPublication();
        String url = "/" + publication.getId() + URL;
        DocumentIdentityMap map = new DocumentIdentityMap(publication);
        Document document = map.getFactory().getFromURL(url);

        File configDir = new File(publication.getDirectory(), "config" + File.separator + "ac"
                + File.separator + "passwd");
        assertTrue(configDir.exists());

View Full Code Here

    //TODO evaluation of meta, workflow
       
        //evaluate the node
        Publication pub = PublicationHelper.getPublication();
        DocumentIdentityMap map = new DocumentIdentityMap(pub);
        TreeSiteManager manager = (TreeSiteManager) pub.getSiteManager(map);
    SiteTree sitetree = manager.getTree(Publication.AUTHORING_AREA);
    SiteTreeNode node = sitetree.getNode(secdocumentid);
    assertNotNull(node);
        System.out.println(
View Full Code Here

TOP

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

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.