Mercurial > dive4elements > gnv-client
comparison gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java @ 19:1557bea6cb55
Do some Imporvements for Userfriendly exceptionhandling.
Added multisupport for Products
gnv/trunk@108 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Mon, 21 Sep 2009 15:28:02 +0000 |
parents | 2535158e2687 |
children | b11f941f7eb2 |
comparison
equal
deleted
inserted
replaced
18:87002cbd194c | 19:1557bea6cb55 |
---|---|
120 */ | 120 */ |
121 private Document doGetRequest(String requestUrl, Document requestBody) throws IOException { | 121 private Document doGetRequest(String requestUrl, Document requestBody) throws IOException { |
122 XMLUtils xmlUtils = new XMLUtils(); | 122 XMLUtils xmlUtils = new XMLUtils(); |
123 Representation output = doGetRequestInternal(requestUrl, requestBody); | 123 Representation output = doGetRequestInternal(requestUrl, requestBody); |
124 Document document = xmlUtils.readDocument(output.getStream()); | 124 Document document = xmlUtils.readDocument(output.getStream()); |
125 log.debug(xmlUtils.writeDocument2String(document)); | |
126 return document; | 125 return document; |
127 } | 126 } |
128 | 127 |
129 /** | 128 /** |
130 * @throws IOException | 129 * @throws IOException |
251 XMLUtils xmlUtils = new XMLUtils(); | 250 XMLUtils xmlUtils = new XMLUtils(); |
252 String url = ((ArtifactFactory)artifactFactory).getDataBaseUrl(); | 251 String url = ((ArtifactFactory)artifactFactory).getDataBaseUrl(); |
253 InputStream is = this.doPostRequest(url+"/"+suburl, request); | 252 InputStream is = this.doPostRequest(url+"/"+suburl, request); |
254 Document result = xmlUtils.readDocument(is); | 253 Document result = xmlUtils.readDocument(is); |
255 // TODO: Fehleranalyse des Dokumentes | 254 // TODO: Fehleranalyse des Dokumentes |
256 log.debug(xmlUtils.writeDocument2String(result)); | |
257 return result; | 255 return result; |
258 } | 256 } |
259 | 257 |
260 private Document createDescribeRequestBody(ArtifactObject currentArtifact){ | 258 private Document createDescribeRequestBody(ArtifactObject currentArtifact){ |
261 Document document = new XMLUtils().newDocument(); | 259 Document document = new XMLUtils().newDocument(); |
354 // 1 Feed | 352 // 1 Feed |
355 this.doFeed(artifactFactory, currentArtifact, inputParameter); | 353 this.doFeed(artifactFactory, currentArtifact, inputParameter); |
356 // 2 Advance | 354 // 2 Advance |
357 String url = this.getArtifactUrl(artifactFactory, currentArtifact); | 355 String url = this.getArtifactUrl(artifactFactory, currentArtifact); |
358 Document advanceDocument = this.createAdvanceRequestBody(currentArtifact, target); | 356 Document advanceDocument = this.createAdvanceRequestBody(currentArtifact, target); |
359 log.debug(new XMLUtils().writeDocument2String(advanceDocument)); | |
360 InputStream advanceResult = this.doPostRequest(url, advanceDocument); | 357 InputStream advanceResult = this.doPostRequest(url, advanceDocument); |
361 // TODO feedResult auswerten und ggf. Fehler werfen. | 358 // TODO feedResult auswerten und ggf. Fehler werfen. |
362 // 3 Descibe | 359 // 3 Descibe |
363 return this.getCurrentStepDescription(artifactFactory, currentArtifact); | 360 return this.getCurrentStepDescription(artifactFactory, currentArtifact); |
364 } catch (IOException e) { | 361 } catch (IOException e) { |