annotate gwt-client/src/main/java/org/dive4elements/river/client/shared/model/ToLoad.java @ 8856:5e38e2924c07 3.2.x

Fix code style.
author Tom Gottfried <tom@intevation.de>
date Thu, 18 Jan 2018 20:12:01 +0100
parents b1f446f675b1
children 84397da33d17
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. */
7175
b1f446f675b1 Save target_out in the recommendation to ensure it is sent to the server
Andre Heinecke <aheinecke@intevation.de>
parents: 6593
diff changeset
24 public static class StringTriple {
1352
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;
7175
b1f446f675b1 Save target_out in the recommendation to ensure it is sent to the server
Andre Heinecke <aheinecke@intevation.de>
parents: 6593
diff changeset
27 public String third;
b1f446f675b1 Save target_out in the recommendation to ensure it is sent to the server
Andre Heinecke <aheinecke@intevation.de>
parents: 6593
diff changeset
28 public StringTriple(String first, String second, String third) {
1352
01b18db3b288 In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 846
diff changeset
29 this.first = first;
01b18db3b288 In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 846
diff changeset
30 this.second = second;
7175
b1f446f675b1 Save target_out in the recommendation to ensure it is sent to the server
Andre Heinecke <aheinecke@intevation.de>
parents: 6593
diff changeset
31 this.third = third;
1352
01b18db3b288 In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 846
diff changeset
32 }
7175
b1f446f675b1 Save target_out in the recommendation to ensure it is sent to the server
Andre Heinecke <aheinecke@intevation.de>
parents: 6593
diff changeset
33 @Override
1352
01b18db3b288 In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 846
diff changeset
34 public int hashCode() {
7175
b1f446f675b1 Save target_out in the recommendation to ensure it is sent to the server
Andre Heinecke <aheinecke@intevation.de>
parents: 6593
diff changeset
35 return first.hashCode() + second.hashCode() + third.hashCode();
1352
01b18db3b288 In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 846
diff changeset
36 }
7175
b1f446f675b1 Save target_out in the recommendation to ensure it is sent to the server
Andre Heinecke <aheinecke@intevation.de>
parents: 6593
diff changeset
37 @Override
b1f446f675b1 Save target_out in the recommendation to ensure it is sent to the server
Andre Heinecke <aheinecke@intevation.de>
parents: 6593
diff changeset
38 public boolean equals(Object o) {
b1f446f675b1 Save target_out in the recommendation to ensure it is sent to the server
Andre Heinecke <aheinecke@intevation.de>
parents: 6593
diff changeset
39 if (!(o instanceof StringTriple)) {
b1f446f675b1 Save target_out in the recommendation to ensure it is sent to the server
Andre Heinecke <aheinecke@intevation.de>
parents: 6593
diff changeset
40 return false;
b1f446f675b1 Save target_out in the recommendation to ensure it is sent to the server
Andre Heinecke <aheinecke@intevation.de>
parents: 6593
diff changeset
41 }
b1f446f675b1 Save target_out in the recommendation to ensure it is sent to the server
Andre Heinecke <aheinecke@intevation.de>
parents: 6593
diff changeset
42 StringTriple other = (StringTriple) o;
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 7175
diff changeset
43 return second.equals(other.second)
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 7175
diff changeset
44 && first.equals(other.first)
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 7175
diff changeset
45 && third.equals(other.third);
1352
01b18db3b288 In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 846
diff changeset
46 }
01b18db3b288 In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 846
diff changeset
47 }
846
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
48 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
49
7175
b1f446f675b1 Save target_out in the recommendation to ensure it is sent to the server
Andre Heinecke <aheinecke@intevation.de>
parents: 6593
diff changeset
50 protected Map<String, Map<StringTriple, ArtifactFilter>> artifacts;
826
2f65c742803f Datacage: Aggregate items to load for easier filtering facets
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 822
diff changeset
51
831
9101b4d64666 Datacage: Re-written ToLoad to feature the new filter models.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 826
diff changeset
52 public ToLoad() {
7175
b1f446f675b1 Save target_out in the recommendation to ensure it is sent to the server
Andre Heinecke <aheinecke@intevation.de>
parents: 6593
diff changeset
53 artifacts = new HashMap<String, Map<StringTriple, ArtifactFilter>>();
822
ffb98b228b3c Add code to extract data to load from datacage tree.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
54 }
ffb98b228b3c Add code to extract data to load from datacage tree.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
55
834
77469d7f3c93 Generate unique keys for anonymous artifacts (aka static data).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 831
diff changeset
56 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
57 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
58
846
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
59 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
60 while (map.containsKey(key)) {
846
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
61 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
62 }
77469d7f3c93 Generate unique keys for anonymous artifacts (aka static data).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 831
diff changeset
63 return key;
77469d7f3c93 Generate unique keys for anonymous artifacts (aka static data).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 831
diff changeset
64 }
6593
254e4e327274 Doc and indentation fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6136
diff changeset
65
254e4e327274 Doc and indentation fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6136
diff changeset
66 public void add(
254e4e327274 Doc and indentation fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6136
diff changeset
67 String artifactName,
254e4e327274 Doc and indentation fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6136
diff changeset
68 String factory,
254e4e327274 Doc and indentation fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6136
diff changeset
69 String out,
254e4e327274 Doc and indentation fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6136
diff changeset
70 String name,
254e4e327274 Doc and indentation fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6136
diff changeset
71 String ids,
254e4e327274 Doc and indentation fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6136
diff changeset
72 String displayName
254e4e327274 Doc and indentation fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6136
diff changeset
73 ) {
254e4e327274 Doc and indentation fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6136
diff changeset
74 add(artifactName, factory, out, name, ids, displayName, null);
254e4e327274 Doc and indentation fix.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6136
diff changeset
75 }
834
77469d7f3c93 Generate unique keys for anonymous artifacts (aka static data).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 831
diff changeset
76
831
9101b4d64666 Datacage: Re-written ToLoad to feature the new filter models.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 826
diff changeset
77 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
78 String artifactName,
9101b4d64666 Datacage: Re-written ToLoad to feature the new filter models.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 826
diff changeset
79 String factory,
9101b4d64666 Datacage: Re-written ToLoad to feature the new filter models.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 826
diff changeset
80 String out,
9101b4d64666 Datacage: Re-written ToLoad to feature the new filter models.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 826
diff changeset
81 String name,
1352
01b18db3b288 In WDiff datacage input make names survive backjumps.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 846
diff changeset
82 String ids,
6136
8d9859d776e5 Handle target_out in the Recommendation / Client datacage code.
Andre Heinecke <aheinecke@intevation.de>
parents: 5993
diff changeset
83 String displayName,
8d9859d776e5 Handle target_out in the Recommendation / Client datacage code.
Andre Heinecke <aheinecke@intevation.de>
parents: 5993
diff changeset
84 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
85 ) {
6136
8d9859d776e5 Handle target_out in the Recommendation / Client datacage code.
Andre Heinecke <aheinecke@intevation.de>
parents: 5993
diff changeset
86 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
87 " 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
88 " 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
89
834
77469d7f3c93 Generate unique keys for anonymous artifacts (aka static data).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 831
diff changeset
90 if (artifactName == null) {
77469d7f3c93 Generate unique keys for anonymous artifacts (aka static data).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 831
diff changeset
91 artifactName = uniqueKey(artifacts);
77469d7f3c93 Generate unique keys for anonymous artifacts (aka static data).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 831
diff changeset
92 }
826
2f65c742803f Datacage: Aggregate items to load for easier filtering facets
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 822
diff changeset
93
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 7175
diff changeset
94 Map<StringTriple, ArtifactFilter> artifact = artifacts.get(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 7175
diff changeset
95 artifactName);
826
2f65c742803f Datacage: Aggregate items to load for easier filtering facets
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 822
diff changeset
96
831
9101b4d64666 Datacage: Re-written ToLoad to feature the new filter models.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 826
diff changeset
97 if (artifact == null) {
7175
b1f446f675b1 Save target_out in the recommendation to ensure it is sent to the server
Andre Heinecke <aheinecke@intevation.de>
parents: 6593
diff changeset
98 artifact = new HashMap<StringTriple, ArtifactFilter>();
831
9101b4d64666 Datacage: Re-written ToLoad to feature the new filter models.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 826
diff changeset
99 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
100 }
2f65c742803f Datacage: Aggregate items to load for easier filtering facets
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 822
diff changeset
101
831
9101b4d64666 Datacage: Re-written ToLoad to feature the new filter models.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 826
diff changeset
102 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
103 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
104 filter = new ArtifactFilter(factory);
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 7175
diff changeset
105 artifact.put(new StringTriple(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 7175
diff changeset
106 factory, displayName, targetOut), filter);
826
2f65c742803f Datacage: Aggregate items to load for easier filtering facets
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 822
diff changeset
107 }
822
ffb98b228b3c Add code to extract data to load from datacage tree.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
108
837
29966a53cfeb Datacage: Use 'ids' instead of 'num' in user specific part, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 834
diff changeset
109 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
110 }
ffb98b228b3c Add code to extract data to load from datacage tree.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
111
826
2f65c742803f Datacage: Aggregate items to load for easier filtering facets
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 822
diff changeset
112 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
113 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
114 }
846
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
115
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
116 public List<Recommendation> toRecommendations() {
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
117 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
118
7175
b1f446f675b1 Save target_out in the recommendation to ensure it is sent to the server
Andre Heinecke <aheinecke@intevation.de>
parents: 6593
diff changeset
119 for (Map.Entry<String, Map<StringTriple, ArtifactFilter>> all:
846
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
120 artifacts.entrySet()
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
121 ) {
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
122 String masterArtifact = all.getKey();
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
123
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
124 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
125 masterArtifact = null;
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
126 }
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
127
7175
b1f446f675b1 Save target_out in the recommendation to ensure it is sent to the server
Andre Heinecke <aheinecke@intevation.de>
parents: 6593
diff changeset
128 for (Map.Entry<StringTriple, ArtifactFilter> entry:
846
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
129 all.getValue().entrySet()
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
130 ) {
7175
b1f446f675b1 Save target_out in the recommendation to ensure it is sent to the server
Andre Heinecke <aheinecke@intevation.de>
parents: 6593
diff changeset
131 StringTriple triple = entry.getKey();
b1f446f675b1 Save target_out in the recommendation to ensure it is sent to the server
Andre Heinecke <aheinecke@intevation.de>
parents: 6593
diff changeset
132 String factory = triple.first;
b1f446f675b1 Save target_out in the recommendation to ensure it is sent to the server
Andre Heinecke <aheinecke@intevation.de>
parents: 6593
diff changeset
133 String targetOut = triple.third;
846
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
134 ArtifactFilter artifactFilter = entry.getValue();
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
135
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
136 String ids;
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
137 Recommendation.Filter filter;
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 if (masterArtifact == null) { // system data
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
140 ids = artifactFilter.collectIds();
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
141 filter = null;
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 else { // user specific
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
144 ids = null;
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
145 filter = artifactFilter.toFilter();
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
146 }
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
147
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
148 Recommendation recommendation = new Recommendation(
7175
b1f446f675b1 Save target_out in the recommendation to ensure it is sent to the server
Andre Heinecke <aheinecke@intevation.de>
parents: 6593
diff changeset
149 factory, ids, masterArtifact, filter, targetOut);
b1f446f675b1 Save target_out in the recommendation to ensure it is sent to the server
Andre Heinecke <aheinecke@intevation.de>
parents: 6593
diff changeset
150 recommendation.setDisplayName(triple.second);
846
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
151
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
152 recommendations.add(recommendation);
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
153 }
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
154 }
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
155
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
156 return recommendations;
e47ef0ca8f33 Compile a list of recommendations out of
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 837
diff changeset
157 }
822
ffb98b228b3c Add code to extract data to load from datacage tree.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
158 }
ffb98b228b3c Add code to extract data to load from datacage tree.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
159 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org