Class BlogPostResourceIdentifier
java.lang.Object
com.atlassian.confluence.content.render.xhtml.model.resource.identifiers.BlogPostsForDateResourceIdentifier
com.atlassian.confluence.content.render.xhtml.model.resource.identifiers.BlogPostResourceIdentifier
- All Implemented Interfaces:
AttachmentContainerResourceIdentifier
,NamedResourceIdentifier
,ResourceIdentifier
public class BlogPostResourceIdentifier
extends BlogPostsForDateResourceIdentifier
implements AttachmentContainerResourceIdentifier, NamedResourceIdentifier
Restrict BlogPostsForDateDto to a single BlogPost on a date.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionBlogPostResourceIdentifier
(String spaceKey, String title, Calendar postingDay) -
Method Summary
Modifier and TypeMethodDescriptionboolean
getTitle()
int
hashCode()
static boolean
isBlogPostLink
(String link) Returns true if the provided link matches the expected blog post pattern.boolean
static BlogPostResourceIdentifier
newInstanceFromLink
(String link, String defaultSpaceKey) Returns a newResourceIdentifier
for a blog post wiki-link in the form "KEY:/2013/03/10/Blog title" or "/2013/03/10/Blog title".toString()
Methods inherited from class com.atlassian.confluence.content.render.xhtml.model.resource.identifiers.BlogPostsForDateResourceIdentifier
getPostingDay, getSpace, getSpaceKey
-
Field Details
-
BLOG_POST_LINK_REGEX
-
-
Constructor Details
-
BlogPostResourceIdentifier
- Parameters:
spaceKey
- (optional) identifies the Space for the BlogPost. May be null if the space is to be derived from contexttitle
- identifies the title of the BlogPost. May be null if the blog is to be derived from contextpostingDay
- identifies the posting date for the blog. May be null if the blog is to be derived from context.
-
-
Method Details
-
isBlogPostLink
Returns true if the provided link matches the expected blog post pattern.- See Also:
-
newInstanceFromLink
public static BlogPostResourceIdentifier newInstanceFromLink(String link, String defaultSpaceKey) throws ParseException Returns a newResourceIdentifier
for a blog post wiki-link in the form "KEY:/2013/03/10/Blog title" or "/2013/03/10/Blog title". If no space key is in the link, uses the provided defaultSpaceKey.Clients should call
isBlogPostLink(String)
first to check that link is a valid blog-post link.- Throws:
ParseException
- if the date in the link cannot be parsedIllegalArgumentException
- if the link does not a valid blog post link according toBLOG_POST_LINK_REGEX
-
getTitle
-
getResourceName
- Specified by:
getResourceName
in interfaceNamedResourceIdentifier
-
isPopulated
public boolean isPopulated()- Returns:
- true if this resource identifier is populated with data.
-
toString
- Overrides:
toString
in classBlogPostsForDateResourceIdentifier
-
equals
- Overrides:
equals
in classBlogPostsForDateResourceIdentifier
-
hashCode
public int hashCode()- Overrides:
hashCode
in classBlogPostsForDateResourceIdentifier
-