gran.app.adapter.kernel.task
Class BaseTaskAdapter

java.lang.Object
  |
  +--gran.app.adapter.kernel.task.BaseTaskAdapter
All Implemented Interfaces:
Adapter, KernelAdapter, TaskAdapter

public class BaseTaskAdapter
extends java.lang.Object
implements TaskAdapter


Constructor Summary
BaseTaskAdapter()
           
 
Method Summary
 java.util.HashSet allowedChildsImpl(java.lang.String taskid, java.lang.String userid, java.util.HashSet result)
          Get collection of of allowed childs
 java.util.HashSet allowedChildsWithSubtasksImpl(java.lang.String taskid, java.lang.String userid, java.util.HashSet result)
          Get collection of of allowed childs
 int containSubtaskImpl(java.lang.String taskid, int result)
          Get amount of subtasks for current task
 void deleteTasksImpl(java.lang.String[] ids)
          delete selected task
 java.lang.String findByShortNameImpl(java.lang.String name, java.lang.String result)
          Find task by short name
 int getChildCountImpl(java.lang.String id, int result)
          Get amount of subtasks for current task
 java.util.Collection getChildrenIdCollectionImpl(java.lang.String taskId, java.util.Collection result)
           
 java.util.HashMap getChildsHashImpl(java.lang.String id, java.util.HashMap result)
           
 java.lang.String getDescription()
          Get description of adapter as plain text
 int getMessageCountImpl(java.lang.String id, int result)
          Get amount of messages for current task
 java.util.Collection getMessagesImpl(java.lang.String taskId, java.util.Collection result)
          Returns collection of messages.
 java.util.Collection getPossibleParentListImpl(java.lang.String taskid, java.util.Collection tasksWithShortNames, java.util.Collection result)
          Get list of possible task parents.
 java.util.Collection getProjectListImpl(java.lang.String userid, java.util.Collection result)
          Get list of available projects for current user
 java.lang.String getProjectNameImpl(java.lang.String id, java.lang.String result)
           
 java.util.ArrayList getTaskChainImpl(java.lang.String startid, java.lang.String stopid, java.util.ArrayList result)
          Get list of task from startid to stopid.
 java.util.ArrayList getTaskIdChainImpl(java.lang.String startid, java.lang.String stopid, java.util.ArrayList result)
          Get list of task from startid to stopid.
 gran.app.slider.TaskSlider getTaskListImpl(java.lang.String taskid, java.lang.String userid, gran.app.filter.FValue flthm, boolean vABACL, boolean withUDF, int pagen, gran.app.slider.TaskSlider result)
          Get list of subtasks
 java.util.Collection getUsersImpl(java.lang.String id, java.util.Collection result)
          Get has of allowed users
 boolean init()
          Initialize adapter.
 gran.model.Task newTaskImpl(java.lang.String taskid, java.lang.String userid, java.lang.String categoryid, java.lang.String name, gran.model.Task result)
          create new child task
 void saveTaskImpl(java.lang.String id, java.lang.String shortname, java.lang.String name, java.lang.String description, java.lang.String hrs, java.lang.String mns, java.lang.String deadline, java.lang.String category, java.lang.String priority, java.lang.String parent, java.lang.String userid, boolean sendMail)
          Save task
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseTaskAdapter

public BaseTaskAdapter()
Method Detail

init

public boolean init()
Description copied from interface: Adapter
Initialize adapter. TrackStudio calls this method during startup.

Specified by:
init in interface Adapter
Returns:
true when adapter initialized, false otherwise.

getDescription

public java.lang.String getDescription()
Description copied from interface: Adapter
Get description of adapter as plain text

Specified by:
getDescription in interface Adapter

saveTaskImpl

public void saveTaskImpl(java.lang.String id,
                         java.lang.String shortname,
                         java.lang.String name,
                         java.lang.String description,
                         java.lang.String hrs,
                         java.lang.String mns,
                         java.lang.String deadline,
                         java.lang.String category,
                         java.lang.String priority,
                         java.lang.String parent,
                         java.lang.String userid,
                         boolean sendMail)
                  throws gran.exception.CantCreateTaskException,
                         gran.exception.GranException
Description copied from interface: TaskAdapter
Save task

Specified by:
saveTaskImpl in interface TaskAdapter
Parameters:
id - - task id
shortname - - task alias
name - - название задачи
description - - task description
hrs - - budget (hh)
mns - - budget (mm)
deadline - - task deadline
category - - task category
priority - - task priority
parent - - task parent
userid - - submitter identifier
sendMail - - send mail when create this message
Throws:
gran.exception.CantCreateTaskException
gran.exception.GranException

newTaskImpl

public gran.model.Task newTaskImpl(java.lang.String taskid,
                                   java.lang.String userid,
                                   java.lang.String categoryid,
                                   java.lang.String name,
                                   gran.model.Task result)
                            throws gran.exception.GranException
Description copied from interface: TaskAdapter
create new child task

Specified by:
newTaskImpl in interface TaskAdapter
Parameters:
taskid - - parent task identifier
userid - - submitter identifier
categoryid - - category of new task identifier
name - - name of new task
gran.exception.GranException

deleteTasksImpl

public void deleteTasksImpl(java.lang.String[] ids)
                     throws gran.exception.GranException
Description copied from interface: TaskAdapter
delete selected task

Specified by:
deleteTasksImpl in interface TaskAdapter
Parameters:
ids - array of task identifiers
gran.exception.GranException

getTaskListImpl

public gran.app.slider.TaskSlider getTaskListImpl(java.lang.String taskid,
                                                  java.lang.String userid,
                                                  gran.app.filter.FValue flthm,
                                                  boolean vABACL,
                                                  boolean withUDF,
                                                  int pagen,
                                                  gran.app.slider.TaskSlider result)
                                           throws java.lang.Exception
