org.tigris.scarab.om
Class MITList

java.lang.Object
  extended byorg.apache.torque.om.BaseObject
      extended byorg.tigris.scarab.om.BaseMITList
          extended byorg.tigris.scarab.om.MITList
All Implemented Interfaces:
org.apache.torque.om.Persistent, org.apache.fulcrum.intake.Retrievable, java.io.Serializable

public class MITList
extends BaseMITList
implements org.apache.torque.om.Persistent

A class representing a list (not List) of MITListItems. MIT stands for Module and IssueType. This class contains corresponding methods to many in Module which take a single IssueType. for example module.getAttributes(issueType) is replaced with mitList.getCommonAttributes() in cases where several modules and issuetypes are involved.

Version:
$Id: MITList.java 10080 2006-04-30 23:38:30Z jorgeuriarte $
Author:
Jon S. Stevens, John McNally
See Also:
Serialized Form

Nested Class Summary
 class MITList.ItemsIterator
           
 
Field Summary
 
Fields inherited from class org.tigris.scarab.om.BaseMITList
collMITListItems, collQuerys, collRModuleUserAttributes
 
Fields inherited from class org.apache.torque.om.BaseObject
NEW_ID
 
Constructor Summary
MITList()
           
 
Method Summary
 void addAll(MITList list)
           
 void addMITListItem(MITListItem item)
          Method called to associate a MITListItem object to this object through the MITListItem foreign key attribute
 void addToCriteria(org.apache.torque.util.Criteria crit)
           
 boolean contains(MITListItem item)
           
 MITList copy()
          Makes a copy of this object.
 java.util.List getAllRModuleOptionTree(Attribute attribute)
           
 java.util.List getAllRModuleUserAttributes()
           
 java.util.List getAttributes(boolean activeOnly, boolean commonOnly)
          Get the list of all attributes in this MITList.
 java.util.List getCommonAttributes()
           
 java.util.List getCommonAttributes(boolean activeOnly)
           
 java.util.List getCommonLeafRModuleOptions(Attribute attribute)
           
 java.util.List getCommonNonUserAttributes()
           
 java.util.List getCommonOptionAttributes()
           
 java.util.List getCommonRModuleOptionTree(Attribute attribute)
           
 java.util.List getCommonRModuleUserAttributes()
           
 java.util.List getCommonUserAttributes()
           
 java.util.List getCommonUserAttributes(boolean activeOnly)
          gets a list of all of the User Attributes common to all modules in the list.
 java.util.List getDescendantsUnion(AttributeOption option)
           
 java.util.List getExpandedMITListItems()
           
 MITListItem getFirstItem()
           
 IssueType getIssueType()
           
 java.util.List getIssueTypeIds()
           
 Module getModule()
           
(package private)  Module getModule(MITListItem item)
           
 java.util.List getModuleIds()
           
 java.util.List getModules()
           
protected  RModuleUserAttribute getNewRModuleUserAttribute(Attribute attribute)
           
 MITList getPermittedSublist(java.lang.String[] permissions, ScarabUser user)
          Creates a new MITList containing only those items from this list for which the searcher has at least one of the permission.
 MITList getPermittedSublist(java.lang.String permission, ScarabUser user)
          Creates a new MITList containing only those items from this list for which the searcher has the given permission.
 java.util.List getPotentialAssignees(boolean includeCommitters)
          potential assignee must have at least one of the permissions for the user attributes in all the modules.
