annotate src/main/java/de/mpiwg/itgroup/annotations/Annotation.java @ 48:0e00bf8e27fb

targets and resources of Annotation object are objects now.
author casties
date Wed, 26 Sep 2012 18:10:47 +0200
parents 03e0f7574224
children 64aa756c60cc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
1 /**
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
2 *
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
3 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
4 package de.mpiwg.itgroup.annotations;
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
5
16
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
6 import java.util.Set;
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
7
15
58357a4b86de ASSIGNED - # 249: Annotations shared in groups
casties
parents: 14
diff changeset
8 import de.mpiwg.itgroup.annotations.neo4j.AnnotationStore;
58357a4b86de ASSIGNED - # 249: Annotations shared in groups
casties
parents: 14
diff changeset
9
4
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
10 /**
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
11 * @author casties
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
12 *
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
13 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
14 public class Annotation {
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
15 /**
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
16 * The URI of this annotation.
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
17 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
18 protected String uri;
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
19
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
20 /**
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
21 * The annotation (body) text.
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
22 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
23 protected String bodyText;
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
24
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
25 /**
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
26 * The URI of the annotation text
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
27 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
28 protected String bodyUri;
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
29
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
30 /**
48
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
31 * The annotation target.
4
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
32 */
48
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
33 protected Target target;
4
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
34
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
35 /**
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
36 * The fragment part of the annotation target.
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
37 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
38 protected String targetFragment;
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
39
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
40 /**
40
03e0f7574224 saving and loading resource targets should work now (no searching yet)
casties
parents: 20
diff changeset
41 * The types of annotation target fragments.
4
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
42 *
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
43 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
44 public static enum FragmentTypes {
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
45 XPOINTER, AREA
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
46 };
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
47
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
48 /**
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
49 * The type of the annotation target fragment.
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
50 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
51 protected FragmentTypes fragmentType;
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
52
40
03e0f7574224 saving and loading resource targets should work now (no searching yet)
casties
parents: 20
diff changeset
53
03e0f7574224 saving and loading resource targets should work now (no searching yet)
casties
parents: 20
diff changeset
54 /**
48
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
55 * The Resource that is annotated e.g. a book.
40
03e0f7574224 saving and loading resource targets should work now (no searching yet)
casties
parents: 20
diff changeset
56 * The target is part of this resource e.g. a page of a book.
03e0f7574224 saving and loading resource targets should work now (no searching yet)
casties
parents: 20
diff changeset
57 */
48
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
58 protected Resource resource;
40
03e0f7574224 saving and loading resource targets should work now (no searching yet)
casties
parents: 20
diff changeset
59
4
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
60 /**
9
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
61 * The creator of this annotation.
4
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
62 */
9
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
63 protected Actor creator;
5
bbf0cc5bee29 version 0.2 really works now
casties
parents: 4
diff changeset
64
bbf0cc5bee29 version 0.2 really works now
casties
parents: 4
diff changeset
65 /**
4
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
66 * The creation date of this annotation.
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
67 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
68 protected String created;
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
69
10
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
70 /**
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
71 * The user or group that has admin permissions.
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
72 * null means any user.
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
73 */
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
74 protected Actor adminPermission;
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
75
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
76 /**
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
77 * The user or group that has delete permissions.
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
78 * null means any user.
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
79 */
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
80 protected Actor deletePermission;
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
81
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
82 /**
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
83 * The user or group that has update permissions.
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
84 * null means any user.
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
85 */
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
86 protected Actor updatePermission;
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
87
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
88 /**
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
89 * The user or group that has read permissions.
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
90 * null means any user.
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
91 */
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
92 protected Actor readPermission;
16
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
93
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
94 /**
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
95 * List of tags on this Annotation.
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
96 */
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
97 protected Set<String> tags;
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
98
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
99 /**
20
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
100 * Returns if the requested action is allowed for the given user on this annotation.
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
101 *
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
102 * @param action
15
58357a4b86de ASSIGNED - # 249: Annotations shared in groups
casties
parents: 14
diff changeset
103 * @param user
58357a4b86de ASSIGNED - # 249: Annotations shared in groups
casties
parents: 14
diff changeset
104 * @param store AnnotationStore to check group membership
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
105 * @return
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
106 */
15
58357a4b86de ASSIGNED - # 249: Annotations shared in groups
casties
parents: 14
diff changeset
107 public boolean isActionAllowed(String action, Person user, AnnotationStore store) {
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
108 if (action.equals("read")) {
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
109 Actor reader = getReadPermission();
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
110 if (reader == null) {
20
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
111 // if not specified then everybody is allowed
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
112 return true;
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
113 } else {
15
58357a4b86de ASSIGNED - # 249: Annotations shared in groups
casties
parents: 14
diff changeset
114 return reader.isEquivalentWith(user, store);
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
115 }
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
116 } else if (action.equals("update")) {
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
117 // require at least an authenticated user
15
58357a4b86de ASSIGNED - # 249: Annotations shared in groups
casties
parents: 14
diff changeset
118 if (user == null) return false;
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
119 Actor updater = getUpdatePermission();
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
120 if (updater == null) {
20
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
121 // if not specified then everybody is allowed
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
122 return true;
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
123 } else {
15
58357a4b86de ASSIGNED - # 249: Annotations shared in groups
casties
parents: 14
diff changeset
124 return updater.isEquivalentWith(user, store);
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
125 }
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
126 } else if (action.equals("delete")) {
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
127 // require at least an authenticated user
15
58357a4b86de ASSIGNED - # 249: Annotations shared in groups
casties
parents: 14
diff changeset
128 if (user == null) return false;
20
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
129 Actor deleter = getDeletePermission();
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
130 if (deleter == null) {
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
131 // if not specified then only creator is allowed
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
132 deleter = creator;
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
133 }
20
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
134 return deleter.isEquivalentWith(user, store);
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
135 } else if (action.equals("admin")) {
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
136 // require at least an authenticated user
15
58357a4b86de ASSIGNED - # 249: Annotations shared in groups
casties
parents: 14
diff changeset
137 if (user == null) return false;
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
138 Actor admin = getAdminPermission();
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
139 if (admin == null) {
20
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
140 // if not specified then only creator is allowed
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
141 admin = creator;
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
142 }
20
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
143 return admin.isEquivalentWith(user, store);
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
144 }
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
145 return false;
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
146 }
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 10
diff changeset
147
4
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
148 /**
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
149 * @return the uri
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
150 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
151 public String getUri() {
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
152 return uri;
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
153 }
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
154
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
155 /**
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
156 * @param uri the uri to set
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
157 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
158 public void setUri(String uri) {
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
159 this.uri = uri;
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
160 }
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
161
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
162 /**
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
163 * @return the bodyText
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
164 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
165 public String getBodyText() {
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
166 return bodyText;
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
167 }
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
168
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
169 /**
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
170 * @param bodyText the bodyText to set
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
171 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
172 public void setBodyText(String bodyText) {
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
173 this.bodyText = bodyText;
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
174 }
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
175
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
176 /**
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
177 * @return the bodyUri
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
178 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
179 public String getBodyUri() {
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
180 return bodyUri;
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
181 }
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
182
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
183 /**
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
184 * @param bodyUri the bodyUri to set
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
185 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
186 public void setBodyUri(String bodyUri) {
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
187 this.bodyUri = bodyUri;
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
188 }
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
189
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
190 /**
48
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
191 * @return the target
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
192 */
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
193 public Target getTarget() {
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
194 return target;
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
195 }
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
196
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
197 /**
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
198 * @param target the target to set
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
199 */
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
200 public void setTarget(Target target) {
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
201 this.target = target;
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
202 }
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
203
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
204 /**
4
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
205 * @return the targetBaseUri
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
206 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
207 public String getTargetBaseUri() {
48
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
208 if (target == null) return null;
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
209 return target.getUri();
4
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
210 }
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
211
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
212 /**
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
213 * @return the targetFragment
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
214 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
215 public String getTargetFragment() {
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
216 return targetFragment;
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
217 }
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
218
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
219 /**
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
220 * @param targetFragment the targetFragment to set
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
221 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
222 public void setTargetFragment(String targetFragment) {
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
223 this.targetFragment = targetFragment;
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
224 }
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
225
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
226 /**
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
227 * @return the targetType
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
228 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
229 public FragmentTypes getFragmentType() {
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
230 return fragmentType;
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
231 }
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
232
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
233 /**
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
234 * @param fragmentType the fragmentType to set
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
235 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
236 public void setFragmentType(FragmentTypes fragmentType) {
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
237 this.fragmentType = fragmentType;
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
238 }
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
239
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
240 /**
48
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
241 * @return the resource
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
242 */
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
243 public Resource getResource() {
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
244 return resource;
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
245 }
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
246
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
247 /**
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
248 * @param resource the resource to set
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
249 */
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
250 public void setResource(Resource resource) {
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
251 this.resource = resource;
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
252 }
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
253
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
254 /**
40
03e0f7574224 saving and loading resource targets should work now (no searching yet)
casties
parents: 20
diff changeset
255 * @return the resourceUri
03e0f7574224 saving and loading resource targets should work now (no searching yet)
casties
parents: 20
diff changeset
256 */
03e0f7574224 saving and loading resource targets should work now (no searching yet)
casties
parents: 20
diff changeset
257 public String getResourceUri() {
48
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
258 if (resource == null) return null;
0e00bf8e27fb targets and resources of Annotation object are objects now.
casties
parents: 40
diff changeset
259 return resource.getUri();
40
03e0f7574224 saving and loading resource targets should work now (no searching yet)
casties
parents: 20
diff changeset
260 }
03e0f7574224 saving and loading resource targets should work now (no searching yet)
casties
parents: 20
diff changeset
261
03e0f7574224 saving and loading resource targets should work now (no searching yet)
casties
parents: 20
diff changeset
262 /**
9
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
263 * @return the creator
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
264 */
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
265 public Actor getCreator() {
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
266 return creator;
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
267 }
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
268
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
269 /**
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
270 * @param creator the creator to set
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
271 */
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
272 public void setCreator(Actor creator) {
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
273 this.creator = creator;
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
274 }
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
275
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
276 /**
4
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
277 * @return the creatorUri
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
278 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
279 public String getCreatorUri() {
9
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
280 if (creator != null) {
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
281 return creator.getUri();
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
282 }
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
283 return null;
4
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
284 }
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
285
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
286 /**
5
bbf0cc5bee29 version 0.2 really works now
casties
parents: 4
diff changeset
287 * @return the creatorName
bbf0cc5bee29 version 0.2 really works now
casties
parents: 4
diff changeset
288 */
bbf0cc5bee29 version 0.2 really works now
casties
parents: 4
diff changeset
289 public String getCreatorName() {
9
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
290 if (creator != null) {
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
291 return creator.getName();
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
292 }
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
293 return null;
5
bbf0cc5bee29 version 0.2 really works now
casties
parents: 4
diff changeset
294 }
bbf0cc5bee29 version 0.2 really works now
casties
parents: 4
diff changeset
295
bbf0cc5bee29 version 0.2 really works now
casties
parents: 4
diff changeset
296 /**
4
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
297 * @return the created
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
298 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
299 public String getCreated() {
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
300 return created;
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
301 }
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
302
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
303 /**
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
304 * @param created the created to set
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
305 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
306 public void setCreated(String created) {
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
307 this.created = created;
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
308 }
10
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
309
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
310 /**
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
311 * @return the adminPermission
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
312 */
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
313 public Actor getAdminPermission() {
20
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
314 if (adminPermission != null) {
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
315 return adminPermission;
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
316 } else {
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
317 // if not specified then only creator is allowed
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
318 return this.creator;
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
319 }
10
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
320 }
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
321
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
322 /**
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
323 * @param adminPermission the adminPermission to set
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
324 */
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
325 public void setAdminPermission(Actor adminPermission) {
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
326 this.adminPermission = adminPermission;
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
327 }
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
328
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
329 /**
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
330 * @return the deletePermission
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
331 */
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
332 public Actor getDeletePermission() {
20
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
333 if (deletePermission != null) {
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
334 return deletePermission;
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
335 } else {
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
336 // if not specified then only creator is allowed
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
337 return this.creator;
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
338 }
10
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
339 }
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
340
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
341 /**
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
342 * @param deletePermission the deletePermission to set
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
343 */
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
344 public void setDeletePermission(Actor deletePermission) {
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
345 this.deletePermission = deletePermission;
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
346 }
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
347
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
348 /**
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
349 * @return the updatePermission
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
350 */
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
351 public Actor getUpdatePermission() {
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
352 return updatePermission;
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
353 }
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
354
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
355 /**
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
356 * @param updatePermission the updatePermission to set
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
357 */
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
358 public void setUpdatePermission(Actor updatePermission) {
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
359 this.updatePermission = updatePermission;
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
360 }
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
361
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
362 /**
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
363 * @return the readPermission
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
364 */
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
365 public Actor getReadPermission() {
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
366 return readPermission;
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
367 }
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
368
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
369 /**
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
370 * @param readPermission the readPermission to set
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
371 */
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
372 public void setReadPermission(Actor readPermission) {
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
373 this.readPermission = readPermission;
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
374 }
16
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
375
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
376 /**
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
377 * @return the tags
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
378 */
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
379 public Set<String> getTags() {
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
380 return tags;
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
381 }
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
382
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
383 /**
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
384 * @param tags the tags to set
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
385 */
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
386 public void setTags(Set<String> tags) {
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
387 this.tags = tags;
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
388 }
4
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
389
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
390
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
391 }