annotate gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DefaultCollection.java @ 5838:5aa05a7a34b7

Rename modules to more fitting names.
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 15:23:37 +0200
parents flys-client/src/main/java/org/dive4elements/river/client/shared/model/DefaultCollection.java@821a02bbfb4e
children 172338b1407f
rev   line source
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
1 package org.dive4elements.river.client.shared.model;
3
9cf5a40b62c7 Added an interface and a default implementation of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
17
6cb8aff3cd6b Enhanced the Collection and its default implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 5
diff changeset
3 import java.util.ArrayList;
3
9cf5a40b62c7 Added an interface and a default implementation of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
4 import java.util.Date;
67
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
5 import java.util.HashMap;
17
6cb8aff3cd6b Enhanced the Collection and its default implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 5
diff changeset
6 import java.util.List;
67
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
7 import java.util.Map;
3
9cf5a40b62c7 Added an interface and a default implementation of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
8
9cf5a40b62c7 Added an interface and a default implementation of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
9
9cf5a40b62c7 Added an interface and a default implementation of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10 /**
9cf5a40b62c7 Added an interface and a default implementation of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11 * The default implementation of a {@link Collection}.
9cf5a40b62c7 Added an interface and a default implementation of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12 *
9cf5a40b62c7 Added an interface and a default implementation of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
9cf5a40b62c7 Added an interface and a default implementation of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14 */
9cf5a40b62c7 Added an interface and a default implementation of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15 public class DefaultCollection implements Collection {
9cf5a40b62c7 Added an interface and a default implementation of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16
9cf5a40b62c7 Added an interface and a default implementation of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17 /** The uuid of the collection. */
9cf5a40b62c7 Added an interface and a default implementation of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18 protected String uuid;
9cf5a40b62c7 Added an interface and a default implementation of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19
1430
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 856
diff changeset
20 /** The name of the collection. */
95
e2abb6b9dc7e A collection provides a method to retrieve its creation time now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 67
diff changeset
21 protected String name;
e2abb6b9dc7e A collection provides a method to retrieve its creation time now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 67
diff changeset
22
1430
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 856
diff changeset
23 /** The creation time of this collection. */
95
e2abb6b9dc7e A collection provides a method to retrieve its creation time now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 67
diff changeset
24 protected Date creation;
e2abb6b9dc7e A collection provides a method to retrieve its creation time now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 67
diff changeset
25
1430
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 856
diff changeset
26 /**
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 856
diff changeset
27 * The time to live of the collection.
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 856
diff changeset
28 * If this value is 0, it will never die.
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 856
diff changeset
29 */
587
53ad6dd2cb2b The project list displays the favorite state of a collection now. A gold star means, that a collection is a owner's favorite project and will never die. A silver star means, that the project is a common project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 524
diff changeset
30 protected long ttl;
53ad6dd2cb2b The project list displays the favorite state of a collection now. A gold star means, that a collection is a owner's favorite project and will never die. A silver star means, that the project is a common project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 524
diff changeset
31
17
6cb8aff3cd6b Enhanced the Collection and its default implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 5
diff changeset
32 /** The list of artifacts that are managed by this Collection.*/
67
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
33 protected List<CollectionItem> items;
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
34
809
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
35 protected List<Recommendation> recommendations;
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
36
1430
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 856
diff changeset
37 /**
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 856
diff changeset
38 * ThemeList by outputmode name.
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 856
diff changeset
39 */
524
ba238f917b94 The theme list information stored in the attribute of a collection is read and added in form of Themes and ThemeLists to the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 95
diff changeset
40 protected Map<String, ThemeList> themeLists;
ba238f917b94 The theme list information stored in the attribute of a collection is read and added in form of Themes and ThemeLists to the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 95
diff changeset
41
1439
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
42 /**
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
43 * Settings by outputmode name.
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
44 */
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
45 protected Map<String, Settings> settings;
67
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
46
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
47 /**
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
48 * Constructor without arguments is necessary for GWT.
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
49 */
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
50 public DefaultCollection() {
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
51 }
17
6cb8aff3cd6b Enhanced the Collection and its default implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 5
diff changeset
52
3
9cf5a40b62c7 Added an interface and a default implementation of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
53
856
ec5c75da5c7a Bugfix flys/issue166: Parse Collection names from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 840
diff changeset
54 public DefaultCollection(String uuid, long ttl, String name) {
1430
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 856
diff changeset
55 this.uuid = uuid;
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 856
diff changeset
56 this.ttl = ttl;
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 856
diff changeset
57 this.name = name;
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 856
diff changeset
58 this.items = new ArrayList<CollectionItem>();
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 856
diff changeset
59 this.themeLists = new HashMap<String, ThemeList>();
840
18fc7afe0251 Ensure list of recommendations is non-null after construction of DefaultCollection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 809
diff changeset
60 this.recommendations = new ArrayList<Recommendation>();
1439
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
61 this.settings = new HashMap<String, Settings>();
524
ba238f917b94 The theme list information stored in the attribute of a collection is read and added in form of Themes and ThemeLists to the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 95
diff changeset
62 }
ba238f917b94 The theme list information stored in the attribute of a collection is read and added in form of Themes and ThemeLists to the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 95
diff changeset
63
ba238f917b94 The theme list information stored in the attribute of a collection is read and added in form of Themes and ThemeLists to the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 95
diff changeset
64
809
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
65 /**
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
66 * Creates a new DefaultCollection with a UUID.
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
67 *
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
68 * @param uuid The UUID.
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
69 */
856
ec5c75da5c7a Bugfix flys/issue166: Parse Collection names from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 840
diff changeset
70 public DefaultCollection(
ec5c75da5c7a Bugfix flys/issue166: Parse Collection names from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 840
diff changeset
71 String uuid,
ec5c75da5c7a Bugfix flys/issue166: Parse Collection names from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 840
diff changeset
72 long ttl,
ec5c75da5c7a Bugfix flys/issue166: Parse Collection names from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 840
diff changeset
73 String name,
ec5c75da5c7a Bugfix flys/issue166: Parse Collection names from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 840
diff changeset
74 List<Recommendation> recs
ec5c75da5c7a Bugfix flys/issue166: Parse Collection names from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 840
diff changeset
75 ) {
ec5c75da5c7a Bugfix flys/issue166: Parse Collection names from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 840
diff changeset
76 this(uuid, ttl, name);
809
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
77
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
78 this.recommendations = recs;
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
79 }
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
80
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
81
587
53ad6dd2cb2b The project list displays the favorite state of a collection now. A gold star means, that a collection is a owner's favorite project and will never die. A silver star means, that the project is a common project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 524
diff changeset
82 public DefaultCollection(
53ad6dd2cb2b The project list displays the favorite state of a collection now. A gold star means, that a collection is a owner's favorite project and will never die. A silver star means, that the project is a common project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 524
diff changeset
83 String uuid,
53ad6dd2cb2b The project list displays the favorite state of a collection now. A gold star means, that a collection is a owner's favorite project and will never die. A silver star means, that the project is a common project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 524
diff changeset
84 long ttl,
856
ec5c75da5c7a Bugfix flys/issue166: Parse Collection names from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 840
diff changeset
85 String name,
809
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
86 List<Recommendation> recommendations,
587
53ad6dd2cb2b The project list displays the favorite state of a collection now. A gold star means, that a collection is a owner's favorite project and will never die. A silver star means, that the project is a common project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 524
diff changeset
87 Map<String, ThemeList> themeLists)
53ad6dd2cb2b The project list displays the favorite state of a collection now. A gold star means, that a collection is a owner's favorite project and will never die. A silver star means, that the project is a common project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 524
diff changeset
88 {
856
ec5c75da5c7a Bugfix flys/issue166: Parse Collection names from DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 840
diff changeset
89 this(uuid, ttl, name, recommendations);
840
18fc7afe0251 Ensure list of recommendations is non-null after construction of DefaultCollection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 809
diff changeset
90 this.themeLists = themeLists;
3
9cf5a40b62c7 Added an interface and a default implementation of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
91 }
9cf5a40b62c7 Added an interface and a default implementation of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
92
9cf5a40b62c7 Added an interface and a default implementation of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
93
1439
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
94 public DefaultCollection(
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
95 String uuid,
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
96 long ttl,
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
97 String name,
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
98 List<Recommendation> recommendations,
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
99 Map<String, ThemeList> themeLists,
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
100 Map<String, Settings> settings)
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
101 {
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
102 this(uuid, ttl, name, recommendations);
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
103 this.themeLists = themeLists;
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
104 this.settings = settings;
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
105 }
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
106
1544
2b3d02626823 Opened Collection interface in preparation of Manual Points-Feature.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1464
diff changeset
107
95
e2abb6b9dc7e A collection provides a method to retrieve its creation time now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 67
diff changeset
108 /**
e2abb6b9dc7e A collection provides a method to retrieve its creation time now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 67
diff changeset
109 * Creates a new DefaultCollection with uuid and name.
e2abb6b9dc7e A collection provides a method to retrieve its creation time now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 67
diff changeset
110 *
e2abb6b9dc7e A collection provides a method to retrieve its creation time now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 67
diff changeset
111 * @param uuid The identifier of this collection.
e2abb6b9dc7e A collection provides a method to retrieve its creation time now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 67
diff changeset
112 * @param name The name of this collection.
e2abb6b9dc7e A collection provides a method to retrieve its creation time now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 67
diff changeset
113 * @param creation The creation time.
e2abb6b9dc7e A collection provides a method to retrieve its creation time now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 67
diff changeset
114 */
587
53ad6dd2cb2b The project list displays the favorite state of a collection now. A gold star means, that a collection is a owner's favorite project and will never die. A silver star means, that the project is a common project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 524
diff changeset
115 public DefaultCollection(String uuid, long ttl, String name, Date creation){
53ad6dd2cb2b The project list displays the favorite state of a collection now. A gold star means, that a collection is a owner's favorite project and will never die. A silver star means, that the project is a common project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 524
diff changeset
116 this(uuid, ttl, name);
95
e2abb6b9dc7e A collection provides a method to retrieve its creation time now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 67
diff changeset
117
e2abb6b9dc7e A collection provides a method to retrieve its creation time now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 67
diff changeset
118 this.creation = creation;
e2abb6b9dc7e A collection provides a method to retrieve its creation time now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 67
diff changeset
119 }
e2abb6b9dc7e A collection provides a method to retrieve its creation time now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 67
diff changeset
120
e2abb6b9dc7e A collection provides a method to retrieve its creation time now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 67
diff changeset
121
5
14bf7895a2ec Added a new method that returns the UUID of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3
diff changeset
122 public String identifier() {
14bf7895a2ec Added a new method that returns the UUID of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3
diff changeset
123 return uuid;
14bf7895a2ec Added a new method that returns the UUID of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3
diff changeset
124 }
14bf7895a2ec Added a new method that returns the UUID of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3
diff changeset
125
14bf7895a2ec Added a new method that returns the UUID of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3
diff changeset
126
95
e2abb6b9dc7e A collection provides a method to retrieve its creation time now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 67
diff changeset
127 public Date getCreationTime() {
e2abb6b9dc7e A collection provides a method to retrieve its creation time now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 67
diff changeset
128 return creation;
e2abb6b9dc7e A collection provides a method to retrieve its creation time now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 67
diff changeset
129 }
e2abb6b9dc7e A collection provides a method to retrieve its creation time now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 67
diff changeset
130
e2abb6b9dc7e A collection provides a method to retrieve its creation time now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 67
diff changeset
131
1430
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 856
diff changeset
132 /**
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 856
diff changeset
133 * Returns now.
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 856
diff changeset
134 * TODO candidate for removal?
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 856
diff changeset
135 */
3
9cf5a40b62c7 Added an interface and a default implementation of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
136 public Date getLastAccess() {
9cf5a40b62c7 Added an interface and a default implementation of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
137 return new Date();
9cf5a40b62c7 Added an interface and a default implementation of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
138 }
9cf5a40b62c7 Added an interface and a default implementation of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
139
9cf5a40b62c7 Added an interface and a default implementation of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
140
587
53ad6dd2cb2b The project list displays the favorite state of a collection now. A gold star means, that a collection is a owner's favorite project and will never die. A silver star means, that the project is a common project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 524
diff changeset
141 public long getTTL() {
53ad6dd2cb2b The project list displays the favorite state of a collection now. A gold star means, that a collection is a owner's favorite project and will never die. A silver star means, that the project is a common project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 524
diff changeset
142 return ttl;
53ad6dd2cb2b The project list displays the favorite state of a collection now. A gold star means, that a collection is a owner's favorite project and will never die. A silver star means, that the project is a common project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 524
diff changeset
143 }
53ad6dd2cb2b The project list displays the favorite state of a collection now. A gold star means, that a collection is a owner's favorite project and will never die. A silver star means, that the project is a common project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 524
diff changeset
144
53ad6dd2cb2b The project list displays the favorite state of a collection now. A gold star means, that a collection is a owner's favorite project and will never die. A silver star means, that the project is a common project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 524
diff changeset
145
597
14e5e51a7de4 Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 587
diff changeset
146 public void setTTL(long ttl) {
14e5e51a7de4 Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 587
diff changeset
147 this.ttl = ttl;
14e5e51a7de4 Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 587
diff changeset
148 }
14e5e51a7de4 Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 587
diff changeset
149
14e5e51a7de4 Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 587
diff changeset
150
3
9cf5a40b62c7 Added an interface and a default implementation of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
151 public String getName() {
95
e2abb6b9dc7e A collection provides a method to retrieve its creation time now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 67
diff changeset
152 return name;
3
9cf5a40b62c7 Added an interface and a default implementation of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
153 }
17
6cb8aff3cd6b Enhanced the Collection and its default implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 5
diff changeset
154
6cb8aff3cd6b Enhanced the Collection and its default implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 5
diff changeset
155
597
14e5e51a7de4 Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 587
diff changeset
156 public void setName(String name) {
14e5e51a7de4 Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 587
diff changeset
157 this.name = name;
14e5e51a7de4 Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 587
diff changeset
158 }
14e5e51a7de4 Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 587
diff changeset
159
14e5e51a7de4 Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 587
diff changeset
160
67
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
161 public void addItem(CollectionItem item) {
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
162 if (item != null) {
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
163 items.add(item);
17
6cb8aff3cd6b Enhanced the Collection and its default implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 5
diff changeset
164 }
6cb8aff3cd6b Enhanced the Collection and its default implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 5
diff changeset
165 }
6cb8aff3cd6b Enhanced the Collection and its default implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 5
diff changeset
166
6cb8aff3cd6b Enhanced the Collection and its default implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 5
diff changeset
167
67
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
168 public int getItemLength() {
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
169 return items.size();
17
6cb8aff3cd6b Enhanced the Collection and its default implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 5
diff changeset
170 }
6cb8aff3cd6b Enhanced the Collection and its default implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 5
diff changeset
171
6cb8aff3cd6b Enhanced the Collection and its default implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 5
diff changeset
172
1544
2b3d02626823 Opened Collection interface in preparation of Manual Points-Feature.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1464
diff changeset
173 /** Returns item at index (0-based), or null if out of range. */
67
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
174 public CollectionItem getItem(int idx) {
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
175 if (idx >= getItemLength()) {
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
176 return null;
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
177 }
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
178
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
179 return items.get(idx);
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
180 }
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
181
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
182
1544
2b3d02626823 Opened Collection interface in preparation of Manual Points-Feature.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1464
diff changeset
183 /**
2b3d02626823 Opened Collection interface in preparation of Manual Points-Feature.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1464
diff changeset
184 * Get item whose identifier is the given string.
2b3d02626823 Opened Collection interface in preparation of Manual Points-Feature.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1464
diff changeset
185 * @param uuid identifier of collection item (artifacts uuid).
2b3d02626823 Opened Collection interface in preparation of Manual Points-Feature.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1464
diff changeset
186 * @return CollectionItem whose identifier is given String, null if not found.
2b3d02626823 Opened Collection interface in preparation of Manual Points-Feature.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1464
diff changeset
187 */
2b3d02626823 Opened Collection interface in preparation of Manual Points-Feature.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1464
diff changeset
188 public CollectionItem getItem(String uuid) {
2b3d02626823 Opened Collection interface in preparation of Manual Points-Feature.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1464
diff changeset
189 int size = getItemLength();
2b3d02626823 Opened Collection interface in preparation of Manual Points-Feature.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1464
diff changeset
190 for (int i = 0; i < size; i++) {
2b3d02626823 Opened Collection interface in preparation of Manual Points-Feature.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1464
diff changeset
191 CollectionItem item = getItem(i);
2b3d02626823 Opened Collection interface in preparation of Manual Points-Feature.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1464
diff changeset
192 if (item.identifier().equals(uuid)) {
2b3d02626823 Opened Collection interface in preparation of Manual Points-Feature.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1464
diff changeset
193 return item;
2b3d02626823 Opened Collection interface in preparation of Manual Points-Feature.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1464
diff changeset
194 }
2b3d02626823 Opened Collection interface in preparation of Manual Points-Feature.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1464
diff changeset
195 }
2b3d02626823 Opened Collection interface in preparation of Manual Points-Feature.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1464
diff changeset
196 return null;
2b3d02626823 Opened Collection interface in preparation of Manual Points-Feature.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1464
diff changeset
197 }
2b3d02626823 Opened Collection interface in preparation of Manual Points-Feature.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1464
diff changeset
198
2b3d02626823 Opened Collection interface in preparation of Manual Points-Feature.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1464
diff changeset
199
67
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
200 public Map<String, OutputMode> getOutputModes() {
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
201 Map<String, OutputMode> modes = new HashMap<String, OutputMode>();
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
202
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
203 for (CollectionItem item: items) {
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
204 List<OutputMode> itemModes = item.getOutputModes();
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
205
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
206 if (itemModes != null) {
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
207 for (OutputMode itemMode: itemModes) {
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
208 String name = itemMode.getName();
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
209 if (!modes.containsKey(name)) {
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
210 // we dont want duplicated OutputModes in our result.
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
211 modes.put(name, itemMode);
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
212 }
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
213 }
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
214 }
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
215 }
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
216
74257b95567b Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 17
diff changeset
217 return modes;
17
6cb8aff3cd6b Enhanced the Collection and its default implementation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 5
diff changeset
218 }
524
ba238f917b94 The theme list information stored in the attribute of a collection is read and added in form of Themes and ThemeLists to the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 95
diff changeset
219
ba238f917b94 The theme list information stored in the attribute of a collection is read and added in form of Themes and ThemeLists to the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 95
diff changeset
220
1430
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 856
diff changeset
221 /**
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 856
diff changeset
222 * Returns ThemeList for given output name.
6bb6d43eeb2d Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 856
diff changeset
223 */
524
ba238f917b94 The theme list information stored in the attribute of a collection is read and added in form of Themes and ThemeLists to the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 95
diff changeset
224 public ThemeList getThemeList(String outName) {
ba238f917b94 The theme list information stored in the attribute of a collection is read and added in form of Themes and ThemeLists to the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 95
diff changeset
225 if (themeLists != null) {
ba238f917b94 The theme list information stored in the attribute of a collection is read and added in form of Themes and ThemeLists to the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 95
diff changeset
226 return themeLists.get(outName);
ba238f917b94 The theme list information stored in the attribute of a collection is read and added in form of Themes and ThemeLists to the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 95
diff changeset
227 }
ba238f917b94 The theme list information stored in the attribute of a collection is read and added in form of Themes and ThemeLists to the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 95
diff changeset
228
ba238f917b94 The theme list information stored in the attribute of a collection is read and added in form of Themes and ThemeLists to the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 95
diff changeset
229 return null;
ba238f917b94 The theme list information stored in the attribute of a collection is read and added in form of Themes and ThemeLists to the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 95
diff changeset
230 }
809
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
231
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
232
1439
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
233 /**
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
234 * Returns Settings for given output name.
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
235 */
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
236 public Settings getSettings(String outName) {
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
237 if (settings != null) {
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
238 return settings.get(outName);
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
239 }
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
240
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
241 return null;
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
242 }
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
243
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
244
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
245 public void setSettings(Map<String, Settings> settings) {
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
246 this.settings = settings;
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
247 }
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
248
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
249
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
250 public void addSettings(String outname, Settings settings) {
1464
c899a7ffdc8f Extract and parse the output settings from describe document and add settings
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1439
diff changeset
251 if (this.settings == null) {
c899a7ffdc8f Extract and parse the output settings from describe document and add settings
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1439
diff changeset
252 this.settings = new HashMap<String, Settings>();
c899a7ffdc8f Extract and parse the output settings from describe document and add settings
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1439
diff changeset
253 }
1439
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
254 this.settings.put(outname, settings);
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
255 }
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
256
4df2d9a4b9b4 Added interfaces and container for output settings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1435
diff changeset
257
1435
f6fbfdc813f0 Allow client to access artifacts data via CollectionItems and Themes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1430
diff changeset
258 /** Set the outputname to themelist map. */
f6fbfdc813f0 Allow client to access artifacts data via CollectionItems and Themes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1430
diff changeset
259 public void setThemeLists(Map<String, ThemeList> map) {
f6fbfdc813f0 Allow client to access artifacts data via CollectionItems and Themes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1430
diff changeset
260 this.themeLists = map;
f6fbfdc813f0 Allow client to access artifacts data via CollectionItems and Themes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1430
diff changeset
261 }
f6fbfdc813f0 Allow client to access artifacts data via CollectionItems and Themes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1430
diff changeset
262
f6fbfdc813f0 Allow client to access artifacts data via CollectionItems and Themes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1430
diff changeset
263
809
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
264 public List<Recommendation> getRecommendations() {
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
265 return recommendations;
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
266 }
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
267
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
268
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
269 public void addRecommendation(Recommendation recommendation) {
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
270 recommendations.add(recommendation);
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
271 }
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
272
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
273
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
274 public void addRecommendations(List<Recommendation> recommendations) {
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
275 this.recommendations.addAll(recommendations);
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
276 }
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
277
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
278
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
279 public boolean loadedRecommendation(Recommendation recommendation) {
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
280 String factory = recommendation.getFactory();
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
281 String dbids = recommendation.getIDs();
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
282
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
283 for (Recommendation in: recommendations) {
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
284 String inFactory = in.getFactory();
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
285 String inDbids = in.getIDs();
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
286
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
287 if (factory.equals(inFactory) && dbids.equals(inDbids)) {
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
288 return true;
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
289 }
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
290 }
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
291
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
292 return false;
e9337488bac3 The Collection now knows its already loaded recommendations - the CollectionView will not load recommendations that have already been loaded before.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 597
diff changeset
293 }
4660
bb9ce9aece70 Add new method hasItems to Collection class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 1544
diff changeset
294
bb9ce9aece70 Add new method hasItems to Collection class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 1544
diff changeset
295
bb9ce9aece70 Add new method hasItems to Collection class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 1544
diff changeset
296 @Override
bb9ce9aece70 Add new method hasItems to Collection class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 1544
diff changeset
297 public boolean hasItems() {
bb9ce9aece70 Add new method hasItems to Collection class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 1544
diff changeset
298 return items.isEmpty();
bb9ce9aece70 Add new method hasItems to Collection class
Björn Ricks <bjoern.ricks@intevation.de>
parents: 1544
diff changeset
299 }
4689
79f11188da21 Add a Collection method to return a string to be displayed in the gui
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
300
79f11188da21 Add a Collection method to return a string to be displayed in the gui
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
301 /**
79f11188da21 Add a Collection method to return a string to be displayed in the gui
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
302 * Returns the name of the collection or uuid if no name is set
79f11188da21 Add a Collection method to return a string to be displayed in the gui
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
303 */
79f11188da21 Add a Collection method to return a string to be displayed in the gui
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
304 @Override
79f11188da21 Add a Collection method to return a string to be displayed in the gui
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
305 public String getDisplayName() {
79f11188da21 Add a Collection method to return a string to be displayed in the gui
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
306 if (this.name != null) {
79f11188da21 Add a Collection method to return a string to be displayed in the gui
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
307 return this.name;
79f11188da21 Add a Collection method to return a string to be displayed in the gui
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
308 }
79f11188da21 Add a Collection method to return a string to be displayed in the gui
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
309 return this.uuid;
79f11188da21 Add a Collection method to return a string to be displayed in the gui
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4660
diff changeset
310 }
3
9cf5a40b62c7 Added an interface and a default implementation of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
311 }
9cf5a40b62c7 Added an interface and a default implementation of a Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
312 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org