/*****************************************************************************
- * Company EURIWARE
+ * Company OPEN CASCADE
* Application SIMAN
* File $Id$
* Creation date 06.10.2012
* @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);
}