annotate src/main/java/de/mpiwg/itgroup/annotations/Annotation.java @ 40:03e0f7574224

saving and loading resource targets should work now (no searching yet)
author casties
date Wed, 26 Sep 2012 14:56:42 +0200
parents 715aa11d138b
children 0e00bf8e27fb
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 /**
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
31 * The base URI of the annotation target.
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
32 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
33 protected String targetBaseUri;
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 /**
03e0f7574224 saving and loading resource targets should work now (no searching yet)
casties
parents: 20
diff changeset
55 * The uri of the resource that is annotated e.g. a book.
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 */
03e0f7574224 saving and loading resource targets should work now (no searching yet)
casties
parents: 20
diff changeset
58 protected String resourceUri;
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 /**
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
191 * @return the targetBaseUri
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
192 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
193 public String getTargetBaseUri() {
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
194 return targetBaseUri;
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
195 }
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
196
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
197 /**
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
198 * @param targetBaseUri the targetBaseUri to set
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
199 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
200 public void setTargetBaseUri(String targetBaseUri) {
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
201 this.targetBaseUri = targetBaseUri;
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
202 }
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
203
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
204 /**
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
205 * @return the targetFragment
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
206 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
207 public String getTargetFragment() {
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
208 return targetFragment;
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
209 }
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 * @param targetFragment the targetFragment to set
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
213 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
214 public void setTargetFragment(String targetFragment) {
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
215 this.targetFragment = targetFragment;
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
216 }
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 * @return the targetType
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
220 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
221 public FragmentTypes getFragmentType() {
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
222 return fragmentType;
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
223 }
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 * @param fragmentType the fragmentType to set
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
227 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
228 public void setFragmentType(FragmentTypes fragmentType) {
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
229 this.fragmentType = fragmentType;
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
230 }
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
231
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
232 /**
40
03e0f7574224 saving and loading resource targets should work now (no searching yet)
casties
parents: 20
diff changeset
233 * @return the resourceUri
03e0f7574224 saving and loading resource targets should work now (no searching yet)
casties
parents: 20
diff changeset
234 */
03e0f7574224 saving and loading resource targets should work now (no searching yet)
casties
parents: 20
diff changeset
235 public String getResourceUri() {
03e0f7574224 saving and loading resource targets should work now (no searching yet)
casties
parents: 20
diff changeset
236 return resourceUri;
03e0f7574224 saving and loading resource targets should work now (no searching yet)
casties
parents: 20
diff changeset
237 }
03e0f7574224 saving and loading resource targets should work now (no searching yet)
casties
parents: 20
diff changeset
238
03e0f7574224 saving and loading resource targets should work now (no searching yet)
casties
parents: 20
diff changeset
239 /**
03e0f7574224 saving and loading resource targets should work now (no searching yet)
casties
parents: 20
diff changeset
240 * @param resourceUri the resourceUri to set
03e0f7574224 saving and loading resource targets should work now (no searching yet)
casties
parents: 20
diff changeset
241 */
03e0f7574224 saving and loading resource targets should work now (no searching yet)
casties
parents: 20
diff changeset
242 public void setResourceUri(String resourceUri) {
03e0f7574224 saving and loading resource targets should work now (no searching yet)
casties
parents: 20
diff changeset
243 this.resourceUri = resourceUri;
03e0f7574224 saving and loading resource targets should work now (no searching yet)
casties
parents: 20
diff changeset
244 }
03e0f7574224 saving and loading resource targets should work now (no searching yet)
casties
parents: 20
diff changeset
245
03e0f7574224 saving and loading resource targets should work now (no searching yet)
casties
parents: 20
diff changeset
246 /**
9
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
247 * @return the creator
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
248 */
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
249 public Actor getCreator() {
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
250 return creator;
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
251 }
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
252
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
253 /**
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
254 * @param creator the creator to set
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
255 */
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
256 public void setCreator(Actor creator) {
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
257 this.creator = creator;
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
258 }
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
259
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
260 /**
4
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
261 * @return the creatorUri
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
262 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
263 public String getCreatorUri() {
9
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
264 if (creator != null) {
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
265 return creator.getUri();
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
266 }
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
267 return null;
4
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
268 }
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
269
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
270 /**
5
bbf0cc5bee29 version 0.2 really works now
casties
parents: 4
diff changeset
271 * @return the creatorName
bbf0cc5bee29 version 0.2 really works now
casties
parents: 4
diff changeset
272 */
bbf0cc5bee29 version 0.2 really works now
casties
parents: 4
diff changeset
273 public String getCreatorName() {
9
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
274 if (creator != null) {
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
275 return creator.getName();
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
276 }
b2bfc3bc9ba8 new internal actor class for creator.
casties
parents: 8
diff changeset
277 return null;
5
bbf0cc5bee29 version 0.2 really works now
casties
parents: 4
diff changeset
278 }
bbf0cc5bee29 version 0.2 really works now
casties
parents: 4
diff changeset
279
bbf0cc5bee29 version 0.2 really works now
casties
parents: 4
diff changeset
280 /**
4
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
281 * @return the created
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
282 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
283 public String getCreated() {
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
284 return created;
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
285 }
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
286
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
287 /**
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
288 * @param created the created to set
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
289 */
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
290 public void setCreated(String created) {
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
291 this.created = created;
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
292 }
10
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
293
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
294 /**
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
295 * @return the adminPermission
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
296 */
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
297 public Actor getAdminPermission() {
20
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
298 if (adminPermission != null) {
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
299 return adminPermission;
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
300 } else {
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
301 // if not specified then only creator is allowed
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
302 return this.creator;
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
303 }
10
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
304 }
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
305
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
306 /**
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
307 * @param adminPermission the adminPermission to set
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
308 */
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
309 public void setAdminPermission(Actor adminPermission) {
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
310 this.adminPermission = adminPermission;
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
311 }
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
312
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
313 /**
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
314 * @return the deletePermission
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
315 */
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
316 public Actor getDeletePermission() {
20
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
317 if (deletePermission != null) {
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
318 return deletePermission;
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
319 } else {
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
320 // if not specified then only creator is allowed
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
321 return this.creator;
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
322 }
10
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
323 }
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
324
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
325 /**
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
326 * @param deletePermission the deletePermission to set
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
327 */
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
328 public void setDeletePermission(Actor deletePermission) {
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
329 this.deletePermission = deletePermission;
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
330 }
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
331
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
332 /**
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
333 * @return the updatePermission
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
334 */
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
335 public Actor getUpdatePermission() {
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
336 return updatePermission;
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
337 }
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
338
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
339 /**
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
340 * @param updatePermission the updatePermission to set
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
341 */
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
342 public void setUpdatePermission(Actor updatePermission) {
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
343 this.updatePermission = updatePermission;
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
344 }
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
345
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
346 /**
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
347 * @return the readPermission
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
348 */
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
349 public Actor getReadPermission() {
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
350 return readPermission;
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
351 }
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
352
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
353 /**
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
354 * @param readPermission the readPermission to set
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
355 */
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
356 public void setReadPermission(Actor readPermission) {
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
357 this.readPermission = readPermission;
90911b2da322 more work on permissions...
casties
parents: 9
diff changeset
358 }
16
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
359
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
360 /**
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
361 * @return the tags
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
362 */
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
363 public Set<String> getTags() {
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
364 return tags;
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
365 }
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
366
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
367 /**
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
368 * @param tags the tags to set
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
369 */
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
370 public void setTags(Set<String> tags) {
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
371 this.tags = tags;
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
372 }
4
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
373
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
374
3599b29c393f store seems to work now :-)
casties
parents:
diff changeset
375 }