Salome HOME
Study validation cycle operations are implemented according to the specification.
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / service / KnowledgeElementService.java
1 /*****************************************************************************
2  * Company         OPEN CASCADE
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.KnowledgeElement;
13 import org.splat.kernel.InvalidPropertyException;
14 import org.splat.service.dto.KnowledgeElementDTO;
15
16 /**
17  * Knowledge element service interface.
18  * 
19  * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
20  */
21 public interface KnowledgeElementService {
22
23         /**
24          * Approve the knowledge element.
25          * 
26          * @param knowledgeElement
27          *            the knowledge element to approve
28          * @return true if approving succeeded
29          */
30         boolean approve(KnowledgeElement knowledgeElement);
31
32         /**
33          * Demote the knowledge element.
34          * 
35          * @param knowledgeElement
36          *            the knowledge element to demote
37          * @return true if demoting succeeded
38          */
39         boolean demote(KnowledgeElement knowledgeElement);
40
41         /**
42          * Promote the knowledge element.
43          * 
44          * @param knowledgeElement
45          *            the knowledge element to promote
46          * @return true if promotion succeeded
47          */
48         boolean promote(KnowledgeElement knowledgeElement);
49
50         /**
51          * Rename the knowledge element.
52          * 
53          * @param knowledgeElement
54          *            the knowledge element to rename
55          * @param title
56          *            the new title of the knowledge element
57          * @throws InvalidPropertyException
58          *             if renaming is failed
59          */
60         void rename(KnowledgeElementDTO knowledgeElement, String title)
61                         throws InvalidPropertyException;
62
63         /**
64          * Get a knowledge element by its id.
65          * 
66          * @param index
67          *            the knowledge element id
68          * @return the found knowledge element
69          */
70         KnowledgeElement selectKnowledgeElement(long index);
71
72         /**
73          * Get a knowledge element DTO by id.
74          * 
75          * @param index
76          *            the knowledge element id
77          * @return the found knowledge element as DTO
78          */
79         KnowledgeElementDTO getKnowledgeElement(long index);
80
81         /**
82          * Update the description of the knowledge element.
83          * 
84          * @param kelm
85          *            the knoledge element to update
86          * @param description
87          *            the new description
88          */
89         void update(KnowledgeElementDTO kelm, String description);
90 }