org.sakaiproject.util
Class MergedList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList
              extended by org.sakaiproject.util.MergedList
All Implemented Interfaces:
Serializable, Cloneable, Iterable, Collection, List, RandomAccess

public class MergedList
extends ArrayList

Contains the list of merged/non-merged channels

See Also:
Serialized Form

Nested Class Summary
static interface MergedList.ChannelReferenceMaker
          Used to create a reference.
static interface MergedList.EntryProvider
          This interface is used to describe a generic list entry provider so that a variety of list entries can be used.
static interface MergedList.MergedEntry
          channel entry used to communicate with the Velocity templates when dealing with merged channels.
 
Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
MergedList()
           
 
Method Summary
 String[] getAllPermittedChannels(MergedList.ChannelReferenceMaker refMaker)
          Forms an array of all channel references to which the user has read access.
 String[] getChannelReferenceArrayFromDelimitedString(String primarychannelReference, String mergedInitParameterValue)
          This gets a list of channels from the portlet configuration information.
 String getDelimitedChannelReferenceString()
          Loads data input by the user into this list and then saves the list to the portlet config information.
 List getReferenceList()
          Returns an array of merged references.
 void loadChannelsFromDelimitedString(boolean isOnWorkspaceTab, boolean mergeAllOnWorkspaceTab, MergedList.EntryProvider entryProvider, String userId, String[] channelArray, boolean isSuperUser, String currentSiteId)
          loadChannelsFromDelimitedString (see description on above method)
 void loadChannelsFromDelimitedString(boolean isOnWorkspaceTab, MergedList.EntryProvider entryProvider, String userId, String[] channelArray, boolean isSuperUser, String currentSiteId)
          loadChannelsFromDelimitedString Selects and loads channels from a list provided by the entryProvider parameter.
 void loadFromRunData(org.sakaiproject.util.ParameterParser params)
          Loads data input by the user into this list and then saves the list to the portlet config information.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

MergedList

public MergedList()
Method Detail

loadChannelsFromDelimitedString

public void loadChannelsFromDelimitedString(boolean isOnWorkspaceTab,
                                            MergedList.EntryProvider entryProvider,
                                            String userId,
                                            String[] channelArray,
                                            boolean isSuperUser,
                                            String currentSiteId)
loadChannelsFromDelimitedString Selects and loads channels from a list provided by the entryProvider parameter. The algorithm for loading channels is a bit complex, and depends on whether or not the user is currently in their "My Workspace", etc. This function formerly filtered through a list of all sites. It still goes through the motions of filtering, and deciding how to flag the channels as to whether or not they are merged, hidden, etc. However, it has been modified to take all of its information from an EntryProvider parameter, This list is now customized and is no longer "all sites in existence". When sites are being selected for merging, this list can be quite long. This function is more often called just to display merged events, so passing a more restricted list makes for better performance. At some point we could condense redundant logic, but this modification was performed under the time constraints of a release. So, an effort was made not to tinker with the logic, so much as to reduce the set of data that the function had to process.

Parameters:
isOnWorkspaceTab - - true if this is the user's my workspace
entryProvider - - provides available channels for load/merge
userId - - current userId
channelArray - - array of selected channels for load/merge
isSuperUser - - if true, then don't merge all available channels
currentSiteId - - current worksite

loadChannelsFromDelimitedString

public void loadChannelsFromDelimitedString(boolean isOnWorkspaceTab,
                                            boolean mergeAllOnWorkspaceTab,
                                            MergedList.EntryProvider entryProvider,
                                            String userId,
                                            String[] channelArray,
                                            boolean isSuperUser,
                                            String currentSiteId)
loadChannelsFromDelimitedString (see description on above method)

Parameters:
isOnWorkspaceTab - - true if this is the user's my workspace
mergeAllOnWorkspaceTab - - if true, merge all channels in channelArray
entryProvider - - provides available channels for load/merge
userId - - current userId
channelArray - - array of selected channels for load/merge
isSuperUser - - if true, then don't merge all available channels
currentSiteId - - current worksite

getAllPermittedChannels

public String[] getAllPermittedChannels(MergedList.ChannelReferenceMaker refMaker)
Forms an array of all channel references to which the user has read access.


getChannelReferenceArrayFromDelimitedString

public String[] getChannelReferenceArrayFromDelimitedString(String primarychannelReference,
                                                            String mergedInitParameterValue)
This gets a list of channels from the portlet configuration information. Channels here can really be a channel or a schedule from a site.


loadFromRunData

public void loadFromRunData(org.sakaiproject.util.ParameterParser params)
Loads data input by the user into this list and then saves the list to the portlet config information. The initContextForMergeOptions() function must have previously been called.


getDelimitedChannelReferenceString

public String getDelimitedChannelReferenceString()
Loads data input by the user into this list and then saves the list to the portlet config information. The initContextForMergeOptions() function must have previously been called.


getReferenceList

public List getReferenceList()
Returns an array of merged references.



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