org.sakaiproject.announcement.impl
Class DbAnnouncementService

java.lang.Object
  extended by org.sakaiproject.message.impl.BaseMessageService
      extended by org.sakaiproject.announcement.impl.BaseAnnouncementService
          extended by org.sakaiproject.announcement.impl.DbAnnouncementService
All Implemented Interfaces:
AnnouncementService, org.sakaiproject.entity.api.ContextObserver, org.sakaiproject.entity.api.EntityProducer, org.sakaiproject.entity.api.EntitySummary, org.sakaiproject.entity.api.EntityTransferrer, org.sakaiproject.entity.api.EntityTransferrerRefMigrator, org.sakaiproject.memory.api.CacheRefresher, org.sakaiproject.message.api.MessageService, org.sakaiproject.util.StorageUser

public class DbAnnouncementService
extends BaseAnnouncementService

DbAnnouncementService fills out the BaseAnnouncementService with a database implementation.

The sql scripts in src/sql/chef_announcement.sql must be run on the database.


Nested Class Summary
protected  class DbAnnouncementService.DbStorage
          Storage implementation
 
Nested classes/interfaces inherited from class org.sakaiproject.announcement.impl.BaseAnnouncementService
BaseAnnouncementService.BaseAnnouncementChannelEdit, BaseAnnouncementService.BaseAnnouncementMessageEdit, BaseAnnouncementService.BaseAnnouncementMessageHeaderEdit, BaseAnnouncementService.PrivacyFilter
 
Nested classes/interfaces inherited from class org.sakaiproject.message.impl.BaseMessageService
org.sakaiproject.message.impl.BaseMessageService.BaseMessageChannelEdit, org.sakaiproject.message.impl.BaseMessageService.BaseMessageEdit, org.sakaiproject.message.impl.BaseMessageService.BaseMessageHeaderEdit, org.sakaiproject.message.impl.BaseMessageService.MessagePermissionFilter, org.sakaiproject.message.impl.BaseMessageService.MessageSelectionFilter, org.sakaiproject.message.impl.BaseMessageService.NotifyThread, org.sakaiproject.message.impl.BaseMessageService.PublicFilter, org.sakaiproject.message.impl.BaseMessageService.Storage
 
Field Summary
protected static String[] FIELDS
           
protected  boolean m_autoDdl
          Configuration: to run the ddl on init or not.
protected  boolean m_convertToDraft
          Set if we are to run the to-draft/owner conversion.
protected  boolean m_convertToPubView
          Set if we are to run the to-pubview conversion.
protected  String m_cTableName
          The name of the db table holding announcement channels.
protected  boolean m_locksInDb
          If true, we do our locks in the remote database, otherwise we do them here.
protected  String m_rTableName
          The name of the db table holding announcement messages.
protected  org.sakaiproject.db.api.SqlService m_sqlService
          Dependency: SqlService
 
Fields inherited from class org.sakaiproject.announcement.impl.BaseAnnouncementService
m_notificationService, rb
 
Fields inherited from class org.sakaiproject.message.impl.BaseMessageService
m_caching, m_channelCache, m_entityManager, m_eventTrackingService, m_idManager, m_memoryService, m_messageCaches, m_securityService, m_serverConfigurationService, m_sessionManager, m_siteService, m_storage, m_threadLocalManager, m_timeService, m_userDirectoryService
 
Fields inherited from interface org.sakaiproject.announcement.api.AnnouncementService
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
 
Fields inherited from interface org.sakaiproject.message.api.MessageService
REF_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 Summary
DbAnnouncementService()
           
 
Method Summary
protected  void convertToDraft()
          fill in the draft and owner db fields
protected  void convertToPubView()
          fill in the pubview db fields
protected  boolean getPubView(String ref)
          Does this resource support public view?
 void init()
          Final initialization, once all dependencies are set.
protected  org.sakaiproject.message.impl.BaseMessageService.Storage newStorage()
          Construct a Storage object.
 void setAuthzGroupService(org.sakaiproject.authz.api.AuthzGroupService authzGroupService)
           
 void setAutoDdl(String value)
          Configuration: to run the ddl on init or not.
 void setContainerTableName(String name)
          Configuration: set the table name for the container.
 void setConvertDraft(String value)
          Configuration: run the to-draft/owner conversion
 void setConvertPubView(String value)
          Configuration: run the to-pubview conversion
 void setLocksInDb(String value)
          Configuration: set the locks-in-db
 void setResourceTableName(String name)
          Configuration: set the table name for the resource.
 void setSqlService(org.sakaiproject.db.api.SqlService service)
          Dependency: SqlService.
 
