com.trackstudio.securedkernel
Class SecuredCategoryAdapterManager

java.lang.Object
  extended by com.trackstudio.securedkernel.SecuredCategoryAdapterManager

public class SecuredCategoryAdapterManager
extends java.lang.Object

This manager is used for creating and deleting of task categories


Constructor Summary
SecuredCategoryAdapterManager()
           
 
Method Summary
 void addRelatedCategory(SessionContext sc, java.lang.String parentId, java.lang.String related)
          Add related category, tasks of which can create subtasks of current category type
 boolean canChangeWorkflow(SessionContext sc, java.lang.String categoryId)
          Checks for abilities to change workflow for this category.
 java.lang.String createCategory(SessionContext sc, java.lang.String taskId, java.lang.String name, java.lang.String workflowId, boolean handlerRequired, boolean groupHandlerAllowed)
          Create a new category
 void deleteCategory(SessionContext sc, java.lang.String categoryId)
          Delete category
 void editCategory(SessionContext sc, java.lang.String categoryId, java.lang.String workflowId, java.lang.String name, boolean handlerReq, boolean groupAllowed)
          Edit category
 java.util.ArrayList getAllPossibleSubcategories(SessionContext sc, java.lang.String categoryId)
           
 java.util.ArrayList getAvailableCategoryList(SessionContext sc, java.lang.String taskId)
          Get list of available categories for the task
 java.util.ArrayList getCategoryRuleList(SessionContext sc, java.lang.String prstatusId, java.lang.String categoryId)
          Get permission rules list for the category
 java.util.ArrayList getChildrenCategoryList(SessionContext sc, java.lang.String categoryId, java.lang.String taskId)
          Get list of children categories for the task
 java.util.ArrayList getCreatableCategoryList(SessionContext sc, java.lang.String taskId)
          Get categories that are acceptable for subtasks of the specified task
 java.lang.String getTemplate(SessionContext sc, java.lang.String categoryId)
          Get template for generation of description for new tasks of this category
 boolean hasSubcategories(SessionContext sc, java.lang.String categoryId, java.lang.String taskId)
          Checks task of this category can contains tasks
 boolean isCategoryCanBeHandler(SessionContext sc, java.lang.String taskId, java.lang.String categoryId, boolean isNew, java.lang.String submitter)
          Checks for abilities for the current user to be handler for tasks of this category
 boolean isCategoryDeletable(SessionContext sc, java.lang.String taskId, java.lang.String categoryId)
          Checks for abilities for the current user to delete tasks of this category
 boolean isCategoryEditable(SessionContext sc, java.lang.String taskId, java.lang.String categoryId)
          Checks for abilities to edit the category
 boolean isCategoryViewable(SessionContext sc, java.lang.String taskId, java.lang.String categoryId)
          Checks for abilities for the current user to view tasks of this category
 void removeRelatedCategory(SessionContext sc, java.lang.String parentId, java.lang.String related)
          Remove related category
 void setCategoryRule(SessionContext sc, java.lang.String categoryId, java.lang.String prstatusId, java.lang.String createType, java.lang.String viewType, java.lang.String modifyType, java.lang.String handlerType, java.lang.String deleteType)
          Set permission rule for the category
 void setCategoryTrigger(SessionContext sc, java.lang.String categoryId, java.lang.String before, java.lang.String insteadOf, java.lang.String after, java.lang.String updBefore, java.lang.String updInsteadOf, java.lang.String updAfter)
          Set triggers which will be fired when tasks of this category are created or edited
 void setTemplate(SessionContext sc, java.lang.String categoryId, java.lang.String template)
          Set template for generation of description for new tasks of this category
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecuredCategoryAdapterManager

public SecuredCategoryAdapterManager()
Method Detail

getAvailableCategoryList

public java.util.ArrayList getAvailableCategoryList(SessionContext sc,
                                                    java.lang.String taskId)
                                             throws GranException
Get list of available categories for the task

