Examples of RCMLEntry


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

        super.act(redirector, resolver, objectModel, src, parameters);

        HashMap actionMap = new HashMap();

        try {
            RCMLEntry entry =getRc().getRCML(getFilename()).getLatestEntry();

      if ((entry == null) || (entry.getType() != RCML.co) || !entry.getIdentity().equals(getUsername())) {
        //check out
              getRc().reservedCheckOut(getFilename(),getUsername());  
      }
    } catch (FileReservedCheckOutException e) {
      actionMap.put("exception", "fileReservedCheckOutException");
View Full Code Here

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

        try {
            if (this.time == -1) {
                SourceNodeRCML rcml = (SourceNodeRCML) this.node.getRcml();
                Vector entries = rcml.getEntries();
                for (Iterator i = entries.iterator(); i.hasNext();) {
                    RCMLEntry entry = (RCMLEntry) i.next();
                    if (entry.getType() == RCML.ci
                            && ((CheckInEntry) entry).getVersion() == this.number) {
                        this.time = entry.getTime();
                        this.userId = entry.getIdentity();
                    }
                }
            }
            if (this.time == -1) {
                throw new RuntimeException("No entry found for [" + this.node.getSourceURI()
View Full Code Here

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

              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

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

            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);

            setParameter(DOCUMENTS, docs);
View Full Code Here

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

        super.act(redirector, resolver, objectModel, src, parameters);

        HashMap actionMap = new HashMap();

        try {
            RCMLEntry entry =getRc().getRCML(getFilename()).getLatestEntry();

      if ((entry == null) || (entry.getType() != RCML.co) || !entry.getIdentity().equals(getUsername())) {
        //check out
              getRc().reservedCheckOut(getFilename(),getUsername());  
      }
    } catch (FileReservedCheckOutException e) {
      actionMap.put("exception", "fileReservedCheckOutException");
View Full Code Here

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

  public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String src,
        Parameters parameters) throws Exception {
        super.act(redirector, resolver, objectModel, src, parameters);

        HashMap actionMap = new HashMap();
        final RCMLEntry entry =getRc().getRCML(getFilename()).getLatestEntry();

        if ((entry != null) && (entry.getType() == RCML.co) ) {
            actionMap.put("filename", getFilename());
            actionMap.put("user", entry.getIdentity());
            return actionMap;
        }
        return null;
    }
View Full Code Here

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

        try {
            if (this.time == -1) {
                SourceNodeRCML rcml = (SourceNodeRCML) this.node.getRcml();
                Vector entries = rcml.getEntries();
                for (Iterator i = entries.iterator(); i.hasNext();) {
                    RCMLEntry entry = (RCMLEntry) i.next();
                    if (entry.getType() == RCML.ci
                            && ((CheckInEntry) entry).getVersion() == this.number) {
                        this.time = entry.getTime();
                        this.userId = entry.getIdentity();
                    }
                }
            }
            if (this.time == -1) {
                throw new RuntimeException("No entry found for [" + this.node.getSourceURI()
View Full Code Here

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

        if (entries.size() == 0) {
            if (type == ci) {
                throw new IllegalStateException("Can't check in - not checked out.");
            }
        } else {
            RCMLEntry latestEntry = getLatestEntry();
            if (type == latestEntry.getType()) {
                String elementName = (String) ELEMENTS.get(new Short(type));
                throw new IllegalStateException("RCML entry type <" + elementName
                        + "> not allowed twice in a row. Before: [" + latestEntry.getIdentity()
                        + "], now: [" + identity + "], node: [" + this.contentSourceUri + "]");
            }
        }

        String sessionId;
        if (type == RCML.co && !restrictedToSession) {
            sessionId = ALL_SESSIONS;
        }
        else {
            sessionId = node.getSession().getId();
        }

        RCMLEntry entry;
        switch (type) {
        case RCML.ci:
            int version = 0;
            CheckInEntry latestEntry = getLatestCheckInEntry();
            if (latestEntry != null) {
View Full Code Here

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

        try {
            NamespaceHelper helper = new NamespaceHelper(NAMESPACE, "", ELEMENT_XPSREVISIONCONTROL);
            Element root = helper.getDocument().getDocumentElement();
            Vector entries = getEntries();
            for (Iterator i = entries.iterator(); i.hasNext();) {
                RCMLEntry entry = (RCMLEntry) i.next();
                Element element = saveToXml(helper, entry);
                root.appendChild(element);
            }
            return helper;
        } catch (Exception e) {
View Full Code Here

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

     * @throws RevisionControlException if an error occurs
     */
    public RCMLEntry getLatestEntry(short type) throws RevisionControlException {
        Vector entries = getEntries();
        for (Iterator i = entries.iterator(); i.hasNext();) {
            RCMLEntry entry = (RCMLEntry) i.next();
            if (entry.getType() == type) {
                return entry;
            }
        }
        return null;
    }
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.