1 /*****************************************************************************
5 * Creation date 06.10.2012
8 *****************************************************************************/
10 package org.splat.service;
12 import java.util.List;
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;
21 * Document type service interface.
23 * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
25 public interface DocumentTypeService {
28 * Get all document types from the database.
30 * @return the list of all document types
32 List<DocumentType> selectAllTypes();
35 * Find all result document types.
37 * @return the list of found types
39 List<DocumentType> selectResultTypes();
42 * Get document type by the given type name.
46 * @return the found document type
48 DocumentType selectType(String name);
51 * Get document type by the given id.
55 * @return the found document type
57 DocumentType selectType(long index);
60 * Create a new document type.
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
72 DocumentType createType(DocumentType.Properties tprop)
73 throws MissedPropertyException, InvalidPropertyException,
74 MultiplyDefinedException;
77 * Get document types applicable for the given study step.
80 * the step (study activity)
81 * @return the list of found document types
83 List<DocumentType> selectTypesOf(ProjectSettingsService.Step step);
86 * Approve the document type.
89 * the document type to approve
90 * @return true if approval succeeded
92 boolean approve(DocumentType aType);