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
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
-
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 static final intprotected static final Stringprotected static final intprotected static final Stringprotected static final StoreRefFields 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 -
Method Summary
Modifier and TypeMethodDescriptionprotected org.alfresco.query.PagingRequestbuildPagingRequest(org.springframework.extensions.webscripts.WebScriptRequest req) Builds up a listing Paging request, based on the arguments specified in the URLprotected org.alfresco.query.PagingResults<TopicInfo> doSearch(Pair<String, String> searchQuery, boolean sortAscending, org.alfresco.query.PagingRequest paging) Do the actual searchexecuteImpl(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) Overrides AbstractDiscussionWebScript to allow a null siteprotected StringgetDateXDaysAgo(int daysAgo) Get the date x days ago in the format 'yyyy-MM-dd'getSearchQuery(SiteInfo site, String author, int daysAgo) Build the search query from the passed in parameters and SEARCH_QUERY constantvoidsetSearchService(SearchService searchService) Sets the searchService.protected org.alfresco.query.PagingResults<TopicInfo> Wrap up search results asTopicInfoinstancesMethods 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, setSiteServiceMethods inherited from class org.springframework.extensions.webscripts.DeclarativeWebScript
execute, executeFinallyImpl, executeImpl, executeImpl, getTemplateModel, renderFormatTemplateMethods 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
-
DEFAULT_TOPIC_AUTHOR
- See Also:
-
DEFAULT_TOPIC_LATEST_POST_DAYS_AGO
protected static final int DEFAULT_TOPIC_LATEST_POST_DAYS_AGO- See Also:
-
DEFAULT_MAX_RESULTS
protected static final int DEFAULT_MAX_RESULTS- See Also:
-
SPACES_STORE
-
SEARCH_QUERY
- See Also:
-
-
Constructor Details
-
ForumTopicsFilteredGet
public ForumTopicsFilteredGet()
-
-
Method Details
-
setSearchService
Sets the searchService.- Parameters:
searchService- SearchService
-
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 AbstractDiscussionWebScript to allow a null site- Overrides:
executeImplin classAbstractDiscussionWebScript- Parameters:
req- WebScriptRequeststatus- Statuscache- Cache- Returns:
- Map
-
executeImpl
protected 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) - Specified by:
executeImplin 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<TopicInfo> doSearch(Pair<String, 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
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
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:
buildPagingRequestin classAbstractDiscussionWebScript- Parameters:
req- WebScriptRequest- Returns:
- PagingRequest
-
wrap
protected org.alfresco.query.PagingResults<TopicInfo> wrap(ResultSet finalResults, org.alfresco.query.PagingRequest paging) Wrap up search results asTopicInfoinstances- Parameters:
finalResults- ResultSetpaging- PagingRequest
-