gps.clientapi
Class ApplicationAPI

java.lang.Object
  extended by gps.clientapi.ApplicationAPI

public class ApplicationAPI
extends java.lang.Object

This class provides API for creating complete project application It includes the following: 1. Creation of Project Application 2. Creation of Project Workflows, States 3. Copy Query Template, Node from the Source Application 4. Assignment of Node to States 5. Role Assignments 6. Menu Assignment

Author:
kchinta

Field Summary
 java.lang.String SourceApplicationName
           
 
Constructor Summary
ApplicationAPI()
          Default Constructor.
ApplicationAPI(java.lang.String servletURL)
          Constructor.
 
Method Summary
 java.lang.String assignApplicationToRoles(java.lang.Double applicationID, java.util.ArrayList roleNames)
          assign application to the given roles
 java.lang.Double createProjectPlanApplication(java.lang.String applicationName, java.lang.String userName, java.lang.String sourceApplicationName)
          creates project application for the given information
 java.util.ArrayList createWorkflow(java.lang.Double ApplicationId, java.lang.Double WorkflowId, java.util.ArrayList statesInfo, java.lang.String NodeTypeFlag)
          creates flow of the work - includes states and operations, for the given workflow
 java.lang.Double createWorkflowHeader(java.lang.Double ApplicationId, java.lang.String workflowName)
          creates workflow header for the given workflow name in the selected project application
 java.util.ArrayList getAllCategoriesForApplication(java.lang.String applicationName)
          Getting all categories for the application using applicationName.
 java.util.ArrayList getApplicationCategoriesForRoleUser(java.lang.String applicationName, java.lang.String roleName, java.lang.String userName)
          Gets the application categories for role user.
 java.util.HashMap getEntireCategoryObject()
          Gets the entire category object.
 java.util.ArrayList getProjectPlanApplications()
          Gets the project plan applications.
 java.lang.Object getRoleCategoriesForApplication(java.lang.String roleName, java.lang.String applicationName)
          Gets the role categories for application using roleName and applicationName
 java.lang.String getSourceApplicationName()
           
 void setSourceApplicationName(java.lang.String sourceApplicationName)
           
 java.util.HashMap subscribeEntireCategoryObject()
          Subscribe entire category object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SourceApplicationName

public java.lang.String SourceApplicationName
Constructor Detail

ApplicationAPI

public ApplicationAPI()
Default Constructor.


ApplicationAPI

public ApplicationAPI(java.lang.String servletURL)
Constructor.

Parameters:
servletURL - the servlet url
Method Detail

getSourceApplicationName

public java.lang.String getSourceApplicationName()

setSourceApplicationName

public void setSourceApplicationName(java.lang.String sourceApplicationName)

getAllCategoriesForApplication

public java.util.ArrayList getAllCategoriesForApplication(java.lang.String applicationName)
                                                   throws java.lang.Exception
Getting all categories for the application using applicationName.

Parameters:
applicationName - the application name
Returns:
the all categories for application
Throws:
java.lang.Exception - the exception

getRoleCategoriesForApplication

public java.lang.Object getRoleCategoriesForApplication(java.lang.String roleName,
                                                        java.lang.String applicationName)
                                                 throws java.lang.Exception
Gets the role categories for application using roleName and applicationName

Parameters:
roleName - the role name
applicationName - the application name
Returns:
the role categories for application
Throws:
java.lang.Exception - the exception

getProjectPlanApplications

public java.util.ArrayList getProjectPlanApplications()
                                               throws java.lang.Exception
Gets the project plan applications.

Returns:
the project plan applications
Throws:
java.lang.Exception - the exception

getEntireCategoryObject

public java.util.HashMap getEntireCategoryObject()
                                          throws java.lang.Exception
Gets the entire category object.

Returns:
the entire category object
Throws:
java.lang.Exception - the exception

subscribeEntireCategoryObject

public java.util.HashMap subscribeEntireCategoryObject()
                                                throws java.lang.Exception
Subscribe entire category object.

Returns:
the hash map
Throws:
java.lang.Exception - the exception

getApplicationCategoriesForRoleUser

public java.util.ArrayList getApplicationCategoriesForRoleUser(java.lang.String applicationName,
                                                               java.lang.String roleName,
                                                               java.lang.String userName)
                                                        throws java.lang.Exception
Gets the application categories for role user.

Parameters:
applicationName - the application name
roleName - the role name
userName - the user name
Returns:
the application categories for role user
Throws:
java.lang.Exception - the exception

createProjectPlanApplication

public java.lang.Double createProjectPlanApplication(java.lang.String applicationName,
                                                     java.lang.String userName,
                                                     java.lang.String sourceApplicationName)
                                              throws java.lang.Exception
creates project application for the given information

Parameters:
applicationName - String - name of the project application
userName - String - who creates the project application
sourceApplicationName - String - used for copy from for Query Template and Node
Returns:
applicationID - Double
Throws:
java.lang.Exception - the exception

createWorkflowHeader

public java.lang.Double createWorkflowHeader(java.lang.Double ApplicationId,
                                             java.lang.String workflowName)
                                      throws java.lang.Exception
creates workflow header for the given workflow name in the selected project application

Parameters:
ApplicationId - Double
workflowName - String - name of the workflow
Returns:
workflowID - Double
Throws:
java.lang.Exception - the exception

createWorkflow

public java.util.ArrayList createWorkflow(java.lang.Double ApplicationId,
                                          java.lang.Double WorkflowId,
                                          java.util.ArrayList statesInfo,
                                          java.lang.String NodeTypeFlag)
                                   throws java.lang.Exception
creates flow of the work - includes states and operations, for the given workflow

Parameters:
ApplicationId - Double
WorkflowId - Double
statesInfo - ArrayList - The ArrayList should contain the following template: [[state1, type (STATE/WORKFLOW), predecessor],[state2, type (STATE/WORKFLOW),predecessor (State1)],[],....]
sourceApplicationName - String - used for copy from for Query Template and Node
Returns:
stateIDList - ArrayList
Throws:
java.lang.Exception - the exception

assignApplicationToRoles

public java.lang.String assignApplicationToRoles(java.lang.Double applicationID,
                                                 java.util.ArrayList roleNames)
                                          throws java.lang.Exception
assign application to the given roles

Parameters:
applicationID - the application id
roleNames - ArrayList - list of role names, to whom the given application should be assigned
Returns:
returnMessage - String
Throws:
java.lang.Exception - the exception