annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationListGrid.java @ 8409:8ef11fad27a2

Purge redundant station-column (the values will go to kmstart).
author Tom Gottfried <tom@intevation.de>
date Tue, 14 Oct 2014 16:33:54 +0200
parents 6c16b61ba9eb
children 4f6892d9dff5
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.stationinfo;
4956
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
10
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
11 import com.google.gwt.core.client.GWT;
8313
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
12 import com.google.gwt.user.client.rpc.AsyncCallback;
4956
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
13
8313
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
14 import com.smartgwt.client.util.SC;
4956
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
15 import com.smartgwt.client.widgets.Canvas;
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
16 import com.smartgwt.client.widgets.grid.ListGridField;
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
17 import com.smartgwt.client.widgets.grid.ListGridRecord;
5503
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 4962
diff changeset
18 import com.smartgwt.client.widgets.grid.events.RecordClickEvent;
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 4962
diff changeset
19 import com.smartgwt.client.widgets.grid.events.RecordClickHandler;
4956
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
20
8313
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
21 import org.dive4elements.river.client.client.Config;
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
22 import org.dive4elements.river.client.client.FLYS;
8313
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
23 import org.dive4elements.river.client.client.services.ArtifactService;
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
24 import org.dive4elements.river.client.client.services.ArtifactServiceAsync;
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
25 import org.dive4elements.river.client.client.services.CreateCollectionService;
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
26 import org.dive4elements.river.client.client.services.CreateCollectionServiceAsync;
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
27 import org.dive4elements.river.client.client.services.StepForwardService;
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
28 import org.dive4elements.river.client.client.services.StepForwardServiceAsync;
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
29 import org.dive4elements.river.client.client.ui.CollectionView;
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
30 import org.dive4elements.river.client.shared.model.Artifact;
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
31 import org.dive4elements.river.client.shared.model.Collection;
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
32 import org.dive4elements.river.client.shared.model.Data;
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
33 import org.dive4elements.river.client.shared.model.DataItem;
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
34 import org.dive4elements.river.client.shared.model.DefaultData;
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
35 import org.dive4elements.river.client.shared.model.DefaultDataItem;
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
36 import org.dive4elements.river.client.shared.model.MeasurementStation;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
37 import org.dive4elements.river.client.shared.model.RiverInfo;
4956
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
38
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
39 import java.util.ArrayList;
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
40 import java.util.List;
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
41
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
42 /**
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
43 * @author <a href="mailto:bjoern.ricks@intevation.de">Björn Ricks</a>
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
44 */
5503
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 4962
diff changeset
45 public class MeasurementStationListGrid
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 4962
diff changeset
46 extends InfoListGrid
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 4962
diff changeset
47 implements RecordClickHandler {
4956
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
48
8313
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
49 /** The ArtifactService used to communicate with the Artifact server. */
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
50 protected ArtifactServiceAsync artifactService =
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
51 GWT.create(ArtifactService.class);
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
52
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
53 /** The StepForwardService used to put data into an existing artifact. */
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
54 protected StepForwardServiceAsync forwardService =
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
55 GWT.create(StepForwardService.class);
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
56
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
57 /** The ArtifactService used to communicate with the Artifact server. */
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
58 protected CreateCollectionServiceAsync createCollectionService =
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
59 GWT.create(CreateCollectionService.class);
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
60
4956
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
61 public MeasurementStationListGrid(FLYS flys) {
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
62 super(flys);
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
63 ListGridField nfield = new ListGridField("name", "Messtelle");
7859
3fda73d9dc56 Fixes flys/issue1308. Add new column "Messstellenart" in "Messstellen-Info".
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6316
diff changeset
64 ListGridField mfield = new ListGridField("measurementtype", "Messstellenart");
4956
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
65 ListGridField sfield = new ListGridField("kmstart", "Start [km]", 60);
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
66 ListGridField efield = new ListGridField("kmend", "Ende [km]", 60);
7873
d027964c4261 Issue1308 Forgot to rename columns.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7859
diff changeset
67 ListGridField lfield = new ListGridField("infolink", "Info");
d027964c4261 Issue1308 Forgot to rename columns.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7859
diff changeset
68 ListGridField cfield = new ListGridField("curvelink", "Feststofftransport-Abfluss-Beziehung");
5503
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 4962
diff changeset
69 cfield.addRecordClickHandler(this);
6272
24be0cc1c67c Replaced the 'old school' wiki link buttons with default links.
Raimund Renkert <rrenkert@intevation.de>
parents: 6194
diff changeset
70
24be0cc1c67c Replaced the 'old school' wiki link buttons with default links.
Raimund Renkert <rrenkert@intevation.de>
parents: 6194
diff changeset
71 this.setShowRecordComponents(true);
24be0cc1c67c Replaced the 'old school' wiki link buttons with default links.
Raimund Renkert <rrenkert@intevation.de>
parents: 6194
diff changeset
72 this.setShowRecordComponentsByCell(true);
8409
8ef11fad27a2 Purge redundant station-column (the values will go to kmstart).
Tom Gottfried <tom@intevation.de>
parents: 8408
diff changeset
73 this.setFields(nfield, mfield, sfield, efield, lfield, cfield);
4956
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
74 }
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
75
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
76 /**
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
77 * Resets the items of the tree.
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
78 * If the list of gauges is empty or null the tree will be empty.
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
79 */
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
80 @Override
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
81 public void setRiverInfo(RiverInfo riverinfo) {
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
82 List<MeasurementStation> stations = riverinfo.getMeasurementStations();
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
83 GWT.log("MeasurmentStationListGrid - setRiverInfo " + stations);
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
84
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
85 if (stations != null && !stations.isEmpty()) {
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
86
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
87 if (!riverinfo.isKmUp()) {
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
88 for (MeasurementStation station : stations) {
8408
6c16b61ba9eb Purge sorting stations without range to end of list.
Tom Gottfried <tom@intevation.de>
parents: 8396
diff changeset
89 addStation(station);
4956
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
90 }
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
91 }
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
92 else {
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
93 for (int i = stations.size()-1; i >= 0; i--) {
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
94 MeasurementStation station = stations.get(i);
8408
6c16b61ba9eb Purge sorting stations without range to end of list.
Tom Gottfried <tom@intevation.de>
parents: 8396
diff changeset
95 addStation(station);
4956
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
96 }
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
97 }
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
98 }
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
99 }
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
100
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
101 private void addStation(MeasurementStation station) {
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
102 ListGridRecord record = new MeasurementStationRecord(station);
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
103 this.addData(record);
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
104 }
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
105
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
106 @Override
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
107 public void open() {
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
108 }
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
109
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
110 @Override
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
111 protected Canvas getExpandPanel(ListGridRecord record) {
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
112 MeasurementStationRecord station = (MeasurementStationRecord)record;
7935
6f8f13d829e5 Removed unnecessary container widgets and layouts.
Raimund Renkert <rrenkert@intevation.de>
parents: 7873
diff changeset
113 return new MeasurementStationInfoPanel(station);
4956
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
114 }
5503
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 4962
diff changeset
115
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 4962
diff changeset
116 @Override
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 4962
diff changeset
117 public void onRecordClick(RecordClickEvent event) {
8313
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
118 final MeasurementStationRecord station =
5503
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 4962
diff changeset
119 (MeasurementStationRecord)event.getRecord();
8313
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
120 Config config = Config.getInstance();
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
121 final String locale = config.getLocale();
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
122 createCollectionService.create(
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
123 locale,
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
124 flys.getCurrentUser().identifier(),
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
125 new AsyncCallback<Collection>() {
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
126 @Override
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
127 public void onFailure(Throwable caught) {
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
128 GWT.log("Could not create the new collection.");
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
129 SC.warn(FLYS.getExceptionString(MSG, caught));
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
130 }
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
131
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
132 @Override
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
133 public void onSuccess(Collection collection) {
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
134 GWT.log("Successfully created a new collection.");
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
135 createArtifact(collection, locale, station);
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
136 }
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
137 }
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
138 );
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
139 }
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
140
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
141 private void createArtifact(
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
142 final Collection collection,
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
143 final String locale,
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
144 final MeasurementStationRecord station
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
145 ) {
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
146 artifactService.create(
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
147 locale, "staticsqrelation", null,
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
148 new AsyncCallback<Artifact>() {
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
149 @Override
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
150 public void onFailure(Throwable caught) {
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
151 GWT.log("Could not create the new artifact.");
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
152 SC.warn(FLYS.getExceptionString(MSG, caught));
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
153 }
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
154
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
155 @Override
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
156 public void onSuccess(Artifact artifact) {
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
157 GWT.log("Successfully created a new artifact.");
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
158
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
159 DataItem riverItem = new DefaultDataItem(
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
160 "river",
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
161 "river",
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
162 station.getRiverName());
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
163 Data river = new DefaultData(
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
164 "river",
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
165 null,
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
166 null,
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
167 new DataItem[]{riverItem});
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
168
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
169 DataItem refItem = new DefaultDataItem(
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
170 "station",
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
171 "station",
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
172 station.getID().toString());
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
173 Data ref = new DefaultData(
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
174 "station",
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
175 null,
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
176 null,
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
177 new DataItem[]{refItem});
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
178
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
179 DataItem nameItem = new DefaultDataItem(
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
180 "station_name",
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
181 "station_name",
8396
a201d475e50d Add location data to sq relation artifact. Fixed station name.
Raimund Renkert <rrenkert@intevation.de>
parents: 8313
diff changeset
182 station.getName().toString());
8313
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
183 Data name = new DefaultData(
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
184 "station_name",
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
185 null,
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
186 null,
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
187 new DataItem[]{nameItem});
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
188
8396
a201d475e50d Add location data to sq relation artifact. Fixed station name.
Raimund Renkert <rrenkert@intevation.de>
parents: 8313
diff changeset
189 DataItem locationItem = new DefaultDataItem(
a201d475e50d Add location data to sq relation artifact. Fixed station name.
Raimund Renkert <rrenkert@intevation.de>
parents: 8313
diff changeset
190 "ld_locations",
a201d475e50d Add location data to sq relation artifact. Fixed station name.
Raimund Renkert <rrenkert@intevation.de>
parents: 8313
diff changeset
191 "ld_locations",
a201d475e50d Add location data to sq relation artifact. Fixed station name.
Raimund Renkert <rrenkert@intevation.de>
parents: 8313
diff changeset
192 station.getKmStart().toString());
a201d475e50d Add location data to sq relation artifact. Fixed station name.
Raimund Renkert <rrenkert@intevation.de>
parents: 8313
diff changeset
193 Data location = new DefaultData(
a201d475e50d Add location data to sq relation artifact. Fixed station name.
Raimund Renkert <rrenkert@intevation.de>
parents: 8313
diff changeset
194 "ld_locations",
a201d475e50d Add location data to sq relation artifact. Fixed station name.
Raimund Renkert <rrenkert@intevation.de>
parents: 8313
diff changeset
195 null,
a201d475e50d Add location data to sq relation artifact. Fixed station name.
Raimund Renkert <rrenkert@intevation.de>
parents: 8313
diff changeset
196 null,
a201d475e50d Add location data to sq relation artifact. Fixed station name.
Raimund Renkert <rrenkert@intevation.de>
parents: 8313
diff changeset
197 new DataItem[]{locationItem});
a201d475e50d Add location data to sq relation artifact. Fixed station name.
Raimund Renkert <rrenkert@intevation.de>
parents: 8313
diff changeset
198
a201d475e50d Add location data to sq relation artifact. Fixed station name.
Raimund Renkert <rrenkert@intevation.de>
parents: 8313
diff changeset
199 Data[] data = new Data[]{river, ref, name, location};
8313
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
200 forwardService.go(locale, artifact, data,
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
201 new AsyncCallback<Artifact>() {
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
202 @Override
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
203 public void onFailure(Throwable caught) {
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
204 GWT.log("Could not feed the artifact.");
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
205 SC.warn(caught.getMessage());
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
206 }
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
207
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
208 @Override
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
209 public void onSuccess(Artifact artifact) {
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
210 GWT.log("Successfully feed the artifact.");
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
211 CollectionView view = new CollectionView(
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
212 flys,
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
213 collection,
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
214 artifact);
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
215 flys.getWorkspace().addView(
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
216 collection.identifier(),
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
217 view);
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
218 view.addArtifactToCollection(artifact);
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
219 }
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
220 });
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
221 }
e3a63d9c5bb1 Updated the client to build a default artifact for sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents: 8285
diff changeset
222 });
5503
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 4962
diff changeset
223 }
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 4962
diff changeset
224
6272
24be0cc1c67c Replaced the 'old school' wiki link buttons with default links.
Raimund Renkert <rrenkert@intevation.de>
parents: 6194
diff changeset
225 @Override
24be0cc1c67c Replaced the 'old school' wiki link buttons with default links.
Raimund Renkert <rrenkert@intevation.de>
parents: 6194
diff changeset
226 public String getCellCSSText(ListGridRecord record, int rowNum,
24be0cc1c67c Replaced the 'old school' wiki link buttons with default links.
Raimund Renkert <rrenkert@intevation.de>
parents: 6194
diff changeset
227 int colNum) {
8409
8ef11fad27a2 Purge redundant station-column (the values will go to kmstart).
Tom Gottfried <tom@intevation.de>
parents: 8408
diff changeset
228 if (colNum == 6) {
6272
24be0cc1c67c Replaced the 'old school' wiki link buttons with default links.
Raimund Renkert <rrenkert@intevation.de>
parents: 6194
diff changeset
229 return "text-decoration: underline; color: #0000EE; cursor: pointer;";
24be0cc1c67c Replaced the 'old school' wiki link buttons with default links.
Raimund Renkert <rrenkert@intevation.de>
parents: 6194
diff changeset
230 }
24be0cc1c67c Replaced the 'old school' wiki link buttons with default links.
Raimund Renkert <rrenkert@intevation.de>
parents: 6194
diff changeset
231 else {
24be0cc1c67c Replaced the 'old school' wiki link buttons with default links.
Raimund Renkert <rrenkert@intevation.de>
parents: 6194
diff changeset
232 return super.getCellCSSText(record, rowNum, colNum);
24be0cc1c67c Replaced the 'old school' wiki link buttons with default links.
Raimund Renkert <rrenkert@intevation.de>
parents: 6194
diff changeset
233 }
24be0cc1c67c Replaced the 'old school' wiki link buttons with default links.
Raimund Renkert <rrenkert@intevation.de>
parents: 6194
diff changeset
234 }
24be0cc1c67c Replaced the 'old school' wiki link buttons with default links.
Raimund Renkert <rrenkert@intevation.de>
parents: 6194
diff changeset
235
4956
f46a07c11324 Refactor Pegel- and Messtelleninfo in client ui
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
236 }

http://dive4elements.wald.intevation.org