X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=Workspace%2FSiman-Common%2Fsrc%2Forg%2Fsplat%2Fservice%2FStudyService.java;h=9b7af704e7c2f0bf208f0b106695c84571455538;hb=1ba46da65ce8b7823a8d01870d3c0db1c7ed85ab;hp=9ba72257473e60635760ff54dcaf42b82dd78b96;hpb=d322fbe7cd10ebd0a6e698b1c0e5402582e5d98c;p=tools%2Fsiman.git diff --git a/Workspace/Siman-Common/src/org/splat/service/StudyService.java b/Workspace/Siman-Common/src/org/splat/service/StudyService.java index 9ba7225..9b7af70 100644 --- a/Workspace/Siman-Common/src/org/splat/service/StudyService.java +++ b/Workspace/Siman-Common/src/org/splat/service/StudyService.java @@ -9,6 +9,7 @@ package org.splat.service; +import java.util.Date; import java.util.List; import org.splat.dal.bo.kernel.User; @@ -18,9 +19,16 @@ import org.splat.dal.bo.som.SimulationContext; import org.splat.dal.bo.som.Study; import org.splat.dal.bo.som.ValidationCycle; 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.StudyFacadeDTO.ScenarioDTO; /** * This class defines all methods for creation, modification the study. @@ -48,6 +56,14 @@ public interface StudyService { */ Study selectStudy(long index); + /** + * Delete the study. + * + * @param index + * the study id + */ + public void removeStudy(final long index); + /** * Create a new study. * @@ -57,13 +73,12 @@ public interface StudyService { * @throws MissedPropertyException * if a mandatory property is missed * @throws InvalidPropertyException - * if some property doesn't exist + * if an invalid value is passed to a property * @throws MultiplyDefinedException * if some property is defined several times */ - Study createStudy(Study.Properties sprop) - throws MissedPropertyException, InvalidPropertyException, - MultiplyDefinedException; + Study createStudy(Study.Properties sprop) throws MissedPropertyException, + InvalidPropertyException, MultiplyDefinedException; /** * Add a simulation context to the first step of the study. If the context doesn't yet saved it is created in the database. @@ -76,7 +91,7 @@ public interface StudyService { * @throws MissedPropertyException * if a mandatory property is missed * @throws InvalidPropertyException - * if some property doesn't exist + * if an invalid value is passed to a property * @throws MultiplyDefinedException * if some property occurs several times */ @@ -93,8 +108,7 @@ public interface StudyService { * the simulation context to add * @return the added simulation context */ - SimulationContext addProjectContext(Study aStudy, - SimulationContext context); + SimulationContext addProjectContext(Study aStudy, SimulationContext context); /** * Remove a simulation context from a study. @@ -171,6 +185,15 @@ public interface StudyService { * @see #isPublic() */ boolean moveToPublic(Study aStudy); + + /** + * Moves this study from the Public to the Private area of the repository. + * + * @param aStudy + * the study to move + * @return true if the move succeeded. + */ + boolean moveToPrivate(Study aStudy); /** * Moves this study from the Public to the Reference area of the repository. For being moved to the Reference area, the study must @@ -194,7 +217,7 @@ public interface StudyService { * new properties of the study * @return true if the study has been updated successfully * @throws InvalidPropertyException - * if some property doesn't exist + * if an invalid value is passed to a property */ boolean update(Study aStudy, Properties sprop) throws InvalidPropertyException; @@ -250,4 +273,82 @@ public interface StudyService { * @return the unmodifiable not null transient list of contributors of this study */ List 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. + *
DocumentDto.id are actually filled in with Publication ids. + * @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 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 docsList, final String userName) + throws IncompatibleDataException; }