annotate src/main/java/org/dive4elements/artifacts/httpclient/ConsoleClient.java @ 125:e602a29f1dcc 3.2.x

Upgrade to Log4j 2
author Tom Gottfried <tom@intevation.de>
date Mon, 28 Feb 2022 17:49:46 +0100
parents 7261c948425c
children
rev   line source
0
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 /*
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2 * Copyright (c) 2010 by Intevation GmbH
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
3 *
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
4 * This program is free software under the LGPL (>=v2.1)
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
5 * Read the file LGPL.txt coming with the software for details
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6 * or visit http://www.gnu.org/licenses/ if it does not exist.
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
7 */
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
8
72
133281653904 Renamed internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 71
diff changeset
9 package org.dive4elements.artifacts.httpclient;
0
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11 import java.io.IOException;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12 import java.io.File;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 import java.io.FileOutputStream;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14 import java.io.OutputStream;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16 import java.util.Arrays;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17 import java.util.ArrayList;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18 import java.util.HashMap;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19 import java.util.List;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20 import java.util.Map;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22 import javax.xml.xpath.XPathConstants;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24 import org.w3c.dom.Document;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25 import org.w3c.dom.Node;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26 import org.w3c.dom.NodeList;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27
125
e602a29f1dcc Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 124
diff changeset
28 import org.apache.logging.log4j.Logger;
e602a29f1dcc Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 124
diff changeset
29 import org.apache.logging.log4j.LogManager;
0
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30
72
133281653904 Renamed internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 71
diff changeset
31 import org.dive4elements.artifacts.httpclient.http.HttpClient;
133281653904 Renamed internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 71
diff changeset
32 import org.dive4elements.artifacts.httpclient.http.HttpClientImpl;
133281653904 Renamed internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 71
diff changeset
33 import org.dive4elements.artifacts.httpclient.http.response.DocumentResponseHandler;
0
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34
72
133281653904 Renamed internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 71
diff changeset
35 import org.dive4elements.artifacts.httpclient.exceptions.ConnectionException;
133281653904 Renamed internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 71
diff changeset
36 import org.dive4elements.artifacts.httpclient.exceptions.NoSuchOptionException;
133281653904 Renamed internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 71
diff changeset
37 import org.dive4elements.artifacts.httpclient.objects.Artifact;
133281653904 Renamed internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 71
diff changeset
38 import org.dive4elements.artifacts.httpclient.utils.ArtifactProtocolUtils;
133281653904 Renamed internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 71
diff changeset
39 import org.dive4elements.artifacts.httpclient.utils.Configuration;
133281653904 Renamed internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 71
diff changeset
40 import org.dive4elements.artifacts.httpclient.utils.XFormNamespaceContext;
133281653904 Renamed internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 71
diff changeset
41 import org.dive4elements.artifacts.httpclient.utils.XMLUtils;
0
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
43 /**
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
45 */
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
46 public class ConsoleClient
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
47 {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
48 /**
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
49 * The path of the configuration directory.
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
50 */
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
51 public static final String CONFIG_PATH = System.getProperty("config.dir",
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
52 "conf");
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
53
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
54 public static final String CONFIG = System.getProperty("config.file",
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
55 "use_case1.conf");
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
56
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
57
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
58 public static final String XPATH_DYNAMIC = "/art:result/art:ui/art:dynamic";
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
59
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
60 /**
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
61 * The logger used in this class.
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
62 */
125
e602a29f1dcc Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 124
diff changeset
63 private static Logger logger = LogManager.getLogger(ConsoleClient.class);
0
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
64
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
65
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
66 public static final Configuration readConfiguration() {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
67 File configDir = new File(CONFIG_PATH);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
68 File configFile = new File(configDir, CONFIG);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
70 logger.debug("Configuration file: " + configFile.getAbsolutePath());
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
71
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
72 if (configFile.isFile() && configFile.canRead()) {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
73 try {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
74 Configuration conf = new Configuration(configFile);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
75 conf.initialize();
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
76
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
77 return conf;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
78 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
79 catch (IOException ioe) {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
80 logger.error("Error while reading configuration.");
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
81 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
82 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
83
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
84 return null;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
85 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
86
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
87
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
88 public static void main( String[] args )
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
89 {
1
c9ac6642973c Renamed GNVClient and GNVClientImpl to HttpClient and HttpClientImpl.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 0
diff changeset
90 logger.info("Starting console client.");
0
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
91
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
92 Configuration conf = readConfiguration();
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
93
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
94 String serverHost = (String) conf.getServerSettings("host");
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
95 String serverPort = (String) conf.getServerSettings("port");
1
c9ac6642973c Renamed GNVClient and GNVClientImpl to HttpClient and HttpClientImpl.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 0
diff changeset
96 HttpClient client = new HttpClientImpl(serverHost + ":" + serverPort);
0
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
97
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
98 try {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
99 Document create = ArtifactProtocolUtils.createCreateDocument(
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
100 (String) conf.getArtifactSettings("fis"));
2
2fdfa20cfa63 Added an interface that is used to create instances of artifacts depending on the framework that includes this lib. The create() method of the HttpClient makes use of this interface.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
101 Artifact artifact = (Artifact) client.create(create, null);
0
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
102
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
103 Map attr = new HashMap();
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
104 String product = (String) conf.getArtifactSettings("product");
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
105 String[] products = extractOptions(client, artifact, product);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
106 attr.put("product", products[0]);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
107
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
108 feedAndGo(client, artifact, attr, "timeSeries");
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
109
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
110 attr.clear();
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
111 String area = (String) conf.getArtifactSettings("areaid");
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
112 String[] areas = extractOptions(client, artifact, area);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
113 attr.put("areaid", areas[0]);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
114 feedAndGo(client, artifact, attr, "timeseries_without_geom");
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
115
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
116 attr.clear();
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
117 String feature = (String) conf.getArtifactSettings("featureid");
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
118 String[] features = extractOptions(client, artifact, feature);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
119 attr.put("featureid", features[0]);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
120 feedAndGo(client, artifact, attr, "timeseries_vector_scalar");
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
121
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
122 attr.clear();
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
123 String vector = (String) conf.getArtifactSettings("vectorscalar");
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
124 String[] vectors = extractOptions(client, artifact, vector);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
125 attr.put("vectorscalar", vectors[0]);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
126 feedAndGo(client, artifact, attr, "timeseries_parameter");
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
127
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
128 attr.clear();
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
129 String parameter = (String) conf.getArtifactSettings("parameterid");
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
130 String[] parameters = extractOptions(client, artifact, parameter);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
131 attr.put("parameterid", parameters);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
132 feedAndGo(client, artifact, attr, "timeseries_depth_height");
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
133
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
134 attr.clear();
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
135 String measure = (String) conf.getArtifactSettings("measurementid");
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
136 String[] measures = extractMeasurements(client, artifact, measure);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
137 attr.put("measurementid", measures);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
138 feedAndGo(client, artifact, attr, "timeseries_interval");
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
139
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
140 attr.clear();
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
141 String min = (String) conf.getArtifactSettings("minvalue");
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
142 String max = (String) conf.getArtifactSettings("maxvalue");
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
143 attr.put("minvalue", min);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
144 attr.put("maxvalue", max);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
145 feedAndGo(client, artifact, attr, "timeseries_calculate_results");
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
146
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
147 try {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
148 Map opts = new HashMap();
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
149 opts.put("mime-type", conf.getOutputSettings("mime-type"));
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
150 opts.put("width", conf.getOutputSettings("width"));
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
151 opts.put("height", conf.getOutputSettings("height"));
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
152 opts.put("points", conf.getOutputSettings("points"));
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
153
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
154 Document chart =
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
155 ArtifactProtocolUtils.createChartDocument(artifact, opts);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
156
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
157 String dir = (String) conf.getOutputSettings("directory");
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
158
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
159 File outDir = new File(dir);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
160 File output = new File(outDir, "output.png");
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
161 OutputStream os = new FileOutputStream(output);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
162
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
163 client.out(artifact, chart, "chart", os);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
164 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
165 catch (IOException ioe) {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
166 logger.error(
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
167 "IO error while writing the output: " + ioe.getMessage());
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
168 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
169
1
c9ac6642973c Renamed GNVClient and GNVClientImpl to HttpClient and HttpClientImpl.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 0
diff changeset
170 logger.debug("Finished console client.");
0
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
171 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
172 catch (ConnectionException ce) {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
173 logger.error(ce.getMessage());
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
174 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
175 catch (NoSuchOptionException nsoe) {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
176 logger.error(
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
177 "No such option found: " + nsoe.getMessage());
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
178 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
179 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
180
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
181
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
182 public static void feedAndGo(
1
c9ac6642973c Renamed GNVClient and GNVClientImpl to HttpClient and HttpClientImpl.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 0
diff changeset
183 HttpClient client,
0
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
184 Artifact artifact,
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
185 Map attr,
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
186 String target)
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
187 throws ConnectionException
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
188 {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
189 Document feed = ArtifactProtocolUtils.createFeedDocument(artifact, attr);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
190 client.feed(artifact, feed, new DocumentResponseHandler());
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
191
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
192 Document advance = ArtifactProtocolUtils.createAdvanceDocument(
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
193 artifact,
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
194 target);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
195
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
196 client.advance(artifact, advance, new DocumentResponseHandler());
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
197 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
198
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
199
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
200 /**
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
201 * XXX I think, this method should be implemented somewhere else to be able
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
202 * to re-use this implementation. But this method needs more work to be more
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
203 * abstract, so it needs to be reimplemented later, I think.
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
204 */
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
205 public static String[] extractOptions(
1
c9ac6642973c Renamed GNVClient and GNVClientImpl to HttpClient and HttpClientImpl.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 0
diff changeset
206 HttpClient client,
0
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
207 Artifact artifact,
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
208 String text)
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
209 throws NoSuchOptionException, ConnectionException
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
210 {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
211 Document describe = ArtifactProtocolUtils.createDescribeDocument(
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
212 artifact, true);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
213
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
214 Document description = (Document) client.describe(
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
215 artifact, describe, new DocumentResponseHandler());
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
216
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
217 List pieces = Arrays.asList(text.split(","));
22
dbf1bfa070af Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2
diff changeset
218 List options = new ArrayList(pieces.size());
0
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
219
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
220 Node dynamic = XMLUtils.getNodeXPath(description, XPATH_DYNAMIC);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
221
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
222 // TODO We should handle these cases better!!
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
223 NodeList items = (NodeList) XMLUtils.getXPath(
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
224 dynamic, "xform:select1/xform:choices/xform:item",
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
225 XPathConstants.NODESET, XFormNamespaceContext.INSTANCE);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
226
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
227 if (items == null || items.getLength() == 0) {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
228 items = (NodeList) XMLUtils.getXPath(
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
229 dynamic, "xform:select/xform:choices/xform:item",
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
230 XPathConstants.NODESET, XFormNamespaceContext.INSTANCE);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
231 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
232
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
233 if (items == null || items.getLength() == 0) {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
234 items = (NodeList) XMLUtils.getXPath(
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
235 dynamic, "xform:group/xform:select/xform:item",
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
236 XPathConstants.NODESET, XFormNamespaceContext.INSTANCE);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
237 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
238
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
239
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
240 for (int i = 0; i < items.getLength(); i++) {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
241 Node item = items.item(i);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
242 Node label = (Node) XMLUtils.getXPath(
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
243 item, "xform:label", XPathConstants.NODE,
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
244 XFormNamespaceContext.INSTANCE);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
245
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
246 Node value = (Node) XMLUtils.getXPath(
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
247 item, "xform:value", XPathConstants.NODE,
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
248 XFormNamespaceContext.INSTANCE);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
249
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
250 if (pieces.indexOf(label.getTextContent()) >= 0)
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
251 options.add(value.getTextContent());
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
252 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
253
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
254 if (options.isEmpty())
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
255 throw new NoSuchOptionException(text);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
256
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
257 return (String[]) options.toArray(new String[options.size()]);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
258 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
259
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
260
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
261 /**
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
262 * XXX This method extracts the measurement ids depending on the user
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
263 * configuration from describe document. Currently, this is a special case
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
264 * that should be handled the same way as all the other options in the
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
265 * describe document.
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
266 */
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
267 public static String[] extractMeasurements(
1
c9ac6642973c Renamed GNVClient and GNVClientImpl to HttpClient and HttpClientImpl.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 0
diff changeset
268 HttpClient client,
0
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
269 Artifact artifact,
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
270 String text)
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
271 throws NoSuchOptionException, ConnectionException
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
272 {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
273 Document describe = ArtifactProtocolUtils.createDescribeDocument(
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
274 artifact, true);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
275
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
276 Document description = (Document) client.describe(
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
277 artifact, describe, new DocumentResponseHandler());
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
278
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
279 List pieces = Arrays.asList(text.split(","));
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
280 List options = new ArrayList(pieces.size());
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
281
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
282 Node dynamic = XMLUtils.getNodeXPath(description, XPATH_DYNAMIC);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
283
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
284 NodeList params = (NodeList) XMLUtils.getXPath(
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
285 dynamic, "xform:group/xform:select",
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
286 XPathConstants.NODESET, XFormNamespaceContext.INSTANCE);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
287
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
288 for (int i = 0; i < params.getLength(); i++) {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
289 Node param = params.item(i);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
290
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
291 NodeList items = (NodeList) XMLUtils.getXPath(
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
292 param, "xform:item[@disabled='false']", XPathConstants.NODESET,
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
293 XFormNamespaceContext.INSTANCE);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
294
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
295 for (int j = 0; j < items.getLength(); j++) {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
296 Node item = items.item(j);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
297
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
298 Node label = (Node) XMLUtils.getXPath(
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
299 item, "xform:label", XPathConstants.NODE,
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
300 XFormNamespaceContext.INSTANCE);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
301
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
302 if (pieces.indexOf(label.getTextContent()) < 0) {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
303 continue;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
304 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
305
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
306 Node value = (Node) XMLUtils.getXPath(
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
307 item, "xform:value", XPathConstants.NODE,
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
308 XFormNamespaceContext.INSTANCE);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
309
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
310 options.add(value.getTextContent());
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
311 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
312 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
313
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
314 if (options.isEmpty())
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
315 throw new NoSuchOptionException(text);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
316
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
317 return (String[]) options.toArray(new String[options.size()]);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
318 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
319 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
320 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:

http://dive4elements.wald.intevation.org