Package org.sakaiproject.util
Class MergedList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList
-
- 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
Nested Classes Modifier and Type Class Description static interfaceMergedList.ChannelReferenceMakerUsed to create a reference.static interfaceMergedList.EntryProviderThis interface is used to describe a generic list entry provider so that a variety of list entries can be used.static interfaceMergedList.MergedEntrychannel 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
Constructors Constructor Description MergedList()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.StringgetDelimitedChannelReferenceString()Loads data input by the user into this list and then saves the list to the portlet config information.ListgetReferenceList()Returns an array of merged references.voidloadChannelsFromDelimitedString(boolean isOnWorkspaceTab, boolean mergeAllOnWorkspaceTab, MergedList.EntryProvider entryProvider, String userId, String[] channelArray, boolean isSuperUser, String currentSiteId)loadChannelsFromDelimitedString (see description on above method)voidloadChannelsFromDelimitedString(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.voidloadFromRunData(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, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
Methods inherited from class java.util.AbstractCollection
containsAll, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Methods inherited from interface java.util.List
containsAll
-
-
-
-
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 workspaceentryProvider- - provides available channels for load/mergeuserId- - current userIdchannelArray- - array of selected channels for load/mergeisSuperUser- - if true, then don't merge all available channelscurrentSiteId- - 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 workspacemergeAllOnWorkspaceTab- - if true, merge all channels in channelArrayentryProvider- - provides available channels for load/mergeuserId- - current userIdchannelArray- - array of selected channels for load/mergeisSuperUser- - if true, then don't merge all available channelscurrentSiteId- - 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(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.
-
-