protected  java.util.List getSavedRMUAs()
           
 ScarabUser getScarabUser()
          Returns the associated ScarabUser object.
 java.util.List getUserAttributePermissions()
          gets a list of permissions associated with the User Attributes that are active for this Module.
 boolean isAnonymous()
           
 boolean isCommon(Attribute attribute)
           
 boolean isCommon(Attribute attribute, boolean activeOnly)
          Checks all items to see if they contain the attribute.
 boolean isCommon(AttributeOption option)
           
 boolean isCommon(AttributeOption option, boolean activeOnly)
          Checks all items after the first to see if they contain the attribute.
 boolean isEmpty()
          tests if the list is empty
 boolean isModifiable()
          Alias for getModifiable()
 boolean isSingleIssueType()
           
 boolean isSingleModule()
           
 boolean isSingleModuleIssueType()
           
 java.util.Iterator iterator()
           
 void save(java.sql.Connection con)
          Stores the object in the database.
 void scheduleItemForDeletion(MITListItem item)
           
 void setScarabUser(ScarabUser v)
          Declares an association between this object and a ScarabUser object
 int size()
           
 java.lang.String toString()
           
 
Methods inherited from class org.tigris.scarab.om.BaseMITList
addQuery, addRModuleUserAttribute, copyInto, getActive, getByName, getByPeerName, getByPosition, getFieldNames, getListId, getMITListItems, getMITListItems, getMITListItems, getMITListItems, getMITListItemsJoinIssueType, getMITListItemsJoinMITList, getMITListItemsJoinScarabModule, getModifiable, getName, getPeer, getPrimaryKey, getQueryKey, getQuerys, getQuerys, getQuerys, getQuerys, getQuerysJoinFrequency, getQuerysJoinIssueType, getQuerysJoinMITList, getQuerysJoinScarabModule, getQuerysJoinScarabUserImpl, getQuerysJoinScope, getRModuleUserAttributes, getRModuleUserAttributes, getRModuleUserAttributes, getRModuleUserAttributes, getRModuleUserAttributesJoinAttribute, getRModuleUserAttributesJoinIssueType, getRModuleUserAttributesJoinMITList, getRModuleUserAttributesJoinScarabModule, getRModuleUserAttributesJoinScarabUserImpl, getScarabUser, getUserId, initMITListItems, initQuerys, initRModuleUserAttributes, isCacheOnSave, save, save, setActive, setListId, setModifiable, setName, setPrimaryKey, setPrimaryKey, setQueryKey, setScarabUserKey, setUserId
 
Methods inherited from class org.apache.torque.om.BaseObject
equals, equals, getLog, hashCode, isModified, isNew, resetModified, setModified, setNew, setPrimaryKey
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.torque.om.Persistent
getPrimaryKey, isModified, isNew, save, save, setModified, setNew, setPrimaryKey, setPrimaryKey
 

Constructor Detail

MITList

public MITList()
Method Detail

size

public int size()

isEmpty

public boolean isEmpty()
tests if the list is empty

Returns:
true if the list is empty, otherwise false

iterator

public java.util.Iterator iterator()

contains

public boolean contains(MITListItem item)

isModifiable

public boolean isModifiable()
Alias for getModifiable()

Returns:
a boolean value

isAnonymous

public boolean isAnonymous()

copy

public MITList copy()
             throws org.apache.torque.TorqueException
Makes a copy of this object. It creates a new object filling in the simple attributes. It then fills all the association collections and sets the related objects to isNew=true.

Overrides:
copy in class BaseMITList
Throws:
org.apache.torque.TorqueException

getPermittedSublist

public MITList getPermittedSublist(java.lang.String permission,
                                   ScarabUser user)
                            throws org.apache.torque.TorqueException
Creates a new MITList containing only those items from this list for which the searcher has the given permission.

Parameters:
permission - a String value
Returns:
a MITList value
Throws:
org.apache.torque.TorqueException

getPermittedSublist

public MITList getPermittedSublist(java.lang.String[] permissions,
                                   ScarabUser user)
                            throws org.apache.torque.TorqueException
Creates a new MITList containing only those items from this list for which the searcher has at least one of the permission.

Returns:
a MITList value
Throws:
org.apache.torque.TorqueException

getFirstItem

public MITListItem getFirstItem()

isSingleModuleIssueType

public boolean isSingleModuleIssueType()

isSingleModule

