Class BlogPost

All Implemented Interfaces:
Searchable, Content, Addressable, ContentTypeAware, HasLinkWikiMarkup, Versioned, RelatableEntity, EditableLabelable, Labelable, ContentConvertible, Spaced, Serializable, Cloneable, Comparable<ContentEntityObject>

public class BlogPost extends AbstractPage implements ContentConvertible
See Also:
  • Field Details

  • Constructor Details

    • BlogPost

      public BlogPost()
  • Method Details

    • getType

      public String getType()
      Description copied from class: ContentEntityObject
      An easy name for the type of this content: makes it easy for things like the #contentLink macro to work out what to draw.

      This is a bit of a hack, but it saves heaps of code elsewhere, especially since we tend to get back these objects wrapped in all sorts of Hibernate CGLIB stuff.

      Specified by:
      getType in interface ContentTypeAware
      Specified by:
      getType in class ContentEntityObject
      Returns:
      the content type
    • toCalendar

      public static Calendar toCalendar(Date date)
    • getCalendarFromDatePath

      public static Calendar getCalendarFromDatePath(String datePath)
      BEFORE USING THIS - consider if BlogPostReference better suits your needs.
      Parameters:
      datePath - - should resemble /2005/11/12/aBlogTitle
      Returns:
      Calendar representing the date of the blog, useful for a call to pageManager.getBlogPost(spaceKey, title, calendarDay)
    • getTitleFromDatePath

      public static String getTitleFromDatePath(String datePath)
      BEFORE USING THIS - consider if BlogPostReference better suits your needs.
      Parameters:
      datePath - - should resemble /2010/11/12/aBlogTitle
      Returns:
      the title of the blog, if supplied with correct input, otherwise a null
    • getLinkPart

      public String getLinkPart()
    • getDatePath

      public String getDatePath()
    • toDatePath

      public static String toDatePath(Date date)
    • getLinkWikiMarkup

      public String getLinkWikiMarkup()
      Specified by:
      getLinkWikiMarkup in interface HasLinkWikiMarkup
      Returns:
      the wiki markup used to link to this content
    • getPostingYear

      public String getPostingYear()
      Returns:
      A string representing the year of posting date. E.g.: 2017. Note: The string is formatted according to the system locale and timezone.
    • getPostingMonth

      public String getPostingMonth()
      Returns:
      The standalone form of a full month name. E.g.: January. Note: The string is formatted according to the system locale and timezone.
    • getPostingMonth

      public String getPostingMonth(DateFormatter formatter)
      Formats month name of the posting date according to given formatter.
      Parameters:
      formatter - The date formatter to use when formatting month name. If null, then default formatter will be used.
      Returns:
      Formatted name of the month of the posting date.
    • getPostingMonthNumeric

      public String getPostingMonthNumeric()
      Returns:
      A string representing the number of the month of posting date. E.g.: January will be formatted as '01'. Note: The string is formatted according to the system locale and timezone.
    • getPostingDayOfMonth

      public String getPostingDayOfMonth()
      Returns:
      A string representing the day of the month of posting date. E.g.: 8th of January will be formatted as '08'. Note: The string is formatted according to the system locale and timezone.
    • getPostingDate

      public Date getPostingDate()
      Alias for EntityObject.getCreationDate()
      Returns:
      the posting date
    • getPostingCalendarDate

      public Calendar getPostingCalendarDate()
    • getContentTypeObject

      public ContentType getContentTypeObject()
      Specified by:
      getContentTypeObject in interface ContentConvertible
      Returns:
      the api ContentType that this ContentConvertible converts to
    • getContentId

      public ContentId getContentId()
      Returns the ContentId for this Blog post.
      Specified by:
      getContentId in interface ContentConvertible
      Overrides:
      getContentId in class ContentEntityObject
      Returns:
      the ContentId representation of this Blog post's id
    • shouldConvertToContent

      public boolean shouldConvertToContent()
      Specified by:
      shouldConvertToContent in interface ContentConvertible
      Returns:
      true if the implementer wants to be part of the core API (default value), false otherwise