Package org.apache.lenya.cms.rc

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


                Date checkOutDate = new Date(coe.getTime());
                actionMap.put("date", checkOutDate.toString());
                actionMap.put("message", "lenya.rc.checkedoutalready");
                actionMap.put("state", "co");
            } else {
                CheckInEntry cie = rcml.getLatestCheckInEntry();
                actionMap.put("user", cie.getIdentity());
                Date checkInDate = new Date(cie.getTime());
                actionMap.put("date", checkInDate.toString());
                actionMap.put("message", "The resource has already been checked in by");   
                actionMap.put("state", "ci");
            }
            return actionMap;
View Full Code Here


        return this.contentSource.getInputStream();
    }

    public long getLastModified() throws RepositoryException {
        try {
            CheckInEntry entry = getRcml().getLatestCheckInEntry();
            if (entry != null) {
                return entry.getTime();
            }
            else {
                throw new RepositoryException("The node [" + this + "] hasn't been checked in yet.");
            }
        } catch (RevisionControlException e) {
View Full Code Here

            throw new RepositoryException(e);
        }
    }

    protected int getCurrentRevisionNumber() throws RepositoryException {
        CheckInEntry entry;
        try {
            entry = getRcml().getLatestCheckInEntry();
        } catch (RevisionControlException e) {
            throw new RepositoryException(e);
        }
        if (entry == null) {
            return 0;
        } else {
            return entry.getVersion();
        }
    }
View Full Code Here

            throw new RepositoryException(e);
        }
    }

    protected int getCurrentRevisionNumber() throws RepositoryException {
        CheckInEntry entry;
        try {
            entry = getRcml().getLatestCheckInEntry();
        } catch (RevisionControlException e) {
            throw new RepositoryException(e);
        }
        if (entry == null) {
            return 0;
        } else {
            return entry.getVersion();
        }
    }
View Full Code Here

     * @throws RepositoryException if an error occurs.
     * @see org.apache.lenya.cms.repository.Node#getLastModified()
     */
    public long getLastModified() throws RepositoryException {
        try {
            CheckInEntry entry = this.node.getRcml().getLatestCheckInEntry();
            if (entry != null) {
                this.lastModified = entry.getTime();
            }
        } catch (RevisionControlException e) {
            throw new RepositoryException(e);
        }
        return this.lastModified;
View Full Code Here

        RCML rcml = this.node.getRcml();
        try {
            Vector entries = rcml.getBackupEntries();
            int[] numbers = new int[entries.size()];
            for (int i = 0; i < entries.size(); i++) {
                CheckInEntry entry = (CheckInEntry) entries.get(i);
                numbers[i] = entry.getVersion();
            }
            return numbers;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
View Full Code Here

        RCMLEntry entry;
        switch (type) {
        case RCML.ci:
            int version = 0;
            CheckInEntry latestEntry = getLatestCheckInEntry();
            if (latestEntry != null) {
                version = latestEntry.getVersion();
            }
            if (newVersion) {
                version++;
            }
            entry = new CheckInEntry(sessionId, identity, time, version, backup);
            break;
        case RCML.co:
            entry = new CheckOutEntry(sessionId, identity, time);
            break;
        default:
View Full Code Here

        entryElement.setAttribute(ATTR_IDENTITY, entry.getIdentity());
        entryElement.setAttribute(ATTR_SESSION, entry.getSessionId());
        entryElement.setAttribute(ATTR_TIME, Long.toString(entry.getTime()));

        if (entry.getType() == ci) {
            CheckInEntry checkInEntry = (CheckInEntry) entry;
            entryElement.setAttribute(ATTR_VERSION, Integer.toString(checkInEntry.getVersion()));
            if (checkInEntry.hasBackup()) {
                entryElement.setAttribute(ATTR_BACKUP, "true");
            }
        }

        return entryElement;
View Full Code Here

            long time = new Long(timeString).longValue();
            if (type.equals(ELEMENT_CHECKIN)) {
                String versionString = element.getAttribute(ATTR_VERSION);
                int version = new Integer(versionString).intValue();
                boolean backup = element.hasAttribute(ATTR_BACKUP);
                return new CheckInEntry(sessionId, identity, time, version, backup);
            } else if (type.equals(ELEMENT_CHECKOUT)) {
                return new CheckOutEntry(sessionId, identity, time);
            } else {
                throw new RuntimeException("Unsupported RCML entry type: [" + type + "]");
            }
View Full Code Here

        long time = new Long(timeString).longValue();
        if (type.equals(ELEMENT_CHECKIN)) {
            String versionString = getChildValue(helper, element, ELEMENT_VERSION);
            int version = new Integer(versionString).intValue();
            boolean backup = helper.getChildren(element, ELEMENT_BACKUP).length > 0;
            return new CheckInEntry(sessionId, identity, time, version, backup);
        } else if (type.equals(ELEMENT_CHECKOUT)) {
            return new CheckOutEntry(sessionId, identity, time);
        } else {
            throw new RuntimeException("Unsupported RCML entry type: [" + type + "]");
        }
View Full Code Here

TOP

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

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.