Salome HOME
Refactoring of Database, replacing SQL by DAOs calls. Methods for search by criteria...
[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   02.10.2012
6  * @author         Author: Maria KRUCHININA
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  * This class defines all methods for creation, modification the study.
26  * @author Maria KRUCHININA
27  *
28  */
29 public interface StudyService {
30         
31         public int generateLocalIndex(Study aStudy);
32
33         public Study selectStudy(long index);
34
35         public Study createStudy(Study.Properties sprop)
36                         throws MissedPropertyException, InvalidPropertyException,
37                         MultiplyDefinedException, RuntimeException;
38
39         public SimulationContext addProjectContext(Study aStudy,
40                         SimulationContext.Properties cprop) throws MissedPropertyException,
41                         InvalidPropertyException, MultiplyDefinedException,
42                         RuntimeException;
43
44         public SimulationContext addProjectContext(Study aStudy,
45                         SimulationContext context);
46
47         public Scenario addScenario(Study aStudy, Scenario.Properties sprop)
48                         throws MissedPropertyException, InvalidPropertyException,
49                         MultiplyDefinedException, RuntimeException;
50
51         public boolean removeProjectContext(Study aStudy, SimulationContext context);
52
53         /**
54          * Demotes this study from In-Check to In-Draft then In-Work states. This function is called internally when demoting the final result
55          * document of the study.
56          * 
57          * @return true if the demotion succeeded.
58          */
59         public boolean demote(Study aStudy);
60
61         /**
62          * Promotes this study from In-Work to In-Draft then In-Check and APPROVED states. This function is called internally when promoting the
63          * final result document of the study.
64          * 
65          * @return true if the demotion succeeded.
66          */
67         public boolean promote(Study aStudy);
68
69         public boolean addContributor(Study aStudy, User user);
70
71         public boolean removeContributor(Study aStudy, User... users);
72
73         public void setValidationCycle(Study aStudy, DocumentType type,
74                         ValidationCycle.Properties vprop);
75
76         /**
77          * Moves this study from the Private to the Public area of the repository.
78          * 
79          * @return true if the move succeeded.
80          * @see #isPublic()
81          */
82         public boolean moveToPublic(Study aStudy);
83
84         /**
85          * Moves this study from the Public to the Reference area of the repository. For being moved to the Reference area, the study must
86          * previously be approved.
87          * 
88          * @return true if the move succeeded.
89          * @see #moveToPublic()
90          * @see #isPublic()
91          * @see Publication#approve(Date)
92          */
93         public boolean moveToReference(Study aStudy);
94
95         public boolean update(Study aStudy, Properties sprop)
96                         throws InvalidPropertyException;
97 }