public abstract class BaseAnnouncementService extends BaseMessage implements AnnouncementService, ContextObserver, EntityTransferrer, 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.
|
BaseMessage.BaseMessageChannelEdit, BaseMessage.BaseMessageEdit, BaseMessage.BaseMessageHeaderEdit, BaseMessage.MessagePermissionFilter, BaseMessage.MessageSelectionFilter, BaseMessage.NotifyThread, BaseMessage.PublicFilter, BaseMessage.Storage| Modifier and Type | Field and Description |
|---|---|
protected NotificationService |
m_notificationService
Dependency: NotificationService.
|
protected static 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_OWNREF_TYPE_CHANNEL, REF_TYPE_MESSAGE, SECURE_ADD, SECURE_ALL_GROUPS, SECURE_CREATE, SECURE_READ, SECURE_READ_DRAFT, SECURE_REMOVE_ANY, SECURE_REMOVE_OWN, SECURE_UPDATE_ANY, SECURE_UPDATE_OWN| Constructor and Description |
|---|
BaseAnnouncementService() |
| Modifier and Type | Method and Description |
|---|---|
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,
AnnouncementMessage msg,
Reference msgRef)
Generate RSS Item element for specified assignment
|
AnnouncementChannel |
getAnnouncementChannel(String ref)
Return a specific announcement channel.
|
Reference |
getAnnouncementReference(String context) |
Time |
getDate(Entity r)
Access the resource date.
|
HttpAccess |
getHttpAccess() |
String |
getLabel() |
Integer |
getMessage_order(Entity r)
Access the resource Message Order.
|
List |
getMessages(String channelReference,
Filter filter,
boolean order,
boolean merged)
Return a list of messages from the provided channel (merged flag returns merged messages)
|
String |
getOwnerId(Entity r)
Access the resource owner user id.
|
protected String |
getReferenceRoot()
Return the reference rooot for use in resource references and urls.
|
String |
getRssUrl(Reference ref) |
String |
getSummarizableReference(String siteId,
String toolIdentifier) |
protected String |
getSummaryFromHeader(Message item,
MessageHeader header)
getSummaryFromHeader implementation
|
void |
init()
Final initialization, once all dependencies are set.
|
boolean |
isDraft(Entity r)
Check if this resource is in draft mode.
|
boolean |
isMessageViewable(AnnouncementMessage message) |
String[] |
myToolIds() |
Entity |
newContainer(Element element)
Construct a new container resource, from an XML element.
|
Entity |
newContainer(Entity other)
Construct a new container resource, as a copy of another
|
Entity |
newContainer(String ref)
Construct a new continer given just ids.
|
Edit |
newContainerEdit(Element element)
Construct a new container resource, from an XML element.
|
Edit |
newContainerEdit(Entity other)
Construct a new container resource, as a copy of another
|
Edit |
newContainerEdit(String ref)
Construct a new continer given just ids.
|
protected MessageHeaderEdit |
newMessageHeader(Message msg,
Element el)
Construct a new message header from XML in a DOM element.
|
protected MessageHeaderEdit |
newMessageHeader(Message msg,
MessageHeader other)
Construct a new message header as a copy of another.
|
protected MessageHeaderEdit |
newMessageHeader(Message msg,
String id)
Construct a new message header from XML in a DOM element.
|
Entity |
newResource(Entity container,
Element element)
Construct a new resource, from an XML element.
|
Entity |
newResource(Entity container,
Entity other)
Construct a new resource from another resource of the same type.
|
Entity |
newResource(Entity container,
String id,
Object[] others)
Construct a new rsource given just an id.
|
Edit |
newResourceEdit(Entity container,
Element element)
Construct a new resource, from an XML element.
|
Edit |
newResourceEdit(Entity container,
Entity other)
Construct a new resource from another resource of the same type.
|
Edit |
newResourceEdit(Entity container,
String id,
Object[] others)
Construct a new rsource given just an id.
|
boolean |
parseEntityReference(String reference,
Reference ref) |
protected void |
printAnnouncementHtml(PrintWriter out,
Reference ref)
Print specified Announcement as HTML Page
|
protected void |
printAnnouncementRss(OutputStream out,
Reference rssRef)
Print all Announcements as RSS Feed
|
protected String |
serviceName()
Report the Service API name being implemented.
|
void |
setAliasService(AliasService aliasService) |
void |
setContentHostingService(ContentHostingService service)
Dependency: contentHostingService.
|
void |
setFunctionManager(FunctionManager functionManager) |
void |
setNotificationService(NotificationService service)
Dependency: NotificationService.
|
void |
setSiteEmailNotificationAnnc(SiteEmailNotificationAnnc siteEmailNotificationAnnc) |
void |
setToolManager(ToolManager toolManager) |
Object[] |
storageFields(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, allowGetMessage, allowRemoveChannel, archive, archiveSynopticOptions, cancelChannel, cancelMessage, canSeeAllGroups, 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, setSecurityService, setServerConfigurationService, setSessionManager, setSiteService, setThreadLocalManager, setTimeService, 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, removeChannelarchive, getEntity, getEntityAuthzGroups, getEntityDescription, getEntityResourceProperties, getEntityUrl, merge, willArchiveMergeprotected static ResourceLoader rb
protected NotificationService m_notificationService
public void setContentHostingService(ContentHostingService service)
service - The NotificationService.public void setSiteEmailNotificationAnnc(SiteEmailNotificationAnnc siteEmailNotificationAnnc)
public void setFunctionManager(FunctionManager functionManager)
public void setAliasService(AliasService aliasService)
public void setToolManager(ToolManager toolManager)
public void setNotificationService(NotificationService service)
service - The NotificationService.public void init()
init in class BaseMessagepublic Entity newContainer(String ref)
newContainer in interface DoubleStorageUserref - The container reference.public Entity newContainer(Element element)
newContainer in interface DoubleStorageUserelement - The XML.public Entity newContainer(Entity other)
newContainer in interface DoubleStorageUserother - The other contianer to copy.public Entity newResource(Entity container, String id, Object[] others)
newResource in interface 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 Entity newResource(Entity container, Element element)
newResource in interface SingleStorageUsercontainer - The Resource that is the container for the new resource (may be null).element - The XML.public Entity newResource(Entity container, Entity other)
newResource in interface SingleStorageUsercontainer - The Resource that is the container for the new resource (may be null).other - The other resource.public Edit newContainerEdit(String ref)
newContainerEdit in interface DoubleStorageUserref - The container reference.public Edit newContainerEdit(Element element)
newContainerEdit in interface DoubleStorageUserelement - The XML.public Edit newContainerEdit(Entity other)
newContainerEdit in interface DoubleStorageUserother - The other contianer to copy.public Edit newResourceEdit(Entity container, String id, Object[] others)
newResourceEdit in interface 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 Edit newResourceEdit(Entity container, Element element)
newResourceEdit in interface SingleStorageUsercontainer - The Resource that is the container for the new resource (may be null).element - The XML.public Edit newResourceEdit(Entity container, Entity other)
newResourceEdit in interface SingleStorageUsercontainer - The Resource that is the container for the new resource (may be null).other - The other resource.public Object[] storageFields(Entity r)
storageFields in interface SingleStorageUserpublic boolean isDraft(Entity r)
isDraft in interface DoubleStorageUserr - The resource.public String getOwnerId(Entity r)
getOwnerId in interface DoubleStorageUserr - The resource.public Time getDate(Entity r)
getDate in interface DoubleStorageUserr - The resource.public Integer getMessage_order(Entity r)
r - The resource.protected String serviceName()
serviceName in class BaseMessageprotected MessageHeaderEdit newMessageHeader(Message msg, String id)
newMessageHeader in class BaseMessageid - The message Id.protected MessageHeaderEdit newMessageHeader(Message msg, Element el)
newMessageHeader in class BaseMessageel - The XML DOM element that has the header information.protected MessageHeaderEdit newMessageHeader(Message msg, MessageHeader other)
newMessageHeader in class BaseMessageother - The other header to copy.protected String eventId(String secure)
eventId in class 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 BaseMessagepublic boolean parseEntityReference(String reference, Reference ref)
parseEntityReference in interface EntityProducerpublic Reference getAnnouncementReference(String context)
getAnnouncementReference in interface AnnouncementServicepublic String channelReference(String context, String id)
channelReference in interface MessageServicechannelReference in class BaseMessagepublic String getRssUrl(Reference ref)
getRssUrl in interface AnnouncementServicepublic boolean isMessageViewable(AnnouncementMessage message)
isMessageViewable in interface AnnouncementServicepublic void contextCreated(String context, boolean toolPlacement)
contextCreated in interface ContextObserverpublic void contextUpdated(String context, boolean toolPlacement)
contextUpdated in interface ContextObserverpublic void contextDeleted(String context, boolean toolPlacement)
contextDeleted in interface ContextObserverpublic String[] myToolIds()
myToolIds in interface ContextObservermyToolIds in interface EntityTransferrerprotected Element generateItemElement(Document doc, AnnouncementMessage msg, Reference msgRef)
protected void printAnnouncementRss(OutputStream out, Reference rssRef)
protected void printAnnouncementHtml(PrintWriter out, Reference ref) throws EntityPermissionException, EntityNotDefinedException
public HttpAccess getHttpAccess()
getHttpAccess in interface EntityProducergetHttpAccess in class BaseMessagepublic AnnouncementChannel getAnnouncementChannel(String ref) throws IdUnusedException, PermissionException
getAnnouncementChannel in interface AnnouncementServiceref - The channel reference.IdUnusedException - If this name is not defined for a announcement channel.PermissionException - If the user does not have any permissions to the channel.public AnnouncementChannelEdit addAnnouncementChannel(String ref) throws IdUsedException, IdInvalidException, PermissionException
addAnnouncementChannel in interface AnnouncementServiceref - The channel reference.IdUsedException - if the id is not unique.IdInvalidException - if the id is not made up of valid characters.PermissionException - if the user does not have permission to add a channel.public List getMessages(String channelReference, Filter filter, boolean order, boolean merged) throws IdUnusedException, PermissionException, NullPointerException
getMessages in interface 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/channelsIdUnusedException - If this name is not defined for a announcement channel.PermissionException - if the user does not have read permission to the channel.NullPointerExceptionpublic String getLabel()
getLabel in interface EntityProducerprotected String getSummaryFromHeader(Message item, MessageHeader header)
getSummaryFromHeader in class BaseMessagepublic void transferCopyEntities(String fromContext, String toContext, List resourceIds)
transferCopyEntities in interface EntityTransferrerpublic Map<String,String> transferCopyEntitiesRefMigrator(String fromContext, String toContext, List resourceIds)
transferCopyEntitiesRefMigrator in interface EntityTransferrerRefMigratorpublic void updateEntityReferences(String toContext, Map<String,String> transversalMap)
updateEntityReferences in interface EntityTransferrerRefMigratorpublic String[] summarizableToolIds()
summarizableToolIds in interface EntitySummarypublic String getSummarizableReference(String siteId, String toolIdentifier)
getSummarizableReference in interface EntitySummarygetSummarizableReference in class BaseMessagepublic void transferCopyEntities(String fromContext, String toContext, List ids, boolean cleanup)
transferCopyEntities in interface EntityTransferrerpublic Map<String,String> transferCopyEntitiesRefMigrator(String fromContext, String toContext, List ids, boolean cleanup)
transferCopyEntitiesRefMigrator in interface EntityTransferrerRefMigratorpublic void clearMessagesCache(String channelRef)
clearMessagesCache in interface AnnouncementServiceCopyright © 2003–2016 The Sakai Foundation. All rights reserved.