com.atlassian.confluence.pages
Class BlogPostsCalendar

java.lang.Object
  extended by com.atlassian.confluence.pages.BlogPostsCalendar

public class BlogPostsCalendar
extends java.lang.Object

Helper bean that turns a list of blog posts into a monthly calendar.


Constructor Summary
BlogPostsCalendar(java.util.Date coversDate, java.util.List blogPosts, java.lang.String spaceKey)
          Construct a new calendar.
 
Method Summary
 java.lang.String formatMonthYear()
           
 java.lang.String getCurrentMonth()
          Get the next year/month in the form yyyy/MM
 int getDaysInMonth()
          Gets the total number of days in the month being calendared.
 BlogPost getFirstPostInNextMonth()
           
 BlogPost getLastPostInPreviousMonth()
           
 java.lang.String getNextMonth()
          Get the next year/month in the form yyyy/MM
 java.util.List getPostsForDay(int dayOfMonth)
          Get the posts made on a particular day of the month
 java.lang.String getPreviousMonth()
          Get the previous year/month in the form yyyy/MM
 java.lang.String getSpaceKey()
           
 int getStartingDayOfMonth()
          Get the starting day of the month as an offset from Sunday (i.e.
 void setFirstPostInNextMonth(BlogPost firstPostInNextMonth)
           
 void setLastPostInPreviousMonth(BlogPost lastPostInPreviousMonth)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlogPostsCalendar

public BlogPostsCalendar(java.util.Date coversDate,
                         java.util.List blogPosts,
                         java.lang.String spaceKey)
Construct a new calendar. Takes a date that falls within the month being calendared, and a list of blog posts that are to populate the calendar. Any blog post falling outside the given month will be ignored quietly.

Parameters:
coversDate - a date falling within the month being calendared
blogPosts - the blog posts to populate the calendar
Method Detail

getDaysInMonth

public int getDaysInMonth()
Gets the total number of days in the month being calendared.

Returns:
the total number of days in the month being calendared

getStartingDayOfMonth

public int getStartingDayOfMonth()
Get the starting day of the month as an offset from Sunday (i.e. Sunday is 0, Monday 1, etc.) This is NOT COMPATIBLE with the constants on the Calendar class.

Returns:
the starting day of the month as an offset from Sunday

getPostsForDay

public java.util.List getPostsForDay(int dayOfMonth)
Get the posts made on a particular day of the month

Parameters:
dayOfMonth - the day of the month to get the posts for (starting at 1)
Returns:
the blog posts made on that day

formatMonthYear

public java.lang.String formatMonthYear()

getSpaceKey

public java.lang.String getSpaceKey()

getPreviousMonth

public java.lang.String getPreviousMonth()
Get the previous year/month in the form yyyy/MM


getNextMonth

public java.lang.String getNextMonth()
Get the next year/month in the form yyyy/MM


getCurrentMonth

public java.lang.String getCurrentMonth()
Get the next year/month in the form yyyy/MM


setLastPostInPreviousMonth

public void setLastPostInPreviousMonth(BlogPost lastPostInPreviousMonth)

setFirstPostInNextMonth

public void setFirstPostInNextMonth(BlogPost firstPostInNextMonth)

getLastPostInPreviousMonth

public BlogPost getLastPostInPreviousMonth()

getFirstPostInNextMonth

public BlogPost getFirstPostInNextMonth()


Copyright © 2003-2008 Atlassian Pty Ltd. All Rights Reserved.