TrainingModuleManager (training-module-library 1.0.0-4.12.0-163223 API)
Date: 2018-07-19

org.gcube.portal.trainingmodule

## Class TrainingModuleManager

- java.lang.Object
- - org.gcube.portal.trainingmodule.TrainingModuleManager

-     public class TrainingModuleManager
      extends Object

  The Class TrainingModuleManager.
  Author:
    Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Jan 19, 2018

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `HL_GROUP_SEPARATOR` The hl group separator.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `TrainingUnitQuestionnaireDTO` | `addQuestionnaireToTrainingUnit(long trainingUnitId, TrainingUnitQuestionnaireDTO questionnaireDTO, String context, String owner)` Adds the questionnaire to training unit.
    `TrainingVideoDTO` | `addVideoToTrainingUnit(long trainingUnitId, TrainingVideoDTO videoDTO, String context, String owner)` Adds the video to training unit.
    `TrainingCourseDTO` | `changeStatus(long trainingProjectId, boolean isActive, String context, String owner)` Change status.
    `int` | `countQuestionnairesForTrainingUnit(long trainingUnitId, String context)` Count questionnaires for training unit.
    `int` | `countVideosForTrainingUnit(long trainingUnitId, String context)` Count videos for training unit.
    `int` | `deleteQuestionnaireForId(long questionnaireId, String context)` Delete questionnaire for id.
    `int` | `deleteTrainingCourse(long trainingCourseId, String context, String owner)` Delete training course.
    `int` | `deleteTrainingUnit(String workspaceFolderId, String context, String owner)` Delete training unit.
    `int` | `deleteTrainingUnitForId(Long unitId, String context)` Delete training unit for id.
    `int` | `deleteVideoForId(long videoId, String context)` Delete video for id.
    `List<TrainingCourseDTO>` | `getCoursesSharedWith(String context, String... sharedWith)` Gets the courses shared with.
    `static TrainingModuleManager` | `getInstance()` Gets the single instance of TrainingModuleManager.
    `List<TrainingUnitQuestionnaireDTO>` | `getListOfQuestionnaireForTrainingUnit(long trainingUnitId, String context)` Gets the list of questionnaire for training unit.
    `List<TrainingUnitDTO>` | `getListOfTrainingUnitFor(long courseId, String context)` Gets the list of training unit for.
    `List<TrainingVideoDTO>` | `getListOfVideoForTrainingUnit(long trainingUnitId, String context)` Gets the list of video for training unit.
    `List<TrainingCourseDTO>` | `getOwnedCourses(String owner, String context)` Gets the owned courses.
    `List<TrainingUnitProgressDTO>` | `getProgressesForUnit(long unitId, String context, String username, String itemId, ItemType itemType)` Gets the progresses for unit.
    `TrainingCourseDTO` | `getTrainingCourse(long courseId, String context)` Gets the training course.
    `TrainingUnitDTO` | `getTrainingUnit(long unitId, String context)` Gets the training unit.
    `TrainingUnitDTO` | `getTrainingUnitFor(String ownerLogin, String workspaceFolderId, String context, String username)` Gets the training unit for.
    `List<TrainingCourseDTO>` | `getUserCourses(String username, String context)` Gets the user courses.
    `TrainingUnitProgressDTO` | `setProgressForUnit(long unitId, String context, String username, String itemId, ItemType itemType, boolean read)` Sets the progress for unit.
    `TrainingCourseDTO` | `storeNewCourse(TrainingCourseDTO projectDTO, String context, String owner)` Store new course.
    `TrainingUnitDTO` | `storeNewUnit(long trainingProjectId, TrainingUnitDTO unitDTO, String context, String owner)` Store new unit.
    `TrainingCourseDTO` | `updateTrainingCourse(TrainingCourseDTO project, String context)` Update training course.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### HL_GROUP_SEPARATOR

          public static String HL_GROUP_SEPARATOR

      The hl group separator.

  - ### Method Detail

    - #### getInstance

          public static TrainingModuleManager getInstance()

      Gets the single instance of TrainingModuleManager.
      Returns:
        single instance of TrainingModuleManager

    - #### getUserCourses

          public List<TrainingCourseDTO> getUserCourses(String username,
                                                        String context)
                                                 throws Exception

      Gets the user courses.
      Parameters:
        `username` - the username
        `context` - the context
      Returns:
        the user courses shared with 'username' and 'group' as context passed in the scope 'context'
      Throws:
        `Exception` - the exception

    - #### getCoursesSharedWith

          public List<TrainingCourseDTO> getCoursesSharedWith(String context,
                                                              String... sharedWith)
                                                       throws Exception

      Gets the courses shared with.
      Parameters:
        `context` - the context
        `sharedWith` - the shared with
      Returns:
        the courses shared with: 'username' or 'group'
      Throws:
        `Exception` - the exception

    - #### getOwnedCourses

          public List<TrainingCourseDTO> getOwnedCourses(String owner,
                                                         String context)
                                                  throws Exception

      Gets the owned courses.
      Parameters:
        `owner` - the owner
        `context` - the context
      Returns:
        the owned courses by 'owner' in the scope 'context'
      Throws:
        `Exception` - the exception

    - #### storeNewCourse

          public TrainingCourseDTO storeNewCourse(TrainingCourseDTO projectDTO,
                                                  String context,
                                                  String owner)
                                           throws Exception

      Store new course.
      Parameters:
        `projectDTO` - the project DTO
        `context` - the context
        `owner` - the username
      Returns:
        the training course DTO
      Throws:
        `Exception` - the exception

    - #### storeNewUnit

          public TrainingUnitDTO storeNewUnit(long trainingProjectId,
                                              TrainingUnitDTO unitDTO,
                                              String context,
                                              String owner)
                                       throws Exception

      Store new unit.
      Parameters:
        `trainingProjectId` - the training project id
        `unitDTO` - the unit DTO
        `context` - the context
        `owner` - the owner username
      Returns:
        the training unit DTO
      Throws:
        `Exception` - the exception

    - #### getTrainingUnit

          public TrainingUnitDTO getTrainingUnit(long unitId,
                                                 String context)
                                          throws Exception

      Gets the training unit.
      Parameters:
        `unitId` - the unit id
        `context` - the context
      Returns:
        the training unit
      Throws:
        `Exception` - the exception

    - #### deleteTrainingCourse

          public int deleteTrainingCourse(long trainingCourseId,
                                          String context,
                                          String owner)
                                   throws Exception

      Delete training course.
      Parameters:
        `trainingCourseId` - the training course id
        `context` - the context
        `owner` - the owner username
      Returns:
        the int
      Throws:
        `Exception` - the exception

    - #### changeStatus

          public TrainingCourseDTO changeStatus(long trainingProjectId,
                                                boolean isActive,
                                                String context,
                                                String owner)
                                         throws Exception

      Change status.
      Parameters:
        `trainingProjectId` - the training project id
        `isActive` - the is active
        `context` - the context
        `owner` - the owner username
      Returns:
        the training course DTO
      Throws:
        `Exception` - the exception

    - #### getTrainingCourse

          public TrainingCourseDTO getTrainingCourse(long courseId,
                                                     String context)
                                              throws Exception

      Gets the training course.
      Parameters:
        `courseId` - the course id
        `context` - the context
      Returns:
        the training course
      Throws:
        `Exception` - the exception

    - #### updateTrainingCourse

          public TrainingCourseDTO updateTrainingCourse(TrainingCourseDTO project,
                                                        String context)
                                                 throws Exception

      Update training course.
      Parameters:
        `project` - the project
        `context` - the context
      Returns:
        the training course DTO
      Throws:
        `Exception` - the exception

    - #### getTrainingUnitFor

          public TrainingUnitDTO getTrainingUnitFor(String ownerLogin,
                                                    String workspaceFolderId,
                                                    String context,
                                                    String username)
                                             throws Exception

      Gets the training unit for.
      Parameters:
        `ownerLogin` - the owner login
        `workspaceFolderId` - the workspace folder id
        `context` - the context
        `username` - the username
      Returns:
        the training unit for
      Throws:
        `Exception` - the exception

    - #### getListOfTrainingUnitFor

          public List<TrainingUnitDTO> getListOfTrainingUnitFor(long courseId,
                                                                String context)
                                                         throws Exception

      Gets the list of training unit for.
      Parameters:
        `courseId` - the course id
        `context` - the context
      Returns:
        the list of training unit for
      Throws:
        `Exception` - the exception

    - #### getListOfQuestionnaireForTrainingUnit

          public List<TrainingUnitQuestionnaireDTO> getListOfQuestionnaireForTrainingUnit(long trainingUnitId,
                                                                                          String context)
                                                                                   throws Exception

      Gets the list of questionnaire for training unit.
      Parameters:
        `trainingUnitId` - the training unit id
        `context` - the context
      Returns:
        the list of questionnaire for training unit
      Throws:
        `Exception` - the exception

    - #### countQuestionnairesForTrainingUnit

          public int countQuestionnairesForTrainingUnit(long trainingUnitId,
                                                        String context)
                                                 throws Exception

      Count questionnaires for training unit.
      Parameters:
        `trainingUnitId` - the training unit id
        `context` - the context
      Returns:
        the int
      Throws:
        `Exception` - the exception

    - #### addQuestionnaireToTrainingUnit

          public TrainingUnitQuestionnaireDTO addQuestionnaireToTrainingUnit(long trainingUnitId,
                                                                             TrainingUnitQuestionnaireDTO questionnaireDTO,
                                                                             String context,
                                                                             String owner)
                                                                      throws Exception

      Adds the questionnaire to training unit.
      Parameters:
        `trainingUnitId` - the training unit id
        `questionnaireDTO` - the questionnaire DTO
        `context` - the context
        `owner` - the owner
      Returns:
        the training unit questionnaire DTO
      Throws:
        `Exception` - the exception

    - #### addVideoToTrainingUnit

          public TrainingVideoDTO addVideoToTrainingUnit(long trainingUnitId,
                                                         TrainingVideoDTO videoDTO,
                                                         String context,
                                                         String owner)
                                                  throws Exception

      Adds the video to training unit.
      Parameters:
        `trainingUnitId` - the training unit id
        `videoDTO` - the video DTO
        `context` - the context
        `owner` - the owner
      Returns:
        the training video DTO
      Throws:
        `Exception` - the exception

    - #### getListOfVideoForTrainingUnit

          public List<TrainingVideoDTO> getListOfVideoForTrainingUnit(long trainingUnitId,
                                                                      String context)
                                                               throws Exception

      Gets the list of video for training unit.
      Parameters:
        `trainingUnitId` - the training unit id
        `context` - the context
      Returns:
        the list of video for training unit
      Throws:
        `Exception` - the exception

    - #### countVideosForTrainingUnit

          public int countVideosForTrainingUnit(long trainingUnitId,
                                                String context)
                                         throws Exception

      Count videos for training unit.
      Parameters:
        `trainingUnitId` - the training unit id
        `context` - the context
      Returns:
        the int
      Throws:
        `Exception` - the exception

    - #### deleteTrainingUnit

          public int deleteTrainingUnit(String workspaceFolderId,
                                        String context,
                                        String owner)
                                 throws Exception

      Delete training unit.
      Parameters:
        `workspaceFolderId` - the workspace folder id
        `context` - the context
        `owner` - the owner
      Returns:
        the int
      Throws:
        `Exception` - the exception

    - #### deleteTrainingUnitForId

          public int deleteTrainingUnitForId(Long unitId,
                                             String context)
                                      throws Exception

      Delete training unit for id.
      Parameters:
        `unitId` - the unit id
        `context` - the context
      Returns:
        the int
      Throws:
        `Exception` - the exception

    - #### deleteVideoForId

          public int deleteVideoForId(long videoId,
                                      String context)
                               throws Exception

      Delete video for id.
      Parameters:
        `videoId` - the video id
        `context` - the context
      Returns:
        the int
      Throws:
        `Exception` - the exception

    - #### deleteQuestionnaireForId

          public int deleteQuestionnaireForId(long questionnaireId,
                                              String context)
                                       throws Exception

      Delete questionnaire for id.
      Parameters:
        `questionnaireId` - the questionnaire id
        `context` - the context
      Returns:
        the int
      Throws:
        `Exception` - the exception

    - #### setProgressForUnit

          public TrainingUnitProgressDTO setProgressForUnit(long unitId,
                                                            String context,
                                                            String username,
                                                            String itemId,
                                                            ItemType itemType,
                                                            boolean read)
                                                     throws Exception

      Sets the progress for unit.
      Parameters:
        `unitId` - the unit id
        `context` - the context
        `username` - the username
        `itemId` - the item id
        `itemType` - the item type
        `read` - the read
      Returns:
        the training unit progress DTO
      Throws:
        `Exception` - the exception

    - #### getProgressesForUnit

          public List<TrainingUnitProgressDTO> getProgressesForUnit(long unitId,
                                                                    String context,
                                                                    String username,
                                                                    String itemId,
                                                                    ItemType itemType)
                                                             throws Exception

      Gets the progresses for unit.
      Parameters:
        `unitId` - the unit id
        `context` - the context
        `username` - the username
        `itemId` - the item id
        `itemType` - the item type
      Returns:
        the progresses for unit
      Throws:
        `Exception` - the exception

Copyright © 2018. All Rights Reserved.