Parameters:
sc - session context
taskId - task's id
Returns:
array of categories ids
Throws:
GranException

createCategory

public java.lang.String createCategory(SessionContext sc,
                                       java.lang.String taskId,
                                       java.lang.String name,
                                       java.lang.String workflowId,
                                       boolean handlerRequired,
                                       boolean groupHandlerAllowed)
                                throws GranException
Create a new category

Parameters:
sc - session context
taskId - parent task's id
name - category's name
workflowId - id of category's workflow
handlerRequired - is task of this category can be without handler
groupHandlerAllowed - is user groups allowed to be handlers for tasks of this category
Returns:
id of a new category
Throws:
GranException

deleteCategory

public void deleteCategory(SessionContext sc,
                           java.lang.String categoryId)
                    throws GranException
Delete category

Parameters:
sc - session context
categoryId - category's id
Throws:
GranException

getTemplate

public java.lang.String getTemplate(SessionContext sc,
                                    java.lang.String categoryId)
                             throws GranException
Get template for generation of description for new tasks of this category

Parameters:
sc - session context
categoryId - category's id
Returns:
template text
Throws:
GranException

setTemplate

public void setTemplate(SessionContext sc,
                        java.lang.String categoryId,
                        java.lang.String template)
                 throws GranException
Set template for generation of description for new tasks of this category

Parameters:
sc - session context
categoryId - category's id
template - new template
Throws:
GranException

editCategory

public void editCategory(SessionContext sc,
                         java.lang.String categoryId,
                         java.lang.String workflowId,
                         java.lang.String name,
                         boolean handlerReq,
                         boolean groupAllowed)
                  throws GranException
Edit category

Parameters:
sc - session context
categoryId - category's id
workflowId - workflos's id
Throws:
GranException

getChildrenCategoryList

public java.util.ArrayList getChildrenCategoryList(SessionContext sc,
                                                   java.lang.String categoryId,
                                                   java.lang.String taskId)
                                            throws GranException
Get list of children categories for the task

Parameters:
sc - session context
categoryId - category's id
taskId - task id
Returns:
liset of Category
Throws:
GranException
See Also:
Category

hasSubcategories

public boolean hasSubcategories(SessionContext sc,
                                java.lang.String categoryId,
                                java.lang.String taskId)
                         throws GranException
Checks task of this category can contains tasks

Parameters:
sc - session context
categoryId - category's id
taskId - task id
Returns:
Throws:
GranException
See Also:
Category

getAllPossibleSubcategories

public java.util.ArrayList getAllPossibleSubcategories(SessionContext sc,
                                                       java.lang.String categoryId)
                                                throws GranException
Throws:
GranException

setCategoryRule

public void setCategoryRule(SessionContext sc,
                            java.lang.String categoryId,
                            java.lang.String prstatusId,
                            java.lang.String createType,
                            java.lang.String viewType,
                            java.lang.String modifyType,
                            java.lang.String handlerType,
                            java.lang.String deleteType)
                     throws GranException
Set permission rule for the category

Parameters:
sc - session context
categoryId - category's id
prstatusId - user status for which permissions should be set
createType - CREATE_ALL, CREATE_HANDLER, CREATE_SUBMITTER, CREATE_SUBMITTER_AND_HANDLER or CREATE_NONE
viewType - VIEW_ALL, VIEW_HANDLER, VIEW_SUBMITTER, VIEW_SUBMITTER_AND_HANDLER or VIEW_NONE
modifyType - EDIT_ALL, EDIT_HANDLER, EDIT_SUBMITTER, EDIT_SUBMITTER_AND_HANDLER or EDIT_NONE
handlerType - BE_HANDLER_ALL, BE_HANDLER_HANDLER, BE_HANDLER_SUBMITTER, BE_HANDLER_SUBMITTER_AND_HANDLER or BE_HANDLER_NONE
deleteType - DELETE_ALL, DELETE_HANDLER, DELETE_SUBMITTER, DELETE_SUBMITTER_AND_HANDLER or DELETE_NONE
Throws:
GranException
See Also:
CategoryConstants

