Package org.apache.lenya.cms.publication

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


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

        // create new document
        DocumentManager documentManager = null;
        ServiceSelector selector = null;
        ResourceType resourceType = null;
        try {

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

            String language = getParameterAsString(LANGUAGE);
            Document initialDocument = getInitialDocument();

            Document document;

            String title = getDublinCoreParameter(DublinCore.ELEMENT_TITLE).trim();

            if (createVersion()) {
                document = documentManager.addVersion(initialDocument, getArea(), language, true);
                document.getLink().setLabel(title);
            } else {
                if (initialDocument == null) {
                    selector = (ServiceSelector) this.manager
                            .lookup(ResourceType.ROLE + "Selector");
                    resourceType = (ResourceType) selector.select(getDocumentTypeName());
                    String sampleName = getParameterAsString(SAMPLE, resourceType.getSampleNames()[0]);
                    ResourceType.Sample sample = resourceType.getSample(sampleName);
                    document = documentManager.add(getDocumentFactory(), resourceType, sample.getUri(),
                            getPublication(), getArea(), getNewDocumentPath(), language,
                            getSourceExtension(), title, getVisibleInNav());
                    document.setMimeType(sample.getMimeType());
                } else {
                    document = documentManager.add(initialDocument, getArea(),
                            getNewDocumentPath(), language, getSourceExtension(), title,
                            getVisibleInNav());
                }
            }

View Full Code Here


                }
            }
           
        }

        DocumentManager docManager = null;
        try {
            docManager = (DocumentManager) this.manager.lookup(DocumentManager.ROLE);
            docManager.moveAll(doc.area(), doc.getPath(), targetArea, targetLoc.getPath());

        } finally {
            if (docManager != null) {
                this.manager.release(docManager);
            }
View Full Code Here

TOP

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

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.