Salome HOME
Satisfy some PMD rules.
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / service / StudyService.java
index 277ea777f9d3bef4d643fa688fe3e64837dcf168..73d498da2e2bd6d533e8015b91e0ef70049cfcc3 100644 (file)
@@ -9,7 +9,6 @@
 
 package org.splat.service;
 
-import java.util.Date;
 import java.util.List;
 
 import org.splat.dal.bo.kernel.User;
@@ -22,9 +21,14 @@ import org.splat.dal.bo.som.Study.Properties;
 import org.splat.exception.IncompatibleDataException;
 import org.splat.exception.InvalidParameterException;
 import org.splat.kernel.InvalidPropertyException;
+import org.splat.kernel.MismatchException;
 import org.splat.kernel.MissedPropertyException;
 import org.splat.kernel.MultiplyDefinedException;
 import org.splat.service.dto.DocToCompareDTO;
+import org.splat.service.dto.DocumentDTO;
+import org.splat.service.dto.StudyFacadeDTO;
+import org.splat.service.dto.UserDTO;
+import org.splat.service.dto.StudyFacadeDTO.ScenarioDTO;
 
 /**
  * This class defines all methods for creation, modification the study.
@@ -58,7 +62,7 @@ public interface StudyService {
         * @param index
         *            the study id
         */
-       public void removeStudy(final long index);
+       void removeStudy(final Long index);
 
        /**
         * Create a new study.
@@ -286,6 +290,17 @@ public interface StudyService {
         */
        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).
         * 
@@ -336,4 +351,30 @@ public interface StudyService {
         */
        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;
 }