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 Details

  • Constructor Details

    • AbstractDiscussionWebScript

      public AbstractDiscussionWebScript()
  • Method Details

    • 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)
    • getOrNull

      protected String getOrNull(org.json.simple.JSONObject json, String key)
    • 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

      protected List<String> getTags(org.json.simple.JSONObject json)
    • 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 reply
      event - 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
    • buildPerson

      protected Object buildPerson(String username)
    • renderPost

      protected Map<String,Object> renderPost(PostInfo post, SiteInfo site)
    • renderTopic

      protected Map<String,Object> renderTopic(TopicInfo topic, SiteInfo site)
    • 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 class org.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)