public abstract class BaseAnnouncementService
extends org.sakaiproject.message.util.BaseMessage
implements org.sakaiproject.announcement.api.AnnouncementService, org.sakaiproject.entity.api.ContextObserver, org.sakaiproject.entity.api.EntityTransferrer, org.sakaiproject.entity.api.EntityTransferrerRefMigrator
BaseAnnouncementService extends the BaseMessage for the specifics of Announcement.
| Modifier and Type | Class and Description |
|---|---|
class |
BaseAnnouncementService.BaseAnnouncementChannelEdit
AnnouncementChannel implementation
|
class |
BaseAnnouncementService.BaseAnnouncementMessageEdit
AnnouncementMessage implementation
|
class |
BaseAnnouncementService.BaseAnnouncementMessageHeaderEdit
AnnouncementMessageHeaderEdit implementation
|
protected class |
BaseAnnouncementService.PrivacyFilter
A filter that will reject announcement message drafts not from the current user, and otherwise use another filter, if defined, for acceptance.
|
org.sakaiproject.message.util.BaseMessage.BaseMessageChannelEdit, org.sakaiproject.message.util.BaseMessage.BaseMessageEdit, org.sakaiproject.message.util.BaseMessage.BaseMessageHeaderEdit, org.sakaiproject.message.util.BaseMessage.MessagePermissionFilter, org.sakaiproject.message.util.BaseMessage.MessageSelectionFilter, org.sakaiproject.message.util.BaseMessage.NotifyThread, org.sakaiproject.message.util.BaseMessage.PublicFilter, org.sakaiproject.message.util.BaseMessage.Storage| Modifier and Type | Field and Description |
|---|---|
protected org.sakaiproject.event.api.NotificationService |
m_notificationService
Dependency: NotificationService.
|
protected static org.sakaiproject.util.ResourceLoader |
rb
Messages, for the http access.
|
m_authzGroupService, m_entityManager, m_eventTrackingService, m_idManager, m_memoryService, m_securityService, m_serverConfigurationService, m_sessionManager, m_siteService, m_storage, m_threadLocalManager, m_timeService, m_userDirectoryServiceANNOUNCEMENT_CHANNEL_PROPERTY, APPLICATION_ID, ASSIGNMENT_REFERENCE, EVENT_ANNC_UPDATE_ACCESS, EVENT_ANNC_UPDATE_AVAILABILITY, EVENT_ANNC_UPDATE_TITLE, MOD_DATE, REF_TYPE_ANNOUNCEMENT, REF_TYPE_ANNOUNCEMENT_RSS, REFERENCE_ROOT, RELEASE_DATE, RETRACT_DATE, SECURE_ANNC_ADD, SECURE_ANNC_ALL_GROUPS, SECURE_ANNC_READ, SECURE_ANNC_READ_DRAFT, SECURE_ANNC_REMOVE_ANY, SECURE_ANNC_REMOVE_OWN, SECURE_ANNC_ROOT, SECURE_ANNC_UPDATE_ANY, SECURE_ANNC_UPDATE_OWN| Constructor and Description |
|---|
BaseAnnouncementService() |
| Modifier and Type | Method and Description |
|---|---|
org.sakaiproject.announcement.api.AnnouncementChannelEdit |
addAnnouncementChannel(String ref)
Add a new announcement channel.
|
String |
channelReference(String context,
String id) |
void |
clearMessagesCache(String channelRef) |
void |
contextCreated(String context,
boolean toolPlacement) |
void |
contextDeleted(String context,
boolean toolPlacement) |
void |
contextUpdated(String context,
boolean toolPlacement) |
protected String |
eventId(String secure)
Form a tracking event string based on a security function string.
|
protected Element |
generateItemElement(Document doc,
org.sakaiproject.announcement.api.AnnouncementMessage msg,
org.sakaiproject.entity.api.Reference msgRef)
Generate RSS Item element for specified assignment
|
org.sakaiproject.announcement.api.AnnouncementChannel |
getAnnouncementChannel(String ref)
Return a specific announcement channel.
|
org.sakaiproject.entity.api.Reference |
getAnnouncementReference(String context) |
org.sakaiproject.time.api.Time |
getDate(org.sakaiproject.entity.api.Entity r)
Access the resource date.
|
org.sakaiproject.entity.api.HttpAccess |
getHttpAccess() |
String |
getLabel() |
Integer |
getMessage_order(org.sakaiproject.entity.api.Entity r)
Access the resource Message Order.
|
List |
getMessages(String channelReference,
org.sakaiproject.javax.Filter filter,
boolean order,
boolean merged)
Return a list of messages from the provided channel (merged flag returns merged messages)
|
String |
getOwnerId(org.sakaiproject.entity.api.Entity r)
Access the resource owner user id.
|
protected String |
getReferenceRoot()
Return the reference rooot for use in resource references and urls.
|
String |
getRssUrl(org.sakaiproject.entity.api.Reference ref) |
String |
getSummarizableReference(String siteId,
String toolIdentifier) |
protected String |
getSummaryFromHeader(org.sakaiproject.message.api.Message item,
org.sakaiproject.message.api.MessageHeader header)
getSummaryFromHeader implementation
|
void |
init()
Final initialization, once all dependencies are set.
|
boolean |
isDraft(org.sakaiproject.entity.api.Entity r)
Check if this resource is in draft mode.
|
boolean |
isMessageViewable(org.sakaiproject.announcement.api.AnnouncementMessage message) |
String[] |
myToolIds() |
org.sakaiproject.entity.api.Entity |
newContainer(Element element)
Construct a new container resource, from an XML element.
|
org.sakaiproject.entity.api.Entity |
newContainer(org.sakaiproject.entity.api.Entity other)
Construct a new container resource, as a copy of another
|
org.sakaiproject.entity.api.Entity |
newContainer(String ref)
Construct a new continer given just ids.
|
org.sakaiproject.entity.api.Edit |
newContainerEdit(Element element)
Construct a new container resource, from an XML element.
|
org.sakaiproject.entity.api.Edit |
newContainerEdit(org.sakaiproject.entity.api.Entity other)
Construct a new container resource, as a copy of another
|
org.sakaiproject.entity.api.Edit |
newContainerEdit(String ref)
Construct a new continer given just ids.
|
protected org.sakaiproject.message.api.MessageHeaderEdit |
newMessageHeader(org.sakaiproject.message.api.Message msg,
Element el)
Construct a new message header from XML in a DOM element.
|
protected org.sakaiproject.message.api.MessageHeaderEdit |
newMessageHeader(org.sakaiproject.message.api.Message msg,
org.sakaiproject.message.api.MessageHeader other)
Construct a new message header as a copy of another.
|
protected org.sakaiproject.message.api.MessageHeaderEdit |
newMessageHeader(org.sakaiproject.message.api.Message msg,
String id)
Construct a new message header from XML in a DOM element.
|
org.sakaiproject.entity.api.Entity |
newResource(org.sakaiproject.entity.api.Entity container,
Element element)
Construct a new resource, from an XML element.
|
org.sakaiproject.entity.api.Entity |
newResource(org.sakaiproject.entity.api.Entity container,
org.sakaiproject.entity.api.Entity other)
Construct a new resource from another resource of the same type.
|
org.sakaiproject.entity.api.Entity |
newResource(org.sakaiproject.entity.api.Entity container,
String id,
Object[] others)
Construct a new rsource given just an id.
|
org.sakaiproject.entity.api.Edit |
newResourceEdit(org.sakaiproject.entity.api.Entity container,
Element element)
Construct a new resource, from an XML element.
|
org.sakaiproject.entity.api.Edit |
newResourceEdit(org.sakaiproject.entity.api.Entity container,
org.sakaiproject.entity.api.Entity other)
Construct a new resource from another resource of the same type.
|
org.sakaiproject.entity.api.Edit |
newResourceEdit(org.sakaiproject.entity.api.Entity container,
String id,
Object[] others)
Construct a new rsource given just an id.
|
boolean |
parseEntityReference(String reference,
org.sakaiproject.entity.api.Reference ref) |
protected void |
printAnnouncementHtml(PrintWriter out,
org.sakaiproject.entity.api.Reference ref)
Print specified Announcement as HTML Page
|
protected void |
printAnnouncementRss(OutputStream out,
org.sakaiproject.entity.api.Reference rssRef)
Print all Announcements as RSS Feed
|
protected String |
serviceName()
Report the Service API name being implemented.
|
void |
setAliasService(org.sakaiproject.alias.api.AliasService aliasService) |
void |
setContentHostingService(org.sakaiproject.content.api.ContentHostingService service)
Dependency: contentHostingService.
|
void |
setFunctionManager(org.sakaiproject.authz.api.FunctionManager functionManager) |
void |
setNotificationService(org.sakaiproject.event.api.NotificationService service)
Dependency: NotificationService.
|
void |
setSecurityService(org.sakaiproject.authz.api.SecurityService securityService) |
void |
setSessionManager(org.sakaiproject.tool.api.SessionManager sessionManager) |
void |
setTimeService(org.sakaiproject.time.api.TimeService timeService) |
void |
setToolManager(org.sakaiproject.tool.api.ToolManager toolManager) |
Object[] |
storageFields(org.sakaiproject.entity.api.Entity r)
Collect the fields that need to be stored outside the XML (for the resource).
|
String[] |
summarizableToolIds() |
void |
transferCopyEntities(String fromContext,
String toContext,
List resourceIds) |
void |
transferCopyEntities(String fromContext,
String toContext,
List ids,
boolean cleanup) |
Map<String,String> |
transferCopyEntitiesRefMigrator(String fromContext,
String toContext,
List resourceIds) |
Map<String,String> |
transferCopyEntitiesRefMigrator(String fromContext,
String toContext,
List ids,
boolean cleanup) |
void |
updateEntityReferences(String toContext,
Map<String,String> transversalMap) |
addChannel, allowAddChannel, allowEditChannel, allowGetChannel, allowGetMessage, allowRemoveChannel, archive, archiveSynopticOptions, cancelChannel, cancelMessage, commitChannel, destroy, disableMessageChannel, editChannel, enableMessageChannel, filterGroupAccess, findChannel, getAccessPoint, getChannel, getChannelIds, getChannelPublic, getChannels, getEntity, getEntityAuthzGroups, getEntityDescription, getEntityResourceProperties, getEntityUrl, getGroupsAllowFunction, getMessage, getMessages, getSummary, isIntersectionGroupRefsToGroups, merge, messageReference, messageReference, newStorage, parseMergeChannelExtra, removeChannel, service, setAuthzGroupService, setCaching, setEntityManager, setEventTrackingService, setIdManager, setMemoryService, setServerConfigurationService, setSiteService, setThreadLocalManager, setUserDirectoryService, transferSynopticOptions, unlock, unlock2, unlock3, unlockCheck, unlockCheck2, unlockCheck3, willArchiveMergeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddChannel, allowAddChannel, allowEditChannel, allowGetChannel, allowRemoveChannel, cancelChannel, cancelMessage, commitChannel, editChannel, getChannel, getChannelIds, getChannelPublic, getChannels, getMessage, getMessages, getSummary, messageReference, messageReference, removeChannelprotected static org.sakaiproject.util.ResourceLoader rb
protected org.sakaiproject.event.api.NotificationService m_notificationService
public void setContentHostingService(org.sakaiproject.content.api.ContentHostingService service)
service - The NotificationService.public void setFunctionManager(org.sakaiproject.authz.api.FunctionManager functionManager)
public void setAliasService(org.sakaiproject.alias.api.AliasService aliasService)
public void setTimeService(org.sakaiproject.time.api.TimeService timeService)
setTimeService in class org.sakaiproject.message.util.BaseMessagepublic void setSessionManager(org.sakaiproject.tool.api.SessionManager sessionManager)
setSessionManager in class org.sakaiproject.message.util.BaseMessagepublic void setToolManager(org.sakaiproject.tool.api.ToolManager toolManager)
public void setSecurityService(org.sakaiproject.authz.api.SecurityService securityService)
setSecurityService in class org.sakaiproject.message.util.BaseMessagepublic void setNotificationService(org.sakaiproject.event.api.NotificationService service)
service - The NotificationService.public void init()
init in class org.sakaiproject.message.util.BaseMessagepublic org.sakaiproject.entity.api.Entity newContainer(String ref)
newContainer in interface org.sakaiproject.util.DoubleStorageUserref - The container reference.public org.sakaiproject.entity.api.Entity newContainer(Element element)
newContainer in interface org.sakaiproject.util.DoubleStorageUserelement - The XML.public org.sakaiproject.entity.api.Entity newContainer(org.sakaiproject.entity.api.Entity other)
newContainer in interface org.sakaiproject.util.DoubleStorageUserother - The other contianer to copy.public org.sakaiproject.entity.api.Entity newResource(org.sakaiproject.entity.api.Entity container,
String id,
Object[] others)
newResource in interface org.sakaiproject.util.SingleStorageUsercontainer - The Resource that is the container for the new resource (may be null).id - The id for the new object.others - (options) array of objects to load into the Resource's fields.public org.sakaiproject.entity.api.Entity newResource(org.sakaiproject.entity.api.Entity container,
Element element)
newResource in interface org.sakaiproject.util.SingleStorageUsercontainer - The Resource that is the container for the new resource (may be null).element - The XML.public org.sakaiproject.entity.api.Entity newResource(org.sakaiproject.entity.api.Entity container,
org.sakaiproject.entity.api.Entity other)
newResource in interface org.sakaiproject.util.SingleStorageUsercontainer - The Resource that is the container for the new resource (may be null).other - The other resource.public org.sakaiproject.entity.api.Edit newContainerEdit(String ref)
newContainerEdit in interface org.sakaiproject.util.DoubleStorageUserref - The container reference.public org.sakaiproject.entity.api.Edit newContainerEdit(Element element)
newContainerEdit in interface org.sakaiproject.util.DoubleStorageUserelement - The XML.public org.sakaiproject.entity.api.Edit newContainerEdit(org.sakaiproject.entity.api.Entity other)
newContainerEdit in interface org.sakaiproject.util.DoubleStorageUserother - The other contianer to copy.public org.sakaiproject.entity.api.Edit newResourceEdit(org.sakaiproject.entity.api.Entity container,
String id,
Object[] others)
newResourceEdit in interface org.sakaiproject.util.SingleStorageUsercontainer - The Resource that is the container for the new resource (may be null).id - The id for the new object.others - (options) array of objects to load into the Resource's fields.public org.sakaiproject.entity.api.Edit newResourceEdit(org.sakaiproject.entity.api.Entity container,
Element element)
newResourceEdit in interface org.sakaiproject.util.SingleStorageUsercontainer - The Resource that is the container for the new resource (may be null).element - The XML.public org.sakaiproject.entity.api.Edit newResourceEdit(org.sakaiproject.entity.api.Entity container,
org.sakaiproject.entity.api.Entity other)
newResourceEdit in interface org.sakaiproject.util.SingleStorageUsercontainer - The Resource that is the container for the new resource (may be null).other - The other resource.public Object[] storageFields(org.sakaiproject.entity.api.Entity r)
storageFields in interface org.sakaiproject.util.SingleStorageUserpublic boolean isDraft(org.sakaiproject.entity.api.Entity r)
isDraft in interface org.sakaiproject.util.DoubleStorageUserr - The resource.public String getOwnerId(org.sakaiproject.entity.api.Entity r)
getOwnerId in interface org.sakaiproject.util.DoubleStorageUserr - The resource.public org.sakaiproject.time.api.Time getDate(org.sakaiproject.entity.api.Entity r)
getDate in interface org.sakaiproject.util.DoubleStorageUserr - The resource.public Integer getMessage_order(org.sakaiproject.entity.api.Entity r)
r - The resource.protected String serviceName()
serviceName in class org.sakaiproject.message.util.BaseMessageprotected org.sakaiproject.message.api.MessageHeaderEdit newMessageHeader(org.sakaiproject.message.api.Message msg,
String id)
newMessageHeader in class org.sakaiproject.message.util.BaseMessageid - The message Id.protected org.sakaiproject.message.api.MessageHeaderEdit newMessageHeader(org.sakaiproject.message.api.Message msg,
Element el)
newMessageHeader in class org.sakaiproject.message.util.BaseMessageel - The XML DOM element that has the header information.protected org.sakaiproject.message.api.MessageHeaderEdit newMessageHeader(org.sakaiproject.message.api.Message msg,
org.sakaiproject.message.api.MessageHeader other)
newMessageHeader in class org.sakaiproject.message.util.BaseMessageother - The other header to copy.protected String eventId(String secure)
eventId in class org.sakaiproject.message.util.BaseMessagesecure - The security function string.
NOTE: if this input is null or blank then event id will default to "annc.INVALID_KEY",
this is only because throwing an exception here would be very disruptive and returning
a null or blank for the event id would cause other failures (SAK-23804)protected String getReferenceRoot()
getReferenceRoot in class org.sakaiproject.message.util.BaseMessagepublic boolean parseEntityReference(String reference, org.sakaiproject.entity.api.Reference ref)
parseEntityReference in interface org.sakaiproject.entity.api.EntityProducerpublic org.sakaiproject.entity.api.Reference getAnnouncementReference(String context)
getAnnouncementReference in interface org.sakaiproject.announcement.api.AnnouncementServicepublic String channelReference(String context, String id)
channelReference in interface org.sakaiproject.message.api.MessageServicechannelReference in class org.sakaiproject.message.util.BaseMessagepublic String getRssUrl(org.sakaiproject.entity.api.Reference ref)
getRssUrl in interface org.sakaiproject.announcement.api.AnnouncementServicepublic boolean isMessageViewable(org.sakaiproject.announcement.api.AnnouncementMessage message)
isMessageViewable in interface org.sakaiproject.announcement.api.AnnouncementServicepublic void contextCreated(String context, boolean toolPlacement)
contextCreated in interface org.sakaiproject.entity.api.ContextObserverpublic void contextUpdated(String context, boolean toolPlacement)
contextUpdated in interface org.sakaiproject.entity.api.ContextObserverpublic void contextDeleted(String context, boolean toolPlacement)
contextDeleted in interface org.sakaiproject.entity.api.ContextObserverpublic String[] myToolIds()
myToolIds in interface org.sakaiproject.entity.api.ContextObservermyToolIds in interface org.sakaiproject.entity.api.EntityTransferrerprotected Element generateItemElement(Document doc, org.sakaiproject.announcement.api.AnnouncementMessage msg, org.sakaiproject.entity.api.Reference msgRef)
protected void printAnnouncementRss(OutputStream out, org.sakaiproject.entity.api.Reference rssRef)
protected void printAnnouncementHtml(PrintWriter out, org.sakaiproject.entity.api.Reference ref) throws org.sakaiproject.entity.api.EntityPermissionException, org.sakaiproject.entity.api.EntityNotDefinedException
org.sakaiproject.entity.api.EntityPermissionExceptionorg.sakaiproject.entity.api.EntityNotDefinedExceptionpublic org.sakaiproject.entity.api.HttpAccess getHttpAccess()
getHttpAccess in interface org.sakaiproject.entity.api.EntityProducergetHttpAccess in class org.sakaiproject.message.util.BaseMessagepublic org.sakaiproject.announcement.api.AnnouncementChannel getAnnouncementChannel(String ref) throws org.sakaiproject.exception.IdUnusedException, org.sakaiproject.exception.PermissionException
getAnnouncementChannel in interface org.sakaiproject.announcement.api.AnnouncementServiceref - The channel reference.org.sakaiproject.exception.IdUnusedException - If this name is not defined for a announcement channel.org.sakaiproject.exception.PermissionException - If the user does not have any permissions to the channel.public org.sakaiproject.announcement.api.AnnouncementChannelEdit addAnnouncementChannel(String ref) throws org.sakaiproject.exception.IdUsedException, org.sakaiproject.exception.IdInvalidException, org.sakaiproject.exception.PermissionException
addAnnouncementChannel in interface org.sakaiproject.announcement.api.AnnouncementServiceref - The channel reference.org.sakaiproject.exception.IdUsedException - if the id is not unique.org.sakaiproject.exception.IdInvalidException - if the id is not made up of valid characters.org.sakaiproject.exception.PermissionException - if the user does not have permission to add a channel.public List getMessages(String channelReference, org.sakaiproject.javax.Filter filter, boolean order, boolean merged) throws org.sakaiproject.exception.IdUnusedException, org.sakaiproject.exception.PermissionException, NullPointerException
getMessages in interface org.sakaiproject.announcement.api.AnnouncementServicechannelReference - Channel's reference Stringfilter - A filtering object to accept messages, or null if no filtering is desired.order - Order of messages, ascending if true, descending if falsemerged - flag to include merged channel messages, true returns ALL messages including merged sites/channelsorg.sakaiproject.exception.IdUnusedException - If this name is not defined for a announcement channel.org.sakaiproject.exception.PermissionException - if the user does not have read permission to the channel.NullPointerExceptionpublic String getLabel()
getLabel in interface org.sakaiproject.entity.api.EntityProducerprotected String getSummaryFromHeader(org.sakaiproject.message.api.Message item, org.sakaiproject.message.api.MessageHeader header)
getSummaryFromHeader in class org.sakaiproject.message.util.BaseMessagepublic void transferCopyEntities(String fromContext, String toContext, List resourceIds)
transferCopyEntities in interface org.sakaiproject.entity.api.EntityTransferrerpublic Map<String,String> transferCopyEntitiesRefMigrator(String fromContext, String toContext, List resourceIds)
transferCopyEntitiesRefMigrator in interface org.sakaiproject.entity.api.EntityTransferrerRefMigratorpublic void updateEntityReferences(String toContext, Map<String,String> transversalMap)
updateEntityReferences in interface org.sakaiproject.entity.api.EntityTransferrerRefMigratorpublic String[] summarizableToolIds()
summarizableToolIds in interface org.sakaiproject.entity.api.EntitySummarypublic String getSummarizableReference(String siteId, String toolIdentifier)
getSummarizableReference in interface org.sakaiproject.entity.api.EntitySummarygetSummarizableReference in class org.sakaiproject.message.util.BaseMessagepublic void transferCopyEntities(String fromContext, String toContext, List ids, boolean cleanup)
transferCopyEntities in interface org.sakaiproject.entity.api.EntityTransferrerpublic Map<String,String> transferCopyEntitiesRefMigrator(String fromContext, String toContext, List ids, boolean cleanup)
transferCopyEntitiesRefMigrator in interface org.sakaiproject.entity.api.EntityTransferrerRefMigratorpublic void clearMessagesCache(String channelRef)
clearMessagesCache in interface org.sakaiproject.announcement.api.AnnouncementServiceCopyright © 2003-2014 The Sakai Foundation. All Rights Reserved.