addRelatedCategory

public void addRelatedCategory(SessionContext sc,
                               java.lang.String parentId,
                               java.lang.String related)
                        throws GranException
Add related category, tasks of which can create subtasks of current category type

Parameters:
sc - session context
parentId - parent category's id
related - related category's id
Throws:
GranException

removeRelatedCategory

public void removeRelatedCategory(SessionContext sc,
                                  java.lang.String parentId,
                                  java.lang.String related)
                           throws GranException
Remove related category

Parameters:
sc - session context
parentId - parent category's id
related - related category's id
Throws:
GranException

getCreatableCategoryList

public java.util.ArrayList getCreatableCategoryList(SessionContext sc,
                                                    java.lang.String taskId)
                                             throws GranException
Get categories that are acceptable for subtasks of the specified task

Parameters:
sc - session context
taskId - task's id
Returns:
array of Category
Throws:
GranException
See Also:
Category

getCategoryRuleList

public java.util.ArrayList getCategoryRuleList(SessionContext sc,
                                               java.lang.String prstatusId,
                                               java.lang.String categoryId)
                                        throws GranException
Get permission rules list for the category

Parameters:
sc - session context
prstatusId - user status for which you want to retreave permissions
categoryId - category's id
Returns:
list of permission type declared in CategoryConstants
Throws:
GranException
See Also:
CategoryConstants

canChangeWorkflow

public boolean canChangeWorkflow(SessionContext sc,
                                 java.lang.String categoryId)
                          throws GranException
Checks for abilities to change workflow for this category. If database contains one or more task of this category, you could not change workflow.

Parameters:
categoryId - category's id
Returns:
true if can
Throws:
GranException

isCategoryEditable

public boolean isCategoryEditable(SessionContext sc,
                                  java.lang.String taskId,
                                  java.lang.String categoryId)
                           throws GranException
Checks for abilities to edit the category

Parameters:
sc - session context
taskId - task's id
categoryId - category's id
Returns:
true if editable
Throws:
GranException

isCategoryCanBeHandler

public boolean isCategoryCanBeHandler(SessionContext sc,
                                      java.lang.String taskId,
                                      java.lang.String categoryId,
                                      boolean isNew,
                                      java.lang.String submitter)
                               throws GranException
Checks for abilities for the current user to be handler for tasks of this category

Parameters:
sc - session context
taskId - task's id
categoryId - category's id
isNew - is task exists
Returns:
true if can
Throws:
GranException

isCategoryDeletable

public boolean isCategoryDeletable(SessionContext sc,
                                   java.lang.String taskId,
                                   java.lang.String categoryId)
                            throws GranException
Checks for abilities for the current user to delete tasks of this category

Parameters:
sc - session context
taskId - task's id
categoryId - category's id
Returns:
true if can
Throws:
GranException

isCategoryViewable

public boolean isCategoryViewable(SessionContext sc,
                                  java.lang.String taskId,
                                  java.lang.String categoryId)
                           throws GranException
Checks for abilities for the current user to view tasks of this category

Parameters:
sc - session context
taskId - task's id
categoryId - category's id
Returns:
true if can
Throws:
GranException

setCategoryTrigger

public void setCategoryTrigger(SessionContext sc,
                               java.lang.String categoryId,
                               java.lang.String before,
                               java.lang.String insteadOf,
                               java.lang.String after,
                               java.lang.String updBefore,
                               java.lang.String updInsteadOf,
                               java.lang.String updAfter)
                        throws GranException
Set triggers which will be fired when tasks of this category are created or edited

Parameters:
sc - session context
categoryId - category's id
before - id of create before trigger
insteadOf - id of create instead trigger
after - id of create after trigger
updBefore - id of edit before trigger
updInsteadOf - id of edit instead trigger
updAfter - id of edit after trigger
Throws:
GranException


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