org.dspace.app.util
Class SyndicationFeed

java.lang.Object
  extended by org.dspace.app.util.SyndicationFeed

public class SyndicationFeed
extends Object

Invoke ROME library to assemble a generic model of a syndication for the given list of Items and scope. Consults configuration for the metadata bindings to feed elements. Uses ROME's output drivers to return any of the implemented formats, e.g. RSS 1.0, RSS 2.0, ATOM 1.0. The feed generator and OpenSearch call on this class so feed contents are uniform for both.

Author:
Larry Stone

Field Summary
static String MSG_FEED_DESCRIPTION
           
static String MSG_FEED_TITLE
           
static String MSG_LOGO_TITLE
           
static String MSG_METADATA
           
static String MSG_UITYPE
           
static String MSG_UNTITLED
          i18n key values
static String UITYPE_JSPUI
           
static String UITYPE_XMLUI
           
 
Constructor Summary
SyndicationFeed(String ui)
          Constructor.
 
Method Summary
 void addModule(com.sun.syndication.feed.module.Module m)
           
static String[] getDescriptionSelectors()
          Returns list of metadata selectors used to compose the description element
 void output(Writer writer)
          send the output to designated Writer
 String outputString()
           
 Document outputW3CDom()
           
 void populate(javax.servlet.http.HttpServletRequest request, DSpaceObject dso, DSpaceObject[] items, Map<String,String> labels)
          Fills in the feed and entry-level metadata from DSpace objects.
 void setType(String feedType)
          Sets the feed type for XML delivery, e.g.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MSG_UNTITLED

public static final String MSG_UNTITLED
i18n key values

See Also:
Constant Field Values

MSG_LOGO_TITLE

public static final String MSG_LOGO_TITLE
See Also:
Constant Field Values

MSG_FEED_TITLE

public static final String MSG_FEED_TITLE
See Also:
Constant Field Values

MSG_FEED_DESCRIPTION

public static final String MSG_FEED_DESCRIPTION
See Also:
Constant Field Values

MSG_METADATA

public static final String MSG_METADATA
See Also:
Constant Field Values

MSG_UITYPE

public static final String MSG_UITYPE
See Also:
Constant Field Values

UITYPE_XMLUI

public static final String UITYPE_XMLUI
See Also:
Constant Field Values

UITYPE_JSPUI

public static final String UITYPE_JSPUI
See Also:
Constant Field Values
Constructor Detail

SyndicationFeed

public SyndicationFeed(String ui)
Constructor.

Parameters:
ui - either "xmlui" or "jspui"
Method Detail

getDescriptionSelectors

public static String[] getDescriptionSelectors()
Returns list of metadata selectors used to compose the description element

Returns:
selector list - format 'schema.element[.qualifier]'

populate

public void populate(javax.servlet.http.HttpServletRequest request,
                     DSpaceObject dso,
                     DSpaceObject[] items,
                     Map<String,String> labels)
Fills in the feed and entry-level metadata from DSpace objects.


setType

public void setType(String feedType)
Sets the feed type for XML delivery, e.g. "rss_1.0", "atom_1.0" Must match one of ROME's configured generators, see rome.properties (currently rss_1.0, rss_2.0, atom_1.0, atom_0.3)


outputW3CDom

public Document outputW3CDom()
                      throws com.sun.syndication.io.FeedException
Returns:
the feed we built as DOM Document
Throws:
com.sun.syndication.io.FeedException

outputString

public String outputString()
                    throws com.sun.syndication.io.FeedException
Returns:
the feed we built as serialized XML string
Throws:
com.sun.syndication.io.FeedException

output

public void output(Writer writer)
            throws com.sun.syndication.io.FeedException,
                   IOException
send the output to designated Writer

Throws:
com.sun.syndication.io.FeedException
IOException

addModule

public void addModule(com.sun.syndication.feed.module.Module m)


Copyright © 2010 DuraSpace. All Rights Reserved.