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