Package org.apache.lenya.cms.rc

Examples of org.apache.lenya.cms.rc.RevisionController


            rcmlDirectory = publicationPath + File.separator + rcmlDirectory;
            String backupDirectory = rcEnvironment.getBackupDirectory();
            backupDirectory = publicationPath + File.separator + backupDirectory;

            // Initialize Revision Controller
            RevisionController rc = new RevisionController(rcmlDirectory, backupDirectory, publicationPath);         
         
          selector = (ServiceSelector) this.manager.lookup(SiteManager.ROLE + "Selector");
            siteManager = (SiteManager) selector.select(_publication.getSiteManagerHint());
            Document[] documents = siteManager.getDocuments(getDocumentIdentityMap(),_publication,this.getArea());

            selector = (ServiceSelector) this.manager.lookup(DocumentBuilder.ROLE + "Selector");
            docBuilder = (DocumentBuilder) selector.select(_publication.getDocumentBuilderHint());
           
            for(int i=0; i< documents.length; i++) {
              String test = documents[i].getCanonicalWebappURL().replaceFirst("/[^/]*.html","");
                if(!test.endsWith("/"))
                  test = test+"/";
              if(test.equals(request)){
                    docs.add(documents[i]);

                String filename = documents[i].getFile().getCanonicalPath();
                filename = filename.substring(publicationPath.length());
                    RCMLEntry entry = rc.getRCML(filename).getLatestEntry();                   
                    if ((entry != null) && (entry.getType() == RCML.co) )
                      checkedOut.add(entry);
                    else
                      checkedOut.add(null);
                    //get additional language documents
                    String[] langs = documents[i].getLanguages();
                    for(int j=0; j< langs.length; j++) {
                      if(!(langs[j].equals(documents[i].getLanguage()))) {
                        String url = documents[i].getCanonicalWebappURL().replaceFirst(".html$","_"+langs[j]+".html");
                        Document langDoc = docBuilder.buildDocument(documents[i].getIdentityMap(),_publication,url);
                        docs.add(langDoc);

                        filename = langDoc.getFile().getCanonicalPath();
                        filename = filename.substring(publicationPath.length());
                            entry = rc.getRCML(filename).getLatestEntry();                   
                            if ((entry != null) && (entry.getType() == RCML.co) )
                              checkedOut.add(entry);
                            else
                              checkedOut.add(null);
                      }
View Full Code Here


            rcmlDirectory = publicationPath + File.separator + rcmlDirectory;
            String backupDirectory = rcEnvironment.getBackupDirectory();
            backupDirectory = publicationPath + File.separator + backupDirectory;

            // Initialize Revision Controller
            RevisionController rc = new RevisionController(rcmlDirectory, backupDirectory, publicationPath);         
         
            Document doc = getTargetDocument(false);
            docs.add(doc);
           
            String filename = doc.getFile().getCanonicalPath();
            filename = filename.substring(publicationPath.length());
            RCMLEntry entry = rc.getRCML(filename).getLatestEntry();                   
            if ((entry != null) && (entry.getType() == RCML.co) )
                checkedOut.add(entry);
            else
                 checkedOut.add(null);
View Full Code Here

    String filename = AUTHORING_PATH +FIRST_DOCUMENT_ID + File.separator + "index_de.xml";
   
    // generate the rcml and rcbak files
    File rcmlDirectory = new File(publicationPath , RCML_DIR);
    File rcbakDirectory = new File(publicationPath , RCBAK_DIR);
    RevisionController rc = new RevisionController(rcmlDirectory.getAbsolutePath(), rcbakDirectory.getAbsolutePath(), publicationPath);
    rc.reservedCheckOut(filename, "lenya");  
    this.time = rc.reservedCheckIn(filename, "lenya", true);  

    // TODO generate the workflow, meta 
  }
View Full Code Here

        File publicationDirectory = PublicationHelper.getPublication().getDirectory();
        String publicationPath = publicationDirectory.getAbsolutePath() + File.separator;
        // generate the rcml and rcbak files
        File rcmlDirectory = new File(publicationPath, RCML_DIR);
        File rcbakDirectory = new File(publicationPath, RCBAK_DIR);
        RevisionController rc = new RevisionController(rcmlDirectory.getAbsolutePath(),
                rcbakDirectory.getAbsolutePath(), publicationPath);
        String filename = AUTHORING_PATH + FIRST_DOCUMENT_ID + File.separator + "index.xml";
        rc.reservedCheckOut(filename, "lenya");
        this.time = rc.reservedCheckIn(filename, "lenya", true);
    }
View Full Code Here

        this.rcmlDirectory = publicationPath + File.separator + this.rcmlDirectory;
        this.backupDirectory = rcEnvironment.getBackupDirectory();
        this.backupDirectory = publicationPath + File.separator + this.backupDirectory;

        // Initialize Revision Controller
        this.rc = new RevisionController(this.rcmlDirectory, this.backupDirectory, publicationPath);
        getLogger().debug("revision controller" + this.rc);

        // /Initialize Revision Controller
        // Get session
        Session session = request.getSession(false);
View Full Code Here

                    .getServletContext().getCanonicalPath());
            String rcmlDirectory = rcEnvironment.getRCMLDirectory();
            rcmlDirectory = publicationPath + File.separator + rcmlDirectory;
            String backupDirectory = rcEnvironment.getBackupDirectory();
            backupDirectory = publicationPath + File.separator + backupDirectory;
            this.rc = new RevisionController(rcmlDirectory, backupDirectory, publicationPath);
            final String filename = getSourceDocument().getFile().getCanonicalPath()
                    .substring(publication.getDirectory().getCanonicalPath().length());
            this.rcml = this.rc.getRCML(filename);

        } catch (final Exception e) {
View Full Code Here

        String rcmlDirectory = rcEnvironment.getRCMLDirectory();
        rcmlDirectory = publicationPath + File.separator + rcmlDirectory;
        String backupDirectory = rcEnvironment.getBackupDirectory();
        backupDirectory = publicationPath + File.separator + backupDirectory;

        return new RevisionController(rcmlDirectory, backupDirectory, publicationPath);
    }
