public class BasicNewsService extends Object implements org.sakaiproject.news.api.NewsService, org.sakaiproject.entity.api.EntityTransferrer
BasicNewsService implements the NewsService using the Rome RSS package.
| Modifier and Type | Field and Description |
|---|---|
static String |
ATTR_TOP_REFRESH |
protected static int |
DEFAULT_EXPIRATION |
protected org.sakaiproject.memory.api.MemoryService |
m_memoryService
Dependency: MemoryService.
|
protected org.sakaiproject.memory.api.Cache |
m_storage |
| Constructor and Description |
|---|
BasicNewsService() |
| Modifier and Type | Method and Description |
|---|---|
String |
archive(String siteId,
Document doc,
Stack stack,
String arg3,
List attachments) |
void |
destroy()
Returns to uninitialized state.
|
org.sakaiproject.news.api.NewsChannel |
getChannel(String source)
Retrieves a NewsChannel object indexed by a URL.
|
org.sakaiproject.entity.api.Entity |
getEntity(org.sakaiproject.entity.api.Reference ref) |
Collection |
getEntityAuthzGroups(org.sakaiproject.entity.api.Reference ref) |
Collection |
getEntityAuthzGroups(org.sakaiproject.entity.api.Reference ref,
String userId) |
String |
getEntityDescription(org.sakaiproject.entity.api.Reference ref) |
org.sakaiproject.entity.api.ResourceProperties |
getEntityResourceProperties(org.sakaiproject.entity.api.Reference ref) |
String |
getEntityUrl(org.sakaiproject.entity.api.Reference ref) |
org.sakaiproject.entity.api.HttpAccess |
getHttpAccess() |
String |
getLabel() |
List |
getNewsitems(String source)
Retrieves a list of items from an rss feed.
|
List |
getNewsitems(String source,
org.sakaiproject.javax.Filter filter)
Retrieves a list of items from an rss feed.
|
protected String |
getUserAgent()
Get the user agent to use for web requests.
|
void |
init()
Final initialization, once all dependencies are set.
|
boolean |
isUpdateAvailable(String source)
Checks whether an update is available for the rss news feed.
|
String |
merge(String siteId,
Element root,
String archivePath,
String fromSiteId,
Map attachmentNames,
Map userIdTrans,
Set userListAllowImport) |
String[] |
myToolIds() |
boolean |
parseEntityReference(String reference,
org.sakaiproject.entity.api.Reference ref) |
void |
removeChannel(String source)
Removes a NewsChannel object from the service.
|
void |
setMemoryService(org.sakaiproject.memory.api.MemoryService service)
Dependency: MemoryService.
|
void |
transferCopyEntities(String fromContext,
String toContext,
List ids) |
void |
transferCopyEntities(String fromContext,
String toContext,
List ids,
boolean cleanup) |
String |
trimToNull(String value) |
protected void |
updateChannel(String source)
Checks whether channel is cached.
|
boolean |
willArchiveMerge() |
boolean |
willImport() |
public static final String ATTR_TOP_REFRESH
protected static final int DEFAULT_EXPIRATION
protected org.sakaiproject.memory.api.Cache m_storage
protected org.sakaiproject.memory.api.MemoryService m_memoryService
public void setMemoryService(org.sakaiproject.memory.api.MemoryService service)
service - The MemoryService.public void init()
public void destroy()
protected void updateChannel(String source) throws org.sakaiproject.news.api.NewsConnectionException, org.sakaiproject.news.api.NewsFormatException
Checks whether channel is cached. If not or if it's expired, retrieve the feed and update the cache
source - The url for the news feedNewsConnectionException, - for errors making the connection.NewsFormatException, - for errors in the URL or errors parsing the feed.org.sakaiproject.news.api.NewsConnectionExceptionorg.sakaiproject.news.api.NewsFormatExceptionpublic List getNewsitems(String source) throws org.sakaiproject.news.api.NewsConnectionException, org.sakaiproject.news.api.NewsFormatException
getNewsitems in interface org.sakaiproject.news.api.NewsServicesource - The url for the feed.NewsConnectionException, - for errors making the connection.NewsFormatException, - for errors in the URL or errors parsing the feed.org.sakaiproject.news.api.NewsConnectionExceptionorg.sakaiproject.news.api.NewsFormatExceptionpublic List getNewsitems(String source, org.sakaiproject.javax.Filter filter) throws org.sakaiproject.news.api.NewsConnectionException, org.sakaiproject.news.api.NewsFormatException
getNewsitems in interface org.sakaiproject.news.api.NewsServicesource - The url for the feed.filter - A filtering object to accept NewsItems, or null if no filtering is desired.NewsConnectionException, - for errors making the connection.NewsFormatException, - for errors in the URL or errors parsing the feed.org.sakaiproject.news.api.NewsConnectionExceptionorg.sakaiproject.news.api.NewsFormatExceptionpublic boolean isUpdateAvailable(String source)
isUpdateAvailable in interface org.sakaiproject.news.api.NewsServicesource - The url for the feed.NewsConnectionException, - for errors making the connection.NewsFormatException, - for errors in the URL or errors parsing the feed.public org.sakaiproject.news.api.NewsChannel getChannel(String source) throws org.sakaiproject.news.api.NewsConnectionException, org.sakaiproject.news.api.NewsFormatException
getChannel in interface org.sakaiproject.news.api.NewsServicesource - The url for the channel.NewsConnectionException, - for errors making the connection.NewsFormatException, - for errors in the URL or errors parsing the feed.org.sakaiproject.news.api.NewsConnectionExceptionorg.sakaiproject.news.api.NewsFormatExceptionpublic void removeChannel(String source)
removeChannel in interface org.sakaiproject.news.api.NewsServicesource - The url for the channel.public String getEntityUrl(org.sakaiproject.entity.api.Reference ref)
getEntityUrl in interface org.sakaiproject.entity.api.EntityProducerpublic boolean willArchiveMerge()
willArchiveMerge in interface org.sakaiproject.entity.api.EntityProducerpublic boolean willImport()
public org.sakaiproject.entity.api.HttpAccess getHttpAccess()
getHttpAccess in interface org.sakaiproject.entity.api.EntityProducerpublic String getEntityDescription(org.sakaiproject.entity.api.Reference ref)
getEntityDescription in interface org.sakaiproject.entity.api.EntityProducerpublic org.sakaiproject.entity.api.ResourceProperties getEntityResourceProperties(org.sakaiproject.entity.api.Reference ref)
getEntityResourceProperties in interface org.sakaiproject.entity.api.EntityProducerpublic org.sakaiproject.entity.api.Entity getEntity(org.sakaiproject.entity.api.Reference ref)
getEntity in interface org.sakaiproject.entity.api.EntityProducerpublic String merge(String siteId, Element root, String archivePath, String fromSiteId, Map attachmentNames, Map userIdTrans, Set userListAllowImport)
merge in interface org.sakaiproject.entity.api.EntityProducerpublic String archive(String siteId, Document doc, Stack stack, String arg3, List attachments)
archive in interface org.sakaiproject.entity.api.EntityProducerpublic void transferCopyEntities(String fromContext, String toContext, List ids)
transferCopyEntities in interface org.sakaiproject.entity.api.EntityTransferrerpublic String getLabel()
getLabel in interface org.sakaiproject.entity.api.EntityProducerpublic Collection getEntityAuthzGroups(org.sakaiproject.entity.api.Reference ref)
public Collection getEntityAuthzGroups(org.sakaiproject.entity.api.Reference ref, String userId)
getEntityAuthzGroups in interface org.sakaiproject.entity.api.EntityProducerpublic String[] myToolIds()
myToolIds in interface org.sakaiproject.entity.api.EntityTransferrerpublic boolean parseEntityReference(String reference, org.sakaiproject.entity.api.Reference ref)
parseEntityReference in interface org.sakaiproject.entity.api.EntityProducerpublic void transferCopyEntities(String fromContext, String toContext, List ids, boolean cleanup)
transferCopyEntities in interface org.sakaiproject.entity.api.EntityTransferrerprotected String getUserAgent()
Copyright © 2003-2015 University of Michigan. All Rights Reserved.