1 | /* |
---|
2 | * Copyright (C) 2013 DASISH |
---|
3 | * |
---|
4 | * This program is free software; you can redistribute it and/or |
---|
5 | * modify it under the terms of the GNU General Public License |
---|
6 | * as published by the Free Software Foundation; either version 2 |
---|
7 | * of the License, or (at your option) any later version. |
---|
8 | * |
---|
9 | * This program is distributed in the hope that it will be useful, |
---|
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
12 | * GNU General Public License for more details. |
---|
13 | * |
---|
14 | * You should have received a copy of the GNU General Public License |
---|
15 | * along with this program; if not, write to the Free Software |
---|
16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
17 | */ |
---|
18 | package eu.dasish.annotation.backend.dao; |
---|
19 | |
---|
20 | |
---|
21 | import eu.dasish.annotation.schema.Permission; |
---|
22 | import eu.dasish.annotation.schema.Notebook; |
---|
23 | import eu.dasish.annotation.schema.NotebookInfo; |
---|
24 | import java.util.List; |
---|
25 | |
---|
26 | /** |
---|
27 | * Created on : Jun 12, 2013, 1:40:09 PM |
---|
28 | * |
---|
29 | * @author Peter Withers <peter.withers@mpi.nl> |
---|
30 | */ |
---|
31 | |
---|
32 | // TODO: not yet fully updated. |
---|
33 | |
---|
34 | public interface NotebookDao extends ResourceDao { |
---|
35 | |
---|
36 | |
---|
37 | /** |
---|
38 | * |
---|
39 | * GETTERS |
---|
40 | * |
---|
41 | */ |
---|
42 | // Returns a list of notebook Ids for the notebooks for which the given user "userID' has "permission" access. |
---|
43 | List<Number> getNotebookIDs(Number userID, Permission acessMode); |
---|
44 | |
---|
45 | // Returns a list of notebook Ids for the notebooks for which the given user "userID" is the owner. |
---|
46 | List<Number> getOwnerNotebookIDs(Number userID); |
---|
47 | |
---|
48 | public List<Number> getPrincipalIDsWithPermission(Number notebookID, Permission permission); |
---|
49 | |
---|
50 | |
---|
51 | |
---|
52 | /** |
---|
53 | * |
---|
54 | * @param notebookID |
---|
55 | * @return the notebook info for the notebook with notebookID |
---|
56 | */ |
---|
57 | NotebookInfo getNotebookInfo(Number notebookID); |
---|
58 | |
---|
59 | |
---|
60 | /** |
---|
61 | * |
---|
62 | * @param notebookID |
---|
63 | * @return notebook metadata for the notebook with notebookID |
---|
64 | */ |
---|
65 | Notebook getNotebookWithoutAnnotationsAndPermissions(Number notebookID); |
---|
66 | |
---|
67 | //? Which type shul be orderedby? |
---|
68 | /** |
---|
69 | * |
---|
70 | * @param maximumAnnotations |
---|
71 | * @param startannotation |
---|
72 | * @param orderedBy |
---|
73 | * @param orederingMode if true then descending, if falset hen ascending |
---|
74 | * @return |
---|
75 | */ |
---|
76 | List<Number> getAnnotations(int maximumAnnotations, int startannotation, String orderedBy, boolean orderingMode); |
---|
77 | |
---|
78 | /** |
---|
79 | * |
---|
80 | * UPDATERS |
---|
81 | * |
---|
82 | * |
---|
83 | */ |
---|
84 | |
---|
85 | |
---|
86 | |
---|
87 | /** |
---|
88 | * |
---|
89 | * @param notebookID |
---|
90 | * @return true if updated, false otherwise. Logs the reason if the notebook is not updated. |
---|
91 | */ |
---|
92 | boolean updateNotebookMetadata(Number notebookID); |
---|
93 | |
---|
94 | /** |
---|
95 | * |
---|
96 | * ADDERS |
---|
97 | * |
---|
98 | * |
---|
99 | */ |
---|
100 | |
---|
101 | Number createNotebook(Notebook notebook); |
---|
102 | |
---|
103 | boolean addAnnotationToNotebook(Number noteboookId, Number AnnotationID); |
---|
104 | |
---|
105 | |
---|
106 | |
---|
107 | /** |
---|
108 | * |
---|
109 | * DELETERS (ADDER) |
---|
110 | * |
---|
111 | * |
---|
112 | */ |
---|
113 | |
---|
114 | boolean deleteannotationFromNotebook(Number notebookID, Number annotationID); |
---|
115 | |
---|
116 | boolean deleteNotebook(Number notebookID); |
---|
117 | } |
---|