Mercurial > dive4elements > river
annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WspDatacagePanel.java @ 9227:84397da33d17
Allow to control specific behaviour in TwinDatacagePanel
Implemented client logic of 'intelligent datacage filtering' for SINFO
author | gernotbelger |
---|---|
date | Wed, 04 Jul 2018 18:28:08 +0200 |
parents | e3c2ae1887e8 |
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.client.ui; |
901
3ef7205b814e
Added stubs for two datacage panels - one for choosing waterlevels, one for choosing DEMs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 |
9220
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
11 import java.util.List; |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
12 import java.util.Map; |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
13 import java.util.Set; |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
14 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
15 import org.dive4elements.river.client.client.Config; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
16 import org.dive4elements.river.client.client.FLYS; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
17 import org.dive4elements.river.client.client.event.StepForwardEvent; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
18 import org.dive4elements.river.client.client.services.LoadArtifactService; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
19 import org.dive4elements.river.client.client.services.LoadArtifactServiceAsync; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
20 import org.dive4elements.river.client.shared.model.Artifact; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
21 import org.dive4elements.river.client.shared.model.Collection; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
22 import org.dive4elements.river.client.shared.model.Data; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
23 import org.dive4elements.river.client.shared.model.DataItem; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
24 import org.dive4elements.river.client.shared.model.DefaultData; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
25 import org.dive4elements.river.client.shared.model.DefaultDataItem; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
26 import org.dive4elements.river.client.shared.model.Recommendation; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
27 import org.dive4elements.river.client.shared.model.Recommendation.Facet; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
28 import org.dive4elements.river.client.shared.model.Recommendation.Filter; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
29 import org.dive4elements.river.client.shared.model.ToLoad; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
30 import org.dive4elements.river.client.shared.model.User; |
901
3ef7205b814e
Added stubs for two datacage panels - one for choosing waterlevels, one for choosing DEMs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 |
9220
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
32 import com.google.gwt.core.client.GWT; |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
33 import com.google.gwt.user.client.rpc.AsyncCallback; |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
34 import com.smartgwt.client.util.SC; |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
35 import com.smartgwt.client.widgets.events.ClickEvent; |
901
3ef7205b814e
Added stubs for two datacage panels - one for choosing waterlevels, one for choosing DEMs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 |
3ef7205b814e
Added stubs for two datacage panels - one for choosing waterlevels, one for choosing DEMs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 public class WspDatacagePanel extends DatacagePanel { |
3ef7205b814e
Added stubs for two datacage panels - one for choosing waterlevels, one for choosing DEMs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 |
4130
df8ac7ff6b1a
Improve warning when user does not select a waterlevel calculation (#914)
Christian Lins <christian.lins@intevation.de>
parents:
3534
diff
changeset
|
39 private static final long serialVersionUID = 2494432743877141135L; |
df8ac7ff6b1a
Improve warning when user does not select a waterlevel calculation (#914)
Christian Lins <christian.lins@intevation.de>
parents:
3534
diff
changeset
|
40 |
9220
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
41 private static final String WATERLEVEL_OUTS = "waterlevels_panel"; |
901
3ef7205b814e
Added stubs for two datacage panels - one for choosing waterlevels, one for choosing DEMs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 |
9220
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
43 private final LoadArtifactServiceAsync loadService = GWT.create(LoadArtifactService.class); |
901
3ef7205b814e
Added stubs for two datacage panels - one for choosing waterlevels, one for choosing DEMs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 |
9220
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
45 public WspDatacagePanel(final User user) { |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
46 super(user, WATERLEVEL_OUTS, null, false); |
901
3ef7205b814e
Added stubs for two datacage panels - one for choosing waterlevels, one for choosing DEMs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 } |
3ef7205b814e
Added stubs for two datacage panels - one for choosing waterlevels, one for choosing DEMs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
49 /** |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
50 * We need to override this method (defined in AbstractUIProvider) because |
6580 | 51 * we have to create a new Artifact specified by the Datacage selection via |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
52 * Async request. |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
53 * |
9220
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
54 * @param e |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
55 * The ClickEvent. |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
56 */ |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
57 @Override |
9220
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
58 public void onClick(final ClickEvent e) { |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
59 final List<String> errors = validate(); |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
60 if (errors == null || errors.isEmpty()) { |
7570
f4c13fbde072
issue1020: Let WspDatacagePanel also handle non-winfo (prev. calc) rec.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6580
diff
changeset
|
61 // 1) Fetch selected recommendation. |
9220
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
62 final Config config = Config.getInstance(); |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
63 final String locale = config.getLocale(); |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
64 final Collection c = this.collection; |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
65 final Recommendation r = getSelectedRecommendation(); |
4130
df8ac7ff6b1a
Improve warning when user does not select a waterlevel calculation (#914)
Christian Lins <christian.lins@intevation.de>
parents:
3534
diff
changeset
|
66 |
df8ac7ff6b1a
Improve warning when user does not select a waterlevel calculation (#914)
Christian Lins <christian.lins@intevation.de>
parents:
3534
diff
changeset
|
67 if (r == null) { |
df8ac7ff6b1a
Improve warning when user does not select a waterlevel calculation (#914)
Christian Lins <christian.lins@intevation.de>
parents:
3534
diff
changeset
|
68 SC.warn(MSG.warning_no_wsp_selected()); |
df8ac7ff6b1a
Improve warning when user does not select a waterlevel calculation (#914)
Christian Lins <christian.lins@intevation.de>
parents:
3534
diff
changeset
|
69 return; |
df8ac7ff6b1a
Improve warning when user does not select a waterlevel calculation (#914)
Christian Lins <christian.lins@intevation.de>
parents:
3534
diff
changeset
|
70 } |
df8ac7ff6b1a
Improve warning when user does not select a waterlevel calculation (#914)
Christian Lins <christian.lins@intevation.de>
parents:
3534
diff
changeset
|
71 |
7570
f4c13fbde072
issue1020: Let WspDatacagePanel also handle non-winfo (prev. calc) rec.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6580
diff
changeset
|
72 // TODO: This could eventually be handled server-side. |
f4c13fbde072
issue1020: Let WspDatacagePanel also handle non-winfo (prev. calc) rec.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6580
diff
changeset
|
73 // 2) Create, load Artifact and fire event. |
9220
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
74 this.loadService.load(c, r, r.getFactory(), locale, new AsyncCallback<Artifact>() { |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
75 @Override |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
76 public void onFailure(final Throwable caught) { |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
77 GWT.log("WspDatacagePanel", caught); |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
78 SC.warn(FLYS.getExceptionString(MSG, caught)); |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
79 } |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
80 |
9220
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
81 @Override |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
82 public void onSuccess(final Artifact newArtifact) { |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
83 GWT.log("Created new artifact."); |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
84 fireStepForwardEvent(new StepForwardEvent(getData(r, newArtifact))); |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
85 } |
9220
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
86 }); |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
87 } else { |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
88 showErrors(errors); |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
89 } |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
90 } |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
91 |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
92 protected Recommendation getSelectedRecommendation() { |
9220
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
93 final ToLoad toLoad = getSelection(); |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
94 final List<Recommendation> recoms = toLoad.toRecommendations(); |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
95 |
3521
ffbdd093da74
Fixed size for GetFeatureInfoWindow.
Christian Lins <christian.lins@intevation.de>
parents:
3363
diff
changeset
|
96 return recoms.size() > 0 ? recoms.get(0) : null; |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
97 } |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
98 |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
99 /** |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
100 * Nothing is done in this method. It returns null, because we serve the |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
101 * Data another way! |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
102 * |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
103 * @return always null! |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
104 */ |
901
3ef7205b814e
Added stubs for two datacage panels - one for choosing waterlevels, one for choosing DEMs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 @Override |
3ef7205b814e
Added stubs for two datacage panels - one for choosing waterlevels, one for choosing DEMs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 protected Data[] getData() { |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
107 // do nothing here, the Data is fetched on another way in this panel. |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
108 return null; |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
109 } |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
110 |
6580 | 111 /** Returns a Data Array with one default item. */ |
9220
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
112 protected final Data[] getData(final Recommendation r, final Artifact newArtifact) { |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
113 final String uuid = newArtifact.getUuid(); |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
114 r.setMasterArtifact(uuid); |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
115 |
9220
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
116 final String value = createDataString(uuid, r); |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
117 |
9220
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
118 final String dataName = getMyDataName(); |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
119 |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
120 final DataItem item = new DefaultDataItem(dataName, dataName, value); |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
121 return new Data[] { new DefaultData(dataName, null, null, new DataItem[] { item }) }; |
901
3ef7205b814e
Added stubs for two datacage panels - one for choosing waterlevels, one for choosing DEMs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
122 } |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
123 |
9220
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
124 private String createDataString(final String artifactId, final Recommendation recommendation) { |
7885
2e30d2c725fa
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7570
diff
changeset
|
125 |
7570
f4c13fbde072
issue1020: Let WspDatacagePanel also handle non-winfo (prev. calc) rec.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6580
diff
changeset
|
126 // The filter will only be available or previous calculation artifacts. |
9220
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
127 final Filter filter = recommendation.getFilter(); |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
128 |
7570
f4c13fbde072
issue1020: Let WspDatacagePanel also handle non-winfo (prev. calc) rec.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6580
diff
changeset
|
129 if (filter != null) { |
9220
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
130 Facet f = null; |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
131 |
9220
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
132 final Map<String, List<Facet>> outs = filter.getOuts(); |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
133 final Set<Map.Entry<String, List<Facet>>> entries = outs.entrySet(); |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
134 |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
135 for (final Map.Entry<String, List<Facet>> entry : entries) { |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
136 final List<Facet> fs = entry.getValue(); |
7570
f4c13fbde072
issue1020: Let WspDatacagePanel also handle non-winfo (prev. calc) rec.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6580
diff
changeset
|
137 |
f4c13fbde072
issue1020: Let WspDatacagePanel also handle non-winfo (prev. calc) rec.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6580
diff
changeset
|
138 f = fs.get(0); |
f4c13fbde072
issue1020: Let WspDatacagePanel also handle non-winfo (prev. calc) rec.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6580
diff
changeset
|
139 if (f != null) { |
f4c13fbde072
issue1020: Let WspDatacagePanel also handle non-winfo (prev. calc) rec.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6580
diff
changeset
|
140 break; |
f4c13fbde072
issue1020: Let WspDatacagePanel also handle non-winfo (prev. calc) rec.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6580
diff
changeset
|
141 } |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
142 } |
7570
f4c13fbde072
issue1020: Let WspDatacagePanel also handle non-winfo (prev. calc) rec.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6580
diff
changeset
|
143 |
9220
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
144 return "[" + artifactId + ";" + f.getName() + ";" + f.getIndex() + "]"; |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
145 } |
9220
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
146 |
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
147 return "[" + artifactId + ";" + recommendation.getFactory() + ";" + 0 + "]"; |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
901
diff
changeset
|
148 } |
9220
e3c2ae1887e8
Allow to filter contents of datacage on client side.
gernotbelger
parents:
8856
diff
changeset
|
149 } |