1 /*****************************************************************************
5 * Creation date 06.10.2012
8 *****************************************************************************/
10 package org.splat.service;
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;
20 * Document service interface.
25 public interface DocumentService {
28 * Defines this document.
31 * the document to define
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)
43 public void initialize(Document aDoc, Properties dprop)
44 throws MissedPropertyException, InvalidPropertyException,
45 NotApplicableException;
48 * Find a document by its id.
52 * @return found document
54 public Document selectDocument(long index);
57 * Find a document by its reference and version.
63 * @return found document
65 public Document selectDocument(String refid, String version);
68 * Generate document reference.
73 * document properties (owner project element is used)
75 public void generateDocumentId(Document aDoc, Properties dprop);
78 * Get a directory where the document file is saved.
79 * @param aDoc the document
82 public java.io.File getSaveDirectory(Document aDoc);