Salome HOME
Database class usage is removed from StudyService.
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / service / DocumentService.java
1 /*****************************************************************************
2  * Company         EURIWARE
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 org.splat.dal.bo.som.Document;
13 import org.splat.dal.bo.som.Document.Properties;
14 import org.splat.kernel.InvalidPropertyException;
15 import org.splat.kernel.MissedPropertyException;
16 import org.splat.kernel.NotApplicableException;
17 import org.splat.som.Step;
18
19 /**
20  * Document service interface.
21  * 
22  * @author RKV
23  * 
24  */
25 public interface DocumentService {
26
27         /**
28          * Defines this document.
29          * 
30          * @param aDoc
31          *            the document to define
32          * @param dprop
33          *            the properties of the document
34          * @throws MissedPropertyException
35          *             if a mandatory property is missed
36          * @throws InvalidPropertyException
37          *             if a property doesn't exist
38          * @throws NotApplicableException
39          *             if the document is undefined
40          * @see Step#createDocument(Properties)
41          * @see #isUndefined()
42          */
43         public void initialize(Document aDoc, Properties dprop)
44                         throws MissedPropertyException, InvalidPropertyException,
45                         NotApplicableException;
46
47         /**
48          * Find a document by its id.
49          * 
50          * @param index
51          *            document id
52          * @return found document
53          */
54         public Document selectDocument(long index);
55
56         /**
57          * Find a document by its reference and version.
58          * 
59          * @param refid
60          *            document reference
61          * @param version
62          *            document version
63          * @return found document
64          */
65         public Document selectDocument(String refid, String version);
66
67         /**
68          * Generate document reference.
69          * 
70          * @param aDoc
71          *            the document
72          * @param dprop
73          *            document properties (owner project element is used)
74          */
75         public void generateDocumentId(Document aDoc, Properties dprop);
76         
77         /**
78          * Get a directory where the document file is saved.
79          * @param aDoc the document
80          * @return a directory
81          */
82         public java.io.File getSaveDirectory(Document aDoc);
83 }