Examples of Publication


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

        String area,
        String documentid,
        String language,
        String propertyname) {

        Publication publication = getPublication();
        DocumentIdToPathMapper pathMapper = publication.getPathMapper();
        String fileName =
            pathMapper
                .getFile(publication, area, documentid, language)
                .getAbsolutePath();
View Full Code Here

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

    String secDocumentId,
    String firstArea,
    String secArea)
    throws SiteTreeException {

    Publication publication = getPublication();
    SiteTree firsttree = publication.getTree(firstArea);
    SiteTree sectree = publication.getTree(secArea);

    StringTokenizer st = new StringTokenizer(secDocumentId, "/");
    int length = st.countTokens() - 1;
        StringBuffer parentId = new StringBuffer(secDocumentId.length());
    for (int i = 0; i < length; i++) {
View Full Code Here

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

     * @see org.apache.tools.ant.Task#execute()
     */
    public void execute() throws BuildException {
        try {
           
            Publication pub = getPublication();
            DocumentBuilder builder = pub.getDocumentBuilder();
           
            String oldTargetUrl = builder.buildCanonicalUrl(pub, getArea(), getOldDocumentId());
            Document oldTargetDocument = builder.buildDocument(pub, oldTargetUrl);
           
            String newTargetUrl = builder.buildCanonicalUrl(pub, getArea(), getNewDocumentId());
View Full Code Here

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

      log("document-id for the source :" + this.getFirstdocumentid());
      log("area for the source :" + this.getFirstarea());
      log("document-id for the destination :" + this.getSecdocumentid());
      log("area for the destination :" + this.getSecarea());

      Publication publication = getPublication();
      SiteTree tree = publication.getTree(this.getSecarea());
      SiteTreeNode node = tree.getNode(this.getSecdocumentid());
      node.acceptReverseSubtree(this);
    } catch (Exception e) {
      throw new BuildException(e);
    }
View Full Code Here

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

      log("rcml dir" + this.getRcmldir());
      log("rcbak dir" + this.getRcbakdir());
      log("src area dir" + this.getSrcareadir());

      //visit the destination tree
      Publication publication = getPublication();
      SiteTree tree = publication.getTree(this.getSecarea());
      SiteTreeNode node = tree.getNode(this.getSecdocumentid());
      node.acceptReverseSubtree(this);

    } catch (Exception e) {
      throw new BuildException(e);
View Full Code Here

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

     * @throws ConfigurationException if an error occurs
     */
    protected void doTest(String target) throws ExecutionException, ParameterException, ConfigurationException, SAXException, IOException {
        System.out.println("Testing target [" + target + "]:");

        Publication publication = PublicationHelper.getPublication();

        TaskManager manager = new TaskManager(publication.getDirectory().getCanonicalPath());
        AntTask task = (AntTask) manager.getTask(TaskManager.ANT_TASK);

        Parameters parameters = getTaskParameters();
        parameters.setParameter(Task.PARAMETER_PUBLICATION_ID, publication.getId());
        parameters.setParameter(Task.PARAMETER_CONTEXT_PREFIX, "/lenya");
        parameters.setParameter(Task.PARAMETER_SERVLET_CONTEXT,
            publication.getServletContext().getCanonicalPath());
        parameters.setParameter(AntTask.TARGET, getTarget());
        task.parameterize(parameters);

        final GregorianCalendar beforeExecution = new GregorianCalendar();

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

        File logDirectory = new File(publication.getDirectory(), AntTask.LOG_PATH);
        File[] logFiles = logDirectory.listFiles(new FileFilter() {
                    public boolean accept(File file) {
                        return file.lastModified() > beforeExecution.getTimeInMillis();
                    }
                });
View Full Code Here

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

  /**
   *  (non-Javadoc)
   * @see org.apache.lenya.cms.task.AntTaskTest#evaluateTest()
   */
    protected void evaluateTest() throws IOException {
        Publication pub = PublicationHelper.getPublication();
        DocumentIdToPathMapper mapper = pub.getPathMapper();
        File publishedFile = mapper.getFile(pub, Publication.LIVE_AREA, DOCUMENT_ID, DOCUMENT_LANGUAGE);
        System.out.println("Path of file to publish: " + publishedFile);
        assertTrue(publishedFile.exists());
        System.out.println("Published file exists: " + publishedFile.getCanonicalPath());
    }
View Full Code Here

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

   */
    protected Parameters getTaskParameters() {
        Parameters parameters = super.getTaskParameters();
        parameters.setParameter("properties.publish.documentid", DOCUMENT_ID);
        parameters.setParameter("properties.publish.language", DOCUMENT_LANGUAGE);
        Publication pub = PublicationHelper.getPublication();
        DocumentIdToPathMapper mapper = pub.getPathMapper();
        parameters.setParameter("properties.publish.sources", mapper.getPath(DOCUMENT_ID, DOCUMENT_LANGUAGE));

        return parameters;
    }
View Full Code Here

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

     * @throws CreatorException when something went wrong.
     * @throws SiteTreeException when something went wrong.
     */
    public void testCreator()
        throws CreatorException, SiteTreeException {
        Publication publication = PublicationHelper.getPublication();
        DocumentCreator creator = new DocumentCreator();
        File authoringDirectory = new File(publication.getDirectory(), AUTHORING_DIR);

        creator.create(publication, authoringDirectory, AREA, PARENT_ID, CHILD_ID, CHILD_NAME,
            CHILD_TYPE, DOCUMENT_TYPE, DOCUMENT_LANGUAGE, VISIBLEINNAV);

        File documentFile = new File(authoringDirectory, CREATED_FILE);
        assertTrue(documentFile.exists());
        System.out.println("File was created: " + documentFile.getAbsolutePath());

        SiteTree sitetree = publication.getTree(AREA);
        SiteTreeNode node = sitetree.getNode(PARENT_ID + "/" + CHILD_ID);
        assertNotNull(node);
        System.out.println("Sitetree node was created: " + node.getId() + " (label: " +
            node.getLabel(DOCUMENT_LANGUAGE) + ")");
    }
View Full Code Here

Examples of org.apache.lenya.lucene.Publication

    protected void initParameters() {
        super.initParameters();
        this.numberOfPubs = Integer.parseInt(getParameterAsString("number-of-pubs"));
        Publication[] pubs = new Publication[this.numberOfPubs];
        for(int i = 0;i < pubs.length;i++) {
            pubs[i] = new Publication();
            pubs[i].id = getParameterAsString("pub"+i+"-id");
            pubs[i].name = getParameterAsString("pub"+i+"-name");
            pubs[i].indexDir = getParameterAsString("pub"+i+"-index-dir");
            pubs[i].searchFields = getParameterAsString("pub"+i+"-search-fields");
            pubs[i].excerptDir = getParameterAsString("pub"+i+"-excerpt-dir");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.