1 /*****************************************************************************
5 * Creation date 02.10.2012
6 * @author Author: Maria KRUCHININA
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;
25 * This class defines all methods for creation, modification the study.
26 * @author Maria KRUCHININA
29 public interface StudyService {
31 public int generateLocalIndex(Study aStudy);
33 public Study selectStudy(long index);
35 public Study createStudy(Study.Properties sprop)
36 throws MissedPropertyException, InvalidPropertyException,
37 MultiplyDefinedException, RuntimeException;
39 public SimulationContext addProjectContext(Study aStudy,
40 SimulationContext.Properties cprop) throws MissedPropertyException,
41 InvalidPropertyException, MultiplyDefinedException,
44 public SimulationContext addProjectContext(Study aStudy,
45 SimulationContext context);
47 public Scenario addScenario(Study aStudy, Scenario.Properties sprop)
48 throws MissedPropertyException, InvalidPropertyException,
49 MultiplyDefinedException, RuntimeException;
51 public boolean removeProjectContext(Study aStudy, SimulationContext context);
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.
57 * @return true if the demotion succeeded.
59 public boolean demote(Study aStudy);
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.
65 * @return true if the demotion succeeded.
67 public boolean promote(Study aStudy);
69 public boolean addContributor(Study aStudy, User user);
71 public boolean removeContributor(Study aStudy, User... users);
73 public void setValidationCycle(Study aStudy, DocumentType type,
74 ValidationCycle.Properties vprop);
77 * Moves this study from the Private to the Public area of the repository.
79 * @return true if the move succeeded.
82 public boolean moveToPublic(Study aStudy);
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.
88 * @return true if the move succeeded.
89 * @see #moveToPublic()
91 * @see Publication#approve(Date)
93 public boolean moveToReference(Study aStudy);
95 public boolean update(Study aStudy, Properties sprop)
96 throws InvalidPropertyException;