Post
instead.@Deprecated public interface Post extends Subscribable
Post
interface specifies the contract for a forum post.Modifier and Type | Field and Description |
---|---|
static String |
ID_URL_PATH_SPLIT
Deprecated.
Property for url path splitter.
|
static String |
PN_DATE
Deprecated.
Property for added.
|
static String |
PN_DISTRIBUTE
Deprecated.
use
Replicator directly to trigger reverse replication. |
static String |
PN_IP_ADDRESS
Deprecated.
Property for ip.
|
static String |
PN_MESSAGE
Deprecated.
Property for jcr:description.
|
static String |
PN_NOTIFY
Deprecated.
Property for notify.
|
static String |
PN_PINNED
Deprecated.
Property for pinned.
|
static String |
PN_REFERER
Deprecated.
Property for referer.
|
static String |
PN_SUBJECT
Deprecated.
Property for jcr:title.
|
static String |
PN_TAGS
Deprecated.
Property for cq:tags.
|
static String |
PN_USER_AGENT
Deprecated.
Property for userAgent.
|
static String |
POST_POSTFIX
Deprecated.
Property for post's postfix.
|
static String |
RESOURCE_TYPE_POST
Deprecated.
Property for forum post resource type.
|
static String |
RESOURCE_TYPE_TOPIC
Deprecated.
Property for forum topic resource type.
|
Modifier and Type | Method and Description |
---|---|
Resource |
addAttachment(String name,
InputStream inputStream,
String mimeType)
Deprecated.
Attach a file to this comment.
|
Post |
addPost(ResourceResolver resourceResolver,
Post post)
Deprecated.
Adds a new post (reply) to this post.
|
Post |
addPost(ResourceResolver resourceResolver,
Post fromRequest,
List<javax.activation.DataSource> attachmentDataSource)
Deprecated.
|
Resource |
getAttachment(String name)
Deprecated.
Retrieve an attachment of this comment by its file name.
|
Map<String,Resource> |
getAttachmentMap()
Deprecated.
Retrieves a map, an entry of which represents a file-name/attachment pair.
|
Date |
getCreated()
Deprecated.
This method returns the date and time this post was created.
|
ForumUser |
getCreatedBy()
Deprecated.
Returns the id of the user that added this post.
|
String |
getDefaultPostResourceType()
Deprecated.
Return the default post resource type.
|
String |
getDefaultTopicResourceType()
Deprecated.
Return the default topic resource type.
|
Forum |
getForum()
Deprecated.
Returns the forum this post belongs to.
|
String |
getId()
Deprecated.
Returns the ID of this post, specifically the node name.
|
int |
getIndex()
Deprecated.
Return the index of this post.
|
Post |
getLatestPost()
Deprecated.
Returns the latest post, i.e.
|
int |
getLimit()
Deprecated.
The maximum number of posts per page.
|
String |
getMessage()
Deprecated.
This method returns the forum post's message as entered by the user.
|
Date |
getModified()
Deprecated.
Returns the date this post was last modified, either directly or via addition of a reply (child post).
|
ForumUser |
getModifiedBy()
Deprecated.
Returns the id of the user that effected the last modification of this post.
|
int |
getNumberOfPages()
Deprecated.
Returns the number of reply pages.
|
int |
getNumberOfParticipants()
Deprecated.
This method has serious performance implications and its use is not advised
|
int |
getPageIndex()
Deprecated.
Return the index of the page this post is on (pagination).
|
Post |
getParent()
Deprecated.
Returns the post that this post is a child of.
|
String |
getParentRelativePath()
Deprecated.
Return the path of the parent post, relative to the root content folder for the forum.
|
String |
getPath()
Deprecated.
Returns the path of this post.
|
Post |
getPost(String id)
Deprecated.
If this post is a topic, retrieve the child post with the given
id . |
Iterator<Post> |
getPosts()
Deprecated.
Returns the first level of posts belonging to this topic in chronological order (addition date, ascending).
|
List<Post> |
getPosts(int page)
Deprecated.
Return a subset of the child posts of this post as defined by the given page.
|
List<Post> |
getPosts(int offset,
int size)
Deprecated.
Return a subset of the child posts of this post as defined by the given offset and size.
|
List<Post> |
getPosts(int offset,
int size,
boolean sortDateDescending)
Deprecated.
Return a subset of the child posts of this post as defined by the given offset and size.
|
List<Post> |
getPosts(int page,
SlingHttpServletRequest request)
Deprecated.
Return a subset of the child posts of this post as defined by the given page.
|
Profile |
getProfile()
Deprecated.
Use
getUserProperties() instead. |
ValueMap |
getProperties()
Deprecated.
Returns the
ValueMap containing the properties of this post. |
int |
getRepliesCount()
Deprecated.
Returns the number of replies (child posts) this post has.
|
int |
getRepliesCount(SlingHttpServletRequest request)
Deprecated.
Returns the number of replies (child posts) this post has.
|
Resource |
getResource()
Deprecated.
The resource object that this object was adapted from.
|
Date |
getSelfModified()
Deprecated.
Returns the date this topic was last modified directly.
|
ForumUser |
getSelfModifiedBy()
Deprecated.
Returns the id of the user that effected the last modification of this topic.
|
String |
getSubject()
Deprecated.
This method returns the forum post's subject as entered by the user.
|
Tag[] |
getTags()
Deprecated.
Returns the
Tag s this post is tagged with. |
String |
getTagsAsString()
Deprecated.
Returns a comma-separated string of names the specified tags.
|
Post |
getTopic()
Deprecated.
Returns the top level post this post is a descendant of.
|
String |
getUrl()
Deprecated.
The URL of this post.
|
String |
getUrl(boolean withPageIndex)
Deprecated.
The URL of this post.
|
String |
getUrl(int index)
Deprecated.
Get the url of this post with the given
index this post is on. |
String |
getUrl(int pageIndex,
boolean includePostId,
boolean includeTopicBucketId)
Deprecated.
The URL of this post with the page index and optionally the post id.
|
UserProperties |
getUserProperties()
Deprecated.
Returns the
userProperties of the user. |
boolean |
isApproved()
Deprecated.
Indicates whether this topic has been approved by a moderator.
|
boolean |
isClosed()
Deprecated.
Indicates whether this forum is closed for further addition of topics/posts.
|
boolean |
isModerated()
Deprecated.
Indicates whether this forum requires moderation for new topcis/posts.
|
boolean |
isPinned()
Deprecated.
Indicates whether this post is pinned.
|
boolean |
isSpam()
Deprecated.
Indicates whether this topic has been classified as spam.
|
boolean |
isSubscribed(Authorizable authorizable)
Deprecated.
Indicates whether the given
authorizable (user) is currently subscribed to this topic. |
boolean |
isTopic()
Deprecated.
Indicates whether this post is in fact a topic (top level post).
|
void |
removeAttachment(String name)
Deprecated.
Removes an attachment from this comment, as identified by its name.
|
void |
subscribe(Authorizable authorizable)
Deprecated.
Subscribes the given
authorizable to receive change notifications for this topic. |
void |
subscribe(Authorizable authorizable,
String workflowModel)
Deprecated.
Subscribes the given
authorizable to receive change notifications for this topic. |
void |
subscribe(Authorizable authorizable,
String workflowModel,
Session session)
Deprecated.
Use
com.adobe.cq.social.commons.notification.Subscribable#subscribe(com.day.cq.security.Authorizable, String, org.apache.sling.api.resource.ResourceResolver)
instead. |
void |
unsubscribe(Authorizable authorizable)
Deprecated.
Unsubscribes the given
authorizable from this post. |
void |
unsubscribe(Authorizable authorizable,
String workflowModel)
Deprecated.
Unsubscribes the given
authorizable from this post. |
void |
unsubscribe(Authorizable authorizable,
String workflowModel,
Session session)
Deprecated.
Use
com.adobe.cq.social.commons.notification.Subscribable#unsubscribe(com.day.cq.security.Authorizable, String, org.apache.sling.api.resource.ResourceResolver)
instead. |
getSubscriptionPath
@Deprecated static final String PN_DISTRIBUTE
Replicator
directly to trigger reverse replication.static final String PN_DATE
static final String PN_MESSAGE
static final String PN_NOTIFY
static final String PN_PINNED
static final String PN_SUBJECT
static final String PN_IP_ADDRESS
static final String PN_REFERER
static final String PN_USER_AGENT
static final String PN_TAGS
static final String POST_POSTFIX
static final String ID_URL_PATH_SPLIT
static final String RESOURCE_TYPE_TOPIC
static final String RESOURCE_TYPE_POST
Post addPost(ResourceResolver resourceResolver, Post post) throws ForumException
resourceResolver
- The ResourceResolver
to use for persisting values.post
- The Post
to add.ForumException
- If an error occurs while adding the post.@Deprecated Post addPost(ResourceResolver resourceResolver, Post fromRequest, List<javax.activation.DataSource> attachmentDataSource) throws ForumException
addAttachment(String, InputStream, String)
resourceResolver
- The ResourceResolver
to use for persisting values.fromRequest
- The Post
to add.attachmentDataSource
- The datasource of the attachment to add.ForumException
- If an error occurs while adding the post.String getMessage()
String
representing the post's message.String getSubject()
String
representing the post's subject or null
if not defined.Date getCreated()
Date
representing the creation date and time.ForumUser getCreatedBy()
Date getModified()
getCreated()
if never modified.ForumUser getModifiedBy()
getCreatedBy()
if never modified.Date getSelfModified()
getCreated()
if never modified.ForumUser getSelfModifiedBy()
getCreatedBy()
if never modified.String getId()
int getLimit()
String getPath()
String
representing the path of this post.Post getTopic() throws ForumException
ForumException
- if the topic couldn't be retrieved.Post getParent() throws ForumException
ForumException
- if the parent couldn't be retrieved.boolean isPinned()
true
if this post is pinned.boolean isSpam()
true
if this topic is spam.boolean isApproved()
true
if this topic is moderated and approved.isModerated()
boolean isModerated()
true
if this forum is moderated.boolean isClosed()
true
if this forum is closed.boolean isTopic()
true
if this post represents a topic.Iterator<Post> getPosts()
Iterator
containing the posts.ValueMap getProperties()
ValueMap
containing the properties of this post.int getRepliesCount()
int getRepliesCount(SlingHttpServletRequest request)
request
- the SlingHttpServletRequest. This is checked to see if a new reply was just created in the
previous request. If there was a new reply created and it hasn't been index yet on this server,
increment the replies count by 1 to still display the new reply in the UI despite the lack of an
index.int getNumberOfPages()
String getUrl()
String
representing the URL of this post.String getUrl(boolean withPageIndex)
withPageIndex
- Whether to have the forum page index in the url. This has a performance implication.String
representing the URL of this post.String getUrl(int pageIndex, boolean includePostId, boolean includeTopicBucketId)
pageIndex
- the page index.includePostId
- true if the selector should include post id.includeTopicBucketId
- true if the selector should include the topic bucket id.Forum getForum()
Forum
or null
if not found.List<Post> getPosts(int page) throws RepositoryException
page
- the page of posts, start at 1.RepositoryException
- if error occurs when accessing repository.List<Post> getPosts(int offset, int size, boolean sortDateDescending) throws RepositoryException
offset
- the offset starting from 0.size
- the max number of elements to return.sortDateDescending
- true if posts are sorted by modified date in descending order and false if ascending.RepositoryException
- if error occurs when accessing repository.List<Post> getPosts(int offset, int size) throws RepositoryException
offset
- the offset starting from 0.size
- the max number of elements to return.RepositoryException
- if error occurs when accessing repository.List<Post> getPosts(int page, SlingHttpServletRequest request) throws RepositoryException
page
- the page of topics, start at 1.request
- the SlingHttpServletRequest. This is checked to see if a new reply was just created in the
previous request. If there was a new reply created and it hasn't been index yet on this server, add
that reply to the end of the posts list so that it can still be displayed.RepositoryException
- if error occurred when accessing repository.Post getLatestPost()
null
is returned.null
if not found.void subscribe(Authorizable authorizable) throws ForumException
authorizable
to receive change notifications for this topic.authorizable
- The Authorizable
to subscribe.ForumException
- - Thrown, if an error during subscription occurs or an attempt is made to subscribe to a
post that is not a topic (isTopic()
== false).void unsubscribe(Authorizable authorizable) throws ForumException
authorizable
from this post.authorizable
- The Authorizable
to unsubscribe.ForumException
- - Thrown, if an error during unsubscription occurs.void subscribe(Authorizable authorizable, String workflowModel) throws ForumException
authorizable
to receive change notifications for this topic.authorizable
- The Authorizable
to subscribe.workflowModel
- the path to the subscribe workflow model.ForumException
- - Thrown, if an error during subscription occurs or an attempt is made to subscribe to a
post that is not a topic (isTopic()
== false).void unsubscribe(Authorizable authorizable, String workflowModel) throws ForumException
authorizable
from this post.authorizable
- The Authorizable
to unsubscribe.workflowModel
- the path to the unsubscribe workflow model.ForumException
- - Thrown, if an error during unsubscription occurs.@Deprecated void subscribe(Authorizable authorizable, String workflowModel, Session session) throws ForumException
com.adobe.cq.social.commons.notification.Subscribable#subscribe(com.day.cq.security.Authorizable, String, org.apache.sling.api.resource.ResourceResolver)
instead.authorizable
to receive change notifications for this topic.subscribe
in interface Subscribable
authorizable
- The Authorizable
to subscribe.workflowModel
- the path to the subscribe workflow model.session
- the session to the subscribe workflow model.ForumException
- - Thrown, if an error during subscription occurs or an attempt is made to subscribe to a
post that is not a topic (isTopic()
== false).@Deprecated void unsubscribe(Authorizable authorizable, String workflowModel, Session session) throws ForumException
com.adobe.cq.social.commons.notification.Subscribable#unsubscribe(com.day.cq.security.Authorizable, String, org.apache.sling.api.resource.ResourceResolver)
instead.authorizable
from this post.unsubscribe
in interface Subscribable
authorizable
- The Authorizable
to unsubscribe.workflowModel
- the path to the unsubscribe workflow model.session
- the session to the unsubscribe workflow model.ForumException
- - Thrown, if an error during unsubscription occurs.boolean isSubscribed(Authorizable authorizable)
authorizable
(user) is currently subscribed to this topic.isSubscribed
in interface Subscribable
authorizable
- The user to check.true
if this post is a topic and the given user is subscribed to it.Tag[] getTags()
Tag
s this post is tagged with.Tag
s of this post.String getTagsAsString()
@Deprecated int getNumberOfParticipants()
@Deprecated Profile getProfile()
getUserProperties()
instead.profile
of the user.null
if not setUserProperties getUserProperties()
userProperties
of the user.null
if not setint getPageIndex()
int getIndex()
String getUrl(int index)
index
this post is on. contained in the URL.index
- The page index.getPageIndex()
Post getPost(String id)
id
.id
- The id.null
if not found.String getParentRelativePath()
String getDefaultTopicResourceType()
String getDefaultPostResourceType()
Resource getResource()
Resource
this object wraps.Resource addAttachment(String name, InputStream inputStream, String mimeType)
name
- The name of the file to attach.inputStream
- The InputStream
representing the contents of the file.mimeType
- The mime-type of this file.Resource
representing the attachment just added.CommentException
- Upon encountering an error during persistence of the attachment.IllegalArgumentException
- if name or inputStream or mimeType is null or empty.Resource getAttachment(String name)
name
- The file name of the attachment.Resource
representing the attachment, or null
if no attachment with the given
name exists.Map<String,Resource> getAttachmentMap()
Map
representing the available attachments, or an empty map if no attachments are present.void removeAttachment(String name)
name
- The name of the attachment to remove.CommentException
- If an error occurs removing the attachment."Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"