Mercurial > hg > AnnotationManagerN4J
annotate src/main/java/de/mpiwg/itgroup/annotations/Person.java @ 32:0731c4549065
UI for editing groups and persons works now. (still no authorisation!)
author | casties |
---|---|
date | Tue, 25 Sep 2012 21:59:21 +0200 |
parents | 58357a4b86de |
children | 9d3885d1681e |
rev | line source |
---|---|
10 | 1 /** |
2 * | |
3 */ | |
4 package de.mpiwg.itgroup.annotations; | |
5 | |
32
0731c4549065
UI for editing groups and persons works now. (still no authorisation!)
casties
parents:
15
diff
changeset
|
6 import de.mpiwg.itgroup.annotations.restlet.BaseRestlet; |
0731c4549065
UI for editing groups and persons works now. (still no authorisation!)
casties
parents:
15
diff
changeset
|
7 |
10 | 8 /** |
9 * @author casties | |
10 * | |
11 */ | |
12 public class Person extends Actor { | |
13 | |
12 | 14 public Person() { |
15 } | |
16 | |
17 public Person(String id) { | |
18 super(); | |
19 this.id = id; | |
20 } | |
21 | |
10 | 22 public Person(String uri, String name) { |
23 super(); | |
24 this.uri = uri; | |
25 this.name = name; | |
26 } | |
27 | |
15 | 28 public Person(String id, String uri, String name) { |
29 super(); | |
30 this.id = id; | |
31 this.uri = uri; | |
32 this.name = name; | |
33 } | |
34 | |
10 | 35 @Override |
36 public boolean isGroup() { | |
37 return false; | |
38 } | |
39 | |
40 public String getIdString() { | |
41 if (id == null) { | |
42 id = getIdFromUri(uri, false); | |
43 } | |
44 return id; | |
45 } | |
46 | |
15 | 47 /** |
48 * Returns a Person with this id or null. | |
49 * | |
50 * @param id | |
51 * @return | |
52 */ | |
53 public static Person createPersonWithId(String id) { | |
54 if (id != null) { | |
55 return new Person(id); | |
56 } | |
57 return null; | |
58 } | |
32
0731c4549065
UI for editing groups and persons works now. (still no authorisation!)
casties
parents:
15
diff
changeset
|
59 |
0731c4549065
UI for editing groups and persons works now. (still no authorisation!)
casties
parents:
15
diff
changeset
|
60 /** |
0731c4549065
UI for editing groups and persons works now. (still no authorisation!)
casties
parents:
15
diff
changeset
|
61 * Sets the name from the id using getFullNameFromLdap of the Application. |
0731c4549065
UI for editing groups and persons works now. (still no authorisation!)
casties
parents:
15
diff
changeset
|
62 * |
0731c4549065
UI for editing groups and persons works now. (still no authorisation!)
casties
parents:
15
diff
changeset
|
63 * @param application |
0731c4549065
UI for editing groups and persons works now. (still no authorisation!)
casties
parents:
15
diff
changeset
|
64 * @return |
0731c4549065
UI for editing groups and persons works now. (still no authorisation!)
casties
parents:
15
diff
changeset
|
65 */ |
0731c4549065
UI for editing groups and persons works now. (still no authorisation!)
casties
parents:
15
diff
changeset
|
66 public String updateName(BaseRestlet application) { |
0731c4549065
UI for editing groups and persons works now. (still no authorisation!)
casties
parents:
15
diff
changeset
|
67 if (id != null) { |
0731c4549065
UI for editing groups and persons works now. (still no authorisation!)
casties
parents:
15
diff
changeset
|
68 name = application.getFullNameFromLdap(id); |
0731c4549065
UI for editing groups and persons works now. (still no authorisation!)
casties
parents:
15
diff
changeset
|
69 } |
0731c4549065
UI for editing groups and persons works now. (still no authorisation!)
casties
parents:
15
diff
changeset
|
70 return name; |
0731c4549065
UI for editing groups and persons works now. (still no authorisation!)
casties
parents:
15
diff
changeset
|
71 } |
10 | 72 } |