com.plumtree.remote.prc.collaboration.tasklist
Interface ITaskList


public interface ITaskList

An ITaskList is a container for ITask. It handles task creation and removal. To create a subtask, use ITask.createSubTask. To create a dependent task, use ITask.addDependentTask.

All task list modifications will not be stored permanently until store is called.


Method Summary
 ITask createTask(java.lang.String name, java.lang.String description, java.util.Date startTime, java.util.Date endTime)
          Creates and returns a task object.
 AccessLevel getAccessLevel(RoleType roleType)
          Returns task list access level for a given role type.
 IProject getContainingProject()
          Returns the project that this task list belongs to.
 java.util.Date getCreatedDate()
          Returns the creation date.
 java.lang.String getDescription()
          Returns the task list description.
 java.lang.String getDetailsURL()
          Returns the URL at which the task list details can be viewed.
 int getID()
          Returns the task list ID.
 java.util.Date getLastModifiedDate()
          Returns the last modified date.
 java.lang.String getName()
          Returns the task list name.
 int getOwnerUserID()
          Returns the user ID of the owner of this object.
 boolean hasCreatedDate()
          Returns true if created date is available, else false.
 boolean hasLastModifiedDate()
          Returns true if last modified date is available, else false.
 boolean isActionAllowed(TaskListPermission permission)
          Returns whether a given TaskListPermission is allowed for this task list.
 boolean isDefaultSecurity()
          Indicates whether this task list uses project-default security.
 void removeTask(ITask task)
          Removes a task given the taskID.
 void setAccessLevel(RoleType roleType, AccessLevel accessLevel)
          Set task list access level for a given role type.
 void setDefaultSecurity(boolean isDefaultSecurity)
          Enables or disables this task list's use of project default security.
 void setDescription(java.lang.String description)
          Sets the task list description.
 void setName(java.lang.String name)
          Sets the task list name.
 void store()
          Stores the task list.
 

Method Detail

createTask

public ITask createTask(java.lang.String name,
                        java.lang.String description,
                        java.util.Date startTime,
                        java.util.Date endTime)
Creates and returns a task object. The newly created task object will not be stored until store is called.

Note that the value of the start date and end date stored in the database may vary by a few milliseconds from the supplied date. The date in this object will reflect the stored date after a call to Store.

Parameters:
name - name of the task; cannot be null.
description - description of the task; cannot be null.
startTime - start time of the task, cannot be null.
endTime - end time of the task, cannot be null.
Returns:
an ITask.
Throws:
java.lang.IllegalStateException - if the object has not yet been stored or has already been removed.

getAccessLevel

public AccessLevel getAccessLevel(RoleType roleType)
Returns task list access level for a given role type.

Parameters:
roleType - the role type; cannot be null.
Returns:
object access level for a given role type.
Throws:
java.lang.IllegalStateException - if the object already been removed.

getContainingProject

public IProject getContainingProject()
                              throws CollaborationException,
                                     java.rmi.RemoteException
Returns the project that this task list belongs to.

Returns:
the project that this task list belongs to.
Throws:
CollaborationException - if the method call resulted in an error.
java.lang.IllegalStateException - if the object already been removed.
java.rmi.RemoteException - if there is a communication problem during the execution of the remote method call.

getCreatedDate

public java.util.Date getCreatedDate()
Returns the creation date.

Returns:
date the creation date.
Throws:
java.lang.IllegalStateException - if the object has not yet been stored or has already been removed.

getDescription

public java.lang.String getDescription()
Returns the task list description.

Returns:
the task list description.
Throws:
java.lang.IllegalStateException - if the object already been removed.

getDetailsURL

public java.lang.String getDetailsURL()
Returns the URL at which the task list details can be viewed.

Note: This URL is gatewayed using the collaboration server's primary portal.

Returns:
the task list details URL
Throws:
java.lang.IllegalStateException - if the object has not yet been stored or has already been removed.

getID

public int getID()
Returns the task list ID.

Returns:
the task list ID.
Throws:
java.lang.IllegalStateException - if the object has not yet been stored or has already been removed.

getLastModifiedDate

public java.util.Date getLastModifiedDate()
Returns the last modified date. The last modified date of a task list will also get updated whenever a new task is created in this task list.

Returns:
the last modified date.
Throws:
java.lang.IllegalStateException - if the object has not yet been stored or has already been removed.

getName

public java.lang.String getName()
Returns the task list name.

Returns:
the task list name.
Throws:
java.lang.IllegalStateException - if the object already been removed.

getOwnerUserID

public int getOwnerUserID()
Returns the user ID of the owner of this object. The owner of an object is the user who creates the object.

Returns:
the owner user ID.
Throws:
java.lang.IllegalStateException - if the object has not yet been stored or has already been removed.

hasCreatedDate

public boolean hasCreatedDate()
Returns true if created date is available, else false.