public boolean isSingleModule()

isSingleIssueType

public boolean isSingleIssueType()

getModule

public Module getModule()
                 throws org.apache.torque.TorqueException
Throws:
org.apache.torque.TorqueException

getIssueType

public IssueType getIssueType()
                       throws org.apache.torque.TorqueException
Throws:
org.apache.torque.TorqueException

getModule

Module getModule(MITListItem item)
           throws org.apache.torque.TorqueException
Throws:
org.apache.torque.TorqueException

setScarabUser

public void setScarabUser(ScarabUser v)
                   throws org.apache.torque.TorqueException
Declares an association between this object and a ScarabUser object

Overrides:
setScarabUser in class BaseMITList
Parameters:
v -
Throws:
org.apache.torque.TorqueException

getScarabUser

public ScarabUser getScarabUser()
                         throws org.apache.torque.TorqueException
Description copied from class: BaseMITList
Returns the associated ScarabUser object. If it was not retrieved before, the object is retrieved from the database

Overrides:
getScarabUser in class BaseMITList
Returns:
the associated ScarabUser object
Throws:
org.apache.torque.TorqueException

getAttributes

public java.util.List getAttributes(boolean activeOnly,
                                    boolean commonOnly)
                             throws org.apache.torque.TorqueException,
                                    com.workingdogs.village.DataSetException
Get the list of all attributes in this MITList. If activeOnly is set to true, return only active attrivutes. If commonOnly is true,return only attributes, which are common in all MITListItems in this list.

Parameters:
activeOnly -
commonOnly -
Returns:
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getCommonAttributes

public java.util.List getCommonAttributes()
                                   throws org.apache.torque.TorqueException,
                                          com.workingdogs.village.DataSetException
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getCommonAttributes

public java.util.List getCommonAttributes(boolean activeOnly)
                                   throws org.apache.torque.TorqueException,
                                          com.workingdogs.village.DataSetException
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

isCommon

public boolean isCommon(Attribute attribute,
                        boolean activeOnly)
                 throws org.apache.torque.TorqueException,
                        com.workingdogs.village.DataSetException
Checks all items to see if they contain the attribute.

Parameters:
attribute - an Attribute value
Returns:
a boolean value
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

isCommon

public boolean isCommon(Attribute attribute)
                 throws org.apache.torque.TorqueException,
                        com.workingdogs.village.DataSetException
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getCommonNonUserAttributes

public java.util.List getCommonNonUserAttributes()
                                          throws org.apache.torque.TorqueException,
                                                 com.workingdogs.village.DataSetException
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getCommonOptionAttributes

public java.util.List getCommonOptionAttributes()
                                         throws org.apache.torque.TorqueException,
                                                com.workingdogs.village.DataSetException
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getCommonUserAttributes

public java.util.List getCommonUserAttributes(boolean activeOnly)
                                       throws org.apache.torque.TorqueException,
                                              com.workingdogs.village.DataSetException
gets a list of all of the User Attributes common to all modules in the list.

Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getCommonUserAttributes

public java.util.List getCommonUserAttributes()
                                       throws org.apache.torque.TorqueException,
                                              com.workingdogs.village.DataSetException
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getPotentialAssignees

public java.util.List getPotentialAssignees(boolean includeCommitters)
                                     throws org.apache.torque.TorqueException,
                                            com.workingdogs.village.DataSetException
potential assignee must have at least one of the permissions for the user attributes in all the modules.

Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getUserAttributePermissions

public java.util.List getUserAttributePermissions()
                                           throws org.apache.torque.TorqueException,
                                                  com.workingdogs.village.DataSetException
gets a list of permissions associated with the User Attributes that are active for this Module.

Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getAllRModuleUserAttributes

public java.util.List getAllRModuleUserAttributes()
                                           throws org.apache.torque.TorqueException,
                                                  com.workingdogs.village.DataSetException,
                                                  org.apache.fulcrum.security.util.TurbineSecurityException
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
org.apache.fulcrum.security.util.TurbineSecurityException