Description copied from interface: TaskAdapter
Get list of subtasks

Specified by:
getTaskListImpl in interface TaskAdapter
Parameters:
taskid - - task identifier
userid - - logged user identifier
flthm - - filter
vABACL - - is access to taskid allowed by ACL ?
withUDF - - any UDFs for taskid
pagen - - page number
java.lang.Exception

findByShortNameImpl

public java.lang.String findByShortNameImpl(java.lang.String name,
                                            java.lang.String result)
                                     throws gran.exception.GranException
Description copied from interface: TaskAdapter
Find task by short name

Specified by:
findByShortNameImpl in interface TaskAdapter
gran.exception.GranException

getPossibleParentListImpl

public java.util.Collection getPossibleParentListImpl(java.lang.String taskid,
                                                      java.util.Collection tasksWithShortNames,
                                                      java.util.Collection result)
                                               throws gran.exception.GranException
Description copied from interface: TaskAdapter
Get list of possible task parents.

Specified by:
getPossibleParentListImpl in interface TaskAdapter
gran.exception.GranException

containSubtaskImpl

public int containSubtaskImpl(java.lang.String taskid,
                              int result)
                       throws gran.exception.GranException
Description copied from interface: TaskAdapter
Get amount of subtasks for current task

Specified by:
containSubtaskImpl in interface TaskAdapter
Throws:
gran.exception.GranException

getTaskChainImpl

public java.util.ArrayList getTaskChainImpl(java.lang.String startid,
                                            java.lang.String stopid,
                                            java.util.ArrayList result)
                                     throws gran.exception.GranException
Description copied from interface: TaskAdapter
Get list of task from startid to stopid. Set startid = null for list from root task

Specified by:
getTaskChainImpl in interface TaskAdapter
gran.exception.GranException

getTaskIdChainImpl

public java.util.ArrayList getTaskIdChainImpl(java.lang.String startid,
                                              java.lang.String stopid,
                                              java.util.ArrayList result)
                                       throws gran.exception.GranException
Description copied from interface: TaskAdapter
Get list of task from startid to stopid. Set startid = null for list from root task

Specified by:
getTaskIdChainImpl in interface TaskAdapter
gran.exception.GranException

getProjectListImpl

public java.util.Collection getProjectListImpl(java.lang.String userid,
                                               java.util.Collection result)
                                        throws gran.exception.GranException
Description copied from interface: TaskAdapter
Get list of available projects for current user

Specified by:
getProjectListImpl in interface TaskAdapter
gran.exception.GranException

allowedChildsImpl

public java.util.HashSet allowedChildsImpl(java.lang.String taskid,
                                           java.lang.String userid,
                                           java.util.HashSet result)
                                    throws gran.exception.GranException
Description copied from interface: TaskAdapter
Get collection of of allowed childs

Specified by:
allowedChildsImpl in interface TaskAdapter
gran.exception.GranException

allowedChildsWithSubtasksImpl

public java.util.HashSet allowedChildsWithSubtasksImpl(java.lang.String taskid,
                                                       java.lang.String userid,
                                                       java.util.HashSet result)
                                                throws gran.exception.GranException
Description copied from interface: TaskAdapter
Get collection of of allowed childs

Specified by:
allowedChildsWithSubtasksImpl in interface TaskAdapter
gran.exception.GranException

getProjectNameImpl

public java.lang.String getProjectNameImpl(java.lang.String id,
                                           java.lang.String result)
                                    throws gran.exception.GranException
Specified by:
getProjectNameImpl in interface TaskAdapter
gran.exception.GranException

getChildrenIdCollectionImpl

public java.util.Collection getChildrenIdCollectionImpl(java.lang.String taskId,
                                                        java.util.Collection result)
                                                 throws gran.exception.GranException
Specified by:
getChildrenIdCollectionImpl in interface TaskAdapter
gran.exception.GranException

getMessagesImpl

public java.util.Collection getMessagesImpl(java.lang.String taskId,
                                            java.util.Collection result)
                                     throws gran.exception.GranException
Description copied from interface: TaskAdapter
Returns collection of messages. This method has default access

Specified by:
getMessagesImpl in interface TaskAdapter
Parameters:
taskId - Task identifier
Returns:
Collection of messages, can be empty
Throws:
gran.exception.GranException

getChildsHashImpl

public java.util.HashMap getChildsHashImpl(java.lang.String id,
                                           java.util.HashMap result)
                                    throws gran.exception.GranException
Specified by:
getChildsHashImpl in interface TaskAdapter
gran.exception.GranException

getUsersImpl

public java.util.Collection getUsersImpl(java.lang.String id,
                                         java.util.Collection result)
                                  throws gran.exception.GranException
Description copied from interface: TaskAdapter
Get has of allowed users

Specified by:
getUsersImpl in interface TaskAdapter
gran.exception.GranException

getMessageCountImpl

public int getMessageCountImpl(java.lang.String id,
                               int result)
                        throws gran.exception.GranException
Description copied from interface: TaskAdapter
Get amount of messages for current task

Specified by:
getMessageCountImpl in interface TaskAdapter
gran.exception.GranException

getChildCountImpl

public int getChildCountImpl(java.lang.String id,
                             int result)
                      throws gran.exception.GranException
Description copied from interface: TaskAdapter
Get amount of subtasks for current task

Specified by:
getChildCountImpl in interface TaskAdapter
gran.exception.GranException


Copyright © 2002-2003 TrackStudio, Ltd. All Rights Reserved.