Class AbstractCommentsWebScript
java.lang.Object
org.springframework.extensions.webscripts.AbstractWebScript
org.springframework.extensions.webscripts.DeclarativeWebScript
org.alfresco.repo.web.scripts.comments.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
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.extensions.webscripts.AbstractWebScript
org.springframework.extensions.webscripts.AbstractWebScript.ScriptDetails
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ActivityService
protected BehaviourFilter
protected static final String
protected static final String
protected static final String
protected ContentService
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected NodeService
protected static final String
protected static final String
protected static final String
protected PermissionService
protected PersonService
protected ServiceRegistry
protected SiteService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecuteImpl
(NodeRef nodeRef, org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.Status status, org.springframework.extensions.webscripts.Cache cache) 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 nodeRefprotected String
get the value from JSON for given key if existsprotected SiteInfo
getSiteInfo
(org.springframework.extensions.webscripts.WebScriptRequest req, boolean searchForSiteInJSON) returns SiteInfo needed for post activityprotected org.json.simple.JSONObject
parseJSON
(org.springframework.extensions.webscripts.WebScriptRequest req) parse JSON from requestprotected org.json.simple.JSONObject
parseJSONFromString
(String input) parse JSON for a given input stringprotected NodeRef
parseRequestForNodeRef
(org.springframework.extensions.webscripts.WebScriptRequest req) returns the nodeRef from web script requestprotected 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 deletedvoid
setActivityService
(ActivityService activityService) void
setBehaviourFilter
(BehaviourFilter behaviourFilter) void
setServiceRegistry
(ServiceRegistry serviceRegistry) Methods inherited from class org.springframework.extensions.webscripts.DeclarativeWebScript
execute, executeFinallyImpl, executeImpl, executeImpl, getTemplateModel, renderFormatTemplate
Methods inherited from class org.springframework.extensions.webscripts.AbstractWebScript
addModuleBundleToCache, checkModuleBundleCache, createArgs, createArgsM, createHeaders, createHeadersM, createScriptParameters, createStatusException, createTemplateParameters, executeScript, getContainer, getDescription, getExecuteScript, getResources, getStatusTemplate, init, renderString, renderString, renderTemplate, sendStatus, setURLModelFactory, toString
-
Field Details
-
COMMENTS_TOPIC_NAME
- See Also:
-
JSON_KEY_SITE
- See Also:
-
JSON_KEY_SITE_ID
- See Also:
-
JSON_KEY_ITEM_TITLE
- See Also:
-
JSON_KEY_PAGE
- See Also:
-
JSON_KEY_TITLE
- See Also:
-
JSON_KEY_PAGE_PARAMS
- See Also:
-
JSON_KEY_NODEREF
- See Also:
-
JSON_KEY_CONTENT
- See Also:
-
COMMENT_CREATED_ACTIVITY
- See Also:
-
COMMENT_DELETED_ACTIVITY
- See Also:
-
serviceRegistry
-
nodeService
-
contentService
-
personService
-
siteService
-
permissionService
-
activityService
-
behaviourFilter
-
PARAM_MESSAGE
- See Also:
-
PARAM_NODE
- See Also:
-
PARAM_ITEM
- See Also:
-
-
Constructor Details
-
AbstractCommentsWebScript
public AbstractCommentsWebScript()
-
-
Method Details
-
setServiceRegistry
-
setBehaviourFilter
-
setActivityService
-
parseRequestForNodeRef
protected NodeRef parseRequestForNodeRef(org.springframework.extensions.webscripts.WebScriptRequest req) returns the nodeRef from web script request- Parameters:
req
-- Returns:
-
getOrNull
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
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 deletereq
-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 classorg.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:
-