+
+ /**
+ * Initialize shortcuts of the study as its transient collections.
+ *
+ * @param aStudy
+ * the study
+ */
+ void loadWorkflow(Study aStudy);
+
+ /**
+ * Returns the validation cycle of the given document type.
+ *
+ * @param aStudy
+ * the study
+ * @param type
+ * the document type being subject of validation
+ * @return the validation cycle of the document, or null if not defined.
+ */
+ ValidationCycle getValidationCycleOf(Study aStudy, DocumentType type);
+
+ /**
+ * Checks if the given user participates to this study. The Study staff includes the author and contributors.
+ *
+ * @param aStudy
+ * the study
+ * @param user
+ * the user to look for
+ * @return true if the given user is actor of this study.
+ * @see #getContributors()
+ */
+ boolean isStaffedBy(Study aStudy, User user);
+
+ /**
+ * Checks if the given user is actor of this study. Actors include contributors, reviewers and approvers.
+ *
+ * @param aStudy
+ * the study
+ * @param user
+ * the user to look for
+ * @return true if the given user is actor of this study.
+ * @see #getActors()
+ */
+ boolean hasActor(Study aStudy, User user);
+
+ /**
+ * Returns unmodifiable initialized transient list of contributors of this study.
+ *
+ * @param aStudy
+ * the study
+ * @return the unmodifiable not null transient list of contributors of this study
+ */
+ List<User> getContributors(Study aStudy);
+
+ /**
+ * Mark study as reference.
+ *
+ * @param aStudy -
+ * the Study
+ */
+ void markStudyAsReference(Study aStudy);
+
+ /**
+ * Remove study as reference. This operation is inverse one to Mark as reference.
+ *
+ * @param aStudy -
+ * the Study
+ */
+ void removeStudyAsReference(Study aStudy);
+
+ /**
+ * Get studies, scenarios and publications available for comparison.
+ * <br><b> DocumentDto.id are actually filled in with Publication ids.</b>
+ * @param userId id of the user to to whom visible studies will be returned.
+ * @return list of {@link StudyFacadeDTO} containing lists of {@link ScenarioDTO} containing list of
+ * {@link DocumentDTO}, corresponding to to the publications available for comparison,
+ * with ids and titles filled in.
+ * @throws MismatchException if some configurations considering postprocessing step are invalid.
+ */
+ List<StudyFacadeDTO> getComparableStudies(final long userId) throws MismatchException;
+
+ /**
+ * Get the description attribute related to the study (there supposed to be the only one such attribute in the database).
+ *
+ * @param studyId
+ * the study id
+ * @return the description attribute value (null if does not exist)
+ * @throws InvalidParameterException
+ * if a study with such id does not exist in the database.
+ */
+ String getDescription(Long studyId) throws InvalidParameterException;
+
+ /**
+ * Set the description attribute related to the study.
+ *
+ * @param studyId
+ * the study id
+ * @param descriptionText
+ * the description text
+ * @throws InvalidParameterException
+ * if some parameters are invalid.
+ */
+ void setDescription(Long studyId, String descriptionText)
+ throws InvalidParameterException;
+
+ /**
+ * Remove a description attached to a study.
+ *
+ * @param studyId
+ * the study id
+ * @throws InvalidParameterException
+ * if no study with such Id has been found in the database.
+ * @return true if succeeded, false if study doesn't have a description.
+ */
+ boolean removeDescription(final Long studyId)
+ throws InvalidParameterException;
+
+ /**
+ * Compare the studies and generate the file that contains the result chart.
+ *
+ * @param docsList
+ * the list of dtos each contains information: StudyTitle, ScenarioTitle, PathToFile in vault.
+ * @param userName
+ * the name of the user who compare the results.
+ * @throws IncompatibleDataException
+ * if data is incompatible for "Compare the studies" functionality.
+ *
+ * @return path to result file in the vault.
+ */
+ String compare(List<DocToCompareDTO> docsList, final String userName)
+ throws IncompatibleDataException;
+
+ /**
+ * Get readers of a given study.
+ * @param studyId the study id.
+ * @return list of user DTO corresponding to the study readers.
+ * @throws InvalidParameterException if no study with such id has been found in the database.
+ */
+ List<UserDTO> getReaders(final long studyId) throws InvalidParameterException;
+
+ /**
+ * Add reader to a given study.
+ * @param studyId the study id.
+ * @param userId the user id.
+ * @return true if the user has been added as a reader
+ * @throws InvalidParameterException if no study or user with such id has been found in the database.
+ */
+ boolean addReader(final long studyId, final long userId) throws InvalidParameterException;
+
+ /**
+ * Remove reader from a given study.
+ * @param studyId the study id.
+ * @param userId the user id.
+ * @return true if the relation has been found and removed
+ * @throws InvalidParameterException if no study or user with such id has been found in the database.
+ */
+ boolean removeReader(final long studyId, final long userId) throws InvalidParameterException;