public abstract class AbstractDiscussionWebScript
extends org.springframework.extensions.webscripts.DeclarativeWebScript
Modifier and Type | Field and 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 org.alfresco.service.cmr.repository.NodeService |
nodeService |
protected org.alfresco.service.cmr.security.PermissionService |
permissionService |
protected PersonService |
personService |
protected SiteService |
siteService |
Constructor and Description |
---|
AbstractDiscussionWebScript() |
Modifier and Type | Method and 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 item
|
protected 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 URL
|
protected 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,
org.alfresco.service.cmr.repository.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,
org.alfresco.util.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(org.alfresco.service.cmr.repository.NodeService nodeService) |
void |
setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService) |
void |
setPersonService(PersonService personService) |
void |
setSiteService(SiteService siteService) |
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
public static final String DISCUSSIONS_SERVICE_ACTIVITY_APP_NAME
protected static final int MAX_QUERY_ENTRY_COUNT
protected static final String KEY_POSTDATA
protected static final String KEY_IS_TOPIC_POST
protected static final String KEY_TOPIC
protected static final String KEY_POST
protected static final String KEY_CAN_EDIT
protected static final String KEY_AUTHOR
protected org.alfresco.service.cmr.repository.NodeService nodeService
protected SiteService siteService
protected PersonService personService
protected ActivityService activityService
protected DiscussionService discussionService
protected org.alfresco.service.cmr.security.PermissionService permissionService
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
public void setSiteService(SiteService siteService)
public void setPersonService(PersonService personService)
public void setActivityService(ActivityService activityService)
public void setDiscussionService(DiscussionService discussionService)
public void setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)
protected org.alfresco.query.PagingRequest buildPagingRequest(org.springframework.extensions.webscripts.WebScriptRequest req)
protected void addActivityEntry(String thing, String event, TopicInfo topic, PostInfo post, SiteInfo site, org.springframework.extensions.webscripts.WebScriptRequest req, org.json.simple.JSONObject json)
thing
- Either post or replyevent
- One of created, updated, deletedprotected boolean canUserEditPost(PostInfo post, SiteInfo site)
protected Map<String,Object> renderTopics(org.alfresco.query.PagingResults<TopicInfo> topics, org.alfresco.query.PagingRequest paging, SiteInfo site)
protected Map<String,Object> renderTopics(List<TopicInfo> topics, org.alfresco.util.Pair<Integer,Integer> size, org.alfresco.query.PagingRequest paging, SiteInfo site)
protected Map<String,Object> buildCommonModel(SiteInfo site, TopicInfo topic, PostInfo post, org.springframework.extensions.webscripts.WebScriptRequest 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(SiteInfo site, org.alfresco.service.cmr.repository.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)
Copyright © 2005–2017 Alfresco Software. All rights reserved.