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
-
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
static final String
protected DiscussionService
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 int
When no maximum or paging info is given, what should we use?protected NodeService
protected PermissionService
protected PersonService
protected SiteService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 itembuildCommonModel
(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.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) executeImpl
(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.Status status, org.springframework.extensions.webscripts.Cache cache) protected String
getTags
(org.json.simple.JSONObject json) renderPost
(PostInfo post, SiteInfo site) renderTopic
(TopicInfo topic, SiteInfo site) renderTopics
(List<TopicInfo> topics, Pair<Integer, Integer> size, org.alfresco.query.PagingRequest paging, SiteInfo site) 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 Details
-
DISCUSSIONS_SERVICE_ACTIVITY_APP_NAME
- See Also:
-
MAX_QUERY_ENTRY_COUNT
protected static final int MAX_QUERY_ENTRY_COUNTWhen no maximum or paging info is given, what should we use?- See Also:
-
KEY_POSTDATA
- See Also:
-
KEY_IS_TOPIC_POST
- See Also:
-
KEY_TOPIC
- See Also:
-
KEY_POST
- See Also:
-
KEY_CAN_EDIT
- See Also:
-
KEY_AUTHOR
- See Also:
-
nodeService
-
siteService
-
personService
-
activityService
-
discussionService
-
permissionService
-
-
Constructor Details
-
AbstractDiscussionWebScript
public AbstractDiscussionWebScript()
-
-
Method Details
-
setNodeService
-
setSiteService
-
setPersonService
-
setActivityService
-
setDiscussionService
-
setPermissionService
-
getOrNull
-
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 -
getTags
-
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
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 -
buildPerson
-
renderPost
-
renderTopic
-
renderTopics
-
renderTopics
-
buildCommonModel
-
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)
-