]> SALOME platform Git repositories - tools/siman.git/blobdiff - Workspace/Siman-Common/src/org/splat/service/ScenarioService.java
Salome HOME
VPV implementation of the new checking algorithm and the unit test (getNewDocumentId())
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / service / ScenarioService.java
index bb375424d69218b03218d6767017fb4448a3ec32..50fcc297808c64e6b61ddaf87d03490615df7500 100644 (file)
@@ -41,11 +41,32 @@ public interface ScenarioService {
         *            the study id
         * @return list of scenario DTOs
         */
-       public List<ScenarioDTO> getStudyScenarios(final Long studyId);
+       List<ScenarioDTO> getStudyScenarios(final Long studyId);
+
+       /**
+     * Get a new id to document arriver after check-out.
+     * Return two several values: -1 or ID of the existing document.
+     *
+     * @param scenId
+     *            the scenario id
+     * @param activityNumber
+     *            the number of activity
+     * @param docId
+     *            the document id
+     * @param fileExt
+     *            the file extension
+     * @return new document id or -1 if same document do nor exist.
+     * 
+     * @throws InvalidPropertyException if activityNumber is incorrect.
+     */
+
+     long getNewDocumentId(final long scenId,
+            final int activityNumber, final Long docId,
+            final String fileExt) throws InvalidPropertyException;
 
        /**
         * Copy content of a source study into the given study up to the given step.
-        * 
+        *
         * @param fromStudyId
         *            the source study id
         * @param fromScenId
@@ -67,7 +88,7 @@ public interface ScenarioService {
         * @throws NotApplicableException
         *             if document state is not applicable
         */
-       public void copyStudyContent(final long fromStudyId, final long fromScenId,
+       void copyStudyContent(final long fromStudyId, final long fromScenId,
                        final int finalStepNum, final long toStudyId)
                        throws InvalidParameterException, MissedPropertyException,
                        InvalidPropertyException, MultiplyDefinedException,
@@ -75,7 +96,7 @@ public interface ScenarioService {
 
        /**
         * Get lists of scenario steps, documents and files for building siman-salome.conf file.
-        * 
+        *
         * @param scenarioId
         *            scenario id
         * @return list of step DTOs
@@ -84,7 +105,7 @@ public interface ScenarioService {
 
        /**
         * Assign context to the study.
-        * 
+        *
         * @param studyId
         *            study id
         * @param ctxType
@@ -98,13 +119,13 @@ public interface ScenarioService {
         * @throws MultiplyDefinedException
         *             if some property is defined several times
         */
-       public void assignStudyContext(final Long studyId, final String ctxType,
+       void assignStudyContext(final Long studyId, final String ctxType,
                        final String ctxValue) throws MissedPropertyException,
                        InvalidPropertyException, MultiplyDefinedException;
 
        /**
         * Create a new study.
-        * 
+        *
         * @param username
         *            user login
         * @param title
@@ -123,12 +144,14 @@ public interface ScenarioService {
         */
        long createStudy(final String username, final String title,
                        final String productName, final String description)
-                       throws InvalidPropertyException, MissedPropertyException,
+                       throws InvalidPropertyException,
+                       MissedPropertyException,
                        MultiplyDefinedException;
 
        /**
-        * Create a new study with one scenario and "product" simulation context.
-        * 
+        * Create a new study with one scenario and "product"
+        * simulation context.
+        *
         * @param sprop
         *            the study properties
         * @param oprop
@@ -228,7 +251,7 @@ public interface ScenarioService {
         * @throws InvalidPropertyException
         *             if the scenario is not found in the database
         */
-       public void checkin(final long scenarioId) throws InvalidPropertyException;
+       void checkin(final long scenarioId) throws InvalidPropertyException;
 
        /**
         * Check out the scenario.
@@ -253,7 +276,7 @@ public interface ScenarioService {
         * @throws NotApplicableException
         *             if the given user can not check out the scenario
         */
-       public void checkout(final long scenarioId, final long userId)
+       void checkout(final long scenarioId, final long userId)
                        throws InvalidPropertyException, NotApplicableException;
 
        /**