Mercurial > dive4elements > river
annotate gwt-client/src/main/java/org/dive4elements/river/client/shared/model/ToLoad.java @ 6593:254e4e327274
Doc and indentation fix.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 18 Jul 2013 12:34:43 +0200 |
parents | 8d9859d776e5 |
children | b1f446f675b1 |
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; |
822
ffb98b228b3c
Add code to extract data to load from datacage tree.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
10 |
846
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
11 import java.util.ArrayList; |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
12 import java.util.List; |
826
2f65c742803f
Datacage: Aggregate items to load for easier filtering facets
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
822
diff
changeset
|
13 import java.util.Map; |
2f65c742803f
Datacage: Aggregate items to load for easier filtering facets
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
822
diff
changeset
|
14 import java.util.HashMap; |
2f65c742803f
Datacage: Aggregate items to load for easier filtering facets
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
822
diff
changeset
|
15 |
822
ffb98b228b3c
Add code to extract data to load from datacage tree.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
16 import java.io.Serializable; |
ffb98b228b3c
Add code to extract data to load from datacage tree.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
17 |
6136
8d9859d776e5
Handle target_out in the Recommendation / Client datacage code.
Andre Heinecke <aheinecke@intevation.de>
parents:
5993
diff
changeset
|
18 import com.google.gwt.core.client.GWT; |
8d9859d776e5
Handle target_out in the Recommendation / Client datacage code.
Andre Heinecke <aheinecke@intevation.de>
parents:
5993
diff
changeset
|
19 |
822
ffb98b228b3c
Add code to extract data to load from datacage tree.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
20 public class ToLoad implements Serializable |
ffb98b228b3c
Add code to extract data to load from datacage tree.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
21 { |
1352
01b18db3b288
In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
846
diff
changeset
|
22 |
6593
254e4e327274
Doc and indentation fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6136
diff
changeset
|
23 /** Two strings. */ |
1352
01b18db3b288
In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
846
diff
changeset
|
24 public class StringPair { |
01b18db3b288
In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
846
diff
changeset
|
25 public String first; |
01b18db3b288
In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
846
diff
changeset
|
26 public String second; |
01b18db3b288
In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
846
diff
changeset
|
27 public StringPair(String first, String second) { |
01b18db3b288
In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
846
diff
changeset
|
28 this.first = first; |
01b18db3b288
In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
846
diff
changeset
|
29 this.second = second; |
01b18db3b288
In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
846
diff
changeset
|
30 } |
01b18db3b288
In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
846
diff
changeset
|
31 public int hashCode() { |
01b18db3b288
In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
846
diff
changeset
|
32 return first.hashCode() + second.hashCode(); |
01b18db3b288
In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
846
diff
changeset
|
33 } |
01b18db3b288
In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
846
diff
changeset
|
34 public boolean equals(StringPair other) { |
01b18db3b288
In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
846
diff
changeset
|
35 return (this.second.equals(other.second)) && (this.first.equals(other.first)); |
01b18db3b288
In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
846
diff
changeset
|
36 } |
01b18db3b288
In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
846
diff
changeset
|
37 } |
846
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
38 public static final String SYNTHETIC_KEY = "key-"; |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
39 |
1352
01b18db3b288
In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
846
diff
changeset
|
40 protected Map<String, Map<StringPair, ArtifactFilter>> artifacts; |
826
2f65c742803f
Datacage: Aggregate items to load for easier filtering facets
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
822
diff
changeset
|
41 |
831
9101b4d64666
Datacage: Re-written ToLoad to feature the new filter models.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
826
diff
changeset
|
42 public ToLoad() { |
1352
01b18db3b288
In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
846
diff
changeset
|
43 artifacts = new HashMap<String, Map<StringPair, ArtifactFilter>>(); |
822
ffb98b228b3c
Add code to extract data to load from datacage tree.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
44 } |
ffb98b228b3c
Add code to extract data to load from datacage tree.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
45 |
834
77469d7f3c93
Generate unique keys for anonymous artifacts (aka static data).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
831
diff
changeset
|
46 public static final String uniqueKey(Map<?, ?> map) { |
77469d7f3c93
Generate unique keys for anonymous artifacts (aka static data).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
831
diff
changeset
|
47 int idx = map.size(); |
77469d7f3c93
Generate unique keys for anonymous artifacts (aka static data).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
831
diff
changeset
|
48 |
846
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
49 String key = SYNTHETIC_KEY + idx; |
834
77469d7f3c93
Generate unique keys for anonymous artifacts (aka static data).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
831
diff
changeset
|
50 while (map.containsKey(key)) { |
846
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
51 key = SYNTHETIC_KEY + ++idx; |
834
77469d7f3c93
Generate unique keys for anonymous artifacts (aka static data).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
831
diff
changeset
|
52 } |
77469d7f3c93
Generate unique keys for anonymous artifacts (aka static data).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
831
diff
changeset
|
53 return key; |
77469d7f3c93
Generate unique keys for anonymous artifacts (aka static data).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
831
diff
changeset
|
54 } |
6593
254e4e327274
Doc and indentation fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6136
diff
changeset
|
55 |
254e4e327274
Doc and indentation fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6136
diff
changeset
|
56 public void add( |
254e4e327274
Doc and indentation fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6136
diff
changeset
|
57 String artifactName, |
254e4e327274
Doc and indentation fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6136
diff
changeset
|
58 String factory, |
254e4e327274
Doc and indentation fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6136
diff
changeset
|
59 String out, |
254e4e327274
Doc and indentation fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6136
diff
changeset
|
60 String name, |
254e4e327274
Doc and indentation fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6136
diff
changeset
|
61 String ids, |
254e4e327274
Doc and indentation fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6136
diff
changeset
|
62 String displayName |
254e4e327274
Doc and indentation fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6136
diff
changeset
|
63 ) { |
254e4e327274
Doc and indentation fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6136
diff
changeset
|
64 add(artifactName, factory, out, name, ids, displayName, null); |
254e4e327274
Doc and indentation fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6136
diff
changeset
|
65 } |
834
77469d7f3c93
Generate unique keys for anonymous artifacts (aka static data).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
831
diff
changeset
|
66 |
831
9101b4d64666
Datacage: Re-written ToLoad to feature the new filter models.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
826
diff
changeset
|
67 public void add( |
9101b4d64666
Datacage: Re-written ToLoad to feature the new filter models.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
826
diff
changeset
|
68 String artifactName, |
9101b4d64666
Datacage: Re-written ToLoad to feature the new filter models.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
826
diff
changeset
|
69 String factory, |
9101b4d64666
Datacage: Re-written ToLoad to feature the new filter models.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
826
diff
changeset
|
70 String out, |
9101b4d64666
Datacage: Re-written ToLoad to feature the new filter models.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
826
diff
changeset
|
71 String name, |
1352
01b18db3b288
In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
846
diff
changeset
|
72 String ids, |
6136
8d9859d776e5
Handle target_out in the Recommendation / Client datacage code.
Andre Heinecke <aheinecke@intevation.de>
parents:
5993
diff
changeset
|
73 String displayName, |
8d9859d776e5
Handle target_out in the Recommendation / Client datacage code.
Andre Heinecke <aheinecke@intevation.de>
parents:
5993
diff
changeset
|
74 String targetOut |
831
9101b4d64666
Datacage: Re-written ToLoad to feature the new filter models.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
826
diff
changeset
|
75 ) { |
6136
8d9859d776e5
Handle target_out in the Recommendation / Client datacage code.
Andre Heinecke <aheinecke@intevation.de>
parents:
5993
diff
changeset
|
76 GWT.log("Adding artifact: " + artifactName + " Factory: " + factory + |
8d9859d776e5
Handle target_out in the Recommendation / Client datacage code.
Andre Heinecke <aheinecke@intevation.de>
parents:
5993
diff
changeset
|
77 " Out: " + out + " Name: " + name + " Ids: " + ids + |
8d9859d776e5
Handle target_out in the Recommendation / Client datacage code.
Andre Heinecke <aheinecke@intevation.de>
parents:
5993
diff
changeset
|
78 " Display Name: " + displayName + " Target Out: " + targetOut); |
8d9859d776e5
Handle target_out in the Recommendation / Client datacage code.
Andre Heinecke <aheinecke@intevation.de>
parents:
5993
diff
changeset
|
79 |
834
77469d7f3c93
Generate unique keys for anonymous artifacts (aka static data).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
831
diff
changeset
|
80 if (artifactName == null) { |
77469d7f3c93
Generate unique keys for anonymous artifacts (aka static data).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
831
diff
changeset
|
81 artifactName = uniqueKey(artifacts); |
77469d7f3c93
Generate unique keys for anonymous artifacts (aka static data).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
831
diff
changeset
|
82 } |
826
2f65c742803f
Datacage: Aggregate items to load for easier filtering facets
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
822
diff
changeset
|
83 |
1352
01b18db3b288
In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
846
diff
changeset
|
84 Map<StringPair, ArtifactFilter> artifact = artifacts.get(artifactName); |
826
2f65c742803f
Datacage: Aggregate items to load for easier filtering facets
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
822
diff
changeset
|
85 |
831
9101b4d64666
Datacage: Re-written ToLoad to feature the new filter models.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
826
diff
changeset
|
86 if (artifact == null) { |
1352
01b18db3b288
In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
846
diff
changeset
|
87 artifact = new HashMap<StringPair, ArtifactFilter>(); |
831
9101b4d64666
Datacage: Re-written ToLoad to feature the new filter models.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
826
diff
changeset
|
88 artifacts.put(artifactName, artifact); |
826
2f65c742803f
Datacage: Aggregate items to load for easier filtering facets
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
822
diff
changeset
|
89 } |
2f65c742803f
Datacage: Aggregate items to load for easier filtering facets
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
822
diff
changeset
|
90 |
831
9101b4d64666
Datacage: Re-written ToLoad to feature the new filter models.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
826
diff
changeset
|
91 ArtifactFilter filter = artifact.get(factory); |
9101b4d64666
Datacage: Re-written ToLoad to feature the new filter models.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
826
diff
changeset
|
92 if (filter == null) { |
9101b4d64666
Datacage: Re-written ToLoad to feature the new filter models.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
826
diff
changeset
|
93 filter = new ArtifactFilter(factory); |
1352
01b18db3b288
In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
846
diff
changeset
|
94 artifact.put(new StringPair(factory, displayName), filter); |
826
2f65c742803f
Datacage: Aggregate items to load for easier filtering facets
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
822
diff
changeset
|
95 } |
822
ffb98b228b3c
Add code to extract data to load from datacage tree.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
96 |
837
29966a53cfeb
Datacage: Use 'ids' instead of 'num' in user specific part, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
834
diff
changeset
|
97 filter.add(out, name, ids); |
822
ffb98b228b3c
Add code to extract data to load from datacage tree.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
98 } |
ffb98b228b3c
Add code to extract data to load from datacage tree.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
99 |
826
2f65c742803f
Datacage: Aggregate items to load for easier filtering facets
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
822
diff
changeset
|
100 public boolean isEmpty() { |
831
9101b4d64666
Datacage: Re-written ToLoad to feature the new filter models.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
826
diff
changeset
|
101 return artifacts.isEmpty(); |
822
ffb98b228b3c
Add code to extract data to load from datacage tree.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
102 } |
846
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
103 |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
104 public List<Recommendation> toRecommendations() { |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
105 List<Recommendation> recommendations = new ArrayList<Recommendation>(); |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
106 |
1352
01b18db3b288
In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
846
diff
changeset
|
107 for (Map.Entry<String, Map<StringPair, ArtifactFilter>> all: |
846
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
108 artifacts.entrySet() |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
109 ) { |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
110 String masterArtifact = all.getKey(); |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
111 |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
112 if (masterArtifact.startsWith(SYNTHETIC_KEY)) { // system data |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
113 masterArtifact = null; |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
114 } |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
115 |
1352
01b18db3b288
In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
846
diff
changeset
|
116 for (Map.Entry<StringPair, ArtifactFilter> entry: |
846
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
117 all.getValue().entrySet() |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
118 ) { |
6593
254e4e327274
Doc and indentation fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6136
diff
changeset
|
119 StringPair pair = entry.getKey(); |
1352
01b18db3b288
In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
846
diff
changeset
|
120 String factory = pair.first; |
846
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
121 ArtifactFilter artifactFilter = entry.getValue(); |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
122 |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
123 String ids; |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
124 Recommendation.Filter filter; |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
125 |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
126 if (masterArtifact == null) { // system data |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
127 ids = artifactFilter.collectIds(); |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
128 filter = null; |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
129 } |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
130 else { // user specific |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
131 ids = null; |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
132 filter = artifactFilter.toFilter(); |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
133 } |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
134 |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
135 Recommendation recommendation = new Recommendation( |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
136 factory, ids, masterArtifact, filter); |
1352
01b18db3b288
In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
846
diff
changeset
|
137 recommendation.setDisplayName(pair.second); |
846
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
138 |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
139 recommendations.add(recommendation); |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
140 } |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
141 } |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
142 |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
143 return recommendations; |
e47ef0ca8f33
Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
837
diff
changeset
|
144 } |
822
ffb98b228b3c
Add code to extract data to load from datacage tree.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
145 } |
ffb98b228b3c
Add code to extract data to load from datacage tree.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
146 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |