org.olat.modules.webFeed
Class FeedViewHelper

java.lang.Object
  extended by org.olat.modules.webFeed.FeedViewHelper

public class FeedViewHelper
extends java.lang.Object

The object provides helper methods for feed views. This is required since the feed urls are user dependent.

Initial Date: Mar 11, 2009

Author:
gwassmann

Constructor Summary
FeedViewHelper(Feed feed, Identity identity, Translator translator, java.lang.Long courseId, java.lang.String nodeId, FeedSecurityCallback callback)
          Use this constructor for localized content (like e.g.
 
Method Summary
 void addItem(Item item)
          Removes the item from the current selection of items
 java.lang.String getFeedDescriptionForBrowser()
           
 java.lang.String getFeedUrl()
           
 java.lang.String getGoogleUrl()
           
 java.lang.String getImageUrl()
           
 java.lang.String getInfo(Item item)
           
 java.lang.String getItemContentForBrowser(Item item)
           
 java.lang.String getItemDescriptionForBrowser(Item item)
           
 java.util.List<Item> getItems(FeedSecurityCallback callback)
           
 java.lang.String getITunesUrl()
           
 java.lang.String getJumpInLink()
           
 java.lang.String getLastModified()
           
 java.lang.String getLastModified(Item item)
           
 java.lang.String getMediaType(Enclosure enclosure)
           
 java.lang.String getMediaUrl(Item item)
           
 java.lang.String getModifierInfo(Item item)
           
 java.lang.String getYahooUrl()
           
 boolean hasNewerItems()
           
 boolean hasOlderItems()
           
 boolean isModified(Item item)
           
 int itemsCount(FeedSecurityCallback callback)
           
 void newerItems()
          Show newer items, meaning go to the previous page.
 void olderItems()
          Show older items, meaning go to the next page.
 void removeItem(Item item)
          Removes the item from the current selection of items
 void resetItems(FeedSecurityCallback callback)
          Resets the item selection to all accessible items of the feed
 void setItemsPerPage(int itemsPerPage)
           
 void setSelectedItems(java.util.List<Item> selectedItems)
           
 void setURIs()
          Set the base uri of an internal feed.
 void startpage()
          Go to the startpage
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeedViewHelper

public FeedViewHelper(Feed feed,
                      Identity identity,
                      Translator translator,
                      java.lang.Long courseId,
                      java.lang.String nodeId,
                      FeedSecurityCallback callback)
Use this constructor for localized content (like e.g. date formats)

Parameters:
feed -
identityKey -
locale -
Method Detail

setURIs

public void setURIs()
Set the base uri of an internal feed.
E.g http://my.olat.org/olat/feed/ident/[IDKEY]/token/[TOKEN]/id/[ORESID]


getITunesUrl

public java.lang.String getITunesUrl()
Returns:
The iTunes subscription url

getYahooUrl

public java.lang.String getYahooUrl()
Returns:
The Yahoo! subscription url

getGoogleUrl

public java.lang.String getGoogleUrl()
Returns:
The Google subscription url

getFeedUrl

public java.lang.String getFeedUrl()
Returns:
The feed url

getMediaUrl

public java.lang.String getMediaUrl(Item item)
Parameters:
item -
Returns:
The media url of the item

getImageUrl

public java.lang.String getImageUrl()
Returns:
The feed image url

getMediaType

public java.lang.String getMediaType(Enclosure enclosure)
Parameters:
enclosure -
Returns:
The media type (audio or video)

getLastModified

public java.lang.String getLastModified(Item item)
Parameters:
item -
Returns:
The formatted last modified date string of the item

getInfo

public java.lang.String getInfo(Item item)
Parameters:
item -
Returns:
Information about the item. Is it draft, scheduled or published?

isModified

public boolean isModified(Item item)

getModifierInfo

public java.lang.String getModifierInfo(Item item)
Parameters:
item -
Returns:
Information about the item. Is it draft, scheduled or published?

getLastModified

public java.lang.String getLastModified()
Returns:
The formatted last modified date string of the feed

getJumpInLink

public java.lang.String getJumpInLink()
Returns:
The jump in link

getItemDescriptionForBrowser

public java.lang.String getItemDescriptionForBrowser(Item item)
Parameters:
item -
Returns:
The item description with media file paths that are dispatchable by the FeedMediaDispatcher

getItemContentForBrowser

public java.lang.String getItemContentForBrowser(Item item)
Parameters:
item -
Returns:
The item content with media file paths that are dispatchable by the FeedMediaDispatcher

getFeedDescriptionForBrowser

public java.lang.String getFeedDescriptionForBrowser()
Returns:
The feed description with dispatchable media file paths

setItemsPerPage

public void setItemsPerPage(int itemsPerPage)

olderItems

public void olderItems()
Show older items, meaning go to the next page.


hasOlderItems

public boolean hasOlderItems()
Returns:
True there are newer items to display

newerItems

public void newerItems()
Show newer items, meaning go to the previous page.


startpage

public void startpage()
Go to the startpage


hasNewerItems

public boolean hasNewerItems()
Returns:
True if there are newer items to display

itemsCount

public int itemsCount(FeedSecurityCallback callback)
Parameters:
callback -
Returns:
The items count of all displayed (accessible) items

getItems

public java.util.List<Item> getItems(FeedSecurityCallback callback)
Returns:
The items to be displayed on the current page

setSelectedItems

public void setSelectedItems(java.util.List<Item> selectedItems)
Parameters:
selectedItems -

removeItem

public void removeItem(Item item)
Removes the item from the current selection of items

Parameters:
item - The item to remove

addItem

public void addItem(Item item)
Removes the item from the current selection of items

Parameters:
item - The item to remove

resetItems

public void resetItems(FeedSecurityCallback callback)
Resets the item selection to all accessible items of the feed

Parameters:
callback -