Package org.dspace.app.util
Class SyndicationFeed
java.lang.Object
org.dspace.app.util.SyndicationFeed
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
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringprotected CollectionServiceprotected CommunityServiceprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected com.rometools.rome.feed.synd.SyndFeedprotected ItemServiceprotected final org.apache.logging.log4j.Loggerstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringi18n key valuesprotected String[]protected jakarta.servlet.http.HttpServletRequestprotected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddModule(com.rometools.rome.feed.module.Module m) Add a ROME plugin module (e.g. for OpenSearch) at the feed level.protected static StringgetDefaultedConfiguration(String key, String dfl) protected Stringprotected Stringvoidsend the output to designated Writervoidpopulate(jakarta.servlet.http.HttpServletRequest request, Context context, IndexableObject dso, List<IndexableObject> items) Fills in the feed and entry-level metadata from DSpace objects.protected StringresolveURL(jakarta.servlet.http.HttpServletRequest request, DSpaceObject dso) Return a url to the DSpace object, either use the official handle for the item or build a url based upon the current server.voidSets the feed type for XML delivery, e.g.protected StringurlOfBitstream(jakarta.servlet.http.HttpServletRequest request, Bitstream logo)
-
Field Details
-
log
protected final org.apache.logging.log4j.Logger log -
MSG_UNTITLED
i18n key values- See Also:
-
MSG_LOGO_TITLE
- See Also:
-
MSG_FEED_TITLE
- See Also:
-
MSG_FEED_DESCRIPTION
- See Also:
-
MSG_METADATA
- See Also:
-
defaultTitleField
-
defaultDescriptionField
-
defaultAuthorField
-
defaultDateField
-
defaultExternalMedia
-
titleField
-
dateField
-
authorField
-
externalSourceField
-
dcCreatorField
-
dcDateField
-
dcDescriptionField
-
podcastableMIMETypes
-
feed
protected com.rometools.rome.feed.synd.SyndFeed feed -
request
protected jakarta.servlet.http.HttpServletRequest request -
collectionService
-
communityService
-
itemService
-
baseURL
-
-
Constructor Details
-
SyndicationFeed
public SyndicationFeed()
-
-
Method Details
-
populate
public void populate(jakarta.servlet.http.HttpServletRequest request, Context context, IndexableObject dso, List<IndexableObject> items) Fills in the feed and entry-level metadata from DSpace objects.- Parameters:
request- requestcontext- contextdso- the scopeitems- array of objects
-
setType
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)- Parameters:
feedType- feed type
-
outputW3CDom
- Returns:
- the feed we built as DOM Document
- Throws:
com.rometools.rome.io.FeedException- if feed error
-
outputString
- Returns:
- the feed we built as serialized XML string
- Throws:
com.rometools.rome.io.FeedException- if feed error
-
output
send the output to designated Writer- Parameters:
writer- Writer- Throws:
com.rometools.rome.io.FeedException- if feed errorIOException- if IO error
-
addModule
public void addModule(com.rometools.rome.feed.module.Module m) Add a ROME plugin module (e.g. for OpenSearch) at the feed level.- Parameters:
m- module
-
getDefaultedConfiguration
-
urlOfBitstream
-
resolveURL
Return a url to the DSpace object, either use the official handle for the item or build a url based upon the current server. If the dspaceobject is null then a local url to the repository is generated.- Parameters:
request- current servlet requestdso- The object to reference, null if to the repository.- Returns:
- URL
-
localize
-
getOneDC
-