Methods inherited from class org.sakaiproject.announcement.impl.BaseAnnouncementService
addAnnouncementChannel, channelReference, clearMessagesCache, contextCreated, contextDeleted, contextUpdated, eventId, generateItemElement, getAnnouncementChannel, getAnnouncementReference, getDate, getHttpAccess, getLabel, getMessage_order, getMessages, getOwnerId, getReferenceRoot, getRssUrl, getSummarizableReference, getSummaryFromHeader, isDraft, isMessageViewable, myToolIds, newContainer, newContainer, newContainer, newContainerEdit, newContainerEdit, newContainerEdit, newMessageHeader, newMessageHeader, newMessageHeader, newResource, newResource, newResource, newResourceEdit, newResourceEdit, newResourceEdit, parseEntityReference, printAnnouncementHtml, printAnnouncementRss, serviceName, setAliasService, setContentHostingService, setFunctionManager, setNotificationService, setSecurityService, setSessionManager, setTimeService, setToolManager, storageFields, summarizableToolIds, transferCopyEntities, transferCopyEntities, transferCopyEntitiesRefMigrator, transferCopyEntitiesRefMigrator, updateEntityReferences
 
Methods inherited from class org.sakaiproject.message.impl.BaseMessageService
addChannel, allowAddChannel, allowEditChannel, allowGetChannel, allowGetMessage, allowRemoveChannel, archive, archiveSynopticOptions, cancelChannel, cancelMessage, commitChannel, destroy, disableMessageChannel, editChannel, enableMessageChannel, findChannel, getAccessPoint, getChannel, getChannelIds, getChannelPublic, getChannels, getEntity, getEntityAuthzGroups, getEntityDescription, getEntityResourceProperties, getEntityUrl, getMessage, getMessages, getSummary, merge, messageReference, messageReference, parseMergeChannelExtra, refresh, removeChannel, service, setCaching, setEntityManager, setEventTrackingService, setIdManager, setMemoryService, setServerConfigurationService, setSiteService, setThreadLocalManager, setUserDirectoryService, transferSynopticOptions, unlock, unlock2, unlock3, unlockCheck, unlockCheck2, unlockCheck3, willArchiveMerge
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.sakaiproject.message.api.MessageService
addChannel, allowAddChannel, allowEditChannel, allowGetChannel, allowRemoveChannel, cancelChannel, cancelMessage, commitChannel, editChannel, getChannel, getChannelIds, getChannelPublic, getChannels, getMessage, getMessages, getSummary, messageReference, messageReference, removeChannel
 
Methods inherited from interface org.sakaiproject.entity.api.EntityProducer
archive, getEntity, getEntityAuthzGroups, getEntityDescription, getEntityResourceProperties, getEntityUrl, merge, willArchiveMerge
 

Field Detail

m_cTableName

protected String m_cTableName
The name of the db table holding announcement channels.


m_rTableName

protected String m_rTableName
The name of the db table holding announcement messages.


m_locksInDb

protected boolean m_locksInDb
If true, we do our locks in the remote database, otherwise we do them here.


FIELDS

protected static final String[] FIELDS

m_sqlService

protected org.sakaiproject.db.api.SqlService m_sqlService
Dependency: SqlService


m_convertToDraft

protected boolean m_convertToDraft
Set if we are to run the to-draft/owner conversion.


m_convertToPubView

protected boolean m_convertToPubView
Set if we are to run the to-pubview conversion.


m_autoDdl

protected boolean m_autoDdl
Configuration: to run the ddl on init or not.

Constructor Detail

DbAnnouncementService

public DbAnnouncementService()
Method Detail

setSqlService

public void setSqlService(org.sakaiproject.db.api.SqlService service)
Dependency: SqlService.

Parameters:
service - The SqlService.

setAuthzGroupService

public void setAuthzGroupService(org.sakaiproject.authz.api.AuthzGroupService authzGroupService)
Overrides:
setAuthzGroupService in class org.sakaiproject.message.impl.BaseMessageService

setContainerTableName

public void setContainerTableName(String name)
Configuration: set the table name for the container.

Parameters:
path - The table name for the container.

setResourceTableName

public void setResourceTableName(String name)
Configuration: set the table name for the resource.

Parameters:
path - The table name for the resource.

setLocksInDb

public void setLocksInDb(String value)
Configuration: set the locks-in-db

Parameters:
path - The storage path.

setConvertDraft

public void setConvertDraft(String value)
Configuration: run the to-draft/owner conversion

Parameters:
value - The conversion desired value.

setConvertPubView

public void setConvertPubView(String value)
Configuration: run the to-pubview conversion

Parameters:
value - The conversion desired value.

setAutoDdl

public void setAutoDdl(String value)
Configuration: to run the ddl on init or not.

Parameters:
value - the auto ddl value.

init

public void init()
Final initialization, once all dependencies are set.

Overrides:
init in class BaseAnnouncementService

newStorage

protected org.sakaiproject.message.impl.BaseMessageService.Storage newStorage()
Construct a Storage object.

Specified by:
newStorage in class org.sakaiproject.message.impl.BaseMessageService
Returns:
The new storage object.

convertToDraft

protected void convertToDraft()
fill in the draft and owner db fields


convertToPubView

protected void convertToPubView()
fill in the pubview db fields


getPubView

protected boolean getPubView(String ref)
Does this resource support public view? (Support for the conversion)

Parameters:
ref - The resource reference
Returns:
true if this resource supports public view, false if not.


Copyright © 2003-2012 University of Michigan. All Rights Reserved.