Examples of RCML


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

        // Get the parameters in order to check some preconditions (e.g.
        // is the document relly checked out).
        String step = parameters.getParameter("step");
               
        Session session = request.getSession(false);
        RCML rcml = getRc().getRCML(getFilename());
        Identity identity = (Identity) session.getAttribute(Identity.class
                .getName());

        if (step.equals("checkit")) {
            if (rcml.getLatestEntry().getType() != RCML.ci) {
                CheckOutEntry coe = rcml.getLatestCheckOutEntry();
                actionMap.put("user", coe.getIdentity());
                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;
        }

        rcml.checkOutIn(RCML.ci, identity.getUser().getId(), new Date().getTime(),
                false);

        return null;
    }
View Full Code Here

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

    /**
     * @see org.apache.lenya.transaction.Transactionable#checkin()
     */
    public void checkin() throws RepositoryException {
        RCML rcml = getRcml();
        synchronized (rcml) {
            try {
                if (!rcml.isCheckedOutBySession(getSession())) {
                    throw new RepositoryException("Cannot check in node [" + getSourceURI()
                            + "]: not checked out by this session!");
                }
                rcml.checkIn(this, exists(), getSession().isDirty(this));
            } catch (Exception e) {
                throw new RepositoryException(e);
            }
        }
    }
View Full Code Here

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

            }
        }
    }

    public void forceCheckIn() throws RepositoryException {
        RCML rcml = getRcml();
        synchronized (rcml) {
            try {
                if (!rcml.isCheckedOut()) {
                    throw new RepositoryException("Cannot check in node [" + getSourceURI()
                            + "]: not checked out!");
                }
                rcml.checkIn(this, false, false);
            } catch (Exception e) {
                throw new RepositoryException(e);
            }
        }
    }
View Full Code Here

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

    public void checkout(boolean restrictedToSession) throws RepositoryException {

        if (getLogger().isDebugEnabled())
            getLogger().debug("SourceNode::checkout() called, sourceURI [" + getSourceURI() + "]");

        RCML rcml = getRcml();
        synchronized (rcml) {
            try {
                if (rcml.isCheckedOut() && !rcml.isCheckedOutBySession(getSession())) {
                    throw new RepositoryException("The node [" + this
                            + "] is already checked out by another session!");
                }
                if (!rcml.isCheckedOut()) {
                    rcml.checkOut(this, restrictedToSession);
                }
            } catch (RevisionControlException e) {
                throw new RepositoryException(e);
            }
        }
View Full Code Here

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

        this.metaSource.delete();
        registerRemoved();
    }

    public String getCheckoutUserId() throws RepositoryException {
        RCML rcml = getRcml();
        synchronized (rcml) {
            try {
                if (!rcml.isCheckedOut()) {
                    throw new RepositoryException("The node [" + this + "] is not checked out!");
                }
                return rcml.getLatestEntry().getIdentity();
            } catch (RevisionControlException e) {
                throw new RepositoryException(e);
            }
        }
    }
View Full Code Here

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

     * @param manager The service manager.
     * @return An RCML object.
     */
    public synchronized RCML getRcml(SourceNode node, ServiceManager manager) {
        String uri = node.getSourceURI();
        RCML rcml = (RCML) this.uri2rcml.get(uri);
        if (rcml == null) {
            rcml = new SourceNodeRCML(node.getContentSource().getRealSourceUri(), node
                    .getMetaSource().getRealSourceUri(), manager);
            this.uri2rcml.put(uri, rcml);
        }
View Full Code Here

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

    /**
     * @see org.apache.lenya.transaction.Transactionable#checkin()
     */
    public void checkin() throws RepositoryException {
        RCML rcml = getRcml();
        synchronized (rcml) {
            try {
                if (!rcml.isCheckedOutBySession(getSession())) {
                    throw new RepositoryException("Cannot check in node [" + getSourceURI()
                            + "]: not checked out by this session!");
                }
                rcml.checkIn(this, exists(), getSession().isDirty(this));
            } catch (Exception e) {
                throw new RepositoryException(e);
            }
        }
    }
View Full Code Here

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

            }
        }
    }

    public void forceCheckIn() throws RepositoryException {
        RCML rcml = getRcml();
        synchronized (rcml) {
            try {
                if (!rcml.isCheckedOut()) {
                    throw new RepositoryException("Cannot check in node [" + getSourceURI()
                            + "]: not checked out!");
                }
                rcml.checkIn(this, false, false);
            } catch (Exception e) {
                throw new RepositoryException(e);
            }
        }
    }
View Full Code Here

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

    public void checkout(boolean restrictedToSession) throws RepositoryException {

        if (getLogger().isDebugEnabled())
            getLogger().debug("SourceNode::checkout() called, sourceURI [" + getSourceURI() + "]");

        RCML rcml = getRcml();
        synchronized (rcml) {
            try {
                if (rcml.isCheckedOut() && !rcml.isCheckedOutBySession(getSession())) {
                    throw new RepositoryException("The node [" + this
                            + "] is already checked out by another session!");
                }
                if (!rcml.isCheckedOut()) {
                    rcml.checkOut(this, restrictedToSession);
                }
            } catch (RevisionControlException e) {
                throw new RepositoryException(e);
            }
        }
View Full Code Here

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

        this.metaSource.delete();
        registerRemoved();
    }

    public String getCheckoutUserId() throws RepositoryException {
        RCML rcml = getRcml();
        synchronized (rcml) {
            try {
                if (!rcml.isCheckedOut()) {
                    throw new RepositoryException("The node [" + this + "] is not checked out!");
                }
                return rcml.getLatestEntry().getIdentity();
            } catch (RevisionControlException e) {
                throw new RepositoryException(e);
            }
        }
    }
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.