Package org.silverpeas.components.projectmanager.control

## Class ProjectManagerSessionController

- java.lang.Object
- - org.silverpeas.core.web.mvc.controller.AbstractComponentSessionController
  - - org.silverpeas.components.projectmanager.control.ProjectManagerSessionController

- All Implemented Interfaces:
    `Serializable`, `org.silverpeas.core.web.mvc.controller.ComponentSessionController`, `org.silverpeas.core.web.session.SessionCloseable`

      public class ProjectManagerSessionController
      extends org.silverpeas.core.web.mvc.controller.AbstractComponentSessionController

  This class contains all the business model for project manager component
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class org.silverpeas.core.web.mvc.controller.AbstractComponentSessionController

      `context`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ProjectManagerSessionController​(org.silverpeas.core.web.mvc.controller.MainSessionController mainSessionCtrl, org.silverpeas.core.web.mvc.controller.ComponentContext componentContext)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `int` | `addTask​(TaskDetail task, Collection<org.silverpeas.core.io.upload.UploadedFile> uploadedFiles)` |
    `void` | `addUnfoldTask​(String id)` |
    `void` | `calculateAllTasksDates()` |
    `void` | `changeDateStatus​(String date, String nextStatus)` | Change le statut de la date
    `void` | `changeDayOfWeekStatus​(String year, String month, String day)` |
    `void` | `checkBeginDate​(TaskDetail task)` | Vérifie la date de début d'une tâche.
    `int` | `checkOccupation​(String taskId, String userId)` |
    `int` | `checkOccupation​(String taskId, String userId, Date beginDate, Date endDate)` |
    `int` | `checkOccupation​(String userId, Date beginDate, Date endDate)` |
    `void` | `createProject​(TaskDetail project, Collection<org.silverpeas.core.io.upload.UploadedFile> uploadedFiles)` | Create a new project
    `String` | `date2UIDate​(Date date)` |
    `void` | `enrichirTask​(TaskDetail task)` |
    `org.silverpeas.core.web.export.ExportCSVBuilder` | `export()` |
    `List<TaskDetail>` | `getAllTasks()` |
    `Calendar` | `getCalendar()` |
    `TaskDetail` | `getCurrentProject()` |
    `Collection<TaskResourceDetail>` | `getCurrentResources()` |
    `TaskDetail` | `getCurrentTask()` |
    `Date` | `getEndDateOfCurrentProjet()` |
    `Filtre` | `getFiltre()` |
    `List<Date>` | `getHolidayDates()` |
    `MonthVO` | `getMonthVO​(Date startDate)` |
    `Date` | `getMostRelevantDate​(String startDate)` | Retrieve the most relevant date if the current date parameter is null.
    `List<TaskDetail>` | `getPotentialPreviousTasks()` |
    `List<TaskDetail>` | `getPotentialPreviousTasks​(boolean onCreation)` |
    `List<MonthVO>` | `getQuarterMonth​(Date curDate)` |
    `String` | `getRole()` |
    `TaskDetail` | `getTask​(String id)` |
    `TaskDetail` | `getTask​(String id, boolean getAttachments)` |
    `TaskDetail` | `getTaskByTodoId​(String todoId)` |
    `TaskDetail` | `getTaskMere​(int mereId)` |
    `TaskDetail` | `getTaskMere​(String mereId)` |
    `List<TaskDetail>` | `getTasks()` |
    `List<TaskDetail>` | `getTasks​(String id)` |
    `List<Integer>` | `getUnfoldTasks()` |
    `String` | `getUserFullName()` |
    `String` | `getUserFullName​(org.silverpeas.core.admin.user.model.UserDetail user)` |
    `List<MonthVO>` | `getYearMonth​(Date curDate)` |
    `String` | `initUserSelect()` |
    `boolean` | `isFiltreActif()` |
    `boolean` | `isProjectDefined()` |
    `Date` | `processEndDate​(String taskId, String charge, Date dateDebut)` |
    `Date` | `processEndDate​(String charge, Date dateDebut, String instanceId)` |
    `Date` | `processEndDate​(TaskDetail task)` |
    `void` | `removeTask​(String id)` |
    `void` | `removeUnfoldTask​(String id)` |
    `void` | `setCurrentProject​(TaskDetail currentProject)` |
    `void` | `setCurrentResources​(Collection<TaskResourceDetail> resources)` |
    `void` | `setFiltre​(Filtre filtre)` |
    `void` | `setFiltreActif​(boolean b)` |
    `Date` | `uiDate2Date​(String uiDate)` |
    `void` | `updateCurrentProject()` |
    `void` | `updateCurrentTask()` |
    `void` | `updateOccupation​(TaskDetail task)` |

    - ### Methods inherited from class org.silverpeas.core.web.mvc.controller.AbstractComponentSessionController

      `addClipboardSelection, clipboardPasteDone, close, getClipboardErrorMessage, getClipboardExceptionError, getClipboardObjects, getClipboardSelectedObjects, getClipboardSize, getComponentAccessController, getComponentId, getComponentLabel, getComponentName, getComponentParameterValue, getComponentParameterValue, getComponentRootName, getComponentUrl, getHighestSilverpeasUserRole, getIcon, getLanguage, getLook, getMultilang, getOrganisationController, getPersonalization, getRSSUrl, getSelection, getSettings, getSilverpeasUserRoles, getSpaceId, getSpaceLabel, getString, getSubscriptionContext, getUrlEncodedParameter, getUserAccessLevel, getUserAvailComponentIds, getUserDetail, getUserDetail, getUserId, getUserManageableGroupIds, getUserManageableSpaceIds, getUserRoles, getZoneId, isAppInMaintenance, isGroupManager, isPasswordChangeAllowed, isSpaceInMaintenance, removeClipboardElement, setAppModeMaintenance, setClipboardSelectedElement, setComponentRootName, setSpaceModeMaintenance`

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

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

