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
index 84d82cc2a255308ea4f107fd658e528153230ccf..3875736ea141de8c1a9b0d5855e7e8f7b5be0339 100644 (file)
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * Company         EURIWARE
+ * Company         OPEN CASCADE
  * Application     SIMAN
  * File            $Id$ 
  * Creation date   06.10.2012
@@ -7,23 +7,78 @@
  * @version        $Revision$
  *****************************************************************************/
 
-package org.splat.service; 
+package org.splat.service;
+
+import java.util.List;
 
 import org.splat.dal.bo.som.DocumentType;
+import org.splat.kernel.InvalidPropertyException;
+import org.splat.kernel.MissedPropertyException;
+import org.splat.kernel.MultiplyDefinedException;
+import org.splat.service.technical.ProjectSettingsService;
 
 /**
- * @author RKV
+ * Document type service interface.
  *
+ * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
  */
 public interface DocumentTypeService {
 
        /**
-        * Checks if documents of this type are result of a study.
-        * A document is the result of a study when it is the result of the last step of the study.
+        * Get all document types from the database.
+        * 
+        * @return the list of all document types
+        */
+       public List<DocumentType> selectAllTypes();
+
+       /**
+        * Find all result document types.
+        * 
+        * @return the list of found types
+        */
+       public List<DocumentType> selectResultTypes();
+
+       /**
+        * Get document type by the given type name.
+        * 
+        * @param name
+        *            the type name
+        * @return the found document type
+        */
+       public DocumentType selectType(String name);
+
+       /**
+        * Get document type by the given id.
+        * 
+        * @param index
+        *            the id
+        * @return the found document type
+        */
+       public DocumentType selectType(long index);
+
+       /**
+        * Create a new document type.
+        * 
+        * @param tprop
+        *            properties of the new document type
+        * @return the created document type
+        * @throws MissedPropertyException
+        *             if a mandatory property is missed
+        * @throws InvalidPropertyException
+        *             if some property doesn't exist
+        * @throws MultiplyDefinedException
+        *             if some property is defined several times
+        */
+       public DocumentType createType(DocumentType.Properties tprop)
+                       throws MissedPropertyException, InvalidPropertyException,
+                       MultiplyDefinedException;
+
+       /**
+        * Get document types applicable for the given study step.
         * 
-        * @return true if documents of this type are result of a study.
-        * @see    #isStepResult()
-        * @see    #isResultOf(org.splat.service.technical.ProjectSettingsServiceImpl.Step)
+        * @param step
+        *            the step (study activity)
+        * @return the list of found document types
         */
-           public boolean isStudyResult (DocumentType aType);
+       public List<DocumentType> selectTypesOf(ProjectSettingsService.Step step);
 }