Salome HOME
More business logic has been moved from BO to services. ServiceLocator is created...
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / service / DocumentTypeService.java
1 /*****************************************************************************
2  * Company         OPEN CASCADE
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 java.util.List;
13
14 import org.splat.dal.bo.som.DocumentType;
15 import org.splat.kernel.InvalidPropertyException;
16 import org.splat.kernel.MissedPropertyException;
17 import org.splat.kernel.MultiplyDefinedException;
18 import org.splat.service.technical.ProjectSettingsService;
19
20 /**
21  * Document type service interface.
22  *
23  * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
24  */
25 public interface DocumentTypeService {
26
27         /**
28          * Get all document types from the database.
29          * 
30          * @return the list of all document types
31          */
32         public List<DocumentType> selectAllTypes();
33
34         /**
35          * Find all result document types.
36          * 
37          * @return the list of found types
38          */
39         public List<DocumentType> selectResultTypes();
40
41         /**
42          * Get document type by the given type name.
43          * 
44          * @param name
45          *            the type name
46          * @return the found document type
47          */
48         public DocumentType selectType(String name);
49
50         /**
51          * Get document type by the given id.
52          * 
53          * @param index
54          *            the id
55          * @return the found document type
56          */
57         public DocumentType selectType(long index);
58
59         /**
60          * Create a new document type.
61          * 
62          * @param tprop
63          *            properties of the new document type
64          * @return the created document type
65          * @throws MissedPropertyException
66          *             if a mandatory property is missed
67          * @throws InvalidPropertyException
68          *             if some property doesn't exist
69          * @throws MultiplyDefinedException
70          *             if some property is defined several times
71          */
72         public DocumentType createType(DocumentType.Properties tprop)
73                         throws MissedPropertyException, InvalidPropertyException,
74                         MultiplyDefinedException;
75
76         /**
77          * Get document types applicable for the given study step.
78          * 
79          * @param step
80          *            the step (study activity)
81          * @return the list of found document types
82          */
83         public List<DocumentType> selectTypesOf(ProjectSettingsService.Step step);
84 }