Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultCollectionItem.java @ 892:63b258bf365c
Bugfix: Use name instead of description for loading new facets via Datacage.
flys-client/trunk@2735 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 14 Sep 2011 10:00:55 +0000 |
parents | c8cd1b918901 |
children | f6fbfdc813f0 |
rev | line source |
---|---|
67
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.client.shared.model; |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 import java.util.List; |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 /** |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 * The default implementation of a CollectionItem. |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 * |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 * @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
|
10 */ |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 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
|
12 |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 /** The identifier that specifies the artifact related to this item.*/ |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 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
|
15 |
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
|
16 /** The hash that specifies the artifact related to this item.*/ |
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
|
17 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
|
18 |
67
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 /** The list of output modes supported by the artifact of this item.*/ |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 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
|
21 |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 /** |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 * 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
|
25 */ |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 public DefaultCollectionItem() { |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 } |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 /** |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 * 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
|
32 * 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
|
33 * |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 * @param identifier The identifier of an artifact. |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 * @param outputModes The output modes supported by this item. |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 */ |
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
|
37 public DefaultCollectionItem( |
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
|
38 String identifier, |
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
|
39 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
|
40 List<OutputMode> modes) { |
67
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 this.identifier = identifier; |
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
|
42 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
|
43 this.outputModes = modes; |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 } |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 public String identifier() { |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 return identifier; |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 } |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 |
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
|
52 public 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
|
53 return 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
|
54 } |
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
|
55 |
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
|
56 |
67
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 public List<OutputMode> getOutputModes() { |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 return outputModes; |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 } |
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 |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 public List<Facet> getFacets(String outputmode) { |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 for (OutputMode mode: outputModes) { |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 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
|
65 // 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
|
66 // OutputModes yet! |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 } |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 } |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 return null; |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 } |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 } |
74257b95567b
Added CollectionItems and Facets and replaced Artifact references in Collection with CollectionItems.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |