org.olat.modules.webFeed.models
Class Feed

java.lang.Object
  extended by org.olat.modules.webFeed.models.Feed
All Implemented Interfaces:
java.io.Serializable, OLATResourceable

public class Feed
extends java.lang.Object
implements OLATResourceable, java.io.Serializable

This is an OLAT feed (or web/news feed) model. It stores all necessary information of a feed including items. Implements Serializable for caching.

Initial Date: Feb 16, 2009

Author:
Gregor Wassmann
See Also:
Serialized Form

Constructor Summary
Feed(OLATResourceable resource)
          Constructor
 
Method Summary
 void add(Item item)
          Add an item to the feed.
 java.lang.String getAuthor()
           
 java.lang.String getDescription()
          Getter for description
 java.lang.String getExternalFeedUrl()
           
 java.lang.String getExternalImageURL()
           
 java.util.List<Item> getFilteredItems(FeedSecurityCallback callback, Identity identity)
           
 java.lang.Long getId()
           
 java.lang.String getImageName()
          Getter for imageName
 java.util.List<java.lang.String> getItemIds()
           
 java.util.List<Item> getItems()
           
 Item[] getItemsArray()
           
 java.util.Date getLastModified()
           
 java.util.List<Item> getPublishedItems()
           
 java.lang.Long getResourceableId()
           
 java.lang.String getResourceableTypeName()
           
 java.lang.String getTitle()
          Getter for title
 boolean hasItems()
           
 boolean isExternal()
           
 boolean isInternal()
           
 boolean isUndefined()
           
 boolean remove(Item item)
          Remove an item from the feed
 void setAuthor(java.lang.String author)
           
 void setDescription(java.lang.String description)
          Setter for description
 void setExternal(java.lang.Boolean isExternal)
           
 void setExternalFeedUrl(java.lang.String feedUrl)
           
 void setExternalImageURL(java.lang.String externalImageURL)
           
 void setId(java.lang.Long id)
           
 void setImageName(java.lang.String name)
          Setter for name
 void setItems(java.util.List<Item> items)
           
 void setLastModified(java.util.Date lastModified)
           
 void setTitle(java.lang.String title)
          Setter for title
 void setType(java.lang.String type)
          Set the resourcable type name.
 void sortItems()
          Sorts the items by publish date in reverse chronological order
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Feed

public Feed(OLATResourceable resource)
Constructor

Parameters:
resource -
Method Detail

setTitle

public void setTitle(java.lang.String title)
Setter for title

Parameters:
title -

setDescription

public void setDescription(java.lang.String description)
Setter for description

Parameters:
description -

setImageName

public void setImageName(java.lang.String name)
Setter for name

Parameters:
name -

getTitle

public java.lang.String getTitle()
Getter for title

Returns:
title

getDescription

public java.lang.String getDescription()
Getter for description

Returns:
description

getImageName

public java.lang.String getImageName()
Getter for imageName

Returns:
imageName

setId

public void setId(java.lang.Long id)
Parameters:
id - The id to set.

getId

public java.lang.Long getId()
Returns:
The id

isExternal

public boolean isExternal()
Returns:
true if the current object is an external feed.

isInternal

public boolean isInternal()
Returns:
true if the current object is an internal feed.

isUndefined

public boolean isUndefined()
Returns:
true if the current object is an external feed.

setExternal

public void setExternal(java.lang.Boolean isExternal)
Parameters:
isExternal - The isExternal to set. (Valid argument values are true, false (their corresponding boolean object) or null)

getItems

public java.util.List<Item> getItems()
Returns:
All items

getFilteredItems

public java.util.List<Item> getFilteredItems(FeedSecurityCallback callback,
                                             Identity identity)
Parameters:
identity -
Returns:
The filtered Items

getPublishedItems

public java.util.List<Item> getPublishedItems()
Returns:
A list of all published items

sortItems

public void sortItems()
Sorts the items by publish date in reverse chronological order


getItemsArray

public Item[] getItemsArray()
Returns:
All items in an array

getItemIds

public java.util.List<java.lang.String> getItemIds()
Returns:
All item ids

add

public void add(Item item)
Add an item to the feed.

Parameters:
item -

remove

public boolean remove(Item item)
Remove an item from the feed

Parameters:
item -
Returns:
true if this list contained the specified element.

setItems

public void setItems(java.util.List<Item> items)
Parameters:
items -

setAuthor

public void setAuthor(java.lang.String author)
Parameters:
author - The author to set.

getAuthor

public java.lang.String getAuthor()
Returns:
Returns the author.

setExternalFeedUrl

public void setExternalFeedUrl(java.lang.String feedUrl)
Parameters:
feedUrl - The external feed URL to set.

getExternalFeedUrl

public java.lang.String getExternalFeedUrl()
Returns:
Returns the externalFeedURL.

setExternalImageURL

public void setExternalImageURL(java.lang.String externalImageURL)
Parameters:
externalImageURL - The externalImageURL to set.

getExternalImageURL

public java.lang.String getExternalImageURL()
Returns:
Returns the externalImageURL.

hasItems

public boolean hasItems()
Returns:
True if there are items

setLastModified

public void setLastModified(java.util.Date lastModified)
Parameters:
lastModified - The lastModified to set.

getLastModified

public java.util.Date getLastModified()
Returns:
Returns the lastModified.

getResourceableId

public java.lang.Long getResourceableId()
Specified by:
getResourceableId in interface OLATResourceable
Returns:
a number identfiying the instance of this type. if null, then the OLATResourcable is just a type. The value 0 (zero) is not allowed
See Also:
OLATResourceable.getResourceableId()

getResourceableTypeName

public java.lang.String getResourceableTypeName()
Specified by:
getResourceableTypeName in interface OLATResourceable
Returns:
a type name. It must be unique within OLAT. Consider this.getClass().getName() as such a type name.
See Also:
OLATResourceable.getResourceableTypeName()

setType

public void setType(java.lang.String type)
Set the resourcable type name. (Sometimes needed on reload, just to make sure.)

Parameters:
type - The resourcable type name