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 createStudy(Study.Properties sprop)
33 throws MissedPropertyException, InvalidPropertyException,
34 MultiplyDefinedException, RuntimeException;
36 public SimulationContext addProjectContext(Study aStudy,
37 SimulationContext.Properties cprop) throws MissedPropertyException,
38 InvalidPropertyException, MultiplyDefinedException,
41 public SimulationContext addProjectContext(Study aStudy,
42 SimulationContext context);
44 public Scenario addScenario(Study aStudy, Scenario.Properties sprop)
45 throws MissedPropertyException, InvalidPropertyException,
46 MultiplyDefinedException, RuntimeException;
48 public boolean removeProjectContext(Study aStudy, SimulationContext context);
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.
54 * @return true if the demotion succeeded.
56 public boolean demote(Study aStudy);
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.
62 * @return true if the demotion succeeded.
64 public boolean promote(Study aStudy);
66 public boolean addContributor(Study aStudy, User user);
68 public boolean removeContributor(Study aStudy, User... users);
70 public void setValidationCycle(Study aStudy, DocumentType type,
71 ValidationCycle.Properties vprop);
74 * Moves this study from the Private to the Public area of the repository.
76 * @return true if the move succeeded.
79 public boolean moveToPublic(Study aStudy);
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.
85 * @return true if the move succeeded.
86 * @see #moveToPublic()
88 * @see Publication#approve(Date)
90 public boolean moveToReference(Study aStudy);
92 public boolean update(Study aStudy, Properties sprop)
93 throws InvalidPropertyException;