com.atlassian.confluence.content.render.xhtml.model.resource.identifiers
Class BlogPostResourceIdentifier

java.lang.Object
  extended by com.atlassian.confluence.content.render.xhtml.model.resource.identifiers.BlogPostsForDateResourceIdentifier
      extended by 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
static java.util.regex.Pattern BLOG_POST_LINK_REGEX
           
 
Constructor Summary
BlogPostResourceIdentifier(java.lang.String spaceKey, java.lang.String title, java.util.Calendar postingDay)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.String getResourceName()
           
 java.lang.String getTitle()
           
 int hashCode()
           
static boolean isBlogPostLink(java.lang.String link)
          Returns true if the provided link matches the expected blog post pattern.
 boolean isPopulated()
           
static BlogPostResourceIdentifier newInstanceFromLink(java.lang.String link, java.lang.String defaultSpaceKey)
          Returns a new ResourceIdentifier for a blog post wiki-link in the form "KEY:/2013/03/10/Blog title" or "/2013/03/10/Blog title".
 java.lang.String toString()
           
 
Methods inherited from class com.atlassian.confluence.content.render.xhtml.model.resource.identifiers.BlogPostsForDateResourceIdentifier
getPostingDay, getSpace, getSpaceKey
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

BLOG_POST_LINK_REGEX

public static final java.util.regex.Pattern BLOG_POST_LINK_REGEX
Constructor Detail

BlogPostResourceIdentifier

public BlogPostResourceIdentifier(java.lang.String spaceKey,
                                  java.lang.String title,
                                  java.util.Calendar postingDay)
Parameters:
spaceKey - (optional) identifies the Space for the BlogPost. May be null if the space is to be derived from context
title - identifies the title of the BlogPost. May be null if the blog is to be derived from context
postingDay - identifies the posting date for the blog. May be null if the blog is to be derived from context.
Method Detail

isBlogPostLink

public static boolean isBlogPostLink(java.lang.String link)
Returns true if the provided link matches the expected blog post pattern.

See Also:
BLOG_POST_LINK_REGEX

newInstanceFromLink

public static BlogPostResourceIdentifier newInstanceFromLink(java.lang.String link,
                                                             java.lang.String defaultSpaceKey)
                                                      throws java.text.ParseException
Returns a new ResourceIdentifier 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:
java.text.ParseException - if the date in the link cannot be parsed
java.lang.IllegalArgumentException - if the link does not a valid blog post link according to BLOG_POST_LINK_REGEX

getTitle

public java.lang.String getTitle()

getResourceName

public java.lang.String getResourceName()
Specified by:
getResourceName in interface NamedResourceIdentifier

isPopulated

public boolean isPopulated()
Returns:
true if this resource identifier is populated with data.

toString

public java.lang.String toString()
Overrides:
toString in class BlogPostsForDateResourceIdentifier

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class BlogPostsForDateResourceIdentifier

hashCode

public int hashCode()
Overrides:
hashCode in class BlogPostsForDateResourceIdentifier


Copyright © 2003-2014 Atlassian. All Rights Reserved.