Package org.apache.lenya.cms.publication

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


            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


     * @throws Exception
     */
    public void testLinks() throws Exception {

        Publication pub = getPublication("test");
        Area area = pub.getArea("authoring");
        SiteStructure site = area.getSite();

        Document source = site.getNode("/index").getLink("en").getDocument();
        Document target = site.getNode("/tutorial").getLink("en").getDocument();

        LinkManager linkManager = null;
View Full Code Here

        }

        final Document source = docs[0];

        final Publication pub = getPublication("test");
        final Area area = pub.getArea("authoring");
        final SiteStructure site = area.getSite();

        final Document target = site.getNode("/index").getLink("en").getDocument();
        final String queryString = "?format=xhtml";
        final String baseLink = "lenya-document:" + target.getUUID() + ",lang="
                + target.getLanguage();
View Full Code Here

            revision = Integer.valueOf(revisionString).intValue();
        }

        try {
            Publication pub = factory.getPublication(pubId);
            Area areaObj = pub.getArea(area);
            Document doc;
            if (areaObj.contains(uuid, language)) {
                doc = areaObj.getDocument(uuid, language);
            } else {
                if (this.fallbackMode == MODE_FAIL) {
                    doc = null;
                } else if (this.fallbackMode == MODE_DEFAULT_LANGUAGE) {
                    if (areaObj.contains(uuid, pub.getDefaultLanguage())) {
                        doc = factory.get(pub, area, uuid, pub.getDefaultLanguage(), revision);
                    } else {
                        doc = null;
                    }
                } else {
View Full Code Here

    public void testImport() throws Exception {
       
        Session session = login("lenya");
       
        Publication pub = getPublication(session, "test");
        Area area = pub.getArea("authoring");
       
        if (area.getDocuments().length == 0) {
            Publication defaultPub = getPublication(session, "default");
            Area defaultArea = defaultPub.getArea("authoring");
            String pubPath = defaultArea.getPublication().getDirectory().getAbsolutePath();
            String path = pubPath.replace(File.separatorChar, '/') + "/example-content";
            Importer importer = new Importer(getManager(), getLogger());
            importer.importContent(defaultPub, area, path);
           
            assertTrue(area.getSite().contains("/tutorial"));
View Full Code Here

        String areaName = getParameterAsString(PARAM_INDEX_AREA);

        String[] areaNames = pub.getAreaNames();
        if (areaName != null && Arrays.asList(areaNames).contains(areaName)) {
            Area area = pub.getArea(areaName);
            indexArea(area);
        } else {
            for (int a = 0; a < areaNames.length; a++) {
                Area area = pub.getArea(areaNames[a]);
                indexArea(area);
            }
        }

    }
View Full Code Here

    public void index(Session session, ResourceType resourceType, String pubId, String area,
            String uuid, String language) throws IndexException {
        DocumentFactory factory = DocumentUtil.createDocumentFactory(this.manager, session);
        try {
            Publication pub = factory.getPublication(pubId);
            Area areaObj = pub.getArea(area);
            if (areaObj.contains(uuid, language)) {
                updateIndex("index", resourceType, pubId, area, uuid, language);
            } else {
                getLogger().debug(
                        "Ignoring document [" + pubId + ":" + area + ":" + uuid + ":" + language
                                + "] because it doesn't exist (anymore).");
View Full Code Here

        Clipboard clipboard = helper.getClipboard(getContext());
        Publication pub = getPublication();
        Document clippedDocument = clipboard.getDocument(identityMap, pub);

        final String targetPath = getTargetPath();
        final Area area = clippedDocument.area();
        DocumentManager documentManager = null;
        try {
            documentManager = (DocumentManager) this.manager.lookup(DocumentManager.ROLE);

            if (clipboard.getMethod() == Clipboard.METHOD_COPY) {
View Full Code Here

        try {
            Document doc = getSourceDocument();
            if (doc == null) {
                URLInformation info = new URLInformation(getSourceURL());
                Publication pub = getDocumentFactory().getPublication(info.getPublicationId());
                Area area = pub.getArea(info.getArea());
                setParameter(PARAM_NUMBER_OF_DOCUMENTS, new Integer(area.getDocuments().length));
                setParameter(PARAM_NUMBER_OF_SITE_NODES, new Integer(area.getSite().getNodes().length));
            }
            else {
                // read parameters from Dublin Core meta-data
                MetaData dc = doc.getMetaData(DublinCore.DC_NAMESPACE);
                setParameter(DublinCore.ELEMENT_TITLE, dc.getFirstValue(DublinCore.ELEMENT_TITLE));
View Full Code Here

        return path;
    }

    public Document[] getDocuments(DocumentFactory factory, Publication pub, String area)
            throws SiteException {
        Area areaObj;
        try {
            areaObj = pub.getArea(area);
        } catch (PublicationException e) {
            throw new SiteException(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.