1 /*****************************************************************************
5 * Creation date 06.10.2012
8 *****************************************************************************/
10 package org.splat.service;
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;
28 public interface StudyService {
30 public int generateLocalIndex(Study aStudy);
32 public Study selectStudy(int index);
34 public Study createStudy(Study.Properties sprop)
35 throws MissedPropertyException, InvalidPropertyException,
36 MultiplyDefinedException, RuntimeException;
38 public SimulationContext addProjectContext(Study aStudy,
39 SimulationContext.Properties cprop) throws MissedPropertyException,
40 InvalidPropertyException, MultiplyDefinedException,
43 public SimulationContext addProjectContext(Study aStudy,
44 SimulationContext context);
46 public Scenario addScenario(Study aStudy, Scenario.Properties sprop)
47 throws MissedPropertyException, InvalidPropertyException,
48 MultiplyDefinedException, RuntimeException;
50 public boolean removeProjectContext(Study aStudy, SimulationContext context);
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.
56 * @return true if the demotion succeeded.
58 public boolean demote(Study aStudy);
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.
64 * @return true if the demotion succeeded.
66 public boolean promote(Study aStudy);
68 public boolean addContributor(Study aStudy, User user);
70 public boolean removeContributor(Study aStudy, User... users);
72 public void setValidationCycle(Study aStudy, DocumentType type,
73 ValidationCycle.Properties vprop);
76 * Moves this study from the Private to the Public area of the repository.
78 * @return true if the move succeeded.
81 public boolean moveToPublic(Study aStudy);
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.
87 * @return true if the move succeeded.
88 * @see #moveToPublic()
90 * @see Publication#approve(Date)
92 public boolean moveToReference(Study aStudy);
94 public boolean update(Study aStudy, Properties sprop)
95 throws InvalidPropertyException;