org.exoplatform.ks.rss
Class RSSGenerate

java.lang.Object
  extended by org.exoplatform.ks.rss.RSSGenerate
Direct Known Subclasses:
RSSProcess

public abstract class RSSGenerate
extends java.lang.Object

Created by The eXo Platform SARL Author : Ha Mai Van ha.mai@exoplatform.com Apr 10, 2009, 10:10:14 AM


Field Summary
 javax.jcr.Node appHomeNode
           
protected  java.lang.String contentProperty
           
 RSS data
           
 java.lang.String descriptionType
           
 java.lang.String eXoLink
           
 java.lang.String FAQ_APP
           
 java.lang.String FAQ_RSS_TYPE
           
 java.lang.String feedType
           
 java.lang.String FORUM_APP
           
 java.lang.String FORUM_RSS_TYPE
           
 java.lang.String KS_FAQ
           
 java.lang.String KS_FORUM
           
 java.lang.String KS_RSS
           
 int maxSize
           
static org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator_
           
 
Constructor Summary
RSSGenerate(org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator)
           
 
Method Summary
 void addNodeRSS(javax.jcr.Node nodeIsAdded, javax.jcr.Node rssNode, RSS data, boolean isNew)
          Add RSS node for a node in KS Application.
 com.sun.syndication.feed.synd.SyndEntry createNewEntry(java.lang.String uri, java.lang.String title, java.lang.String link, java.util.List<java.lang.String> listContent, com.sun.syndication.feed.synd.SyndContent description, java.util.Date pubDate, java.lang.String author)
          Create new entry
 com.sun.syndication.feed.synd.SyndFeed createNewFedd(java.lang.String title, java.util.Date pubDate)
          Create a new feed with some default content: link is the link to eXo web site and feed type is rss_2.0
abstract  void generateFAQRSS(java.lang.String path, int eventType, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
           
abstract  void generateForumsRSS(java.lang.String path, int typeEvent, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
           
 javax.jcr.Node getKSServiceHome(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider, java.lang.String serviceType)
           
protected  javax.jcr.Node getNodeById(java.lang.String objectId, org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
          Get one node in FORUM application by id
 java.lang.String getPageLink()
           
 void getRSSData(javax.jcr.Node rssNode, RSS data)
          Get data of RSS node, content of RSS node will be set into the second parameter
 void removeRSSItem(java.lang.String objectid, javax.jcr.Node node, java.lang.String feedDescription)
          Remove one item from RSS feed based on id of object which is changed
 com.sun.syndication.feed.synd.SyndFeed updateRSSFeed(RSS data, java.lang.String removeItemId, com.sun.syndication.feed.synd.SyndEntry newEntry)
          Update content for RSSFeed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nodeHierarchyCreator_

public static org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator_

appHomeNode

public javax.jcr.Node appHomeNode

KS_RSS

public final java.lang.String KS_RSS

feedType

public final java.lang.String feedType

descriptionType

public final java.lang.String descriptionType

eXoLink

public final java.lang.String eXoLink

contentProperty

protected final java.lang.String contentProperty

data

public RSS data

maxSize

public int maxSize

FAQ_RSS_TYPE

public final java.lang.String FAQ_RSS_TYPE

FORUM_RSS_TYPE

public final java.lang.String FORUM_RSS_TYPE

KS_FAQ

public final java.lang.String KS_FAQ

KS_FORUM

public final java.lang.String KS_FORUM

FAQ_APP

public final java.lang.String FAQ_APP

FORUM_APP

public final java.lang.String FORUM_APP
Constructor Detail

RSSGenerate

public RSSGenerate(org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator)
Method Detail

getKSServiceHome

public javax.jcr.Node getKSServiceHome(org.exoplatform.services.jcr.ext.common.SessionProvider sProvider,
                                       java.lang.String serviceType)
                                throws java.lang.Exception
Throws:
java.lang.Exception

getPageLink

public java.lang.String getPageLink()
                             throws java.lang.Exception
Throws:
java.lang.Exception

getNodeById

protected javax.jcr.Node getNodeById(java.lang.String objectId,
                                     org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                              throws java.lang.Exception
Get one node in FORUM application by id

Parameters:
objectId - id of node which is got
sProvider - the session provider
Returns:
node
Throws:
java.lang.Exception

addNodeRSS

public void addNodeRSS(javax.jcr.Node nodeIsAdded,
                       javax.jcr.Node rssNode,
                       RSS data,
                       boolean isNew)
                throws java.lang.Exception
Add RSS node for a node in KS Application.

Parameters:
nodeIsAdded - Node is added RSS
rssNode - rssNode which is added into KS node
data - data of RSS feed
isNew - is true if is add new RSS and false if is update
Throws:
java.lang.Exception

getRSSData

public void getRSSData(javax.jcr.Node rssNode,
                       RSS data)
                throws java.lang.Exception
Get data of RSS node, content of RSS node will be set into the second parameter

Parameters:
rssNode - RSS node
data - data which is used to store content of RSS node
Throws:
java.lang.Exception

updateRSSFeed

public com.sun.syndication.feed.synd.SyndFeed updateRSSFeed(RSS data,
                                                            java.lang.String removeItemId,
                                                            com.sun.syndication.feed.synd.SyndEntry newEntry)
                                                     throws java.lang.Exception
Update content for RSSFeed.

The first, based on RSS parameter (the first parameter) to get all items.
After that, from id of object which is changed,the item of this object will be removed from RSSFeed.
The finally, add new entry (the third parameter) into top of RSS Feed.

Note: Set the third parameter is null when remove an item

Set the second parameter is null when get all items and add new entry with the third parameter

Set the second and third parameter is null when get all items without add any item

Parameters:
data - RSS object
removeItemId - id of object which is changed
Returns:
List of items
Throws:
java.lang.Exception

removeRSSItem

public void removeRSSItem(java.lang.String objectid,
                          javax.jcr.Node node,
                          java.lang.String feedDescription)
                   throws java.lang.Exception
Remove one item from RSS feed based on id of object which is changed

Parameters:
objectid - id of object
node - Node content RSS feed
feedDescription - description about RSS feed
Throws:
java.lang.Exception

createNewFedd

public com.sun.syndication.feed.synd.SyndFeed createNewFedd(java.lang.String title,
                                                            java.util.Date pubDate)
Create a new feed with some default content: link is the link to eXo web site and feed type is rss_2.0

Returns:

createNewEntry

public com.sun.syndication.feed.synd.SyndEntry createNewEntry(java.lang.String uri,
                                                              java.lang.String title,
                                                              java.lang.String link,
                                                              java.util.List<java.lang.String> listContent,
                                                              com.sun.syndication.feed.synd.SyndContent description,
                                                              java.util.Date pubDate,
                                                              java.lang.String author)
Create new entry

Parameters:
uri - uri of item
title - title of item
link - link to this item
listContent - the content of item
description - the description for this item
Returns:
SyndEntry

generateFAQRSS

public abstract void generateFAQRSS(java.lang.String path,
                                    int eventType,
                                    org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)

generateForumsRSS

public abstract void generateForumsRSS(java.lang.String path,
                                       int typeEvent,
                                       org.exoplatform.services.jcr.ext.common.SessionProvider sProvider)
                                throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2011 eXo Platform SAS. All Rights Reserved.