|
Clearspace API (1.10.16) Core Javadocs | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jivesoftware.community.util.BlogUtils
public class BlogUtils
Collection of utility methods used across blogs
Includes replaceNonAlphanumeric() from Roller Weblogger server (Apache license).
| Method Summary | |
|---|---|
static java.lang.String |
format8601Date(java.util.Date date)
|
static java.lang.String |
getAuthorFeedURL(Blog blog,
User author)
Returns a string containing the path to the author feed for a specific blog / author combination. |
static java.lang.String |
getAuthorPermalink(Blog blog)
Returns a author permalink for a blog which is a combination of the base URL, the blog display name and the word 'authors'. |
static java.lang.String |
getAuthorPermalink(Blog blog,
User author)
Returns a author permalink for a blog and author which is a combination of the base URL, the blog display name and the word 'authors' and the authors username. |
static java.lang.String |
getBlogCommentFeedURL()
Returns a string containing the path to a feed which contains recent comments across the entire system. |
static java.lang.String |
getBlogFeedURL()
Returns a string containing the path to a feed which contains newly created blogs across the entire system. |
static java.lang.String |
getBlogTrackbackFeedURL()
Returns a string containing the path to a feed which contains recent trackbacks across the entire system. |
static java.lang.String |
getBlogURL(Blog blog)
Returns the URL for the blog which is a combination of the base URL and the blog display name. |
static java.lang.String |
getCommentFeedURL(Blog blog)
Returns a string containing the path to the comments feed for a blog. |
static java.lang.String |
getCommentFeedURL(BlogPost post)
Returns a string containing the path to the comments feed for a specific post. |
static java.lang.String |
getCommentPermalink(Comment comment)
Returns a permalink for a blog comment which is a combination of the base URL, the blog display name, the year / month / day, the entry name and a suffix / comment ID. |
static java.lang.String |
getCommentURL(BlogPost post)
Returns a string containing the path to the script that accepts comment postings which is a combination of the base URL, the blog display name and the post permalink. |
static java.lang.String |
getFeedURL()
Returns a string containing the path to a feed which contains recent posts across the entire system. |
static java.lang.String |
getFeedURL(Blog blog)
Returns a string containing the path to the feed which is a combination of the base URL, the blog display name and the default system feed type. |
static java.lang.String |
getFromEmail()
Get an available email address to use for outbound emails. |
static java.lang.String |
getFromName()
Get an available from name to use for outbound emails. |
static java.lang.String |
getHumanFriendlyDate(java.util.Date dateToFormat)
Deprecated. Replaced by DateUtils.displayFriendly(long) |
static java.lang.String |
getPostPermalink(BlogPost post)
Returns a permalink for a blog post which is a combination of the base URL, the blog display name and the post permalink. |
static java.util.List<java.lang.String> |
getReservedURIs()
Returns a list of reserved words that cannot be used by blog authors as display names. |
static java.lang.String |
getSearchURL(Blog blog)
Returns a string containing the path to the script that accepts search queries for a blog which is a combination of the base URL, the blog display name and the search path. |
static java.lang.String |
getTagFeedURL(Blog blog,
ContentTag tag)
Returns a string containing the path to the tag feed which is a combination of the base URL, the blog display name, the word 'feed-tags' and the given tag or tags. |
static java.lang.String |
getTagFeedURL(Blog blog,
java.util.List<ContentTag> tags)
Returns a string containing the path to the tag feed which is a combination of the base URL, the blog display name, the word 'feed-tags' and the given tag or tags. |
static java.lang.String |
getTagFeedURL(Blog blog,
java.lang.String tags)
Returns a string containing the path to the tag feed which is a combination of the base URL, the blog display name, the word 'feed-tags' and the given tag or tags. |
static java.lang.String |
getTagFeedURL(ContentTag tag)
Returns a string containing the path to the tag feed for the system and a given tag. |
static java.lang.String |
getTagFeedURL(java.util.List<ContentTag> tags)
Returns a string containing the path to the tag feed for the system and a given list of tags. |
static java.lang.String |
getTagFeedURLPrefix()
Returns the tag feed URL prefix for the system tag feeds, which the getTagFeedURL(com.jivesoftware.community.ContentTag) methods depend on. |
static java.lang.String |
getTagFeedURLPrefix(Blog blog)
Returns the tag feed URL prefix for a given blog, which the getTagFeedURL(com.jivesoftware.community.ContentTag) methods depend on. |
static java.lang.String |
getTagPermalink(Blog blog,
ContentTag tag)
Returns a tag permalink for a blog which is a combination of the base URL, the blog display name, the word 'tags' and the given tag.. |
static java.lang.String |
getTagPermalink(Blog blog,
java.util.List<ContentTag> tags)
Returns a tag permalink for a blog which is a combination of the base URL, the blog display name, the word 'tags' and a list of tags. |
static java.lang.String |
getTagPermalink(Blog blog,
java.lang.String tags)
Returns a tag permalink for a blog which is a combination of the base URL, the blog display name, the word 'tags' and the given tag or tags, delimited using a plus (+) sign. |
static java.lang.String |
getTagPermalink(java.lang.String tag)
Returns a tag permalink for the system which is a combination of the base URL, the word 'tags' and the tag. |
static java.lang.String |
getTagsPermalink(Blog blog)
Returns a tag permalink for a blog which is a combination of the base URL, the blog display name and the word 'tags'. |
static java.lang.String |
getTrackbackFeedURL(Blog blog)
Returns a string containing the path to the trackbacks feed for a blog. |
static java.lang.String |
getTrackbackFeedURL(BlogPost post)
Returns a string containing the path to the trackbacks feed for a specific post. |
static java.lang.String |
getTrackbackPermalink(Trackback trackback)
Returns a permalink for a blog trackback which is a combination of the base URL, the blog display name, the year / month / day, the entry name and a suffix / trackback ID. |
static java.lang.String |
getTrackbackURL(BlogPost post)
Returns a trackback URL for a blog post which is a combination of the base URL, the blog display name and the post permalink. |
static java.lang.String |
getUserFeedURL(java.lang.String username)
Returns a string containing the path to the feed which is a combination of the base URL, the username and the default system feed type. |
static java.lang.String |
getUserFeedURLPrefix()
|
static boolean |
isReservedURI(java.lang.String displayName)
Used by blog config to make sure a display name provided by a user does not conflict with one of the reserved names in the /blog/ namespace. |
static boolean |
isValidDisplayName(java.lang.String str)
Method to validate a display name for a blog. |
static java.lang.String |
makeURLSafe(java.lang.String str)
Trims spaces from the start and end of the string, replaces punctuation, and then replaces occurences of non-alphanumeric characters (except dashes) with a dash. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static java.lang.String getFeedURL()
public static java.lang.String getBlogFeedURL()
public static java.lang.String getBlogCommentFeedURL()
public static java.lang.String getBlogTrackbackFeedURL()
public static java.lang.String getUserFeedURL(java.lang.String username)
username - the username of the user to display the feed for
public static java.lang.String getTagFeedURL(ContentTag tag)
tag - The tag to get the feed url for.
public static java.lang.String getTagFeedURL(java.util.List<ContentTag> tags)
tags - The list of tags to get the feed url for.
public static java.lang.String getFeedURL(Blog blog)
blog - the blog to display the feed for
public static java.lang.String getCommentFeedURL(Blog blog)
blog - the blog to display the comments feed for
public static java.lang.String getCommentFeedURL(BlogPost post)
post - the post to display the feed for
public static java.lang.String getAuthorFeedURL(Blog blog,
User author)
blog - the blog to display the feed forauthor - the user to display the feed for
public static java.lang.String getAuthorPermalink(Blog blog)
blog - The blog to get a author permalink for.
public static java.lang.String getAuthorPermalink(Blog blog,
User author)
blog - The blog to get an author permalink for.author - The user to get an author permalink for
public static java.lang.String getTrackbackFeedURL(Blog blog)
blog - the blog to display the trackbacks feed for
public static java.lang.String getTrackbackFeedURL(BlogPost post)
post - the post to display the feed for
public static java.lang.String getTagFeedURL(Blog blog,
ContentTag tag)
blog - the blog to get the feed fortag - the tag to get the feed for
public static java.lang.String getTagFeedURL(Blog blog,
java.util.List<ContentTag> tags)
blog - The blog to get a feed url for.tags - List of tags under the blog to get a feed url for.
public static java.lang.String getTagFeedURL(Blog blog,
java.lang.String tags)
blog - The blog to get a feed url for.tags - List of tags under the blog to get a feed url for.
public static java.lang.String getTagFeedURLPrefix(Blog blog)
getTagFeedURL(com.jivesoftware.community.ContentTag) methods depend on. Useful for classes
that need to build a tag feed URL without knowing what tags
will be used.
blog - The blog to get the url tag feed url prefix for.
public static java.lang.String getTagFeedURLPrefix()
getTagFeedURL(com.jivesoftware.community.ContentTag) methods depend on. Useful for classes
that need to build a tag feed URL without knowing what tags
will be used.
public static java.lang.String getUserFeedURLPrefix()
public static java.lang.String getBlogURL(Blog blog)
blog - The blog to get a url for.
public static java.lang.String getPostPermalink(BlogPost post)
More information: http://en.wikipedia.org/wiki/Permalink
post - The blog post to get a perma link for.
public static java.lang.String getCommentPermalink(Comment comment)
comment - the comment to get a link for
public static java.lang.String getTrackbackPermalink(Trackback trackback)
trackback - the trackback to get a link for
public static java.lang.String getTagsPermalink(Blog blog)
blog - The blog to get a tag permalink for.
public static java.lang.String getTagPermalink(java.lang.String tag)
tag - The tag to get a permalink for.
public static java.lang.String getTagPermalink(Blog blog,
ContentTag tag)
blog - The blog to get a permalink for.tag - The tag under the blog to get a permalink for.
public static java.lang.String getTagPermalink(Blog blog,
java.util.List<ContentTag> tags)
blog - The blog to get a permalink for.tags - The tags under the blog to get a permalink for.
public static java.lang.String getTagPermalink(Blog blog,
java.lang.String tags)
blog - The blog to get a permalink for.tags - The tags under the blog to get a permalink for.
public static java.lang.String getCommentURL(BlogPost post)
post - The blog post to get a comment url for.
public static java.lang.String getSearchURL(Blog blog)
blog - The blog to get a search url for.
public static java.lang.String getTrackbackURL(BlogPost post)
post - The blog post to get a track back url for.
public static boolean isValidDisplayName(java.lang.String str)
str - the blog display name to check.
getReservedURIs()public static java.lang.String makeURLSafe(java.lang.String str)
Examples:
str - The string to make a safe url from.
public static java.lang.String getFromEmail()
blogs.email.fromEmail.
public static java.lang.String getFromName()
blogs.email.fromName.
public static boolean isReservedURI(java.lang.String displayName)
displayName - The display name of the blog.
public static java.util.List<java.lang.String> getReservedURIs()
public static java.lang.String format8601Date(java.util.Date date)
@Deprecated public static java.lang.String getHumanFriendlyDate(java.util.Date dateToFormat)
DateUtils.displayFriendly(long)
Ported from JavaScript library by Nelson Minar.
dateToFormat - The date to format.
|
Clearspace Project Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||