AbstractPost
instead@Deprecated public abstract class AbstractPost extends Object implements Post
Post
interface specifies the contract for a forum post.ID_URL_PATH_SPLIT, PN_DATE, PN_DISTRIBUTE, PN_IP_ADDRESS, PN_MESSAGE, PN_NOTIFY, PN_PINNED, PN_REFERER, PN_SUBJECT, PN_TAGS, PN_USER_AGENT, POST_POSTFIX, RESOURCE_TYPE_POST, RESOURCE_TYPE_TOPIC
Constructor and Description |
---|
AbstractPost()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
Post |
addPost(ResourceResolver resourceResolver,
Post post)
Deprecated.
Adds a new post (reply) to this post.
|
Post |
addPost(ResourceResolver resourceResolver,
Post post,
List<javax.activation.DataSource> fileAttachments)
Deprecated.
Adds a new post (reply) to this post with attachments.
|
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.
Returns the number of unique participants of this topic, i.e.
|
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 limit,
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 offset and size.
|
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.
|
String |
getSubscriptionPath()
Deprecated.
|
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 |
setLatestPost(Post post)
Deprecated.
|
void |
setRepliesCount(int count)
Deprecated.
|
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,
ResourceResolver resourceResolver)
Deprecated.
Subscribes the given
authorizable to receive change notifications for this topic. |
void |
subscribe(Authorizable authorizable,
String workflowModel,
Session session)
Deprecated.
Subscribes the given
authorizable to receive change notifications for this topic. |
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,
ResourceResolver resourceResolver)
Deprecated.
Unsubscribes the given
authorizable from this post. |
void |
unsubscribe(Authorizable authorizable,
String workflowModel,
Session session)
Deprecated.
Unsubscribes the given
authorizable from this post. |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addAttachment, getAttachment, getAttachmentMap, removeAttachment
public Date getCreated()
getCreated
in interface Post
Date
representing the creation date and time.public ForumUser getCreatedBy()
getCreatedBy
in interface Post
public Date getModified()
getModified
in interface Post
Post.getCreated()
if never modified.public ForumUser getModifiedBy()
getModifiedBy
in interface Post
Post.getCreatedBy()
if never modified.public Date getSelfModified()
getSelfModified
in interface Post
Post.getCreated()
if never modified.public ForumUser getSelfModifiedBy()
getSelfModifiedBy
in interface Post
Post.getCreatedBy()
if never modified.public String getId()
public int getLimit()
public String getPath()
public String getParentRelativePath()
getParentRelativePath
in interface Post
public Post getTopic()
public Post getParent()
public boolean isPinned()
public boolean isTopic()
public Iterator<Post> getPosts()
public List<Post> getPosts(int page)
public List<Post> getPosts(int page, SlingHttpServletRequest request) throws RepositoryException
public ValueMap getProperties()
ValueMap
containing the properties of this post.getProperties
in interface Post
public int getRepliesCount()
getRepliesCount
in interface Post
public int getRepliesCount(SlingHttpServletRequest request)
getRepliesCount
in interface Post
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.public String getUrl()
public String getUrl(int pageIndex, boolean includePostId, boolean includeTopicBucketId)
public String getUrl(boolean withPageIndex)
public Forum getForum()
public List<Post> getPosts(int offset, int limit, boolean sortDateDescending)
getPosts
in interface Post
offset
- the offset starting from 0.limit
- the max number of elements to return.sortDateDescending
- true if posts are sorted by modified date in descending order and false if ascending.public Post getLatestPost()
null
is returned.getLatestPost
in interface Post
null
if not found.public void subscribe(Authorizable authorizable)
authorizable
to receive change notifications for this topic.subscribe
in interface Post
authorizable
- The Authorizable
to subscribe.public void subscribe(Authorizable authorizable, String workflowModel)
authorizable
to receive change notifications for this topic.subscribe
in interface Post
authorizable
- The Authorizable
to subscribe.workflowModel
- the path to the subscribe workflow model.public void subscribe(Authorizable authorizable, String workflowModel, Session session)
authorizable
to receive change notifications for this topic.subscribe
in interface Subscribable
subscribe
in interface Post
authorizable
- The Authorizable
to subscribe.workflowModel
- the path to the subscribe workflow model.session
- the session to the subscribe workflow model.public void unsubscribe(Authorizable authorizable)
authorizable
from this post.unsubscribe
in interface Post
authorizable
- The Authorizable
to unsubscribe.public void unsubscribe(Authorizable authorizable, String workflowModel)
authorizable
from this post.unsubscribe
in interface Post
authorizable
- The Authorizable
to unsubscribe.workflowModel
- the path to the unsubscribe workflow model.public void unsubscribe(Authorizable authorizable, String workflowModel, Session session)
authorizable
from this post.unsubscribe
in interface Subscribable
unsubscribe
in interface Post
authorizable
- The Authorizable
to unsubscribe.workflowModel
- the path to the unsubscribe workflow model.session
- the session to the unsubscribe workflow model.public boolean isSubscribed(Authorizable authorizable)
authorizable
(user) is currently subscribed to this topic.isSubscribed
in interface Subscribable
isSubscribed
in interface Post
authorizable
- The user to check.true
if this post is a topic and the given user is subscribed to it.public int getNumberOfParticipants()
getNumberOfParticipants
in interface Post
@Deprecated public Profile getProfile()
getUserProperties()
instead.profile
of the user.getProfile
in interface Post
null
if not setpublic UserProperties getUserProperties()
userProperties
of the user.getUserProperties
in interface Post
null
if not setpublic int getPageIndex()
getPageIndex
in interface Post
public String getUrl(int index)
index
this post is on. contained in the URL.getUrl
in interface Post
index
- The page index.Post.getPageIndex()
public Post getPost(String id)
id
.public boolean isSpam()
public boolean isModerated()
isModerated
in interface Post
true
if this forum is moderated.public boolean isClosed()
public boolean isApproved()
isApproved
in interface Post
true
if this topic is moderated and approved.Post.isModerated()
public Post addPost(ResourceResolver resourceResolver, Post post) throws ForumException
addPost
in interface Post
resourceResolver
- The ResourceResolver
to use for persisting values.post
- The Post
to add.ForumException
- If an error occurs while adding the post.public Post addPost(ResourceResolver resourceResolver, Post post, List<javax.activation.DataSource> fileAttachments) throws ForumException
addPost
in interface Post
resourceResolver
- The ResourceResolver
to use for persisting values.post
- The Post
to add.fileAttachments
- The datasource of the attachment to add.ForumException
- If an error occurs while adding the post.public String getMessage()
getMessage
in interface Post
String
representing the post's message.public String getSubject()
getSubject
in interface Post
String
representing the post's subject or null
if not defined.public String getTagsAsString()
getTagsAsString
in interface Post
public void setLatestPost(Post post)
public void setRepliesCount(int count)
public int getNumberOfPages()
getNumberOfPages
in interface Post
public int getIndex()
public String getDefaultTopicResourceType()
getDefaultTopicResourceType
in interface Post
public String getDefaultPostResourceType()
getDefaultPostResourceType
in interface Post
public Resource getResource()
getResource
in interface Post
Resource
this object wraps.public void subscribe(Authorizable authorizable, String workflowModel, ResourceResolver resourceResolver)
Post
authorizable
to receive change notifications for this topic.subscribe
in interface Subscribable
subscribe
in interface Post
authorizable
- The Authorizable
to subscribe.workflowModel
- the path to the subscribe workflow model.resourceResolver
- the session to the subscribe workflow model.public void unsubscribe(Authorizable authorizable, String workflowModel, ResourceResolver resourceResolver)
Post
authorizable
from this post.unsubscribe
in interface Subscribable
unsubscribe
in interface Post
authorizable
- The Authorizable
to unsubscribe.workflowModel
- the path to the unsubscribe workflow model.resourceResolver
- the session to the unsubscribe workflow model.public String getSubscriptionPath()
getSubscriptionPath
in interface Subscribable
"Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"