Salome HOME
Fix of checkin and removeDocument.
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / service / ProjectElementService.java
1 /*****************************************************************************
2  * Company         OPEN CASCADE
3  * Application     SIMAN
4  * File            $Id$ 
5  * Creation date   07.10.2012
6  * @author         $Author$
7  * @version        $Revision$
8  *****************************************************************************/
9
10 package org.splat.service;
11
12 import java.util.Map;
13
14 import org.splat.dal.bo.som.ProjectElement;
15 import org.splat.som.Step;
16
17 /**
18  * Project element service interface.
19  * 
20  * @author RKV
21  * 
22  */
23 public interface ProjectElementService {
24
25         /**
26          * Get the first activity of the project element.
27          * 
28          * @param elem
29          *            a study or a scenario
30          * @return the first activity (step) of the project element
31          */
32         Step getFirstStep(ProjectElement elem);
33
34         /**
35          * Get activities of the project element.
36          * 
37          * @param elem
38          *            a study or a scenario
39          * @return array of activities (steps).
40          */
41         Step[] getSteps(ProjectElement elem);
42
43         /**
44          * Get map of steps numbers to steps for the given project element.
45          * 
46          * @param elem
47          *            the project element
48          * @return map of steps numbers to steps
49          */
50         public Map<Integer, Step> getStepsMap(final ProjectElement elem);
51
52         /**
53          * Refreshes the internal data potentially out-of-date. This function needs to be called when Publication objects are added to this
54          * Project Element before being saved. The reason is, as saving a persistent object changes its hashcode, hashed data need to be rebuilt
55          * after saving for making functions based on this hashcode such as remove(), working.
56          * 
57          * @param elem
58          *            the project element to refresh
59          */
60         void refresh(ProjectElement elem);
61 }