Package org.nuxeo.ecm.platform.comment.api

Examples of org.nuxeo.ecm.platform.comment.api.CommentableDocument


    public List<DocumentModel> getComments(DocumentModel doc)
            throws ClientException {
        // Load document comments if exist
        List<DocumentModel> comments = null;
        CommentableDocument commentableDoc = doc.getAdapter(CommentableDocument.class);
        if (commentableDoc != null) {
            comments = commentableDoc.getComments();
        }
        return comments;
    }
View Full Code Here


    public List<DocumentModel> getCommentChildren(DocumentModel doc,
            DocumentModel parent) throws ClientException {
        // Load all comment children of the document doc
        List<DocumentModel> comments = null;
        CommentableDocument commentableDoc = doc.getAdapter(CommentableDocument.class);
        if (commentableDoc != null) {
            comments = commentableDoc.getComments(parent);
        }
        return comments;
    }
View Full Code Here

            String docToCommentRef = request.getParameter("docToCommentRef");
            DocumentModel docToComment = session.getDocument(new IdRef(
                    docToCommentRef));
            String commentParentRef = request.getParameter("commentParentRef");
            // Create comment
            CommentableDocument commentableDoc = null;
            if (docToComment != null) {
                commentableDoc = docToComment.getAdapter(CommentableDocument.class);
            }
            DocumentModel newComment;
            if (commentParentRef != null) {
                // if exists retrieve comment parent
                DocumentModel commentParent = session.getDocument(new IdRef(
                        commentParentRef));
                newComment = commentableDoc.addComment(commentParent, myComment);
            } else {
                newComment = commentableDoc.addComment(myComment);
            }
            // automatically validate the comments
            if (CommentsConstants.COMMENT_LIFECYCLE.equals(newComment.getLifeCyclePolicy())) {
                new FollowTransitionUnrestricted(ctx.getCoreSession(),
                        newComment.getRef(),
View Full Code Here

TOP

Related Classes of org.nuxeo.ecm.platform.comment.api.CommentableDocument

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.