]> SALOME platform Git repositories - tools/siman.git/blob - Workspace/Siman-Common/src/org/splat/service/StudyService.java
Salome HOME
Siman codebase is refactored. Spring beans are introduced in the context.
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / service / StudyService.java
1 /*****************************************************************************
2  * Company         EURIWARE
3  * Application     SIMAN
4  * File            $Id$ 
5  * Creation date   06.10.2012
6  * @author         $Author$
7  * @version        $Revision$
8  *****************************************************************************/
9
10 package org.splat.service;
11
12 import org.splat.dal.bo.kernel.User;
13 import org.splat.dal.bo.som.DocumentType;
14 import org.splat.dal.bo.som.Publication;
15 import org.splat.dal.bo.som.Scenario;
16 import org.splat.dal.bo.som.SimulationContext;
17 import org.splat.dal.bo.som.Study;
18 import org.splat.dal.bo.som.ValidationCycle;
19 import org.splat.dal.bo.som.Study.Properties;
20 import org.splat.kernel.InvalidPropertyException;
21 import org.splat.kernel.MissedPropertyException;
22 import org.splat.kernel.MultiplyDefinedException;
23
24 /**
25  * @author RKV
26  * 
27  */
28 public interface StudyService {
29
30         public int generateLocalIndex(Study aStudy);
31
32         public Study createStudy(Study.Properties sprop)
33                         throws MissedPropertyException, InvalidPropertyException,
34                         MultiplyDefinedException, RuntimeException;
35
36         public SimulationContext addProjectContext(Study aStudy,
37                         SimulationContext.Properties cprop) throws MissedPropertyException,
38                         InvalidPropertyException, MultiplyDefinedException,
39                         RuntimeException;
40
41         public SimulationContext addProjectContext(Study aStudy,
42                         SimulationContext context);
43
44         public Scenario addScenario(Study aStudy, Scenario.Properties sprop)
45                         throws MissedPropertyException, InvalidPropertyException,
46                         MultiplyDefinedException, RuntimeException;
47
48         public boolean removeProjectContext(Study aStudy, SimulationContext context);
49
50         /**
51          * Demotes this study from In-Check to In-Draft then In-Work states. This function is called internally when demoting the final result
52          * document of the study.
53          * 
54          * @return true if the demotion succeeded.
55          */
56         public boolean demote(Study aStudy);
57
58         /**
59          * Promotes this study from In-Work to In-Draft then In-Check and APPROVED states. This function is called internally when promoting the
60          * final result document of the study.
61          * 
62          * @return true if the demotion succeeded.
63          */
64         public boolean promote(Study aStudy);
65
66         public boolean addContributor(Study aStudy, User user);
67
68         public boolean removeContributor(Study aStudy, User... users);
69
70         public void setValidationCycle(Study aStudy, DocumentType type,
71                         ValidationCycle.Properties vprop);
72
73         /**
74          * Moves this study from the Private to the Public area of the repository.
75          * 
76          * @return true if the move succeeded.
77          * @see #isPublic()
78          */
79         public boolean moveToPublic(Study aStudy);
80
81         /**
82          * Moves this study from the Public to the Reference area of the repository. For being moved to the Reference area, the study must
83          * previously be approved.
84          * 
85          * @return true if the move succeeded.
86          * @see #moveToPublic()
87          * @see #isPublic()
88          * @see Publication#approve(Date)
89          */
90         public boolean moveToReference(Study aStudy);
91
92         public boolean update(Study aStudy, Properties sprop)
93                         throws InvalidPropertyException;
94 }