Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/LoadSingleEpochSelectState.java @ 9224:c3994657c15d
salix workflow little improvments
author | gernotbelger |
---|---|
date | Wed, 04 Jul 2018 15:26:08 +0200 |
parents | artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/LoadMultipleEpochSelectState.java@bfe97ad35df5 |
children | f5cff8708531 |
comparison
equal
deleted
inserted
replaced
9223:bfe97ad35df5 | 9224:c3994657c15d |
---|---|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde | |
2 * Software engineering by Intevation GmbH | |
3 * | |
4 * This file is Free Software under the GNU AGPL (>=v3) | |
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the | |
6 * documentation coming with Dive4Elements River for details. | |
7 */ | |
8 | |
9 package org.dive4elements.river.artifacts.uinfo.salix; | |
10 | |
11 import java.util.HashMap; | |
12 import java.util.Map; | |
13 | |
14 import org.apache.log4j.Logger; | |
15 import org.dive4elements.artifacts.Artifact; | |
16 import org.dive4elements.artifacts.CallContext; | |
17 import org.dive4elements.artifacts.common.utils.XMLUtils.ElementCreator; | |
18 import org.dive4elements.river.artifacts.states.AddTableDataHelper; | |
19 import org.dive4elements.river.artifacts.states.DefaultState; | |
20 import org.w3c.dom.Element; | |
21 | |
22 public class LoadSingleEpochSelectState extends DefaultState { | |
23 private static final long serialVersionUID = 1L; | |
24 /** The log used in this class. */ | |
25 private static Logger log = Logger.getLogger(LoadSingleEpochSelectState.class); | |
26 | |
27 /** | |
28 * The default constructor that initializes an empty State object. | |
29 */ | |
30 public LoadSingleEpochSelectState() { | |
31 } | |
32 | |
33 @Override | |
34 protected String getUIProvider() { | |
35 return "common.load_single_epoch_select"; | |
36 } | |
37 | |
38 @Override | |
39 protected void appendItems(final Artifact artifact, final ElementCreator creator, final String name, final CallContext context, final Element select) { | |
40 final String datakey = "singleepoch"; | |
41 // TODO: MAKE DATASOURCE | |
42 try { | |
43 if (datakey.equals(name)) { | |
44 | |
45 final AddTableDataHelper helper = new AddTableDataHelper(creator, select, "year", context.getMeta()); | |
46 | |
47 helper.addColumn(0, "pinfrom", "40", "common.client.ui.from", "ICON", "CENTER", "from"); | |
48 helper.addColumn(1, "pinto", "40", "common.client.ui.to", "ICON", "CENTER", "to"); | |
49 helper.addColumn(2, "year", "60", "year", "INTEGER", "LEFT", null); | |
50 helper.addColumn(3, "sounding", "200", "uinfo.salix.soundings", "STRING", "LEFT", null); | |
51 // final CollisionAccess access = new CollisionAccess((SINFOArtifact) artifact); // Der River wurde im vorigen State | |
52 // bereits gesetzt | |
53 | |
54 // final List<Collision> collisions = CollisionHibernateFactory.getCollisionsByRiver(access.getRiver()); | |
55 // for (final Collision coll : collisions) { // TODO: Filter on Range (?) | |
56 // final Integer year = coll.getYear(); | |
57 // for (final Collision coll : collisions) { | |
58 for (int i = 0; i < 3; i++) {// : Collision.getYearsOfRiver(access.getRiver())) { | |
59 // final Integer year = coll.getYear(); | |
60 final Map<String, String> row = new HashMap<>(); | |
61 row.put("year", String.valueOf(1995 + i)); // Nullpointer? | |
62 row.put("sounding", "TODO: Peilungen für das Jahr in dieser Zelle auflisten."); | |
63 helper.addRow(row); | |
64 } | |
65 // } | |
66 helper.submitMapToXml(); | |
67 } | |
68 } | |
69 catch ( | |
70 | |
71 final IllegalArgumentException iae) { | |
72 iae.printStackTrace(); | |
73 } | |
74 } | |
75 } |