public class DiscussionServiceImpl extends Object implements DiscussionService
Modifier and Type | Field and Description |
---|---|
protected static String |
CANNED_QUERY_GET_CHILDREN |
protected static String |
CANNED_QUERY_GET_CHILDREN_TARGETS |
protected static String |
CANNED_QUERY_GET_TOPICS_WITH_POSTS |
static String |
DISCUSSION_COMPONENT |
protected static int |
MAX_REPLIES_FETCH_SIZE |
Constructor and Description |
---|
DiscussionServiceImpl() |
Modifier and Type | Method and Description |
---|---|
PostInfo |
createPost(TopicInfo topic,
String contents)
Creates a new
PostInfo in the given topic,
with the specified contents. |
PostInfo |
createReply(PostInfo parentPost,
String contents)
Creates a new
PostInfo which is a reply to
the specified other post, with the given contents. |
TopicInfo |
createTopic(org.alfresco.service.cmr.repository.NodeRef parentNodeRef,
String title)
Creates a new
TopicInfo attached to the specified Node. |
TopicInfo |
createTopic(String siteShortName,
String title)
Creates a new
TopicInfo in the given site |
void |
deletePost(PostInfo post)
Deletes an existing
PostInfo from the repository |
void |
deleteTopic(TopicInfo topic)
Deletes an existing
TopicInfo from the repository |
org.alfresco.query.PagingResults<TopicInfo> |
findTopics(org.alfresco.service.cmr.repository.NodeRef nodeRef,
String username,
String tag,
boolean sortAscending,
org.alfresco.query.PagingRequest paging)
Searches for all topics attached to the specified Node, filtered
by username or tag, sorted by either oldest or newest topics first.
|
org.alfresco.query.PagingResults<TopicInfo> |
findTopics(String siteShortName,
String username,
String tag,
boolean sortAscending,
org.alfresco.query.PagingRequest paging)
Searches for all topics in a site, filtered by username or tag, sorted by
either oldest or newest topics first.
|
org.alfresco.util.Pair<TopicInfo,PostInfo> |
getForNodeRef(org.alfresco.service.cmr.repository.NodeRef nodeRef)
|
PostInfo |
getMostRecentPost(TopicInfo topic)
Retrieves the newest (most recent) Post in a topic, be that
the Primary Post or a Reply.
|
PostInfo |
getPost(TopicInfo topic,
String postName)
Retrieves an existing
PostInfo from the repository |
PostInfo |
getPrimaryPost(TopicInfo topic)
Retrieves the Primary (Root) Post in a topic, to which all
replies belong.
|
protected org.alfresco.service.cmr.repository.NodeRef |
getSiteDiscussionsContainer(String siteShortName,
boolean create)
Fetches the Discussions Container on a site, creating as required if requested.
|
TopicInfo |
getTopic(org.alfresco.service.cmr.repository.NodeRef parentNodeRef,
String topicName)
Retrieves an existing
TopicInfo from the repository,
which is attached to the specified Node. |
TopicInfo |
getTopic(String siteShortName,
String topicName)
Retrieves an existing
TopicInfo from the repository,
which is within a site |
org.alfresco.query.PagingResults<org.alfresco.util.Pair<TopicInfo,Integer>> |
listHotTopics(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Date since,
org.alfresco.query.PagingRequest paging)
Finds topics which have had replies since the specified date, and
returns them along with the count of replies since then.
|
org.alfresco.query.PagingResults<org.alfresco.util.Pair<TopicInfo,Integer>> |
listHotTopics(String siteShortName,
Date since,
org.alfresco.query.PagingRequest paging)
Finds topics which have had replies since the specified date, and
returns them along with the count of replies since then.
|
PostWithReplies |
listPostReplies(PostInfo primaryPost,
int levels)
Retrieves all replies to a Post
|
PostWithReplies |
listPostReplies(TopicInfo topic,
int levels)
Retrieves all replies on a Topic
|
org.alfresco.query.PagingResults<PostInfo> |
listPosts(TopicInfo topic,
org.alfresco.query.PagingRequest paging)
Retrieves all posts in a topic, ordered by creation date
|
org.alfresco.query.PagingResults<TopicInfo> |
listTopics(org.alfresco.service.cmr.repository.NodeRef nodeRef,
boolean sortAscending,
org.alfresco.query.PagingRequest paging)
Retrieves all topics attached to the specified Node, sorted by
either oldest or newest topics first.
|
org.alfresco.query.PagingResults<TopicInfo> |
listTopics(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Date from,
Date to,
boolean sortAscending,
org.alfresco.query.PagingRequest paging)
Retrieves all topics attached to the specified Node, created in the
given date range, sorted by either oldest or newest topics first.
|
org.alfresco.query.PagingResults<TopicInfo> |
listTopics(org.alfresco.service.cmr.repository.NodeRef nodeRef,
String username,
boolean sortAscending,
org.alfresco.query.PagingRequest paging)
Retrieves all topics attached to the specified Node, filtered by username,
sorted by either oldest or newest topics first.
|
org.alfresco.query.PagingResults<TopicInfo> |
listTopics(String siteShortName,
boolean sortAscending,
org.alfresco.query.PagingRequest paging)
Retrieves all topics in a site, sorted by either oldest
or newest topics first.
|
org.alfresco.query.PagingResults<TopicInfo> |
listTopics(String siteShortName,
Date from,
Date to,
boolean sortAscending,
org.alfresco.query.PagingRequest paging)
Retrieves all topics in a site, created in the given date range, sorted by
either oldest or newest topics first.
|
org.alfresco.query.PagingResults<TopicInfo> |
listTopics(String siteShortName,
String username,
boolean sortAscending,
org.alfresco.query.PagingRequest paging)
Retrieves all topics in a site, filtered by username, sorted by
either oldest or newest topics first.
|
void |
setCannedQueryRegistry(org.alfresco.util.registry.NamedObjectRegistry<org.alfresco.query.CannedQueryFactory<? extends Object>> cannedQueryRegistry)
Set the registry of
canned queries |
void |
setContentService(ContentService contentService) |
void |
setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService) |
void |
setNodeDAO(NodeDAO nodeDAO) |
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService) |
void |
setSearchService(org.alfresco.service.cmr.search.SearchService searchService) |
void |
setSiteService(SiteService siteService) |
void |
setTaggingService(TaggingService taggingService) |
void |
setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
Set the
TenantService |
void |
setTransactionService(TransactionService transactionService) |
PostInfo |
updatePost(PostInfo post)
Updates an existing
PostInfo in the repository. |
TopicInfo |
updateTopic(TopicInfo topic)
Updates an existing
TopicInfo in the repository. |
public static final String DISCUSSION_COMPONENT
protected static final String CANNED_QUERY_GET_CHILDREN
protected static final String CANNED_QUERY_GET_CHILDREN_TARGETS
protected static final String CANNED_QUERY_GET_TOPICS_WITH_POSTS
protected static final int MAX_REPLIES_FETCH_SIZE
public void setNodeDAO(NodeDAO nodeDAO)
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
public void setSiteService(SiteService siteService)
public void setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
public void setContentService(ContentService contentService)
public void setTaggingService(TaggingService taggingService)
public void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
public void setTransactionService(TransactionService transactionService)
public void setCannedQueryRegistry(org.alfresco.util.registry.NamedObjectRegistry<org.alfresco.query.CannedQueryFactory<? extends Object>> cannedQueryRegistry)
canned queries
public void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
TenantService
protected org.alfresco.service.cmr.repository.NodeRef getSiteDiscussionsContainer(String siteShortName, boolean create)
public TopicInfo getTopic(String siteShortName, String topicName)
DiscussionService
TopicInfo
from the repository,
which is within a sitegetTopic
in interface DiscussionService
public TopicInfo getTopic(org.alfresco.service.cmr.repository.NodeRef parentNodeRef, String topicName)
DiscussionService
TopicInfo
from the repository,
which is attached to the specified Node.
The parent Node should normally either be a Site Container, or a
ForumModel.TYPE_FORUM
getTopic
in interface DiscussionService
public PostInfo getPost(TopicInfo topic, String postName)
DiscussionService
PostInfo
from the repositorygetPost
in interface DiscussionService
public TopicInfo createTopic(String siteShortName, String title)
DiscussionService
TopicInfo
in the given sitecreateTopic
in interface DiscussionService
public TopicInfo createTopic(org.alfresco.service.cmr.repository.NodeRef parentNodeRef, String title)
DiscussionService
TopicInfo
attached to the specified Node.
The parent Node should normally either be a Site Container, or a
ForumModel.TYPE_FORUM
createTopic
in interface DiscussionService
public PostInfo createPost(TopicInfo topic, String contents)
DiscussionService
PostInfo
in the given topic,
with the specified contents.
Normally only one post is created this way on a topic,
and the remainder of the posts are created as
replies to the DiscussionService.getPrimaryPost(TopicInfo)
primary post.createPost
in interface DiscussionService
PostInfo
public PostInfo createReply(PostInfo parentPost, String contents)
DiscussionService
PostInfo
which is a reply to
the specified other post, with the given contents.
The link between the parent post and the reply is
created as part of this.createReply
in interface DiscussionService
PostInfo
public TopicInfo updateTopic(TopicInfo topic)
DiscussionService
TopicInfo
in the repository.updateTopic
in interface DiscussionService
TopicInfo
public PostInfo updatePost(PostInfo post)
DiscussionService
PostInfo
in the repository.updatePost
in interface DiscussionService
PostInfo
public void deleteTopic(TopicInfo topic)
DiscussionService
TopicInfo
from the repositorydeleteTopic
in interface DiscussionService
public void deletePost(PostInfo post)
DiscussionService
PostInfo
from the repositorydeletePost
in interface DiscussionService
public org.alfresco.util.Pair<TopicInfo,PostInfo> getForNodeRef(org.alfresco.service.cmr.repository.NodeRef nodeRef)
DiscussionService
TopicInfo
or a PostInfo
, returns
the objects wrapping the Node.
For a Topic, the 2nd half of the pair is null.
For a Post, both halves of the pair are set.
For anything else, the response is null.getForNodeRef
in interface DiscussionService
public PostInfo getPrimaryPost(TopicInfo topic)
DiscussionService
getPrimaryPost
in interface DiscussionService
public PostInfo getMostRecentPost(TopicInfo topic)
DiscussionService
getMostRecentPost
in interface DiscussionService
public org.alfresco.query.PagingResults<TopicInfo> listTopics(String siteShortName, boolean sortAscending, org.alfresco.query.PagingRequest paging)
DiscussionService
listTopics
in interface DiscussionService
public org.alfresco.query.PagingResults<TopicInfo> listTopics(org.alfresco.service.cmr.repository.NodeRef nodeRef, boolean sortAscending, org.alfresco.query.PagingRequest paging)
DiscussionService
listTopics
in interface DiscussionService
public org.alfresco.query.PagingResults<TopicInfo> listTopics(String siteShortName, String username, boolean sortAscending, org.alfresco.query.PagingRequest paging)
DiscussionService
listTopics
in interface DiscussionService
public org.alfresco.query.PagingResults<TopicInfo> listTopics(org.alfresco.service.cmr.repository.NodeRef nodeRef, String username, boolean sortAscending, org.alfresco.query.PagingRequest paging)
DiscussionService
listTopics
in interface DiscussionService
public org.alfresco.query.PagingResults<TopicInfo> listTopics(String siteShortName, Date from, Date to, boolean sortAscending, org.alfresco.query.PagingRequest paging)
DiscussionService
listTopics
in interface DiscussionService
public org.alfresco.query.PagingResults<TopicInfo> listTopics(org.alfresco.service.cmr.repository.NodeRef nodeRef, Date from, Date to, boolean sortAscending, org.alfresco.query.PagingRequest paging)
DiscussionService
listTopics
in interface DiscussionService
public org.alfresco.query.PagingResults<org.alfresco.util.Pair<TopicInfo,Integer>> listHotTopics(String siteShortName, Date since, org.alfresco.query.PagingRequest paging)
DiscussionService
listHotTopics
in interface DiscussionService
public org.alfresco.query.PagingResults<org.alfresco.util.Pair<TopicInfo,Integer>> listHotTopics(org.alfresco.service.cmr.repository.NodeRef nodeRef, Date since, org.alfresco.query.PagingRequest paging)
DiscussionService
listHotTopics
in interface DiscussionService
public org.alfresco.query.PagingResults<TopicInfo> findTopics(String siteShortName, String username, String tag, boolean sortAscending, org.alfresco.query.PagingRequest paging)
DiscussionService
findTopics
in interface DiscussionService
public org.alfresco.query.PagingResults<TopicInfo> findTopics(org.alfresco.service.cmr.repository.NodeRef nodeRef, String username, String tag, boolean sortAscending, org.alfresco.query.PagingRequest paging)
DiscussionService
findTopics
in interface DiscussionService
public org.alfresco.query.PagingResults<PostInfo> listPosts(TopicInfo topic, org.alfresco.query.PagingRequest paging)
DiscussionService
listPosts
in interface DiscussionService
public PostWithReplies listPostReplies(TopicInfo topic, int levels)
DiscussionService
listPostReplies
in interface DiscussionService
public PostWithReplies listPostReplies(PostInfo primaryPost, int levels)
DiscussionService
listPostReplies
in interface DiscussionService
Copyright © 2005–2017 Alfresco Software. All rights reserved.