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.DeclarativeWebScriptThis class is the abstract controller for the comments web scripts (delete and post)- Since:
- 4.2.6
- Author:
- Ramona Popa
-
-
Field Summary
Fields Modifier and Type Field Description protected ActivityServiceactivityServiceprotected BehaviourFilterbehaviourFilterprotected static StringCOMMENT_CREATED_ACTIVITYprotected static StringCOMMENT_DELETED_ACTIVITYprotected static StringCOMMENTS_TOPIC_NAMEprotected ContentServicecontentServiceprotected static StringJSON_KEY_CONTENTprotected static StringJSON_KEY_ITEM_TITLEprotected static StringJSON_KEY_NODEREFprotected static StringJSON_KEY_PAGEprotected static StringJSON_KEY_PAGE_PARAMSprotected static StringJSON_KEY_SITEprotected static StringJSON_KEY_SITE_IDprotected static StringJSON_KEY_TITLEprotected NodeServicenodeServiceprotected static StringPARAM_ITEMprotected static StringPARAM_MESSAGEprotected static StringPARAM_NODEprotected PermissionServicepermissionServiceprotected PersonServicepersonServiceprotected ServiceRegistryserviceRegistryprotected SiteServicesiteService
-
Constructor Summary
Constructors Constructor Description AbstractCommentsWebScript()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description 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)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 nodeRefprotected StringgetOrNull(org.json.simple.JSONObject json, String key)get the value from JSON for given key if existsprotected SiteInfogetSiteInfo(org.springframework.extensions.webscripts.WebScriptRequest req, boolean searchForSiteInJSON)returns SiteInfo needed for post activityprotected org.json.simple.JSONObjectparseJSON(org.springframework.extensions.webscripts.WebScriptRequest req)parse JSON from requestprotected org.json.simple.JSONObjectparseJSONFromString(String input)parse JSON for a given input stringprotected NodeRefparseRequestForNodeRef(org.springframework.extensions.webscripts.WebScriptRequest req)returns the nodeRef from web script requestprotected voidpostActivity(org.json.simple.JSONObject json, org.springframework.extensions.webscripts.WebScriptRequest req, NodeRef nodeRef, String activityType)Post an activity entry for the comment added or deletedvoidsetActivityService(ActivityService activityService)voidsetBehaviourFilter(BehaviourFilter behaviourFilter)voidsetServiceRegistry(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 Detail
-
COMMENTS_TOPIC_NAME
protected static final String COMMENTS_TOPIC_NAME
- See Also:
- Constant Field Values
-
JSON_KEY_SITE
protected static final String JSON_KEY_SITE
- See Also:
- Constant Field Values
-
JSON_KEY_SITE_ID
protected static final String JSON_KEY_SITE_ID
- See Also:
- Constant Field Values
-
JSON_KEY_ITEM_TITLE
protected static final String JSON_KEY_ITEM_TITLE
- See Also:
- Constant Field Values
-
JSON_KEY_PAGE
protected static final String JSON_KEY_PAGE
- See Also:
- Constant Field Values
-
JSON_KEY_TITLE
protected static final String JSON_KEY_TITLE
- See Also:
- Constant Field Values
-
JSON_KEY_PAGE_PARAMS
protected static final String JSON_KEY_PAGE_PARAMS
- See Also:
- Constant Field Values
-
JSON_KEY_NODEREF
protected static final String JSON_KEY_NODEREF
- See Also:
- Constant Field Values
-
JSON_KEY_CONTENT
protected static final String JSON_KEY_CONTENT
- See Also:
- Constant Field Values
-
COMMENT_CREATED_ACTIVITY
protected static final String COMMENT_CREATED_ACTIVITY
- See Also:
- Constant Field Values
-
COMMENT_DELETED_ACTIVITY
protected static final String COMMENT_DELETED_ACTIVITY
- See Also:
- Constant Field Values
-
serviceRegistry
protected ServiceRegistry serviceRegistry
-
nodeService
protected NodeService nodeService
-
contentService
protected ContentService contentService
-
personService
protected PersonService personService
-
siteService
protected SiteService siteService
-
permissionService
protected PermissionService permissionService
-
activityService
protected ActivityService activityService
-
behaviourFilter
protected BehaviourFilter behaviourFilter
-
PARAM_MESSAGE
protected static final String PARAM_MESSAGE
- See Also:
- Constant Field Values
-
PARAM_NODE
protected static final String PARAM_NODE
- See Also:
- Constant Field Values
-
PARAM_ITEM
protected static final String PARAM_ITEM
- See Also:
- Constant Field Values
-
-
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 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:
executeImplin 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:
-
-