Returns:
true if created date is available, else false.
Throws:
java.lang.IllegalStateException - if the object has already been removed.

hasLastModifiedDate

public boolean hasLastModifiedDate()
Returns true if last modified date is available, else false.

Returns:
true if last modified date is available, else false.
Throws:
java.lang.IllegalStateException - if the object has already been removed.

isActionAllowed

public boolean isActionAllowed(TaskListPermission permission)
                        throws CollaborationException,
                               java.rmi.RemoteException
Returns whether a given TaskListPermission is allowed for this task list. This method can be used to determine if a user can perform a given action within the context of a task list such as editing a task list, copying a task list, editing task list security, etc. See the enumeration type TaskListPermission for details about specific task list permissions.

Parameters:
permission - task list permission.
Returns:
true if the user can perform the given action, else false.
Throws:
java.lang.IllegalStateException - if the object has not yet been stored or has already been removed.
CollaborationException - if the method call resulted in an error.
java.rmi.RemoteException - if there is a communication problem during the execution of the remote method call.

isDefaultSecurity

public boolean isDefaultSecurity()
Indicates whether this task list uses project-default security. If true, trying to modify security on the current object alone will not have any effect. setDefaultSecurity must be set to false in order to modify individual object's security. Default value for default security on a task list is true.

Returns:
true if the object uses project-default security, false if the object is enabled to use its own security, i.e., setDefaultSecurity has been called with a false value.
Throws:
java.lang.IllegalStateException - if the object already been removed.

removeTask

public void removeTask(ITask task)
                throws CollaborationException,
                       java.rmi.RemoteException
Removes a task given the taskID.

Parameters:
task - task to be removed; cannot be null.
Throws:
CollaborationException - if the method call resulted. in an error
java.lang.IllegalStateException - if the object has not yet been stored or has already been removed.
java.lang.IllegalArgumentException - if id of the task is no > 0.
java.rmi.RemoteException - if there is a communication problem during the execution of the remote method call.

setAccessLevel

public void setAccessLevel(RoleType roleType,
                           AccessLevel accessLevel)
Set task list access level for a given role type. The task list must have its default security disabled prior to this call using setDefaultSecurity{false}. Any security change on the task list will be automatically applied to all tasks in this task list after store is called. Trying to modify the access level for a Leader role type will throw CollaborationException upon store.
 //Below sample code shows how to set the access level on a discussion.
 
 //verify if the current user has the permission to edit security for the discussion
 boolean hasPermission = discussion.isActionAllowed(DiscussionPermission.EDIT_SECURITY);
 
 //after making sure the current user has permission to edit security, modify the access level
 if (hasPermission)
 
 {
 //first disable using project default security
 discussion.setDefaultSecurity(false);
 
 //then change discussion to have the READ access level for member role type
 discussion.setAccessLevel(RoleType.MEMBER, AccessLevels.READ);
 
 //need to store the discussion to persist the access level change
 discussion.store();
 }
 

Parameters:
roleType - the role type for which access level will be set; cannot be null.
accessLevel - the access level; cannot be null.
Throws:
java.lang.IllegalStateException - if project default security is used, call setDefaultSecurity(false) prior to modify object access level.

setDefaultSecurity

public void setDefaultSecurity(boolean isDefaultSecurity)
Enables or disables this task list's use of project default security. Calling this method with true will enable defaultSecurity, calling it with false will disable defaultSecurity.

By default all objects are created with defaultSecurity set to true. To modify security on individual objects in a project, the objects must have defaultSecurity disabled prior to modification. After this method is called, any project-level security modification will not be applied to the objects, and only individual object's security modification will be used.

This method might be used in conjunction with isDefaultSecurity, which would indicate if the current object has defaultSecurity enabled.

Parameters:
isDefaultSecurity - true if it uses default security, otherwise false
Throws:
java.lang.IllegalStateException - if the object already been removed.

setDescription

public void setDescription(java.lang.String description)
Sets the task list description.

Parameters:
description - the task list description; cannot be null.
Throws:
java.lang.IllegalStateException - if the object already been removed.

setName

public void setName(java.lang.String name)
Sets the task list name.

Parameters:
name - the task list name; cannot be null
Throws:
java.lang.IllegalStateException - if the object already been removed.

store

public void store()
           throws CollaborationException,
                  java.rmi.RemoteException
Stores the task list. Any modification of the task list will not be stored permanently until this method is called. Can be used to store a newly created task list, or edit an existing task list.

Throws:
CollaborationException - if the method call resulted in an error.
java.lang.IllegalStateException - if the object already been removed.
java.rmi.RemoteException - if there is a communication problem during the execution of the remote method call.


For additional information on the IDK, including tutorials, blogs, code samples and more,see the AquaLogic User Interaction Developer Center on BEA dev2dev.

Copyright ©2007 BEA Systems, Inc. All Rights Reserved.