public abstract class AbstractCommentsWebScript
extends org.springframework.extensions.webscripts.DeclarativeWebScript
Modifier and Type | Field and Description |
---|---|
protected ActivityService |
activityService |
protected BehaviourFilter |
behaviourFilter |
protected static String |
COMMENT_CREATED_ACTIVITY |
protected static String |
COMMENT_DELETED_ACTIVITY |
protected static String |
COMMENTS_TOPIC_NAME |
protected ContentService |
contentService |
protected static String |
JSON_KEY_CONTENT |
protected static String |
JSON_KEY_ITEM_TITLE |
protected static String |
JSON_KEY_NODEREF |
protected static String |
JSON_KEY_PAGE |
protected static String |
JSON_KEY_PAGE_PARAMS |
protected static String |
JSON_KEY_SITE |
protected static String |
JSON_KEY_SITE_ID |
protected static String |
JSON_KEY_TITLE |
protected org.alfresco.service.cmr.repository.NodeService |
nodeService |
protected static String |
PARAM_ITEM |
protected static String |
PARAM_MESSAGE |
protected static String |
PARAM_NODE |
protected org.alfresco.service.cmr.security.PermissionService |
permissionService |
protected PersonService |
personService |
protected ServiceRegistry |
serviceRegistry |
protected SiteService |
siteService |
Constructor and Description |
---|
AbstractCommentsWebScript() |
Modifier and Type | Method and Description |
---|---|
protected abstract Map<String,Object> |
executeImpl(org.alfresco.service.cmr.repository.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 nodeRef
|
protected String |
getOrNull(org.json.simple.JSONObject json,
String key)
get the value from JSON for given key if exists
|
protected SiteInfo |
getSiteInfo(org.springframework.extensions.webscripts.WebScriptRequest req,
boolean searchForSiteInJSON)
returns SiteInfo needed for post activity
|
protected org.json.simple.JSONObject |
parseJSON(org.springframework.extensions.webscripts.WebScriptRequest req)
parse JSON from request
|
protected org.json.simple.JSONObject |
parseJSONFromString(String input)
parse JSON for a given input string
|
protected org.alfresco.service.cmr.repository.NodeRef |
parseRequestForNodeRef(org.springframework.extensions.webscripts.WebScriptRequest req)
returns the nodeRef from web script request
|
protected void |
postActivity(org.json.simple.JSONObject json,
org.springframework.extensions.webscripts.WebScriptRequest req,
org.alfresco.service.cmr.repository.NodeRef nodeRef,
String activityType)
Post an activity entry for the comment added or deleted
|
void |
setActivityService(ActivityService activityService) |
void |
setBehaviourFilter(BehaviourFilter behaviourFilter) |
void |
setServiceRegistry(ServiceRegistry serviceRegistry) |
execute, executeFinallyImpl, executeImpl, executeImpl, getTemplateModel, renderFormatTemplate
addModuleBundleToCache, checkModuleBundleCache, createArgs, createArgsM, createHeaders, createHeadersM, createScriptParameters, createStatusException, createTemplateParameters, executeScript, getContainer, getDescription, getExecuteScript, getResources, getStatusTemplate, init, renderString, renderString, renderTemplate, sendStatus, setURLModelFactory, toString
protected static final String COMMENTS_TOPIC_NAME
protected static final String JSON_KEY_SITE
protected static final String JSON_KEY_SITE_ID
protected static final String JSON_KEY_ITEM_TITLE
protected static final String JSON_KEY_PAGE
protected static final String JSON_KEY_TITLE
protected static final String JSON_KEY_PAGE_PARAMS
protected static final String JSON_KEY_NODEREF
protected static final String JSON_KEY_CONTENT
protected static final String COMMENT_CREATED_ACTIVITY
protected static final String COMMENT_DELETED_ACTIVITY
protected ServiceRegistry serviceRegistry
protected org.alfresco.service.cmr.repository.NodeService nodeService
protected ContentService contentService
protected PersonService personService
protected SiteService siteService
protected org.alfresco.service.cmr.security.PermissionService permissionService
protected ActivityService activityService
protected BehaviourFilter behaviourFilter
protected static final String PARAM_MESSAGE
protected static final String PARAM_NODE
protected static final String PARAM_ITEM
public void setServiceRegistry(ServiceRegistry serviceRegistry)
public void setBehaviourFilter(BehaviourFilter behaviourFilter)
public void setActivityService(ActivityService activityService)
protected org.alfresco.service.cmr.repository.NodeRef parseRequestForNodeRef(org.springframework.extensions.webscripts.WebScriptRequest req)
req
- protected String getOrNull(org.json.simple.JSONObject json, String key)
json
- key
- protected org.json.simple.JSONObject parseJSON(org.springframework.extensions.webscripts.WebScriptRequest req)
req
- protected org.json.simple.JSONObject parseJSONFromString(String input)
input
- protected void postActivity(org.json.simple.JSONObject json, org.springframework.extensions.webscripts.WebScriptRequest req, org.alfresco.service.cmr.repository.NodeRef nodeRef, String activityType)
json
- - is not sent null with this activity type - only for deletereq
- nodeRef
- activityType
- protected SiteInfo getSiteInfo(org.springframework.extensions.webscripts.WebScriptRequest req, boolean searchForSiteInJSON)
req
- protected Map<String,Object> executeImpl(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.Status status, org.springframework.extensions.webscripts.Cache cache)
executeImpl
in class org.springframework.extensions.webscripts.DeclarativeWebScript
protected abstract Map<String,Object> executeImpl(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.Status status, org.springframework.extensions.webscripts.Cache cache)
nodeRef
- req
- status
- cache
- Copyright © 2005–2017 Alfresco Software. All rights reserved.