Class AnnouncementService


  • public class AnnouncementService
    extends Object
    Deprecated.

    AnnouncementService is a static Cover for the AnnouncementService; see that interface for usage details.

    Version:
    $Revision$
    Author:
    University of Michigan, Sakai Software Development Team
    • Field Detail

      • EVENT_ANNC_UPDATE_AVAILABILITY

        public static final String EVENT_ANNC_UPDATE_AVAILABILITY
        Deprecated.
        See Also:
        Constant Field Values
      • APPLICATION_ID

        public static String APPLICATION_ID
        Deprecated.
      • REFERENCE_ROOT

        public static String REFERENCE_ROOT
        Deprecated.
      • SECURE_ANNC_ROOT

        public static String SECURE_ANNC_ROOT
        Deprecated.
      • SECURE_ANNC_READ

        public static String SECURE_ANNC_READ
        Deprecated.
      • SECURE_ANNC_ADD

        public static String SECURE_ANNC_ADD
        Deprecated.
      • SECURE_ANNC_REMOVE_OWN

        public static String SECURE_ANNC_REMOVE_OWN
        Deprecated.
      • SECURE_ANNC_REMOVE_ANY

        public static String SECURE_ANNC_REMOVE_ANY
        Deprecated.
      • SECURE_ANNC_UPDATE_OWN

        public static String SECURE_ANNC_UPDATE_OWN
        Deprecated.
      • SECURE_ANNC_UPDATE_ANY

        public static String SECURE_ANNC_UPDATE_ANY
        Deprecated.
      • SECURE_ANNC_READ_DRAFT

        public static String SECURE_ANNC_READ_DRAFT
        Deprecated.
      • SECURE_READ

        public static String SECURE_READ
        Deprecated.
      • SECURE_ADD

        public static String SECURE_ADD
        Deprecated.
      • SECURE_REMOVE_OWN

        public static String SECURE_REMOVE_OWN
        Deprecated.
      • SECURE_REMOVE_ANY

        public static String SECURE_REMOVE_ANY
        Deprecated.
      • SECURE_UPDATE_OWN

        public static String SECURE_UPDATE_OWN
        Deprecated.
      • SECURE_UPDATE_ANY

        public static String SECURE_UPDATE_ANY
        Deprecated.
      • SECURE_READ_DRAFT

        public static String SECURE_READ_DRAFT
        Deprecated.
      • REF_TYPE_CHANNEL

        public static String REF_TYPE_CHANNEL
        Deprecated.
      • REF_TYPE_MESSAGE

        public static String REF_TYPE_MESSAGE
        Deprecated.
    • Constructor Detail

      • AnnouncementService

        public AnnouncementService()
        Deprecated.
    • Method Detail

      • getInstance

        public static AnnouncementService getInstance()
        Deprecated.
        Access the component instance: special cover only method.
        Returns:
        the component instance.
      • getAnnouncementChannel

        public static AnnouncementChannel getAnnouncementChannel​(String param0)
                                                          throws org.sakaiproject.exception.IdUnusedException,
                                                                 org.sakaiproject.exception.PermissionException
        Deprecated.
        A (AnnouncementChannel) cover for getChannel() to return a specific announcement channel.
        Parameters:
        param0 - The channel reference string.
        Returns:
        the AnnouncementChannel that has the specified name.
        Throws:
        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.
      • addAnnouncementChannel

        public static AnnouncementChannelEdit addAnnouncementChannel​(String param0)
                                                              throws org.sakaiproject.exception.IdUsedException,
                                                                     org.sakaiproject.exception.IdInvalidException,
                                                                     org.sakaiproject.exception.PermissionException
        Deprecated.
        A (AnnouncementChannel) cover for addChannel() to add a new announcement channel.
        Parameters:
        param0 - The channel reference string.
        Returns:
        The newly created channel.
        Throws:
        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.
      • getChannels

        public static List getChannels()
        Deprecated.
        Return a list of all the defined channels.
        Returns:
        a list of MessageChannel (or extension) objects (may be empty).
      • allowGetChannel

        public static boolean allowGetChannel​(String param0)
        Deprecated.
        check permissions for getChannel().
        Parameters:
        param0 - The channel reference string.
        Returns:
        true if the user is allowed to getChannel(channelId), false if not.
      • allowAddChannel

        public static boolean allowAddChannel​(String param0)
        Deprecated.
        check permissions for addChannel().
        Parameters:
        param0 - The channel reference string.
        Returns:
        true if the user is allowed to addChannel(channelId), false if not.
      • addChannel

        public static org.sakaiproject.message.api.MessageChannelEdit addChannel​(String param0)
                                                                          throws org.sakaiproject.exception.IdUsedException,
                                                                                 org.sakaiproject.exception.IdInvalidException,
                                                                                 org.sakaiproject.exception.PermissionException
        Deprecated.
        Add a new channel. Must commitEdit() to make official, or cancelEdit() when done!
        Parameters:
        The - channel reference string.
        Returns:
        The newly created channel, locked for update.
        Throws:
        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.
      • allowEditChannel

        public static boolean allowEditChannel​(String param0)
        Deprecated.
        check permissions for editChannel()
        Parameters:
        param0 - The channel reference string.
        Returns:
        true if the user is allowed to update the channel, false if not.
      • editChannel

        public static org.sakaiproject.message.api.MessageChannelEdit editChannel​(String param0)
                                                                           throws org.sakaiproject.exception.IdUnusedException,
                                                                                  org.sakaiproject.exception.PermissionException,
                                                                                  org.sakaiproject.exception.InUseException
        Deprecated.
        Return a specific channel, as specified by channel id, locked for update. Must commitEdit() to make official, or cancelEdit() when done!
        Parameters:
        param0 - The channel reference string.
        Returns:
        the Channel that has the specified id.
        Throws:
        org.sakaiproject.exception.IdUnusedException - If this name is not a defined channel.
        org.sakaiproject.exception.PermissionException - If the user does not have any permissions to edit the channel.
        org.sakaiproject.exception.InUseException - if the channel is locked for edit by someone else.
      • commitChannel

        public static void commitChannel​(org.sakaiproject.message.api.MessageChannelEdit param0)
        Deprecated.
        Commit the changes made to a MessageChannelEdit object, and release the lock. The MessageChannelEdit is disabled, and not to be used after this call.
        Parameters:
        param0 - The MessageChannelEdit object to commit.
      • cancelChannel

        public static void cancelChannel​(org.sakaiproject.message.api.MessageChannelEdit param0)
        Deprecated.
        Cancel the changes made to a MessageChannelEdit object, and release the lock. The MessageChannelEdit is disabled, and not to be used after this call.
        Parameters:
        param0 - The MessageChannelEdit object to cancel.
      • allowRemoveChannel

        public static boolean allowRemoveChannel​(String param0)
        Deprecated.
        Check permissions for removeChannel().
        Parameters:
        param0 - The channel reference string.
        Returns:
        true if the user is allowed to removeChannel(), false if not.
      • removeChannel

        public static void removeChannel​(org.sakaiproject.message.api.MessageChannelEdit param0)
                                  throws org.sakaiproject.exception.PermissionException
        Deprecated.
        Remove a channel - it must be locked from editChannel().
        Parameters:
        param0 - The MessageChannelEdit object of the channel to remove.
        Throws:
        org.sakaiproject.exception.PermissionException - if the user does not have permission to remove a channel.
      • channelReference

        public static String channelReference​(String param0,
                                              String param1)
        Deprecated.
        Access the internal reference which can be used to access the channel from within the system.
        Parameters:
        param0 - The context string.
        param1 - The channel id.
        Returns:
        The the internal reference which can be used to access the channel from within the system.
      • messageReference

        public static String messageReference​(String param0,
                                              String param1,
                                              String param2)
        Deprecated.
        Access the internal reference which can be used to access the message from within the system.
        Parameters:
        param0 - The context string.
        param1 - The channel id.
        param2 - The message id.
        Returns:
        The the internal reference which can be used to access the message from within the system.
      • messageReference

        public static String messageReference​(String param0,
                                              String param1)
        Deprecated.
        Access the internal reference which can be used to access the message from within the system.
        Parameters:
        param0 - The channel reference string
        param1 - The message id.
        Returns:
        The the internal reference which can be used to access the message from within the system.
      • cancelMessage

        public static void cancelMessage​(org.sakaiproject.message.api.MessageEdit param0)
        Deprecated.
        Cancel the changes made to a MessageEdit object, and release the lock. The MessageEdit is disabled, and not to be used after this call.
        Parameters:
        param0 - The MessageEdit object to cancel.
      • getMessages

        public static List getMessages​(String param0,
                                       org.sakaiproject.time.api.Time param1,
                                       int param2,
                                       boolean param3,
                                       boolean param4,
                                       boolean param5)
                                throws org.sakaiproject.exception.PermissionException
        Deprecated.
        Access a list of messages in the channel, that are after the date, limited to just the n latest messages, ordered as specified, including drafts if specified. Channel read permission is required, unless pubViewOnly is selected - draft read on the channel is required to see drafts.
        Parameters:
        param0 - channel reference string
        param1 - if null, no date limit, else limited to only messages after this date.
        param2 - if 0, no count limit, else limited to only the latest this number of messages.
        param3 - if true, sort oldest first, else sort latest first.
        param4 - if true, include drafts (if the user has draft permission), else leave them out.
        param5 - if true, include only messages marked pubview, else include any.
        Returns:
        A list of Message objects that meet the criteria; may be empty
        Throws:
        org.sakaiproject.exception.PermissionException - If the current user does not have channel read permission.
      • getChannelIds

        public static List getChannelIds​(String param0)
        Deprecated.
        Access a list of channel ids that are defined related to the context.
        Parameters:
        param0 - The context in which to search
        Returns:
        A List (String) of channel id for channels withing the context.
      • getMessage

        public static org.sakaiproject.message.api.Message getMessage​(org.sakaiproject.entity.api.Reference param0)
                                                               throws org.sakaiproject.exception.IdUnusedException,
                                                                      org.sakaiproject.exception.PermissionException
        Deprecated.
        Get a message, given a reference. This call avoids the need to have channel security, as long as the user has permissions to the message.
        Parameters:
        param0 - The message reference
        Returns:
        The message.
        Throws:
        org.sakaiproject.exception.IdUnusedException - If this reference does not identify a message.
        org.sakaiproject.exception.PermissionException - If the user does not have any permissions to the message.
      • getChannel

        public static org.sakaiproject.message.api.MessageChannel getChannel​(String param0)
                                                                      throws org.sakaiproject.exception.IdUnusedException,
                                                                             org.sakaiproject.exception.PermissionException
        Deprecated.
        Return a specific channel.
        Parameters:
        param0 - The channel reference.
        Returns:
        the MessageChannel that has the specified name.
        Throws:
        org.sakaiproject.exception.IdUnusedException - If this name is not defined for any channel.
        org.sakaiproject.exception.PermissionException - If the user does not have any permissions to the channel.
      • getLabel

        public static String getLabel()
        Deprecated.
      • getSummary

        public static Map getSummary​(String param0,
                                     int param1,
                                     int param2)
                              throws org.sakaiproject.exception.IdUsedException,
                                     org.sakaiproject.exception.IdInvalidException,
                                     org.sakaiproject.exception.PermissionException
        Deprecated.
        Get a summary of an Announcement Channel
        Parameters:
        param0 - channel reference string.
        param1 - Maximum number of items to return
        param2 - Maximum number of days to peer back
        Returns:
        The Map containing the Summary
        Throws:
        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.
      • getAnnouncementReference

        public static org.sakaiproject.entity.api.Reference getAnnouncementReference​(String param0)
        Deprecated.
        Get announcement entity reference for given context
        Parameters:
        param0 - announcement context (site-id)
        Returns:
        announcement entity reference
      • getRssUrl

        public static String getRssUrl​(org.sakaiproject.entity.api.Reference param0)
        Deprecated.
        Get URL to access the announcement rss feed
        Parameters:
        param0 - The announcement entity reference
        Returns:
        URL for announcement rss feed
      • isMessageViewable

        public static boolean isMessageViewable​(AnnouncementMessage param0)
        Deprecated.
        Determine if message viewable based on release/retract dates (if set)
        Parameters:
        param0 - AnnouncementMessage
        Returns:
        boolean
      • clearMessagesCache

        public static void clearMessagesCache​(String channelRef)
        Deprecated.
        clears the message cache for this channel
        Parameters:
        channelRef -
      • getMessages

        public static List getMessages​(String channelReference,
                                       org.sakaiproject.javax.Filter filter,
                                       boolean order,
                                       boolean merged)
                                throws org.sakaiproject.exception.IdUnusedException,
                                       org.sakaiproject.exception.PermissionException,
                                       NullPointerException
        Deprecated.
        Return a list of messages from the provided channel (merged flag returns merged messages)
        Parameters:
        channelReference - Channel's reference String
        filter - A filtering object to accept messages, or null if no filtering is desired.
        order - Order of messages, ascending if true, descending if false
        merged - flag to include merged channel messages, true returns ALL messages including merged sites/channels
        Returns:
        a list of Message objects or specializations of Message objects (may be empty).
        Throws:
        org.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.
        NullPointerException