Class AbstractDiscussionWebScript
- java.lang.Object
-
- org.springframework.extensions.webscripts.AbstractWebScript
-
- org.springframework.extensions.webscripts.DeclarativeWebScript
-
- org.alfresco.repo.web.scripts.discussion.AbstractDiscussionWebScript
-
- All Implemented Interfaces:
org.springframework.extensions.webscripts.WebScript
- Direct Known Subclasses:
ForumPostDelete
,ForumPostGet
,ForumPostPut
,ForumPostRepliesGet
,ForumPostRepliesPost
,ForumTopicPost
,ForumTopicsFilteredGet
,ForumTopicsGet
,ForumTopicsHotGet
,ForumTopicsMineGet
,ForumTopicsRecentGet
public abstract class AbstractDiscussionWebScript extends org.springframework.extensions.webscripts.DeclarativeWebScript
- Since:
- 4.0
- Author:
- Nick Burch
-
-
Field Summary
Fields Modifier and Type Field Description protected ActivityService
activityService
static String
DISCUSSIONS_SERVICE_ACTIVITY_APP_NAME
protected DiscussionService
discussionService
protected static String
KEY_AUTHOR
protected static String
KEY_CAN_EDIT
protected static String
KEY_IS_TOPIC_POST
protected static String
KEY_POST
protected static String
KEY_POSTDATA
protected static String
KEY_TOPIC
protected static int
MAX_QUERY_ENTRY_COUNT
When no maximum or paging info is given, what should we use?protected NodeService
nodeService
protected PermissionService
permissionService
protected PersonService
personService
protected SiteService
siteService
-
Constructor Summary
Constructors Constructor Description AbstractDiscussionWebScript()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addActivityEntry(String thing, String event, TopicInfo topic, PostInfo post, SiteInfo site, org.springframework.extensions.webscripts.WebScriptRequest req, org.json.simple.JSONObject json)
Generates an activity entry for the discussion itemprotected Map<String,Object>
buildCommonModel(SiteInfo site, TopicInfo topic, PostInfo post, org.springframework.extensions.webscripts.WebScriptRequest req)
protected org.alfresco.query.PagingRequest
buildPagingRequest(org.springframework.extensions.webscripts.WebScriptRequest req)
Builds up a listing Paging request, based on the arguments specified in the URLprotected Object
buildPerson(String username)
protected boolean
canUserEditPost(PostInfo post, SiteInfo site)
Is the current user allowed to edit this post? In order to be deemed allowed, you first need write permissions on the underlying node of the post.protected abstract Map<String,Object>
executeImpl(SiteInfo site, NodeRef nodeRef, TopicInfo topic, PostInfo post, org.springframework.extensions.webscripts.WebScriptRequest req, org.json.simple.JSONObject json, 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)
protected String
getOrNull(org.json.simple.JSONObject json, String key)
protected List<String>
getTags(org.json.simple.JSONObject json)
protected Map<String,Object>
renderPost(PostInfo post, SiteInfo site)
protected Map<String,Object>
renderTopic(TopicInfo topic, SiteInfo site)
protected Map<String,Object>
renderTopics(List<TopicInfo> topics, Pair<Integer,Integer> size, org.alfresco.query.PagingRequest paging, SiteInfo site)
protected Map<String,Object>
renderTopics(org.alfresco.query.PagingResults<TopicInfo> topics, org.alfresco.query.PagingRequest paging, SiteInfo site)
void
setActivityService(ActivityService activityService)
void
setDiscussionService(DiscussionService discussionService)
void
setNodeService(NodeService nodeService)
void
setPermissionService(PermissionService permissionService)
void
setPersonService(PersonService personService)
void
setSiteService(SiteService siteService)
-
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
-
DISCUSSIONS_SERVICE_ACTIVITY_APP_NAME
public static final String DISCUSSIONS_SERVICE_ACTIVITY_APP_NAME
- See Also:
- Constant Field Values
-
MAX_QUERY_ENTRY_COUNT
protected static final int MAX_QUERY_ENTRY_COUNT
When no maximum or paging info is given, what should we use?- See Also:
- Constant Field Values
-
KEY_POSTDATA
protected static final String KEY_POSTDATA
- See Also:
- Constant Field Values
-
KEY_IS_TOPIC_POST
protected static final String KEY_IS_TOPIC_POST
- See Also:
- Constant Field Values
-
KEY_TOPIC
protected static final String KEY_TOPIC
- See Also:
- Constant Field Values
-
KEY_POST
protected static final String KEY_POST
- See Also:
- Constant Field Values
-
KEY_CAN_EDIT
protected static final String KEY_CAN_EDIT
- See Also:
- Constant Field Values
-
KEY_AUTHOR
protected static final String KEY_AUTHOR
- See Also:
- Constant Field Values
-
nodeService
protected NodeService nodeService
-
siteService
protected SiteService siteService
-
personService
protected PersonService personService
-
activityService
protected ActivityService activityService
-
discussionService
protected DiscussionService discussionService
-
permissionService
protected PermissionService permissionService
-
-
Method Detail
-
setNodeService
public void setNodeService(NodeService nodeService)
-
setSiteService
public void setSiteService(SiteService siteService)
-
setPersonService
public void setPersonService(PersonService personService)
-
setActivityService
public void setActivityService(ActivityService activityService)
-
setDiscussionService
public void setDiscussionService(DiscussionService discussionService)
-
setPermissionService
public void setPermissionService(PermissionService permissionService)
-
buildPagingRequest
protected org.alfresco.query.PagingRequest buildPagingRequest(org.springframework.extensions.webscripts.WebScriptRequest req)
Builds up a listing Paging request, based on the arguments specified in the URL
-
addActivityEntry
protected void addActivityEntry(String thing, String event, TopicInfo topic, PostInfo post, SiteInfo site, org.springframework.extensions.webscripts.WebScriptRequest req, org.json.simple.JSONObject json)
Generates an activity entry for the discussion item- Parameters:
thing
- Either post or replyevent
- One of created, updated, deleted
-
canUserEditPost
protected boolean canUserEditPost(PostInfo post, SiteInfo site)
Is the current user allowed to edit this post? In order to be deemed allowed, you first need write permissions on the underlying node of the post. You then also need to either be the cm:creator of the post node, or a site manager
-
renderTopics
protected Map<String,Object> renderTopics(org.alfresco.query.PagingResults<TopicInfo> topics, org.alfresco.query.PagingRequest paging, SiteInfo site)
-
renderTopics
protected Map<String,Object> renderTopics(List<TopicInfo> topics, Pair<Integer,Integer> size, org.alfresco.query.PagingRequest paging, SiteInfo site)
-
buildCommonModel
protected Map<String,Object> buildCommonModel(SiteInfo site, TopicInfo topic, PostInfo post, org.springframework.extensions.webscripts.WebScriptRequest req)
-
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:
executeImpl
in classorg.springframework.extensions.webscripts.DeclarativeWebScript
-
executeImpl
protected abstract Map<String,Object> executeImpl(SiteInfo site, NodeRef nodeRef, TopicInfo topic, PostInfo post, org.springframework.extensions.webscripts.WebScriptRequest req, org.json.simple.JSONObject json, org.springframework.extensions.webscripts.Status status, org.springframework.extensions.webscripts.Cache cache)
-
-