public class PodcastServiceImpl extends Object implements org.sakaiproject.api.app.podcasts.PodcastService
| Modifier and Type | Field and Description |
|---|---|
protected String |
m_relativeAccessPoint
Needed for when Notification implemented *
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPodcast(String title,
Date displayDate,
String description,
byte[] body,
String filename,
String contentType)
Add a podcast to the site's resources
|
boolean |
allowAccess(String id)
Determines if authenticated user has 'read' access to podcast collection folder
|
boolean |
allowOptions(int option) |
void |
cancelContentCollection(org.sakaiproject.content.api.ContentCollectionEdit cce)
Cancels attempt at changing this collection (releases the lock)
|
List |
checkDISPLAY_DATE(List resourcesList)
Checks if podcast resources have a DISPLAY_DATE set.
|
List |
checkDISPLAY_DATE(List resourcesList,
String siteId) |
boolean |
checkForActualPodcasts()
Determines if folder contains actual files
|
boolean |
checkPodcastFolder()
Tests whether the podcasts folder exists and create it if it does not
|
void |
commitContentCollection(org.sakaiproject.content.api.ContentCollectionEdit cce)
Commits changes to ContentHosting (releases the lock)
|
void |
destroy() |
protected void |
enablePodcastSecurityAdvisor()
Establish a security advisor to allow the "embedded" azg work to occur
with no need for additional security permissions.
|
List |
filterPodcasts(List resourcesList)
Returns only those podcasts whose DISPLAY_DATE property is today or earlier
|
List |
filterPodcasts(List resourcesList,
String siteId)
Returns only those podcasts whose DISPLAY_DATE property is today or earlier
This version for feed so can pass siteId
|
List |
filterResources(List resourcesList)
Remove non-file resources from list of potential podcasts and
files restricted to groups user not part of
|
List |
filterResources(List resourcesList,
String siteId) |
org.sakaiproject.content.api.ContentCollection |
getContentCollection(String siteId)
Get ContentCollection object for podcasts
|
org.sakaiproject.content.api.ContentCollectionEdit |
getContentCollectionEditable(String siteId)
Get ContentCollection object for podcasts
|
org.sakaiproject.time.api.Time |
getDISPLAY_DATE(org.sakaiproject.entity.api.ResourceProperties rp)
If Release Date property not set, check if DISPLAY_DATE exists
and if it does, return it so it can be set as the Release Date.
|
Date |
getGMTdate(long date)
Returns the date set in GMT time
|
int |
getOptions()
Returns (from content hosting) whether the podcast folder is PUBLIC or
SITE
|
String |
getPodcastFileURL(String resourceId)
Returns the file's URL
|
List |
getPodcasts()
Retrieve Podcasts for site and if podcast folder does not exist, create
it.
|
List |
getPodcasts(String siteId)
Retrieve Podcasts for site and if podcast folder does not exist, create
it.
|
String |
getPodcastsFolderRef()
Returns a reference to Podcasts folder in Resources to pass to
permissions page.
|
String |
getSiteId()
Retrieve the site id
|
String |
getSiteURL()
Returns the site URL as a string
|
String |
getUserId()
Retrieve the current user id
|
String |
getUserName()
Retrieve the current user display name
|
void |
init()
FUTURE: needed to implement Notification services
|
boolean |
isPodcastFolderHidden(String siteId)
Returns TRUE if Podcasts folder has HIDDEN property set
OR release date is in the future
OR retract date is in the past
05/08 - enable security advisor since if folder is truly
hidden and a student/access user attempts to access it will
generate a Permissions error
|
boolean |
isPublic(String podcastFolderId)
Returns boolean TRUE = Display to non-members FALSE - Display to Site
|
void |
removePodcast(String resourceId)
Removes a podcast
|
String |
retrievePodcastFolderId(String siteId)
Returns podcast folder id using either 'podcasts' or 'Podcasts'.
|
void |
reviseOptions(boolean option)
Changes the podcast folder view status (either PUBLIC or SITE)
|
void |
revisePodcast(String resourceId,
String title,
Date date,
String description,
byte[] body,
String filename)
Will apply changes made (if any) to podcast
|
void |
setContentHostingService(org.sakaiproject.content.api.ContentHostingService chs)
Injects ContentHostingService into this service
|
org.sakaiproject.content.api.ContentResource |
setDISPLAY_DATE(String siteId,
String resourceId,
org.sakaiproject.time.api.Time releaseDate) |
org.sakaiproject.content.api.ContentResource |
setDISPLAY_DATE(String resourceId,
org.sakaiproject.time.api.Time releaseDate)
Sets the DISPLAY_DATE property to the creation date of the podcast.
|
void |
setEventTrackingService(org.sakaiproject.event.api.EventTrackingService ets)
Injects the EventTrackingService into this service
|
void |
setPodcastPermissionsService(org.sakaiproject.api.app.podcasts.PodcastPermissionsService podcastPermissionsService)
Injects PodcastAuthzService into this service
|
void |
setSecurityService(org.sakaiproject.authz.api.SecurityService ss)
Injects the SecurityService into this service
|
void |
setSessionManager(org.sakaiproject.tool.api.SessionManager sm)
Injects the SessionManager into this service
|
void |
setSiteService(org.sakaiproject.site.api.SiteService ss)
Injects the SiteService into this service
|
void |
setTimeService(org.sakaiproject.time.api.TimeService ts)
Injects the TimeService into this service
|
void |
setToolManager(org.sakaiproject.tool.api.ToolManager tm)
Injects ToolManager into this service
|
void |
setUserDirectoryService(org.sakaiproject.user.api.UserDirectoryService uds)
Injects the UserDirectoryService into this service
|
protected String m_relativeAccessPoint
public void setContentHostingService(org.sakaiproject.content.api.ContentHostingService chs)
setContentHostingService in interface org.sakaiproject.api.app.podcasts.PodcastServicepublic void setToolManager(org.sakaiproject.tool.api.ToolManager tm)
setToolManager in interface org.sakaiproject.api.app.podcasts.PodcastServicepublic void setUserDirectoryService(org.sakaiproject.user.api.UserDirectoryService uds)
public void setSessionManager(org.sakaiproject.tool.api.SessionManager sm)
public void setTimeService(org.sakaiproject.time.api.TimeService ts)
public void setSecurityService(org.sakaiproject.authz.api.SecurityService ss)
public void setSiteService(org.sakaiproject.site.api.SiteService ss)
public void setEventTrackingService(org.sakaiproject.event.api.EventTrackingService ets)
public void setPodcastPermissionsService(org.sakaiproject.api.app.podcasts.PodcastPermissionsService podcastPermissionsService)
public String getSiteId()
getSiteId in interface org.sakaiproject.api.app.podcasts.PodcastServicepublic String getUserId()
getUserId in interface org.sakaiproject.api.app.podcasts.PodcastServicepublic String getUserName()
getUserName in interface org.sakaiproject.api.app.podcasts.PodcastServicepublic String getSiteURL()
public List filterPodcasts(List resourcesList)
filterPodcasts in interface org.sakaiproject.api.app.podcasts.PodcastServiceresourcesList - List of podcastspublic List filterPodcasts(List resourcesList, String siteId)
filterPodcasts in interface org.sakaiproject.api.app.podcasts.PodcastServiceresourcesList - List of podcastspublic org.sakaiproject.content.api.ContentCollection getContentCollection(String siteId) throws org.sakaiproject.exception.IdUnusedException, org.sakaiproject.exception.PermissionException
getContentCollection in interface org.sakaiproject.api.app.podcasts.PodcastServiceString - The siteId to grab the correct podcastsorg.sakaiproject.exception.IdUnusedExceptionorg.sakaiproject.exception.PermissionExceptionpublic org.sakaiproject.content.api.ContentCollectionEdit getContentCollectionEditable(String siteId) throws org.sakaiproject.exception.IdUnusedException, org.sakaiproject.exception.PermissionException, org.sakaiproject.exception.InUseException
getContentCollectionEditable in interface org.sakaiproject.api.app.podcasts.PodcastServiceString - The siteId to grab the correct podcastsorg.sakaiproject.exception.IdUnusedExceptionorg.sakaiproject.exception.PermissionExceptionorg.sakaiproject.exception.InUseExceptionpublic String getPodcastsFolderRef()
getPodcastsFolderRef in interface org.sakaiproject.api.app.podcasts.PodcastServicepublic List filterResources(List resourcesList)
resourcesList - The list of potential podcastspublic String retrievePodcastFolderId(String siteId) throws org.sakaiproject.exception.PermissionException
retrievePodcastFolderId in interface org.sakaiproject.api.app.podcasts.PodcastServicesiteId - The site to searchorg.sakaiproject.exception.PermissionException - Access denied or Not found so not availableorg.sakaiproject.exception.IdInvalidException - Constructed Id not validorg.sakaiproject.exception.IdUsedException - When attempting to create Podcast folder, id is a duplicatepublic List getPodcasts() throws org.sakaiproject.exception.PermissionException, org.sakaiproject.exception.InUseException, org.sakaiproject.exception.IdInvalidException, org.sakaiproject.exception.InconsistentException, org.sakaiproject.exception.IdUsedException
getPodcasts in interface org.sakaiproject.api.app.podcasts.PodcastServiceorg.sakaiproject.exception.PermissionExceptionorg.sakaiproject.exception.InUseExceptionorg.sakaiproject.exception.IdInvalidExceptionorg.sakaiproject.exception.InconsistentExceptionorg.sakaiproject.exception.IdUsedExceptionpublic List getPodcasts(String siteId) throws org.sakaiproject.exception.PermissionException, org.sakaiproject.exception.InUseException, org.sakaiproject.exception.IdInvalidException, org.sakaiproject.exception.InconsistentException, org.sakaiproject.exception.IdUsedException
getPodcasts in interface org.sakaiproject.api.app.podcasts.PodcastServiceString - The siteId the feed needs the podcasts fromorg.sakaiproject.exception.PermissionExceptionorg.sakaiproject.exception.InUseExceptionorg.sakaiproject.exception.IdInvalidExceptionorg.sakaiproject.exception.InconsistentExceptionorg.sakaiproject.exception.IdUsedExceptionpublic void addPodcast(String title, Date displayDate, String description, byte[] body, String filename, String contentType) throws org.sakaiproject.exception.OverQuotaException, org.sakaiproject.exception.ServerOverloadException, org.sakaiproject.exception.InconsistentException, org.sakaiproject.exception.IdInvalidException, org.sakaiproject.exception.IdLengthException, org.sakaiproject.exception.PermissionException, org.sakaiproject.exception.IdUniquenessException
addPodcast in interface org.sakaiproject.api.app.podcasts.PodcastServicetitle - The title of this podcast resourcedisplayDate - The display date for this podcast resourcedescription - The description of this podcast resourcebody - The bytes of this podcastorg.sakaiproject.exception.OverQuotaException - To display Over Quota Alert to userorg.sakaiproject.exception.ServerOverloadException - To display Internal Server Error Alert to userorg.sakaiproject.exception.InconsistentException - To display Internal Server Error Alert to userorg.sakaiproject.exception.IdInvalidException - To display Invalid Id Alert to userorg.sakaiproject.exception.IdLengthException - To display File path too long Alert to userorg.sakaiproject.exception.PermissionException - To display Permission denied Alert to userorg.sakaiproject.exception.IdUniquenessException - To display Duplicate id used Alert to userpublic void removePodcast(String resourceId) throws org.sakaiproject.exception.IdUnusedException, org.sakaiproject.exception.InUseException, org.sakaiproject.exception.TypeException, org.sakaiproject.exception.PermissionException
removePodcast in interface org.sakaiproject.api.app.podcasts.PodcastServiceid - The podcast to be removed from ContentHostingorg.sakaiproject.exception.IdUnusedExceptionorg.sakaiproject.exception.InUseExceptionorg.sakaiproject.exception.TypeExceptionorg.sakaiproject.exception.PermissionExceptionpublic boolean checkPodcastFolder()
throws org.sakaiproject.exception.PermissionException,
org.sakaiproject.exception.InUseException
checkPodcastFolder in interface org.sakaiproject.api.app.podcasts.PodcastServiceorg.sakaiproject.exception.PermissionExceptionorg.sakaiproject.exception.InUseExceptionpublic boolean checkForActualPodcasts()
checkForActualPodcasts in interface org.sakaiproject.api.app.podcasts.PodcastServicepublic void revisePodcast(String resourceId, String title, Date date, String description, byte[] body, String filename) throws org.sakaiproject.exception.PermissionException, org.sakaiproject.exception.InUseException, org.sakaiproject.exception.OverQuotaException, org.sakaiproject.exception.ServerOverloadException
revisePodcast in interface org.sakaiproject.api.app.podcasts.PodcastServiceString - The resourceIdString - The titleDate - The display/publish dateString - The descriptionbyte[] - The actual file contentsString - The filenameorg.sakaiproject.exception.PermissionExceptionorg.sakaiproject.exception.InUseExceptionorg.sakaiproject.exception.OverQuotaExceptionorg.sakaiproject.exception.ServerOverloadExceptionpublic List checkDISPLAY_DATE(List resourcesList)
checkDISPLAY_DATE in interface org.sakaiproject.api.app.podcasts.PodcastServiceList - The list of podcast resourcespublic org.sakaiproject.content.api.ContentResource setDISPLAY_DATE(String resourceId, org.sakaiproject.time.api.Time releaseDate)
ResourceProperties - The ResourceProperties that need DISPLAY_DATE addedpublic org.sakaiproject.content.api.ContentResource setDISPLAY_DATE(String siteId, String resourceId, org.sakaiproject.time.api.Time releaseDate)
public org.sakaiproject.time.api.Time getDISPLAY_DATE(org.sakaiproject.entity.api.ResourceProperties rp)
ResourceProperties - The ResourceProperties to get DISPLAY_DATE frompublic String getPodcastFileURL(String resourceId) throws org.sakaiproject.exception.PermissionException, org.sakaiproject.exception.IdUnusedException
getPodcastFileURL in interface org.sakaiproject.api.app.podcasts.PodcastServiceString - The resource Idorg.sakaiproject.exception.PermissionExceptionorg.sakaiproject.exception.IdUnusedExceptionpublic void init()
public void destroy()
public void reviseOptions(boolean option)
reviseOptions in interface org.sakaiproject.api.app.podcasts.PodcastServiceboolean - True means PUBLIC view, FALSE means privatepublic int getOptions()
getOptions in interface org.sakaiproject.api.app.podcasts.PodcastServicepublic void commitContentCollection(org.sakaiproject.content.api.ContentCollectionEdit cce)
commitContentCollection in interface org.sakaiproject.api.app.podcasts.PodcastServiceContentCollectionEdit - The ContentCollection to be savedpublic void cancelContentCollection(org.sakaiproject.content.api.ContentCollectionEdit cce)
cancelContentCollection in interface org.sakaiproject.api.app.podcasts.PodcastServicecce - The ContentCollectionEdit that is not to be changedpublic boolean isPublic(String podcastFolderId)
isPublic in interface org.sakaiproject.api.app.podcasts.PodcastServicepodcastFolderId - The podcast folder id to checkpublic boolean isPodcastFolderHidden(String siteId) throws org.sakaiproject.exception.IdUnusedException, org.sakaiproject.exception.PermissionException
isPodcastFolderHidden in interface org.sakaiproject.api.app.podcasts.PodcastServiceorg.sakaiproject.exception.IdUnusedExceptionorg.sakaiproject.exception.PermissionExceptionpublic Date getGMTdate(long date)
getGMTdate in interface org.sakaiproject.api.app.podcasts.PodcastServicedate - The date represented as a long valuepublic boolean allowAccess(String id)
allowAccess in interface org.sakaiproject.api.app.podcasts.PodcastServiceid - The id for the podcast collection folderprotected void enablePodcastSecurityAdvisor()
public boolean allowOptions(int option)
allowOptions in interface org.sakaiproject.api.app.podcasts.PodcastServiceCopyright © 2004-2015 Sakai Project. All Rights Reserved.