Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/shared/model/CollectionRecord.java @ 226:a13382876e5d
The project list is sorted now.
flys-client/trunk@1671 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 12 Apr 2011 13:11:46 +0000 |
parents | 9bd9c24f4935 |
children | 53ad6dd2cb2b |
comparison
equal
deleted
inserted
replaced
225:9040663aee01 | 226:a13382876e5d |
---|---|
21 * | 21 * |
22 * @param collection The artifact collection. | 22 * @param collection The artifact collection. |
23 */ | 23 */ |
24 public CollectionRecord(Collection collection) { | 24 public CollectionRecord(Collection collection) { |
25 this.collection = collection; | 25 this.collection = collection; |
26 | |
27 setCreationTime(collection.getCreationTime()); | |
28 | |
29 String name = collection.getName(); | |
30 setName(name != null && name.length() > 0 | |
31 ? name | |
32 : collection.identifier()); | |
33 } | |
34 | |
35 | |
36 /** | |
37 * Sets the creation time. | |
38 * | |
39 * @param creationTime The creation time. | |
40 */ | |
41 public void setCreationTime(Date creationTime) { | |
42 setAttribute("creationTime", creationTime); | |
26 } | 43 } |
27 | 44 |
28 | 45 |
29 /** | 46 /** |
30 * Returns the date of the creation. | 47 * Returns the date of the creation. |
31 * | 48 * |
32 * @return the creation time. | 49 * @return the creation time. |
33 */ | 50 */ |
34 public Date getCreationTime() { | 51 public Date getCreationTime() { |
35 return collection.getCreationTime(); | 52 return getAttributeAsDate("creationTime"); |
36 } | 53 } |
37 | 54 |
38 | 55 |
39 /** | 56 /** |
40 * Returns the name of the collection. | 57 * Returns the name of the collection. |
41 * | 58 * |
42 * @return the name of the collection. | 59 * @return the name of the collection. |
43 */ | 60 */ |
44 public String getName() { | 61 public void setName(String name) { |
45 String name = collection.getName(); | 62 setAttribute("name", name); |
46 return name != null && name.length() > 0 | |
47 ? name | |
48 : collection.identifier(); | |
49 } | 63 } |
50 | 64 |
51 | 65 |
66 /** | |
67 * Returns the name of the collection or the uuid if no name is specified. | |
68 * | |
69 * @return the name of the collection. | |
70 */ | |
71 public String getName() { | |
72 return getAttributeAsString("name"); | |
73 } | |
74 | |
75 | |
76 /** | |
77 * Returns the collection objects itself. | |
78 * | |
79 * @return the collection object. | |
80 */ | |
52 public Collection getCollection() { | 81 public Collection getCollection() { |
53 return collection; | 82 return collection; |
54 } | 83 } |
55 } | 84 } |
56 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 85 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |