Salome HOME
df872e765594a8e18aea37f1d18fe2aec81701a2
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / service / ScenarioService.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.KnowledgeElement;
14 import org.splat.dal.bo.som.Scenario;
15 import org.splat.kernel.InvalidPropertyException;
16 import org.splat.kernel.MissedPropertyException;
17 import org.splat.kernel.MultiplyDefinedException;
18 import org.splat.som.Step;
19
20 /**
21  * Scenario service interface.
22  * 
23  * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
24  */
25 public interface ScenarioService {
26
27         /**
28          * Add a new knowledge element to the scenario.
29          * 
30          * @param aScenario
31          *            the scenario
32          * @param kprop
33          *            knowledge element properties
34          * @return the created knowledge element
35          * @throws MissedPropertyException
36          *             if a mandatory property is missed
37          * @throws InvalidPropertyException
38          *             if some property doesn't exist
39          * @throws MultiplyDefinedException
40          *             if some property is defined several times
41          */
42         public KnowledgeElement addKnowledgeElement(Scenario aScenario,
43                         KnowledgeElement.Properties kprop) throws MissedPropertyException,
44                         InvalidPropertyException, MultiplyDefinedException;
45
46         /**
47          * Check in the scenario.
48          * 
49          * @param aScenario
50          *            the scenario to check in
51          */
52         public void checkin(Scenario aScenario);
53
54         /**
55          * Check out the scenario.
56          * 
57          * @param aScenario
58          *            the scenario to check out
59          * @param user
60          *            the current user
61          * @return true if check out operation succeeded
62          */
63         public boolean checkout(Scenario aScenario, User user);
64
65         /**
66          * Copy contents from other scenario up to its given step into the given scenario.
67          * 
68          * @param scenario
69          *            the target scenario
70          * @param lastep
71          *            the last processed step of the source scenario
72          */
73         public void copyContentsUpTo(Scenario scenario, Step lastep);
74
75         /**
76          * Check if the scenario is empty, i.d. no one of its steps doesn't contain any knowledge elements or documents.
77          * 
78          * @param scenario
79          *            the scenario to check
80          * @return true if the scenario is empty
81          */
82         public boolean isEmpty(Scenario scenario);
83 }