1 /*****************************************************************************
5 * Creation date 06.10.2012
8 *****************************************************************************/
10 package org.splat.service;
12 import java.io.IOException;
13 import java.util.List;
15 import org.splat.dal.bo.som.Document;
16 import org.splat.dal.bo.som.DocumentType;
17 import org.splat.dal.bo.som.Publication;
18 import org.splat.dal.bo.som.SimulationContext;
19 import org.splat.kernel.InvalidPropertyException;
20 import org.splat.kernel.MismatchException;
21 import org.splat.kernel.MissedPropertyException;
22 import org.splat.kernel.MultiplyDefinedException;
23 import org.splat.kernel.NotApplicableException;
24 import org.splat.som.Step;
27 * Step service interface.
29 * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
31 public interface StepService {
34 * Create a new document published in the given study step.
37 * the target study step
39 * properties of the new document
40 * @return the created publication of the new document
41 * @throws MissedPropertyException
42 * if a mandatory property is missed
43 * @throws InvalidPropertyException
44 * if some property doesn't exist
45 * @throws MultiplyDefinedException
46 * if some property is defined several times
48 * if a file system error occurs
50 Publication createDocument(Step aStep, Document.Properties dprop)
51 throws MissedPropertyException, InvalidPropertyException,
52 MultiplyDefinedException, IOException;
55 * Publish an existing document in the given study step.
58 * the target study step
60 * new properties of the document
61 * @return the created publication of the document
62 * @throws MissedPropertyException
63 * if a mandatory property is missed
64 * @throws InvalidPropertyException
65 * if some property doesn't exist
66 * @throws NotApplicableException
67 * if the document is undefined
69 Publication assignDocument(Step aStep, Document.Properties dprop)
70 throws MissedPropertyException, InvalidPropertyException,
71 NotApplicableException;
74 * Create a new version of a document in the given study step.
79 * the base document published version
81 * properties of the new version
82 * @return the new version publication
83 * @throws MissedPropertyException
84 * if a mandatory property is missed
85 * @throws InvalidPropertyException
86 * if some property doesn't exist
87 * @throws MultiplyDefinedException
88 * if some property is defined several times
90 * if a file system error occurs
91 * @throws MismatchException
92 * if the document is not applicable to the given study step
94 Publication versionDocument(Step aStep, Publication base,
95 Document.Properties dprop) throws MissedPropertyException,
96 InvalidPropertyException, MultiplyDefinedException, IOException,
100 * Add simulation context to the study step.
105 * properties of the simulation context to add
106 * @return the added simulation context
107 * @throws MissedPropertyException
108 * if a mandatory property is missed
109 * @throws InvalidPropertyException
110 * if some property doesn't exist
111 * @throws MultiplyDefinedException
112 * if some property is defined several times
114 SimulationContext addSimulationContext(Step aStep,
115 SimulationContext.Properties dprop) throws MissedPropertyException,
116 InvalidPropertyException, MultiplyDefinedException;
119 * Add simulation context to the study step.
124 * the simulation context to add
125 * @return the added simulation context
127 SimulationContext addSimulationContext(Step firstStep,
128 SimulationContext context);
131 * Remove a simulation context from the study step.
136 * the simulation context to remove
137 * @return true if removal succeeded
139 boolean removeSimulationContext(Step aStep, SimulationContext context);
142 * Add a document publication to the given step.
145 * the target study step
147 * the document publication to add
148 * @return true if publication succeeded
150 boolean add(Step aStep, Publication newdoc);
153 * Remove a document publication from the given step.
158 * the document publication to remove
159 * @return true if removing of the publication succeeded
161 boolean remove(Step aStep, Publication oldoc);
164 * Remove a document from the given step.
169 * the document publication
170 * @return true if removing of the document succeeded
172 boolean removeDocument(Step aStep, Publication doctag);
175 * Get document types which are applicable for the given study step (activity).
179 * @return the list of document types
181 List<DocumentType> getValidDocumentTypes(Step aStep);