org.olat.core.util.notifications
Class SubscriptionInfo

java.lang.Object
  extended by org.olat.core.util.notifications.SubscriptionInfo
Direct Known Subclasses:
NoSubscriptionInfo

public class SubscriptionInfo
extends java.lang.Object

Description:
this object holds the items-description/title the list is used for multiple elements (all the news-item itself) they know how to be rendered (either html or plain-text)

Initial Date: 25.10.2004

Author:
Felix Jost

Field Summary
static java.lang.String MIME_HTML
           
static java.lang.String MIME_PLAIN
           
 
Constructor Summary
SubscriptionInfo(TitleItem title, java.util.List<SubscriptionListItem> subsList)
           
 
Method Summary
 void addSubscriptionListItem(SubscriptionListItem sI)
           
 int countSubscriptionListItems()
           
 java.lang.String getCustomUrl()
           
 java.lang.String getSpecificInfo(java.lang.String mimeType, java.util.Locale locale)
          looping over List with all contained items for this subs-info
 java.lang.String getTitle(java.lang.String mimeType)
           
 boolean hasNews()
           
 void setCustomUrl(java.lang.String customUrl)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIME_HTML

public static final java.lang.String MIME_HTML
See Also:
Constant Field Values

MIME_PLAIN

public static final java.lang.String MIME_PLAIN
See Also:
Constant Field Values
Constructor Detail

SubscriptionInfo

public SubscriptionInfo(TitleItem title,
                        java.util.List<SubscriptionListItem> subsList)
Method Detail

getSpecificInfo

public java.lang.String getSpecificInfo(java.lang.String mimeType,
                                        java.util.Locale locale)
looping over List with all contained items for this subs-info

Parameters:
mimeType - the mimetype of the desired output; supported are currently text/plain and text/html
Returns:
the specific (subscriber and type) info for a notification entry. e.g. "5 new posts" for a forum subscription, or "10 new uploads" for a folder subscription

hasNews

public boolean hasNews()
Returns:
true if there is any news

getTitle

public java.lang.String getTitle(java.lang.String mimeType)
Parameters:
mimeType - the mimetype of the desired output; supported are currently text/plain and text/html
Returns:
the title of a notification entry. e.g. "5 new posts" for a forum subscription, or "10 new uploads" for a folder subscription

addSubscriptionListItem

public void addSubscriptionListItem(SubscriptionListItem sI)

getCustomUrl

public java.lang.String getCustomUrl()
Returns:
Returns the customUrl.

setCustomUrl

public void setCustomUrl(java.lang.String customUrl)
Parameters:
customUrl - The customUrl to set.

countSubscriptionListItems

public int countSubscriptionListItems()
Returns:
The number of subscription list items, meaning the number of news items for this subscription