Package org.apache.lenya.cms.publication

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


    protected void createAreaVersion(Publication publication, String areaName, String uuid,
            String lang) throws PublicationException, ServiceException {
        DocumentManager docManager = null;
        try {
            Area authoring = publication.getArea(Publication.AUTHORING_AREA);
            Document authoringDoc = authoring.getDocument(uuid, lang);
            docManager = (DocumentManager) this.manager.lookup(DocumentManager.ROLE);
            docManager.copyToArea(authoringDoc, areaName);
        } finally {
            if (docManager != null) {
                this.manager.release(docManager);
View Full Code Here


                            "Error by setting up the transformation. Please fix the calling code.");
                if (lang == null)
                    lang = pub.getDefaultLanguage();
                List returnValues = new ArrayList();
                try {
                    Area areaObj = pub.getArea(this.area);
                    if (areaObj.contains(uuid, lang)) {
                        Document document = areaObj.getDocument(uuid, lang);
                        MetaData metaData = document.getMetaData(ns);
                        returnValues.addAll(Arrays.asList(metaData.getValues(key)));
                    } else if (defaultValue != null) {
                        returnValues.add(defaultValue);
                    } else {
View Full Code Here

        String areaName = snippets[1];
        SiteTree tree;
        try {
            DocumentFactory factory = DocumentUtil.createDocumentFactory(this.manager, session);
            Publication publication = factory.getPublication(publicationId);
            Area  area = publication.getArea(areaName);
           
            if (session.isModifiable() || session instanceof SharedItemStore) {
                tree = new SiteTreeImpl(this.manager, area, getLogger());
            }
            else {
View Full Code Here

            preOrder = getPreOrder(doc.getLink().getNode());
        } else {
            preOrder = new ArrayList();
            URLInformation info = new URLInformation(getSourceURL());
            Publication pub = factory.getPublication(info.getPublicationId());
            Area area = pub.getArea(info.getArea());
            SiteStructure site = area.getSite();
            SiteNode[] topLevelNodes = site.getTopLevelNodes();
            for (int i = 0; i < topLevelNodes.length; i++) {
                preOrder.addAll(getPreOrder(topLevelNodes[i]));
            }
        }
View Full Code Here

        String areaName = snippets[1];
        SiteTree tree;
        try {
            DocumentFactory factory = DocumentUtil.createDocumentFactory(this.manager, session);
            Publication publication = factory.getPublication(publicationId);
            Area  area = publication.getArea(areaName);
           
            if (session.isModifiable() || session instanceof SharedItemStore) {
                tree = new SiteTreeImpl(this.manager, area, getLogger());
            }
            else {
View Full Code Here

            Session session = RepositoryUtil.getSession(this.manager, _request);
            DocumentFactory factory = DocumentUtil.createDocumentFactory(this.manager, session);
            String url = ServletHelper.getWebappURI(_request);
            URLInformation info = new URLInformation(url);
            Publication pub = factory.getPublication(info.getPublicationId());
            Area area = pub.getArea(info.getArea());
            this.rewriter = new UrlToUuidRewriter(area);
        } catch (final Exception e1) {
            throw new ProcessingException(e1);
        }
    }
View Full Code Here

        String areaId = params.getParameter("area", info.getArea());

        DocumentFactory factory = DocumentUtil.getDocumentFactory(this.manager, request);
        try {
            Publication pub = factory.getPublication(pubId);
            Area area = pub.getArea(areaId);
            this.site = area.getSite();
        } catch (Exception e) {
            throw new ProcessingException(e);
        }
    }
View Full Code Here

            String pubId = steps[steps.length - 4];
            String areaName = steps[steps.length - 2];
            try {
                Session session = RepositoryUtil.createSession(this.manager, null, false);
                DocumentFactory factory = DocumentUtil.createDocumentFactory(this.manager, session);
                Area area = factory.getPublication(pubId).getArea(areaName);
                SiteTreeImpl tree = new SiteTreeImpl(this.manager, area, getLogger());
                int treeRev = tree.getRevision();
                int rcmlRev = tree.getRevision(tree.getRepositoryNode());
                if (treeRev != rcmlRev) {
                    throw new IllegalStateException("Tree revision " + treeRev
View Full Code Here

        return defaultPub;
    }

    protected void doCheckPreconditions() throws Exception {
        super.doCheckPreconditions();
        Area area = getArea();
        if (area.getDocuments().length > 0) {
            addErrorMessage("You can't import anything because this publication already contains content.");
        }
    }
View Full Code Here

    protected Area getArea() {
        String url = getSourceURL();
        URLInformation info = new URLInformation(url);
        String pubId = info.getPublicationId();
        String areaName = info.getArea();
        Area area;
        try {
            area = getDocumentFactory().getPublication(pubId).getArea(areaName);
        } catch (PublicationException e) {
            throw new RuntimeException(e);
        }
View Full Code Here

TOP

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

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.