Class AbstractCommentsWebScript

  • All Implemented Interfaces:
    org.springframework.extensions.webscripts.WebScript
    Direct Known Subclasses:
    CommentDelete, CommentsPost

    public abstract class AbstractCommentsWebScript
    extends org.springframework.extensions.webscripts.DeclarativeWebScript
    This class is the abstract controller for the comments web scripts (delete and post)
    Since:
    4.2.6
    Author:
    Ramona Popa
    • Constructor Detail

      • AbstractCommentsWebScript

        public AbstractCommentsWebScript()
    • Method Detail

      • setServiceRegistry

        public void setServiceRegistry​(ServiceRegistry serviceRegistry)
      • setBehaviourFilter

        public void setBehaviourFilter​(BehaviourFilter behaviourFilter)
      • setActivityService

        public void setActivityService​(ActivityService activityService)
      • parseRequestForNodeRef

        protected NodeRef parseRequestForNodeRef​(org.springframework.extensions.webscripts.WebScriptRequest req)
        returns the nodeRef from web script request
        Parameters:
        req -
        Returns:
      • getOrNull

        protected String getOrNull​(org.json.simple.JSONObject json,
                                   String key)
        get the value from JSON for given key if exists
        Parameters:
        json -
        key -
        Returns:
      • parseJSON

        protected org.json.simple.JSONObject parseJSON​(org.springframework.extensions.webscripts.WebScriptRequest req)
        parse JSON from request
        Parameters:
        req -
        Returns:
      • parseJSONFromString

        protected org.json.simple.JSONObject parseJSONFromString​(String input)
        parse JSON for a given input string
        Parameters:
        input -
        Returns:
      • postActivity

        protected void postActivity​(org.json.simple.JSONObject json,
                                    org.springframework.extensions.webscripts.WebScriptRequest req,
                                    NodeRef nodeRef,
                                    String activityType)
        Post an activity entry for the comment added or deleted
        Parameters:
        json - - is not sent null with this activity type - only for delete
        req -
        nodeRef -
        activityType -
      • getSiteInfo

        protected SiteInfo getSiteInfo​(org.springframework.extensions.webscripts.WebScriptRequest req,
                                       boolean searchForSiteInJSON)
        returns SiteInfo needed for post activity
        Parameters:
        req -
        Returns:
      • executeImpl

        protected Map<String,​Object> executeImpl​(org.springframework.extensions.webscripts.WebScriptRequest req,
                                                       org.springframework.extensions.webscripts.Status status,
                                                       org.springframework.extensions.webscripts.Cache cache)
        Overrides DeclarativeWebScript with parse request for nodeRef
        Overrides:
        executeImpl in class org.springframework.extensions.webscripts.DeclarativeWebScript
      • executeImpl

        protected abstract Map<String,​Object> executeImpl​(NodeRef nodeRef,
                                                                org.springframework.extensions.webscripts.WebScriptRequest req,
                                                                org.springframework.extensions.webscripts.Status status,
                                                                org.springframework.extensions.webscripts.Cache cache)
        Parameters:
        nodeRef -
        req -
        status -
        cache -
        Returns: