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

org.gcube.portal.trainingmodule

## Class TrainingDTOManager

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

-     public class TrainingDTOManager
      extends Object

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

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `TrainingUnitQuestionnaire` | `addQuestionnaireToTrainingUnit(long trainingUnitId, TrainingUnitQuestionnaire questionnaire, String context, String owner)` Adds the questionnaire to training unit.
    `TrainingVideo` | `addVideoToTrainingUnit(long trainingUnitId, TrainingVideo video, String context, String owner)` Adds the video to training unit.
    `TrainingProject` | `changeStatus(long trainingProjectId, boolean isActive, String context, String owner)` Change status.
    `int` | `deleteQuestionnaireForId(long questionnaireId, String context)` Delete questionnaire for id.
    `int` | `deleteTrainingProject(long trainingProjectId, String context, String owner)` Delete training project.
    `int` | `deleteTrainingUnitFor(String ownerLogin, String workspaceFolderId, String context)` Delete training unit for.
    `int` | `deleteTrainingUnitForId(Long unitId, String context)` Delete training unit for id.
    `int` | `deleteVideoForId(long videoId, String context)` Delete video for id.
    `List<TrainingProject>` | `getCoursesFor(String context)` Gets the user courses.
    `protected static TrainingDTOManager` | `getInstance()` Gets the single instance of TrainingModuleManager.
    `List<TrainingUnitQuestionnaire>` | `getListOfQuestionnaireForTrainingUnit(long trainingUnitId, String context)` Gets the list of questionnaire for training unit.
    `List<TrainingVideo>` | `getListOfVideoForTrainingUnit(long trainingUnitId, String context)` Gets the list of video for training unit.
    `List<TrainingUnit>` | `getListUnitForTrainingProject(long trainingProjectId, String context)` Gets the list unit for training project.
    `List<TrainingProject>` | `getOwnedCourses(String owner, String context)` Gets the owned courses.
    `List<ProgressPerUnit>` | `getProgressForUnit(long unitId, String context, String username, String itemId, ItemType itemType)` Gets the progress for unit.
    `TrainingProject` | `getTrainingProject(long projectId, String context, String owner)` Gets the training project.
    `TrainingUnit` | `getTrainingUnit(long unitId, String context, String owner)` Gets the training unit.
    `TrainingUnit` | `getTrainingUnitFor(String ownerLogin, String workspaceFolderId, String context)` Gets the training unit for.
    `ProgressPerUnit` | `setProgressForUnit(long unitId, String context, String username, String itemId, ItemType itemType, boolean read)` Sets the progress for unit.
    `TrainingProject` | `storeNewCourse(TrainingProject project, String context, String owner)` Store new course.
    `TrainingUnit` | `storeNewUnit(long trainingProjectId, TrainingUnit unit, String context, String owner)` Store new unit.
    `TrainingProject` | `updateTrainingProject(TrainingProject project, String context)` Update training project.

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

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

- - ### Method Detail

    - #### getInstance

          protected static TrainingDTOManager getInstance()

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

    - #### getCoursesFor

          public List<TrainingProject> getCoursesFor(String context)
                                              throws Exception

      Gets the user courses.
      Parameters:
        `context` - the context
      Returns:
        the user courses
      Throws:
        `Exception` - the exception

    - #### getListOfVideoForTrainingUnit

          public List<TrainingVideo> 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

    - #### getListOfQuestionnaireForTrainingUnit

          public List<TrainingUnitQuestionnaire> 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

    - #### getOwnedCourses

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

      Gets the owned courses.
      Parameters:
        `owner` - the username
        `context` - the context
      Returns:
        the owned courses
      Throws:
        `Exception` - the exception

    - #### storeNewCourse

          public TrainingProject storeNewCourse(TrainingProject project,
                                                String context,
                                                String owner)
                                         throws Exception

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

    - #### storeNewUnit

          public TrainingUnit storeNewUnit(long trainingProjectId,
                                           TrainingUnit unit,
                                           String context,
                                           String owner)
                                    throws Exception

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

    - #### getTrainingUnit

          public TrainingUnit getTrainingUnit(long unitId,
                                              String context,
                                              String owner)
                                       throws Exception

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

    - #### getTrainingProject

          public TrainingProject getTrainingProject(long projectId,
                                                    String context,
                                                    String owner)
                                             throws Exception

      Gets the training project.
      Parameters:
        `projectId` - the project id
        `context` - the context
        `owner` - the owner
      Returns:
        the training project
      Throws:
        `Exception` - the exception

    - #### deleteTrainingProject

          public int deleteTrainingProject(long trainingProjectId,
                                           String context,
                                           String owner)
                                    throws Exception

      Delete training project.
      Parameters:
        `trainingProjectId` - the training project id
        `context` - the context
        `owner` - the owner
      Returns:
        the int
      Throws:
        `Exception` - the exception

    - #### changeStatus

          public TrainingProject 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 project DTO
      Throws:
        `Exception` - the exception

    - #### getTrainingUnitFor

          public TrainingUnit getTrainingUnitFor(String ownerLogin,
                                                 String workspaceFolderId,
                                                 String context)
                                          throws Exception

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

    - #### getListUnitForTrainingProject

          public List<TrainingUnit> getListUnitForTrainingProject(long trainingProjectId,
                                                                  String context)
                                                           throws Exception

      Gets the list unit for training project.
      Parameters:
        `trainingProjectId` - the training project id
        `context` - the context
      Returns:
        the list unit for training project
      Throws:
        `Exception` - the exception

    - #### deleteTrainingUnitFor

          public int deleteTrainingUnitFor(String ownerLogin,
                                           String workspaceFolderId,
                                           String context)
                                    throws Exception

      Delete training unit for.
      Parameters:
        `ownerLogin` - the owner login
        `workspaceFolderId` - the workspace folder id
        `context` - the context
      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

    - #### updateTrainingProject

          public TrainingProject updateTrainingProject(TrainingProject project,
                                                       String context)
                                                throws Exception

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

    - #### addQuestionnaireToTrainingUnit

          public TrainingUnitQuestionnaire addQuestionnaireToTrainingUnit(long trainingUnitId,
                                                                          TrainingUnitQuestionnaire questionnaire,
                                                                          String context,
                                                                          String owner)
                                                                   throws Exception

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

    - #### addVideoToTrainingUnit

          public TrainingVideo addVideoToTrainingUnit(long trainingUnitId,
                                                      TrainingVideo video,
                                                      String context,
                                                      String owner)
                                               throws Exception

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

    - #### setProgressForUnit

          public ProgressPerUnit 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 progress per unit
      Throws:
        `Exception` - the exception

    - #### getProgressForUnit

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

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

Copyright © 2018. All Rights Reserved.