Class ForumTopicsFilteredGet
- java.lang.Object
-
- org.springframework.extensions.webscripts.AbstractWebScript
-
- org.springframework.extensions.webscripts.DeclarativeWebScript
-
- org.alfresco.repo.web.scripts.discussion.AbstractDiscussionWebScript
-
- org.alfresco.repo.web.scripts.discussion.ForumTopicsFilteredGet
-
- All Implemented Interfaces:
org.springframework.extensions.webscripts.WebScript
public class ForumTopicsFilteredGet extends AbstractDiscussionWebScript
Gets topics matching the filters passed to it in the URL. topics = 'mine' (searches for posts by the user) or 'all' (ignores the author in the search) history = days in the past to search resultSize = the number of topics returned in the results- Author:
- Jamie Allison
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
DEFAULT_MAX_RESULTS
protected static java.lang.String
DEFAULT_TOPIC_AUTHOR
protected static int
DEFAULT_TOPIC_LATEST_POST_DAYS_AGO
protected static java.lang.String
SEARCH_QUERY
protected static org.alfresco.service.cmr.repository.StoreRef
SPACES_STORE
-
Fields inherited from class org.alfresco.repo.web.scripts.discussion.AbstractDiscussionWebScript
activityService, DISCUSSIONS_SERVICE_ACTIVITY_APP_NAME, discussionService, KEY_AUTHOR, KEY_CAN_EDIT, KEY_IS_TOPIC_POST, KEY_POST, KEY_POSTDATA, KEY_TOPIC, MAX_QUERY_ENTRY_COUNT, nodeService, permissionService, personService, siteService
-
-
Constructor Summary
Constructors Constructor Description ForumTopicsFilteredGet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 org.alfresco.query.PagingResults<org.alfresco.service.cmr.discussion.TopicInfo>
doSearch(org.alfresco.util.Pair<java.lang.String,java.lang.String> searchQuery, boolean sortAscending, org.alfresco.query.PagingRequest paging)
Do the actual searchprotected java.util.Map<java.lang.String,java.lang.Object>
executeImpl(org.alfresco.service.cmr.site.SiteInfo site, org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.cmr.discussion.TopicInfo topic, org.alfresco.service.cmr.discussion.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 java.util.Map<java.lang.String,java.lang.Object>
executeImpl(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.Status status, org.springframework.extensions.webscripts.Cache cache)
Overrides AbstractDiscussionWebScript to allow a null siteprotected java.lang.String
getDateXDaysAgo(int daysAgo)
Get the date x days ago in the format 'yyyy-MM-dd'protected org.alfresco.util.Pair<java.lang.String,java.lang.String>
getSearchQuery(org.alfresco.service.cmr.site.SiteInfo site, java.lang.String author, int daysAgo)
Build the search query from the passed in parameters and SEARCH_QUERY constantvoid
setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
Sets the searchService.protected org.alfresco.query.PagingResults<org.alfresco.service.cmr.discussion.TopicInfo>
wrap(org.alfresco.service.cmr.search.ResultSet finalResults, org.alfresco.query.PagingRequest paging)
Wrap up search results asTopicInfo
instances-
Methods inherited from class org.alfresco.repo.web.scripts.discussion.AbstractDiscussionWebScript
addActivityEntry, buildCommonModel, buildPerson, canUserEditPost, getOrNull, getTags, renderPost, renderTopic, renderTopics, renderTopics, setActivityService, setDiscussionService, setNodeService, setPermissionService, setPersonService, setSiteService
-
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
-
DEFAULT_TOPIC_AUTHOR
protected static final java.lang.String DEFAULT_TOPIC_AUTHOR
- See Also:
- Constant Field Values
-
DEFAULT_TOPIC_LATEST_POST_DAYS_AGO
protected static final int DEFAULT_TOPIC_LATEST_POST_DAYS_AGO
- See Also:
- Constant Field Values
-
DEFAULT_MAX_RESULTS
protected static final int DEFAULT_MAX_RESULTS
- See Also:
- Constant Field Values
-
SPACES_STORE
protected static final org.alfresco.service.cmr.repository.StoreRef SPACES_STORE
-
SEARCH_QUERY
protected static final java.lang.String SEARCH_QUERY
- See Also:
- Constant Field Values
-
-
Method Detail
-
setSearchService
public void setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
Sets the searchService.- Parameters:
searchService
- SearchService
-
executeImpl
protected java.util.Map<java.lang.String,java.lang.Object> executeImpl(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.Status status, org.springframework.extensions.webscripts.Cache cache)
Overrides AbstractDiscussionWebScript to allow a null site- Overrides:
executeImpl
in classAbstractDiscussionWebScript
- Parameters:
req
- WebScriptRequeststatus
- Statuscache
- Cache- Returns:
- Map
-
executeImpl
protected java.util.Map<java.lang.String,java.lang.Object> executeImpl(org.alfresco.service.cmr.site.SiteInfo site, org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.cmr.discussion.TopicInfo topic, org.alfresco.service.cmr.discussion.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)
- Specified by:
executeImpl
in classAbstractDiscussionWebScript
- Parameters:
site
- SiteInfonodeRef
- Not required. It is only included because it is overriding the parent class.topic
- Not required. It is only included because it is overriding the parent class.post
- Not required. It is only included because it is overriding the parent class.req
- WebScriptRequeststatus
- Not required. It is only included because it is overriding the parent class.cache
- Not required. It is only included because it is overriding the parent class.- Returns:
- Map
-
doSearch
protected org.alfresco.query.PagingResults<org.alfresco.service.cmr.discussion.TopicInfo> doSearch(org.alfresco.util.Pair<java.lang.String,java.lang.String> searchQuery, boolean sortAscending, org.alfresco.query.PagingRequest paging)
Do the actual search- Parameters:
searchQuery
- Pair with query string in first and query language in secondsortAscending
- booleanpaging
- PagingRequest
-
getSearchQuery
protected org.alfresco.util.Pair<java.lang.String,java.lang.String> getSearchQuery(org.alfresco.service.cmr.site.SiteInfo site, java.lang.String author, int daysAgo)
Build the search query from the passed in parameters and SEARCH_QUERY constant- Parameters:
site
- SiteInfoauthor
- StringdaysAgo
- int- Returns:
- Pair with the query string in first and query language in second
-
getDateXDaysAgo
protected java.lang.String getDateXDaysAgo(int daysAgo)
Get the date x days ago in the format 'yyyy-MM-dd'- Parameters:
daysAgo
- int- Returns:
- String
-
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- Overrides:
buildPagingRequest
in classAbstractDiscussionWebScript
- Parameters:
req
- WebScriptRequest- Returns:
- PagingRequest
-
wrap
protected org.alfresco.query.PagingResults<org.alfresco.service.cmr.discussion.TopicInfo> wrap(org.alfresco.service.cmr.search.ResultSet finalResults, org.alfresco.query.PagingRequest paging)
Wrap up search results asTopicInfo
instances- Parameters:
finalResults
- ResultSetpaging
- PagingRequest
-
-