Examples of RCMLEntry


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

                    Document xml = SourceUtil.readDOM(uri, this.manager);
                    NamespaceHelper helper = new NamespaceHelper(NAMESPACE, "", xml);
                    Element parent = xml.getDocumentElement();
                    Element[] elements = helper.getChildren(parent);
                    for (int i = 0; i < elements.length; i++) {
                        RCMLEntry entry = getEntry(helper, elements[i]);
                        entries.add(entry);
                    }
                }
            } catch (Exception e) {
                throw new RevisionControlException(e);
View Full Code Here

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

     */
    public synchronized Vector getBackupEntries() throws Exception {
        Vector entries = getEntries();
        Vector backupEntries = new Vector();
        for (Iterator i = entries.iterator(); i.hasNext();) {
            RCMLEntry entry = (RCMLEntry) i.next();
            if (entry.getType() == RCML.ci && ((CheckInEntry) entry).hasBackup()) {
                backupEntries.add(entry);
            }
        }
        return backupEntries;
    }
View Full Code Here

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

        Vector entries = getEntries();
        RCMLEntry[] array = (RCMLEntry[]) entries.toArray(new RCMLEntry[entries.size()]);

        for (int i = this.maximalNumberOfEntries; i < entries.size(); i++) {
            // remove the backup file associated with this entry
            RCMLEntry entry = array[i];
            if (entry.getType() == ci && ((CheckInEntry) entry).hasBackup()) {
                long time = entry.getTime();
                deleteBackup(this.contentSourceUri, time);
                deleteBackup(this.metaSourceUri, time);
            }
            this.entries.remove(entry);
        }
View Full Code Here

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

    public String[] getBackupsTime() throws Exception {

        Vector entries = getEntries();
        List times = new ArrayList();
        for (Iterator i = entries.iterator(); i.hasNext();) {
            RCMLEntry entry = (RCMLEntry) i.next();
            if (entry.getType() == ci && ((CheckInEntry) entry).hasBackup()) {
                times.add(Long.toString(entry.getTime()));
            }
        }
        return (String[]) times.toArray(new String[times.size()]);

    }
View Full Code Here

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

        try {

            Vector backupEntries = otherRcml.getBackupEntries();
            for (Iterator i = backupEntries.iterator(); i.hasNext();) {
                RCMLEntry entry = (RCMLEntry) i.next();
                long time = entry.getTime();
                String otherContentUri = otherRcml.getBackupSourceUri(otherSourceNode
                        .getContentSource(), time);
                String thisContentUri = this
                        .getBackupSourceUri(sourceNode.getContentSource(), time);
                SourceUtil.copy(this.manager, otherContentUri, thisContentUri);

                String otherMetaUri = otherRcml.getBackupSourceUri(otherSourceNode.getMetaSource(),
                        time);
                String thisMetaUri = this.getBackupSourceUri(sourceNode.getMetaSource(), time);
                SourceUtil.copy(this.manager, otherMetaUri, thisMetaUri);
            }

            this.entries = new Vector();
            Vector otherEntries = otherRcml.getEntries();
            for (Iterator i = otherEntries.iterator(); i.hasNext();) {
                RCMLEntry entry = (RCMLEntry) i.next();
                RCMLEntry newEntry = null;
                switch (entry.getType()) {
                case co:
                    newEntry = new CheckOutEntry(entry.getSessionId(), entry.getIdentity(), entry
                            .getTime());
                    break;
View Full Code Here

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

            throw new RevisionControlException(e);
        }
    }

    public synchronized boolean isCheckedOut() throws RevisionControlException {
        RCMLEntry entry = getLatestEntry();
        return entry != null && entry.getType() == RCML.co;
    }
View Full Code Here

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

    }

    public boolean isCheckedOutBySession(Session session) throws RevisionControlException {
        Vector entries = getEntries();
        if (entries.size() > 0) {
            RCMLEntry entry = (RCMLEntry) entries.get(0);
            String otherSessionId = entry.getSessionId();
            if (entry.getType() == co) {
                // not restricted to session
                if (otherSessionId.equals(ALL_SESSIONS)) {
                    String otherUserId = entry.getIdentity();
                    String userId = session.getIdentity().getUser().getId();
                    return userId.equals(otherUserId);
                }
                // restricted to session
                if (otherSessionId.equals(session.getId())) {
View Full Code Here

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

    }

    public boolean exists() throws RepositoryException {
        try {
            RCML rcml = getRcml();
            RCMLEntry entry = rcml.getLatestEntry();
            if (entry == null) {
                return false;
            } else if (entry.getType() == RCML.ci) {
                return true;
            } else {
                if (rcml.getLatestCheckInEntry() != null) {
                    return true;
                } else {
                    // before first check-in, the node exists only in the session that created it
                    return entry.getSessionId().equals(getSession().getId());
                }
            }
        } catch (RevisionControlException e) {
            throw new RepositoryException(e);
        }
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

        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
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.