Package com.pathomation
Class Control
java.lang.Object
com.pathomation.Control
Wrapper class around PMA.control API
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionformatTrainingSessionProperly
(org.json.JSONObject session) Helper method to convert a JSON representation of a PMA.control training session to a proper Java-esque structuregetAllParticipants
(String pmaControlURL, String pmaCoreSessionID) This method is used to get all participants registered across all sessionsstatic org.json.JSONObject
getCaseCollection
(String pmaControlURL, Integer pmaControlCaseCollectionID, String pmaCoreSessionID) This method is used to get a case collection details (by ID)static org.json.JSONObject
getCaseCollectionByTitle
(String pmaControlURL, String pmaCoreSessionID, String caseCollectionTitle) This method is used to get a case collection by its titlegetCaseCollections
(String pmaControlURL, Integer pmaControlProjectID, String pmaCoreSessionID) This method is used to retrieve case collection details that belong to a specific projectgetCaseCollectionTitles
(String pmaControlURL, Integer pmaControlProjectID, String pmaCoreSessionID) This method is used to retrieve case collections (possibly filtered by project ID), titles onlygetCaseCollectionTitlesDict
(String pmaControlURL, Integer pmaControlProjectID, String pmaCoreSessionID) This method is used to retrieve case collections (possibly filtered by project ID), returns a map of case collection IDs and titlesstatic Integer
getCaseCollectionTrainingSessionID
(String pmaControlURL, Integer pmaControlTrainingSessionID, Integer pmaControlCaseCollectionID, String pmaCoreSessionID) This method is a helper to obtain internal technical keys that link training sessions with case collectionsstatic org.json.JSONArray
getCaseForCaseCollection
(String pmaControlURL, Integer pmaControlCaseCollectionID, String pmaCoreSessionID) This method is used to retrieve cases for a specific collectiongetProject
(String pmaControlURL, Integer pmaControlProjectID, String pmaCoreSessionID) This method is used to get a project details (project defined by its ID)getProjectByCaseCollectionID
(String pmaControlURL, Integer pmacontrolCaseCollectionID, String pmaCoreSessionID) This method is used to retrieve project based on the case collection IDgetProjectByCaseID
(String pmaControlURL, Integer pmacontrolCaseID, String pmaCoreSessionID) This method is used to retrieve project based on the case IDgetProjects
(String pmaControlURL, String pmaCoreSessionID) This method is used to retrieve project details for all projectsgetProjectTitles
(String pmaControlURL, String pmaCoreSessionID) This method is used to retrieve the projects then returns exclusively their titlesgetProjectTitlesDict
(String pmaControlURL, String pmaCoreSessionID, String title) This method is used to retrieve projects then returns a map of project-IDS and titlesgetTrainingSession
(String pmaControlURL, Integer pmaControlTrainingSessionID, String pmaCoreSessionID) This method is used to get the first (training) session with ID = pmaControlTrainingSessionIDgetTrainingSessionParticipants
(String pmaControlURL, Integer pmaControlTrainingSessionID, String pmaCoreSessionID) This method is used to extract the participants in a particular sessiongetTrainingSessions
(String pmaControlURL, Integer pmaControlProjectID, String pmaCoreSessionID) This method is used to retrieve (training) sessions (possibly filtered by project ID)getTrainingSessionsForParticipant
(String pmaControlURL, String participantUsername, String pmaCoreSessionID) This method is used to get sessions for a certain participantgetTrainingSessionsViaProject
(String pmaControlURL, Integer pmaControlProjectID, String pmaCoreSessionID, String sessionTitle) This method is used to retrieve (training) sessions (possibly filtered by project ID)getTrainingSessionTitles
(String pmaControlURL, Integer pmaControlProjectID, String pmaCoreSessionID, String sessionTitle) This method is used to retrieve sessions (possibly filtered by project ID), titles onlygetTrainingSessionTitlesDict
(String pmaControlURL, Integer pmaControlProjectID, String pmaCoreSessionID, String sessionTitle) This method is used to retrieve (training) sessions (possibly filtered by project ID), returns a map of session IDs and titlesstatic String
getTrainingSessionURL
(String pmaControlURL, String participantSessionID, String participantUsername, Integer pmaControlTrainingSessionID, Integer pmaControlCaseCollectionID, String pmaCoreSessionID) static String
getVersionInfo
(String pmaControlURL) This method is used to get version info from PMA.control instance running at pmacontrolURLstatic Boolean
isParticipantInTrainingSession
(String pmaControlURL, String participantUsername, Integer pmaControlTrainingSessionID, String pmaCoreSessionID) This method is used to check if a specific user participates in a specific sessionstatic String
registerParticipantForTrainingSession
(String pmaControlURL, String participantUsername, Integer pmaControlTrainingSessionID, Control.PmaTrainingSessionRole pmaControlRole, String pmaCoreSessionID) This method is used to register a participant for a session, assign a specific rolestatic String
registerParticipantsForProject
(String pmaControlURL, String participantUsername, Integer pmaControlProjectID, Control.PmaTrainingSessionRole pmaControlRole, String pmaCoreSessionID, Integer pmaControlInteractionMode) This method is used to register a participant for all sessions in a given project, assigning a specific rolestatic org.json.JSONObject
searchCaseCollection
(String pmaControlURL, String keyword, String pmaCoreSessionID) This method is used to return the first collection that has keyword as part of its string; search is case insensitivesearchProjects
(String pmaControlURL, String keyword, String pmaCoreSessionID) This method is used to get the projects whose title matches a certain keyword search patternsearchTrainingSession
(String pmaControlURL, String keyword, String pmaCoreSessionID) This method is used to return the first (training) session that has keyword as part of its string; search is case insensitivestatic void
setDebugFlag
(boolean flag) This method is used to determine whether the Java SDK runs in debugging mode or not.static String
setParticipantInteractionMode
(String pmaControlURL, String participantUsername, Integer pmaControlTrainingSessionID, Integer pmaControlCaseCollectionID, Integer pmaControlInteractionMode, String pmaCoreSessionID) This method is an overload of previous one.static String
setParticipantInteractionModeCaseCollection
(String pmaControlURL, String participantUsername, Integer pmaControlTrainingSessionID, int[] pmaControlCaseCollectionIDs, Integer pmaControlInteractionMode, String pmaCoreSessionID) This method is used to a ssign an interaction mode to a particpant for an array of Case Collections within a training sessionstatic String
setParticipantInteractionModeInBatch
(String pmaControlURL, String participantUsername, List<Map<String, Object>> trainingSessions, Integer pmaControlInteractionMode, String pmaCoreSessionID) This method is used to assign an interaction mode to a particpant for training sessions in batch mode
-
Constructor Details
-
Control
public Control()
-
-
Method Details
-
setDebugFlag
public static void setDebugFlag(boolean flag) This method is used to determine whether the Java SDK runs in debugging mode or not. When in debugging mode (flag = true), extra output is produced when certain conditions in the code are not met- Parameters:
flag
- Debugging mode (activated or deactivated)
-
getVersionInfo
This method is used to get version info from PMA.control instance running at pmacontrolURL- Parameters:
pmaControlURL
- PMA Control's URL- Returns:
- Version information
-
formatTrainingSessionProperly
Helper method to convert a JSON representation of a PMA.control training session to a proper Java-esque structure- Parameters:
session
- Session details- Returns:
- Map of formatted session information
-
getTrainingSessionsForParticipant
public static Map<Integer,Map<String, getTrainingSessionsForParticipantObject>> (String pmaControlURL, String participantUsername, String pmaCoreSessionID) This method is used to get sessions for a certain participant- Parameters:
pmaControlURL
- URL for PMA.ControlparticipantUsername
- PMA.core usernamepmaCoreSessionID
- PMA.core session ID- Returns:
- Map of sessions for a certain participant
-
getTrainingSessionParticipants
public static Map<String,org.json.JSONObject> getTrainingSessionParticipants(String pmaControlURL, Integer pmaControlTrainingSessionID, String pmaCoreSessionID) This method is used to extract the participants in a particular session- Parameters:
pmaControlURL
- URL for PMA.ControlpmaControlTrainingSessionID
- Training session IDpmaCoreSessionID
- PMA.core session ID- Returns:
- Map of participants in a particular session
-
isParticipantInTrainingSession
public static Boolean isParticipantInTrainingSession(String pmaControlURL, String participantUsername, Integer pmaControlTrainingSessionID, String pmaCoreSessionID) This method is used to check if a specific user participates in a specific session- Parameters:
pmaControlURL
- URL for PMA.ControlparticipantUsername
- PMA.core usernamepmaControlTrainingSessionID
- Training session IDpmaCoreSessionID
- PMA.core session ID- Returns:
- True if a specific user participates in a specific session, false otherwise.
-
getTrainingSessionURL
public static String getTrainingSessionURL(String pmaControlURL, String participantSessionID, String participantUsername, Integer pmaControlTrainingSessionID, Integer pmaControlCaseCollectionID, String pmaCoreSessionID) throws Exception - Parameters:
pmaControlURL
- URL for PMA.ControlparticipantSessionID
- The participant's session ID to allow for eventual impersonationparticipantUsername
- participant usernamepmaControlTrainingSessionID
- Training session IDpmaControlCaseCollectionID
- Case collection IDpmaCoreSessionID
- PMA.core session ID, the administrative session ID to verify that the participant is registered for the training session- Returns:
- Session's URL
- Throws:
Exception
- If participantUsername isn't registred for this session
-
getAllParticipants
public static Map<String,Map<Integer, getAllParticipantsString>> (String pmaControlURL, String pmaCoreSessionID) This method is used to get all participants registered across all sessions- Parameters:
pmaControlURL
- PMA.control URLpmaCoreSessionID
- PMA.core session ID- Returns:
- Map of all participants registered across all sessions
-
registerParticipantForTrainingSession
public static String registerParticipantForTrainingSession(String pmaControlURL, String participantUsername, Integer pmaControlTrainingSessionID, Control.PmaTrainingSessionRole pmaControlRole, String pmaCoreSessionID) This method is used to register a participant for a session, assign a specific role- Parameters:
pmaControlURL
- PMA.control URLparticipantUsername
- PMA.core usernamepmaControlTrainingSessionID
- Training session IDpmaControlRole
- RolepmaCoreSessionID
- PMA.core session ID- Returns:
- URL connection output in JSON format
-
registerParticipantsForProject
public static String registerParticipantsForProject(String pmaControlURL, String participantUsername, Integer pmaControlProjectID, Control.PmaTrainingSessionRole pmaControlRole, String pmaCoreSessionID, Integer pmaControlInteractionMode) This method is used to register a participant for all sessions in a given project, assigning a specific role- Parameters:
pmaControlURL
- PMA.control URLparticipantUsername
- PMA.core usernamepmaControlProjectID
- Project's IDpmaControlRole
- RolepmaCoreSessionID
- PMA.core session IDpmaControlInteractionMode
- The interaction mode to use- Returns:
- List of all sessions in a project that the participant was registered to
-
getCaseCollectionTrainingSessionID
public static Integer getCaseCollectionTrainingSessionID(String pmaControlURL, Integer pmaControlTrainingSessionID, Integer pmaControlCaseCollectionID, String pmaCoreSessionID) This method is a helper to obtain internal technical keys that link training sessions with case collections- Parameters:
pmaControlURL
- PMA.control URLpmaControlTrainingSessionID
- Training session IDpmaControlCaseCollectionID
- Case collection IDpmaCoreSessionID
- PMA.core session ID- Returns:
- Identifier caseCollectionTrainingSessionID
-
setParticipantInteractionMode
public static String setParticipantInteractionMode(String pmaControlURL, String participantUsername, Integer pmaControlTrainingSessionID, Integer pmaControlCaseCollectionID, Integer pmaControlInteractionMode, String pmaCoreSessionID) throws Exception This method is an overload of previous one. We created to add the possibility to assign an interaction mode outside the defined enum values- Parameters:
pmaControlURL
- PMA.control URLparticipantUsername
- PMA.core usernamepmaControlTrainingSessionID
- Training session IDpmaControlCaseCollectionID
- Case collection IDpmaControlInteractionMode
- Interaction modepmaCoreSessionID
- PMA.core session ID- Returns:
- URL connection output in JSON format
- Throws:
Exception
- If user is NOT registered in the provided PMA.control training session
-
getTrainingSessionTitles
public static List<String> getTrainingSessionTitles(String pmaControlURL, Integer pmaControlProjectID, String pmaCoreSessionID, String sessionTitle) This method is used to retrieve sessions (possibly filtered by project ID), titles only- Parameters:
pmaControlURL
- URL for PMA.ControlpmaControlProjectID
- Project's IDpmaCoreSessionID
- PMA.core session IDsessionTitle
- An optional session title filter- Returns:
- List of session titles
-
getTrainingSessionTitlesDict
public static Map<Integer,String> getTrainingSessionTitlesDict(String pmaControlURL, Integer pmaControlProjectID, String pmaCoreSessionID, String sessionTitle) This method is used to retrieve (training) sessions (possibly filtered by project ID), returns a map of session IDs and titles- Parameters:
pmaControlURL
- URL for PMA.ControlpmaControlProjectID
- Project's IDpmaCoreSessionID
- PMA.core session IDsessionTitle
- an optional session title filter- Returns:
- Map of session IDs and titles
-
getTrainingSessions
public static Map<Integer,Map<String, getTrainingSessionsObject>> (String pmaControlURL, Integer pmaControlProjectID, String pmaCoreSessionID) This method is used to retrieve (training) sessions (possibly filtered by project ID)- Parameters:
pmaControlURL
- URL for PMA.ControlpmaControlProjectID
- Project's IDpmaCoreSessionID
- PMA.core session ID- Returns:
- Map of session IDs and titles
-
getTrainingSessionsViaProject
public static Map<Integer,Map<String, getTrainingSessionsViaProjectObject>> (String pmaControlURL, Integer pmaControlProjectID, String pmaCoreSessionID, String sessionTitle) This method is used to retrieve (training) sessions (possibly filtered by project ID)- Parameters:
pmaControlURL
- URL for PMA.ControlpmaControlProjectID
- Project's IDpmaCoreSessionID
- PMA.core session IDsessionTitle
- An optional session title filter- Returns:
- Map of session IDs and titles
-
getTrainingSession
public static Map<String,Object> getTrainingSession(String pmaControlURL, Integer pmaControlTrainingSessionID, String pmaCoreSessionID) This method is used to get the first (training) session with ID = pmaControlTrainingSessionID- Parameters:
pmaControlURL
- URL for PMA.ControlpmaControlTrainingSessionID
- Training session's IDpmaCoreSessionID
- PMA.core session ID- Returns:
- First training session with ID = pmacontrolTrainingSessionID
-
searchTrainingSession
public static Map<String,Object> searchTrainingSession(String pmaControlURL, String keyword, String pmaCoreSessionID) This method is used to return the first (training) session that has keyword as part of its string; search is case insensitive- Parameters:
pmaControlURL
- URL for PMA.Controlkeyword
- key word to search againstpmaCoreSessionID
- PMA.core session ID- Returns:
- Map of the first (training) session whose title matches the search criteria
-
getCaseCollections
public static Map<Integer,org.json.JSONObject> getCaseCollections(String pmaControlURL, Integer pmaControlProjectID, String pmaCoreSessionID) This method is used to retrieve case collection details that belong to a specific project- Parameters:
pmaControlURL
- URL for PMA.ControlpmaControlProjectID
- Project's IDpmaCoreSessionID
- PMA.core session ID- Returns:
- Map of case collection details
-
getCaseCollectionTitles
public static List<String> getCaseCollectionTitles(String pmaControlURL, Integer pmaControlProjectID, String pmaCoreSessionID) This method is used to retrieve case collections (possibly filtered by project ID), titles only- Parameters:
pmaControlURL
- URL for PMA.ControlpmaControlProjectID
- Project's IDpmaCoreSessionID
- PMA.core session ID- Returns:
- List of case collections titles
-
getCaseCollectionByTitle
public static org.json.JSONObject getCaseCollectionByTitle(String pmaControlURL, String pmaCoreSessionID, String caseCollectionTitle) This method is used to get a case collection by its title- Parameters:
pmaControlURL
- URL for PMA.ControlpmaCoreSessionID
- PMA.core session IDcaseCollectionTitle
- The case collection's title- Returns:
- The case collection in json object format
-
getCaseCollectionTitlesDict
public static Map<Integer,String> getCaseCollectionTitlesDict(String pmaControlURL, Integer pmaControlProjectID, String pmaCoreSessionID) This method is used to retrieve case collections (possibly filtered by project ID), returns a map of case collection IDs and titles- Parameters:
pmaControlURL
- URL for PMA.ControlpmaControlProjectID
- Project's IDpmaCoreSessionID
- PMA.core session ID- Returns:
- Map of case collection IDs and titles
-
getCaseCollection
public static org.json.JSONObject getCaseCollection(String pmaControlURL, Integer pmaControlCaseCollectionID, String pmaCoreSessionID) This method is used to get a case collection details (by ID)- Parameters:
pmaControlURL
- URL for PMA.ControlpmaControlCaseCollectionID
- Case collection's IDpmaCoreSessionID
- PMA.core session ID- Returns:
- The case collection in json object format
-
getCaseForCaseCollection
public static org.json.JSONArray getCaseForCaseCollection(String pmaControlURL, Integer pmaControlCaseCollectionID, String pmaCoreSessionID) This method is used to retrieve cases for a specific collection- Parameters:
pmaControlURL
- PMA.control URLpmaControlCaseCollectionID
- Case collection IDpmaCoreSessionID
- PMA.core session ID- Returns:
- List of cases for a specific collection
-
searchCaseCollection
public static org.json.JSONObject searchCaseCollection(String pmaControlURL, String keyword, String pmaCoreSessionID) This method is used to return the first collection that has keyword as part of its string; search is case insensitive- Parameters:
pmaControlURL
- URL for PMA.Controlkeyword
- Keyword to seach collections againstpmaCoreSessionID
- PMA.core session ID- Returns:
- The first collection that matches the search criteria
-
getProjects
public static Map<Integer,org.json.JSONObject> getProjects(String pmaControlURL, String pmaCoreSessionID) This method is used to retrieve project details for all projects- Parameters:
pmaControlURL
- URL for PMA.ControlpmaCoreSessionID
- PMA.core session ID- Returns:
- Map of project details for all projects
-
getProjectTitles
This method is used to retrieve the projects then returns exclusively their titles- Parameters:
pmaControlURL
- URL for PMA.ControlpmaCoreSessionID
- PMA.core session ID- Returns:
- List of projects' titles
-
getProjectTitlesDict
public static Map<Integer,String> getProjectTitlesDict(String pmaControlURL, String pmaCoreSessionID, String title) This method is used to retrieve projects then returns a map of project-IDS and titles- Parameters:
pmaControlURL
- URL for PMA.ControlpmaCoreSessionID
- PMA.core session IDtitle
- Optional title filter- Returns:
- Map of project-IDs and titles
-
getProject
public static Map<String,Object> getProject(String pmaControlURL, Integer pmaControlProjectID, String pmaCoreSessionID) This method is used to get a project details (project defined by its ID)- Parameters:
pmaControlURL
- URL for PMA.ControlpmaControlProjectID
- Project's IDpmaCoreSessionID
- PMA.core session ID- Returns:
- Map of the project's details
-
getProjectByCaseID
public static Map<String,Object> getProjectByCaseID(String pmaControlURL, Integer pmacontrolCaseID, String pmaCoreSessionID) This method is used to retrieve project based on the case ID- Parameters:
pmaControlURL
- URL for PMA.ControlpmacontrolCaseID
- Case's IDpmaCoreSessionID
- PMA.core session ID- Returns:
- Map of the project details
-
getProjectByCaseCollectionID
public static Map<String,Object> getProjectByCaseCollectionID(String pmaControlURL, Integer pmacontrolCaseCollectionID, String pmaCoreSessionID) This method is used to retrieve project based on the case collection ID- Parameters:
pmaControlURL
- URL for PMA.ControlpmacontrolCaseCollectionID
- Case collection's IDpmaCoreSessionID
- PMA.core session ID- Returns:
- Map of the project details
-
searchProjects
public static List<Map<String,Object>> searchProjects(String pmaControlURL, String keyword, String pmaCoreSessionID) This method is used to get the projects whose title matches a certain keyword search pattern- Parameters:
pmaControlURL
- URL for PMA.Controlkeyword
- Keyword to seach projects againstpmaCoreSessionID
- PMA.core session ID- Returns:
- List of Maps of projects whose title matches the search criteria
-
setParticipantInteractionModeCaseCollection
public static String setParticipantInteractionModeCaseCollection(String pmaControlURL, String participantUsername, Integer pmaControlTrainingSessionID, int[] pmaControlCaseCollectionIDs, Integer pmaControlInteractionMode, String pmaCoreSessionID) throws Exception This method is used to a ssign an interaction mode to a particpant for an array of Case Collections within a training session- Parameters:
pmaControlURL
- PMA.control URLparticipantUsername
- PMA.core usernamepmaControlTrainingSessionID
- Training session IDpmaControlCaseCollectionIDs
- Array of Case collection IDspmaControlInteractionMode
- Interaction modepmaCoreSessionID
- PMA.core session ID- Returns:
- URL connection output in JSON format
- Throws:
Exception
- If user is NOT registered in the provided PMA.control training session
-
setParticipantInteractionModeInBatch
public static String setParticipantInteractionModeInBatch(String pmaControlURL, String participantUsername, List<Map<String, Object>> trainingSessions, Integer pmaControlInteractionMode, String pmaCoreSessionID) throws ExceptionThis method is used to assign an interaction mode to a particpant for training sessions in batch mode- Parameters:
pmaControlURL
- PMA.control URLparticipantUsername
- PMA.core usernametrainingSessions
- Training sessionspmaControlInteractionMode
- Interaction modepmaCoreSessionID
- PMA.core session ID- Returns:
- URL connection output in JSON format
- Throws:
Exception
- If user is NOT registered in the provided PMA.control training session
-