View Full Code Here

                            .getCanonicalPath());
                    String rcmlDirectory = publicationPath + File.separator
                            + rcEnvironment.getRCMLDirectory();
                    String backupDirectory = publicationPath + File.separator
                            + rcEnvironment.getBackupDirectory();
                    this.revisionController = new RevisionController(rcmlDirectory,
                            backupDirectory, publicationPath);
                } finally {
                    if (resolver != null) {
                        if (contextSource != null) {
                            resolver.release(contextSource);
View Full Code Here

            File rcmlDirectory = new File(publicationDir, rcEnvironment.getRCMLDirectory());
            File backupDirectory = new File(publicationDir, rcEnvironment.getBackupDirectory());

            revisionController =
                new RevisionController(
                    rcmlDirectory.getAbsolutePath(),
                    backupDirectory.getAbsolutePath(),
                    publicationDir.getAbsolutePath());
        }
        return revisionController;
View Full Code Here

    String filename = AUTHORING_PATH +FIRST_DOCUMENT_ID + File.separator + "index_de.xml";
   
    // generate the rcml and rcbak files
    File rcmlDirectory = new File(publicationPath , RCML_DIR);
    File rcbakDirectory = new File(publicationPath , RCBAK_DIR);
    RevisionController rc = new RevisionController(rcmlDirectory.getAbsolutePath(), rcbakDirectory.getAbsolutePath(), publicationPath);
    rc.reservedCheckOut(filename, "lenya");  
    time = rc.reservedCheckIn(filename, "lenya", true);  

    // TODO generate the workflow, meta 
  }
View Full Code Here

TOP

Related Classes of org.apache.lenya.cms.rc.RevisionController

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.