Class EngineComment.CommentActionHandler

  • Enclosing class:
    EngineComment

    public class EngineComment.CommentActionHandler
    extends java.lang.Object
    Manages all commenting related operations.
    • Constructor Summary

      Constructors 
      Constructor Description
      CommentActionHandler​(java.sql.Connection c, int userID, mks.ci.common.comment.CommentOpArgs args)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      mks.ci.common.comment.CommentOpReturn create()
      Create a comment against an item in a context.
      mks.ci.common.comment.CommentOpReturn delete()
      Deletes one or more comments based on the arguments.
      mks.ci.common.comment.CommentOpReturn edit​(mks.ci.common.comment.CommentOpArgs.State state)
      Edits one or more comments.
      mks.ci.common.comment.CommentOpReturn reply()
      Create a reply to an already existing comment.
      mks.ci.common.comment.CommentOpReturn view()
      View one or more comments.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CommentActionHandler

        public CommentActionHandler​(java.sql.Connection c,
                                    int userID,
                                    mks.ci.common.comment.CommentOpArgs args)
    • Method Detail

      • create

        public mks.ci.common.comment.CommentOpReturn create()
                                                     throws java.sql.SQLException,
                                                            mks.ci.exception.CIException
        Create a comment against an item in a context. As of now it's designed for Document Model where a comment can be created for a node.
        Throws:
        java.sql.SQLException
        mks.ci.exception.CIException
      • reply

        public mks.ci.common.comment.CommentOpReturn reply()
                                                    throws java.sql.SQLException,
                                                           mks.ci.exception.CIException
        Create a reply to an already existing comment. As per current design all replies should be under root commentID (One-level structure).
        Throws:
        java.sql.SQLException
        mks.ci.exception.CIException
      • view

        public mks.ci.common.comment.CommentOpReturn view()
                                                   throws java.sql.SQLException,
                                                          mks.ci.exception.CIException
        View one or more comments. If commentID is provided, it'll return the record associated with it. If itemID or contextID is given, all comments associted with them will be returned. If user doesn't have access to the context, he shouldn't be able to view any comments.
        Throws:
        java.sql.SQLException
        mks.ci.exception.CIException
      • edit

        public mks.ci.common.comment.CommentOpReturn edit​(mks.ci.common.comment.CommentOpArgs.State state)
                                                   throws java.sql.SQLException,
                                                          mks.ci.exception.CIException
        Edits one or more comments. A comment can be edited if it's created by the same user and if it's state is Active. If editing for a commentID, one can edit the text and state of the comment. If edit operation is for an item or for context, then one edit only state of all comments created by the specific user.
        Throws:
        java.sql.SQLException
        mks.ci.exception.CIException
      • delete

        public mks.ci.common.comment.CommentOpReturn delete()
                                                     throws java.sql.SQLException,
                                                            mks.ci.exception.CIException
        Deletes one or more comments based on the arguments. If commentID is provided, then only that comment will be deleted if it's created by the same user. If contextID and itemID is given, then all comments against the item will be deleted which are created by the same user. Also all replies will be deleted irrespective of the created user. If contextID is given, then all comments for the context will be deleted which are created by the same user. Also all replies will be deleted irrespective of the created user.
        Throws:
        java.sql.SQLException
        mks.ci.exception.CIException