Salome HOME
Id now is Long instead of Integer. First unit test is created. hibernate-3.5.jar...
[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 java.util.List;
13 import org.splat.dal.bo.kernel.User;
14 import org.splat.dal.bo.som.DocumentType;
15 import org.splat.dal.bo.som.Publication;
16 import org.splat.dal.bo.som.Scenario;
17 import org.splat.dal.bo.som.SimulationContext;
18 import org.splat.dal.bo.som.Study;
19 import org.splat.dal.bo.som.ValidationCycle;
20 import org.splat.dal.bo.som.Study.Properties;
21 import org.splat.kernel.InvalidPropertyException;
22 import org.splat.kernel.MissedPropertyException;
23 import org.splat.kernel.MultiplyDefinedException;
24
25 /**
26  * This class defines all methods for creation, modification the study.
27  * @author Maria KRUCHININA
28  *
29  */
30 public interface StudyService {
31         
32         /**
33          * Get the simulation context list for displaying drop-down list values populating
34          * on the "Create new study" screen.
35          * @return List of the simulation contexts.
36          */
37         List<SimulationContext> getSimulationContextList();
38         
39         public int generateLocalIndex(Study aStudy);
40
41         public Study selectStudy(long index);
42
43         public Study createStudy(Study.Properties sprop)
44                         throws MissedPropertyException, InvalidPropertyException,
45                         MultiplyDefinedException, RuntimeException;
46
47         public SimulationContext addProjectContext(Study aStudy,
48                         SimulationContext.Properties cprop) throws MissedPropertyException,
49                         InvalidPropertyException, MultiplyDefinedException,
50                         RuntimeException;
51
52         public SimulationContext addProjectContext(Study aStudy,
53                         SimulationContext context);
54
55         public Scenario addScenario(Study aStudy, Scenario.Properties sprop)
56                         throws MissedPropertyException, InvalidPropertyException,
57                         MultiplyDefinedException, RuntimeException;
58
59         public boolean removeProjectContext(Study aStudy, SimulationContext context);
60
61         /**
62          * Demotes this study from In-Check to In-Draft then In-Work states. This function is called internally when demoting the final result
63          * document of the study.
64          * 
65          * @return true if the demotion succeeded.
66          */
67         public boolean demote(Study aStudy);
68
69         /**
70          * Promotes this study from In-Work to In-Draft then In-Check and APPROVED states. This function is called internally when promoting the
71          * final result document of the study.
72          * 
73          * @return true if the demotion succeeded.
74          */
75         public boolean promote(Study aStudy);
76
77         public boolean addContributor(Study aStudy, User user);
78
79         public boolean removeContributor(Study aStudy, User... users);
80
81         public void setValidationCycle(Study aStudy, DocumentType type,
82                         ValidationCycle.Properties vprop);
83
84         /**
85          * Moves this study from the Private to the Public area of the repository.
86          * 
87          * @return true if the move succeeded.
88          * @see #isPublic()
89          */
90         public boolean moveToPublic(Study aStudy);
91
92         /**
93          * Moves this study from the Public to the Reference area of the repository. For being moved to the Reference area, the study must
94          * previously be approved.
95          * 
96          * @return true if the move succeeded.
97          * @see #moveToPublic()
98          * @see #isPublic()
99          * @see Publication#approve(Date)
100          */
101         public boolean moveToReference(Study aStudy);
102
103         public boolean update(Study aStudy, Properties sprop)
104                         throws InvalidPropertyException;
105 }