Mercurial > dive4elements > river
annotate gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DefaultCollectionItem.java @ 9499:853f2dafc16e
VegetationZones in CrossSectionsDiagram
author | gernotbelger |
---|---|
date | Thu, 27 Sep 2018 18:06:26 +0200 |
parents | ea9eef426962 |
children |
rev | line source |
---|---|
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
2 * Software engineering by Intevation GmbH |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
3 * |
5993
ea9eef426962
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5861
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
5993
ea9eef426962
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5861
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
7 */ |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
8 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
9 package org.dive4elements.river.client.shared.model; |
67
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import java.util.List; |
1435
f6fbfdc813f0
Allow client to access artifacts data via CollectionItems and Themes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
87
diff
changeset
|
12 import java.util.Map; |
67
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 /** |
1435
f6fbfdc813f0
Allow client to access artifacts data via CollectionItems and Themes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
87
diff
changeset
|
15 * The default implementation of a CollectionItem (artifact). |
67
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 * |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 */ |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 public class DefaultCollectionItem implements CollectionItem { |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 |
9499 | 21 private static final long serialVersionUID = 1L; |
22 | |
1435
f6fbfdc813f0
Allow client to access artifacts data via CollectionItems and Themes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
87
diff
changeset
|
23 /** The identifier that specifies the artifact related to this item. */ |
67
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 protected String identifier; |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 |
1435
f6fbfdc813f0
Allow client to access artifacts data via CollectionItems and Themes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
87
diff
changeset
|
26 /** The hash that specifies the artifact related to this item. */ |
87
c8cd1b918901
Bugfix: Step back will remove duplicated output tab and an extended chart image URL bypasses the browser cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
67
diff
changeset
|
27 protected String hash; |
c8cd1b918901
Bugfix: Step back will remove duplicated output tab and an extended chart image URL bypasses the browser cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
67
diff
changeset
|
28 |
1435
f6fbfdc813f0
Allow client to access artifacts data via CollectionItems and Themes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
87
diff
changeset
|
29 /** The list of output modes supported by the artifact of this item. */ |
67
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 protected List<OutputMode> outputModes; |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 |
1435
f6fbfdc813f0
Allow client to access artifacts data via CollectionItems and Themes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
87
diff
changeset
|
32 /** The map of datanames to data values. */ |
f6fbfdc813f0
Allow client to access artifacts data via CollectionItems and Themes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
87
diff
changeset
|
33 protected Map<String, String> data; |
f6fbfdc813f0
Allow client to access artifacts data via CollectionItems and Themes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
87
diff
changeset
|
34 |
67
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 /** |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 * An empty constructor. |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 */ |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 public DefaultCollectionItem() { |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 } |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 /** |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 * The default constructor to create a new CollectionItem related to an |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 * artifact with output modes. |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 * |
9499 | 45 * @param identifier |
46 * The identifier of an artifact. | |
47 * @param outputModes | |
48 * The output modes supported by this item. | |
67
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 */ |
9499 | 50 public DefaultCollectionItem(final String identifier, final String hash, final List<OutputMode> modes, final Map<String, String> data) { |
51 this.identifier = identifier; | |
52 this.hash = hash; | |
67
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 this.outputModes = modes; |
9499 | 54 this.data = data; |
67
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 } |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 |
9499 | 57 @Override |
67
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 public String identifier() { |
9499 | 59 return this.identifier; |
67
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 } |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 |
9499 | 62 @Override |
87
c8cd1b918901
Bugfix: Step back will remove duplicated output tab and an extended chart image URL bypasses the browser cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
67
diff
changeset
|
63 public String hash() { |
9499 | 64 return this.hash; |
87
c8cd1b918901
Bugfix: Step back will remove duplicated output tab and an extended chart image URL bypasses the browser cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
67
diff
changeset
|
65 } |
c8cd1b918901
Bugfix: Step back will remove duplicated output tab and an extended chart image URL bypasses the browser cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
67
diff
changeset
|
66 |
9499 | 67 @Override |
67
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 public List<OutputMode> getOutputModes() { |
9499 | 69 return this.outputModes; |
67
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 } |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 |
9499 | 72 @Override |
73 public List<Facet> getFacets(final String outputmode) { | |
74 for (final OutputMode mode : this.outputModes) { | |
67
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 if (outputmode.equals(mode.getName())) { |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 // TODO Return facets, but facets are not implemented for |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 // OutputModes yet! |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 } |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 } |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 return null; |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 } |
1435
f6fbfdc813f0
Allow client to access artifacts data via CollectionItems and Themes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
87
diff
changeset
|
83 |
f6fbfdc813f0
Allow client to access artifacts data via CollectionItems and Themes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
87
diff
changeset
|
84 /** |
f6fbfdc813f0
Allow client to access artifacts data via CollectionItems and Themes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
87
diff
changeset
|
85 * Returns artifact data. |
9499 | 86 * |
1435
f6fbfdc813f0
Allow client to access artifacts data via CollectionItems and Themes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
87
diff
changeset
|
87 * @return key/value data map |
f6fbfdc813f0
Allow client to access artifacts data via CollectionItems and Themes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
87
diff
changeset
|
88 */ |
9499 | 89 @Override |
1435
f6fbfdc813f0
Allow client to access artifacts data via CollectionItems and Themes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
87
diff
changeset
|
90 public Map<String, String> getData() { |
f6fbfdc813f0
Allow client to access artifacts data via CollectionItems and Themes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
87
diff
changeset
|
91 return this.data; |
f6fbfdc813f0
Allow client to access artifacts data via CollectionItems and Themes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
87
diff
changeset
|
92 } |
67
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 } |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |