Package org.apache.lenya.cms.publication

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


     * @param webappUrl The webapp URL.
     * @return A publication.
     * @throws AccessControlException when something went wrong.
     */
    protected Publication getPublication(String webappUrl) throws AccessControlException {
        Publication publication = null;

        assert webappUrl.startsWith("/");
        // remove leading slash
        String url = webappUrl.substring(1);

View Full Code Here


     * Link test.
     * @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();
       
View Full Code Here

                    if (util != null) {
                        this.manager.release(util);
                    }
                }

                Publication pub = PublicationUtil.getPublicationFromUrl(this.manager,
                        factory,
                        this.webappUrl);
                if (!authorizer.authorizeUsecase(tab.getUsecase(), this.roles, pub)) {
                    if (getLogger().isDebugEnabled()) {
                        getLogger().debug("Usecase not authorized");
View Full Code Here

        ServiceSelector selector = null;
        SiteManager siteManager = null;
        SourceResolver resolver = null;
        try {
            resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
            Publication pub = factory.getPublication(pubId);
            selector = (ServiceSelector) this.manager.lookup(SiteManager.ROLE + "Selector");
            siteManager = (SiteManager) selector.select(pub.getSiteManagerHint());

            List nodes = new ArrayList();
            Map uri2meta = new HashMap();

            String[] areas = { Publication.AUTHORING_AREA, Publication.LIVE_AREA,
View Full Code Here

            throw new ExecutionException("Parameters missing: [" + keyString + "]");
        }

        TaskManager manager;

        Publication publication = getTaskParameters().getPublication();

        WorkflowInvoker workflowInvoker = new WorkflowInvoker(getParameters(), this.manager);
        workflowInvoker.setup(publication, getWrapperParameters().getWebappUrl());

        Task task;
        try {
            manager = new TaskManager(publication.getDirectory().getAbsolutePath(), this.manager);
            task = manager.getTask(taskId);

            Properties properties = new Properties();
            properties.putAll(getTaskParameters().getMap());
            Parameters _parameters = Parameters.fromProperties(properties);

            task.parameterize(_parameters);
        } catch (final ConfigurationException e) {
            throw new ExecutionException(e);
        } catch (final ParameterException e) {
            throw new ExecutionException(e);
        } catch (final SAXException e) {
            throw new ExecutionException(e);
        } catch (final IOException e) {
            throw new ExecutionException(e);
        } catch (ExecutionException e) {
            throw e;
        }

        log.debug("-----------------------------------");
        log.debug(" Triggering workflow");
        log.debug("-----------------------------------");

        // FIXME The new workflow is set before the end of the transition because the document id
        // and so the document are sometimes changing during the transition (ex archiving , ...)
        workflowInvoker.invokeTransition();

        log.debug("-----------------------------------");
        log.debug(" Triggering task");
        log.debug("-----------------------------------");

        task.execute(publication.getServletContext().getAbsolutePath());

        log.debug("-----------------------------------");
        log.debug(" Triggering notification");
        log.debug("-----------------------------------");
        Notifier notifier = new Notifier(manager, getParameters());
View Full Code Here

            NamespaceMap schedulerParameters = new NamespaceMap(LoadQuartzServlet.PREFIX);

            DocumentFactory identityMap = DocumentUtil.createDocumentIdentityMap(null, null);
            String url = ServletHelper.getWebappURI(ObjectModelHelper.getRequest(this.objectModel));
            Publication pub = null;

            schedulerParameters.put(ServletJob.PARAMETER_DOCUMENT_URL,identityMap.getFromURL(url)
                    .getCanonicalWebappURL());
            schedulerParameters.put(LoadQuartzServlet.PARAMETER_PUBLICATION_ID, pub.getId());
            map.putAll(schedulerParameters.getPrefixedMap());
        } catch (final Exception e) {
            throw new ProcessingException(e);
        }
View Full Code Here

        String url = getSourceURL();
        URLInformation info = new URLInformation(url);
        String pubId = info.getPublicationId();

        DocumentFactory factory = getDocumentFactory();
        Publication pub = factory.getPublication(pubId);
        Area area = pub.getArea(info.getArea());

        Document[] docs = area.getDocuments();

        IndexUpdater updater = null;
        try {
View Full Code Here

            } else {
                String webappUrl = ServletHelper.getWebappURI(request);
                URLInformation info = new URLInformation(webappUrl);
                pubId = info.getPublicationId();
            }
            Publication pub = factory.getPublication(pubId);
            this.site = pub.getArea(area).getSite();

            if (this.path == null) {
                if (site.containsByUuid(uuid, language)) {
                    Link link = site.getByUuid(uuid, language);
                    this.path = link.getNode().getPath();
View Full Code Here

            this.attributes.addAttribute("", ATTR_UUID, ATTR_UUID, "CDATA", uuid);
        this.attributes.addAttribute("", ATTR_FOLDER, ATTR_FOLDER, "CDATA", isFolder);

        if (this.showType) {
            try {
                Publication pub = this.site.getPublication();
                String area = this.site.getArea();
                String type = pub.getArea(area).getDocument(node.getUuid(),
                        pub.getDefaultLanguage()).getMimeType();
                this.attributes.addAttribute("", ATTR_TYPE, ATTR_TYPE, "CDATA", type);
            } catch (PublicationException e) {
                throw new SiteException(e);
            }
        }
View Full Code Here

        ServiceSelector selector = null;
        SiteManager siteManager = null;
        try {           
            Session session = RepositoryUtil.getSession(this.manager, request);
            DocumentFactory map = DocumentUtil.createDocumentFactory(this.manager, session);
            Publication publication = PublicationUtil.getPublication(
                    this.manager, request);
           
           
            selector = (ServiceSelector) this.manager.lookup(SiteManager.ROLE
                    + "Selector");
            siteManager = (SiteManager) selector.select(publication
                    .getSiteManagerHint());

            Document[] docs = siteManager.getDocuments(map, publication, area);
            ArrayList filteredDocs = new ArrayList(1);         
            for (int i=0; i<docs.length; i++) {
View Full Code Here

TOP

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

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.