1 /*****************************************************************************
5 * Creation date 02.10.2012
6 * @author Author: Maria KRUCHININA
8 *****************************************************************************/
10 package org.splat.service;
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;
26 * This class defines all methods for creation, modification the study.
27 * @author Maria KRUCHININA
30 public interface StudyService {
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.
37 List<SimulationContext> getSimulationContextList();
39 public int generateLocalIndex(Study aStudy);
41 public Study selectStudy(int index);
43 public Study createStudy(Study.Properties sprop)
44 throws MissedPropertyException, InvalidPropertyException,
45 MultiplyDefinedException, RuntimeException;
47 public SimulationContext addProjectContext(Study aStudy,
48 SimulationContext.Properties cprop) throws MissedPropertyException,
49 InvalidPropertyException, MultiplyDefinedException,
52 public SimulationContext addProjectContext(Study aStudy,
53 SimulationContext context);
55 public Scenario addScenario(Study aStudy, Scenario.Properties sprop)
56 throws MissedPropertyException, InvalidPropertyException,
57 MultiplyDefinedException, RuntimeException;
59 public boolean removeProjectContext(Study aStudy, SimulationContext context);
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.
65 * @return true if the demotion succeeded.
67 public boolean demote(Study aStudy);
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.
73 * @return true if the demotion succeeded.
75 public boolean promote(Study aStudy);
77 public boolean addContributor(Study aStudy, User user);
79 public boolean removeContributor(Study aStudy, User... users);
81 public void setValidationCycle(Study aStudy, DocumentType type,
82 ValidationCycle.Properties vprop);
85 * Moves this study from the Private to the Public area of the repository.
87 * @return true if the move succeeded.
90 public boolean moveToPublic(Study aStudy);
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.
96 * @return true if the move succeeded.
97 * @see #moveToPublic()
99 * @see Publication#approve(Date)
101 public boolean moveToReference(Study aStudy);
103 public boolean update(Study aStudy, Properties sprop)
104 throws InvalidPropertyException;