getCommonRModuleUserAttributes

public java.util.List getCommonRModuleUserAttributes()
                                              throws org.apache.torque.TorqueException,
                                                     com.workingdogs.village.DataSetException,
                                                     org.apache.fulcrum.security.util.TurbineSecurityException
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
org.apache.fulcrum.security.util.TurbineSecurityException

getNewRModuleUserAttribute

protected RModuleUserAttribute getNewRModuleUserAttribute(Attribute attribute)
                                                   throws org.apache.torque.TorqueException
Throws:
org.apache.torque.TorqueException

getSavedRMUAs

protected java.util.List getSavedRMUAs()
                                throws org.apache.torque.TorqueException
Throws:
org.apache.torque.TorqueException

getCommonLeafRModuleOptions

public java.util.List getCommonLeafRModuleOptions(Attribute attribute)
                                           throws org.apache.torque.TorqueException,
                                                  ScarabException
Throws:
org.apache.torque.TorqueException
ScarabException

getCommonRModuleOptionTree

public java.util.List getCommonRModuleOptionTree(Attribute attribute)
                                          throws org.apache.torque.TorqueException,
                                                 ScarabException
Throws:
org.apache.torque.TorqueException
ScarabException

getAllRModuleOptionTree

public java.util.List getAllRModuleOptionTree(Attribute attribute)
                                       throws org.apache.torque.TorqueException
Throws:
org.apache.torque.TorqueException

getDescendantsUnion

public java.util.List getDescendantsUnion(AttributeOption option)
                                   throws org.apache.torque.TorqueException
Throws:
org.apache.torque.TorqueException

isCommon

public boolean isCommon(AttributeOption option)
                 throws org.apache.torque.TorqueException,
                        com.workingdogs.village.DataSetException
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

isCommon

public boolean isCommon(AttributeOption option,
                        boolean activeOnly)
                 throws org.apache.torque.TorqueException,
                        com.workingdogs.village.DataSetException
Checks all items after the first to see if they contain the attribute. It is assumed the attribute is included in the first item.

Parameters:
option - an Attribute value
Returns:
a boolean value
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getModuleIds

public java.util.List getModuleIds()

getModules

public java.util.List getModules()
                          throws org.apache.torque.TorqueException
Throws:
org.apache.torque.TorqueException

getIssueTypeIds

public java.util.List getIssueTypeIds()

addToCriteria

public void addToCriteria(org.apache.torque.util.Criteria crit)
                   throws org.apache.torque.TorqueException
Throws:
org.apache.torque.TorqueException

addAll

public void addAll(MITList list)
            throws org.apache.torque.TorqueException
Throws:
org.apache.torque.TorqueException

addMITListItem

public void addMITListItem(MITListItem item)
                    throws org.apache.torque.TorqueException
Description copied from class: BaseMITList
Method called to associate a MITListItem object to this object through the MITListItem foreign key attribute

Overrides:
addMITListItem in class BaseMITList
Parameters:
item - MITListItem
Throws:
org.apache.torque.TorqueException

getExpandedMITListItems

public java.util.List getExpandedMITListItems()

scheduleItemForDeletion

public void scheduleItemForDeletion(MITListItem item)

save

public void save(java.sql.Connection con)
          throws org.apache.torque.TorqueException
Description copied from class: BaseMITList
Stores the object in the database. If the object is new, it inserts it; otherwise an update is performed. This method is meant to be used as part of a transaction, otherwise use the save() method and the connection details will be handled internally

Specified by:
save in interface org.apache.torque.om.Persistent
Overrides:
save in class BaseMITList
Parameters:
con -
Throws:
org.apache.torque.TorqueException

toString

public java.lang.String toString()
Overrides:
toString in class BaseMITList


Copyright © 2000-2004 Tigris.org. All Rights Reserved.