- - ### Constructor Detail

    - #### ProjectManagerSessionController

          public ProjectManagerSessionController​(org.silverpeas.core.web.mvc.controller.MainSessionController mainSessionCtrl,
                                                 org.silverpeas.core.web.mvc.controller.ComponentContext componentContext)

  - ### Method Detail

    - #### getCurrentTask

          public TaskDetail getCurrentTask()

    - #### addUnfoldTask

          public void addUnfoldTask​(String id)

    - #### removeUnfoldTask

          public void removeUnfoldTask​(String id)

    - #### getUnfoldTasks

          public List<Integer> getUnfoldTasks()

    - #### getAllTasks

          public List<TaskDetail> getAllTasks()

    - #### getTasks

          public List<TaskDetail> getTasks()

    - #### getTasks

          public List<TaskDetail> getTasks​(String id)

    - #### getPotentialPreviousTasks

          public List<TaskDetail> getPotentialPreviousTasks()

    - #### getPotentialPreviousTasks

          public List<TaskDetail> getPotentialPreviousTasks​(boolean onCreation)

    - #### processEndDate

          public Date processEndDate​(TaskDetail task)

      Parameters:
        `task` - la tache dont on veut calculer la date de fin
      Returns:
        la date de fin (= dateDebut + Charge)

    - #### processEndDate

          public Date processEndDate​(String taskId,
                                     String charge,
                                     Date dateDebut)

    - #### processEndDate

          public Date processEndDate​(String charge,
                                     Date dateDebut,
                                     String instanceId)

    - #### checkBeginDate

          public void checkBeginDate​(TaskDetail task)

      Vérifie la date de début d'une tâche. Si la date de début est un jour non travaillé, la date de début sera le prochain jour travaillé.
      Parameters:
        `task` - la tâche dont la date de début doit être vérifiée

    - #### enrichirTask

          public void enrichirTask​(TaskDetail task)

    - #### getTask

          public TaskDetail getTask​(String id)

    - #### getTask

          public TaskDetail getTask​(String id,
                                    boolean getAttachments)

    - #### getTaskByTodoId

          public TaskDetail getTaskByTodoId​(String todoId)

    - #### getTaskMere

          public TaskDetail getTaskMere​(String mereId)

    - #### getTaskMere

          public TaskDetail getTaskMere​(int mereId)

    - #### addTask

          public int addTask​(TaskDetail task,
                             Collection<org.silverpeas.core.io.upload.UploadedFile> uploadedFiles)

    - #### removeTask

          public void removeTask​(String id)

    - #### updateCurrentTask

          public void updateCurrentTask()

    - #### initUserSelect

          public String initUserSelect()

    - #### isFiltreActif

          public boolean isFiltreActif()

    - #### setFiltreActif

          public void setFiltreActif​(boolean b)

    - #### getFiltre

          public Filtre getFiltre()

    - #### setFiltre

          public void setFiltre​(Filtre filtre)

    - #### isProjectDefined

          public boolean isProjectDefined()

    - #### createProject

          public void createProject​(TaskDetail project,
                                    Collection<org.silverpeas.core.io.upload.UploadedFile> uploadedFiles)

      Create a new project
      Parameters:
        `project` - the new TaskDetail project

    - #### getCurrentProject

          public TaskDetail getCurrentProject()

    - #### setCurrentProject

          public void setCurrentProject​(TaskDetail currentProject)

    - #### getEndDateOfCurrentProjet

          public Date getEndDateOfCurrentProjet()

    - #### updateCurrentProject

          public void updateCurrentProject()

    - #### changeDateStatus

          public void changeDateStatus​(String date,
                                       String nextStatus)
                                throws ParseException

      Change le statut de la date
      Parameters:
        `date` - la date
        `nextStatus` - le nouveau statut de la date
      Throws:
        `ParseException`

    - #### changeDayOfWeekStatus

          public void changeDayOfWeekStatus​(String year,
                                            String month,
                                            String day)

    - #### getHolidayDates

          public List<Date> getHolidayDates()

    - #### calculateAllTasksDates

          public void calculateAllTasksDates()

    - #### uiDate2Date

          public Date uiDate2Date​(String uiDate)
                           throws ParseException

      Throws:
        `ParseException`

    - #### date2UIDate

          public String date2UIDate​(Date date)

    - #### getUserFullName

          public String getUserFullName​(org.silverpeas.core.admin.user.model.UserDetail user)

    - #### getUserFullName

          public String getUserFullName()

    - #### getCalendar

          public Calendar getCalendar()

    - #### getRole

          public String getRole()

      Returns:
        String representation of highest user role

    - #### setCurrentResources

          public void setCurrentResources​(Collection<TaskResourceDetail> resources)

    - #### getCurrentResources

          public Collection<TaskResourceDetail> getCurrentResources()

    - #### updateOccupation

          public void updateOccupation​(TaskDetail task)

    - #### checkOccupation

          public int checkOccupation​(String taskId,
                                     String userId)

    - #### checkOccupation

          public int checkOccupation​(String taskId,
                                     String userId,
                                     Date beginDate,
                                     Date endDate)

    - #### checkOccupation

          public int checkOccupation​(String userId,
                                     Date beginDate,
                                     Date endDate)

    - #### getMonthVO

          public MonthVO getMonthVO​(Date startDate)

      Parameters:
        `startDate` - the date from which we get the current month
      Returns:
        the Month Value Object of the date's month parameter.

    - #### getQuarterMonth

          public List<MonthVO> getQuarterMonth​(Date curDate)

      Parameters:
        `curDate` - If null parameter we get the current month system.
      Returns:
        a quarter which contains 3 month value object starting from start date month

    - #### getYearMonth

          public List<MonthVO> getYearMonth​(Date curDate)

      Parameters:
        `curDate` - If null parameter we get the current month system.
      Returns:
        a quarter which contains 3 month value object starting from start date month

    - #### getMostRelevantDate

          public Date getMostRelevantDate​(String startDate)
                                   throws ParseException

      Retrieve the most relevant date if the current date parameter is null.
      Parameters:
        `startDate` - the string representation of the date. If null we will retrieve the most relevant date in order to display current tasks
      Returns:
        the most relevant date
      Throws:
        `ParseException` - if the date cannot be parsed.

    - #### export

          public org.silverpeas.core.web.export.ExportCSVBuilder export()