annotate gwt-client/src/main/java/org/dive4elements/river/client/server/ArtifactServiceImpl.java @ 8203:238fc722f87a

sed 's/logger/log/g' src/**/*.java
author Sascha L. Teichmann <teichmann@intevation.de>
date Fri, 05 Sep 2014 13:19:22 +0200
parents cbdf839008a7
children 519023ce3500
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.server;
11
6aeb4072eeb4 Added interfaces and a stub implementation of an artifact service the should provide the methods for communicating with the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10
1367
ab8eb2f544f2 Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 905
diff changeset
11 import org.apache.log4j.Logger;
ab8eb2f544f2 Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 905
diff changeset
12
11
6aeb4072eeb4 Added interfaces and a stub implementation of an artifact service the should provide the methods for communicating with the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 import com.google.gwt.user.server.rpc.RemoteServiceServlet;
6aeb4072eeb4 Added interfaces and a stub implementation of an artifact service the should provide the methods for communicating with the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
15 import org.dive4elements.river.client.shared.exceptions.ServerException;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
16 import org.dive4elements.river.client.shared.model.Artifact;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
17 import org.dive4elements.river.client.client.services.ArtifactService;
11
6aeb4072eeb4 Added interfaces and a stub implementation of an artifact service the should provide the methods for communicating with the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
19 import org.dive4elements.river.client.shared.model.Collection;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
20 import org.dive4elements.river.client.shared.model.Recommendation;
11
6aeb4072eeb4 Added interfaces and a stub implementation of an artifact service the should provide the methods for communicating with the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21
6aeb4072eeb4 Added interfaces and a stub implementation of an artifact service the should provide the methods for communicating with the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22 /**
6aeb4072eeb4 Added interfaces and a stub implementation of an artifact service the should provide the methods for communicating with the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23 * This interface provides artifact specific services as CREATE, DESCRIBE, FEED,
6aeb4072eeb4 Added interfaces and a stub implementation of an artifact service the should provide the methods for communicating with the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24 * ADVANCE and OUT.
6aeb4072eeb4 Added interfaces and a stub implementation of an artifact service the should provide the methods for communicating with the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25 *
6aeb4072eeb4 Added interfaces and a stub implementation of an artifact service the should provide the methods for communicating with the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
6aeb4072eeb4 Added interfaces and a stub implementation of an artifact service the should provide the methods for communicating with the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27 */
6aeb4072eeb4 Added interfaces and a stub implementation of an artifact service the should provide the methods for communicating with the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
28 public class ArtifactServiceImpl
6aeb4072eeb4 Added interfaces and a stub implementation of an artifact service the should provide the methods for communicating with the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
29 extends RemoteServiceServlet
6aeb4072eeb4 Added interfaces and a stub implementation of an artifact service the should provide the methods for communicating with the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30 implements ArtifactService
6aeb4072eeb4 Added interfaces and a stub implementation of an artifact service the should provide the methods for communicating with the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31 {
8203
238fc722f87a sed 's/logger/log/g' src/**/*.java
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6040
diff changeset
32 /** Private log. */
238fc722f87a sed 's/logger/log/g' src/**/*.java
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6040
diff changeset
33 private static final Logger log =
1367
ab8eb2f544f2 Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 905
diff changeset
34 Logger.getLogger(ArtifactServiceImpl.class);
ab8eb2f544f2 Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 905
diff changeset
35
ab8eb2f544f2 Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 905
diff changeset
36
905
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 845
diff changeset
37 /**
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 845
diff changeset
38 * Creates new Artifacts based on a given Recommendation and factory.
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 845
diff changeset
39 * <b>Note, that all the work is done in ArtifactHelper!</b>
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 845
diff changeset
40 *
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 845
diff changeset
41 * @param locale The locale used for HTTP request.
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 845
diff changeset
42 * @param factory The factory that is used to create the new Artifact.
2890
fba76f4afca9 Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1425
diff changeset
43 * @param recom Recommendation with details of the artifact to create.
905
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 845
diff changeset
44 *
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 845
diff changeset
45 * @return a new Artifact.
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 845
diff changeset
46 */
803
653ae84533e7 Read/create recommended Artifacts and add them to the current Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 229
diff changeset
47 public Artifact create(
843
78ef14dc1877 Forward recommendations as a structure to RPC service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 807
diff changeset
48 String locale,
78ef14dc1877 Forward recommendations as a structure to RPC service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 807
diff changeset
49 String factory,
905
478a571f1f94 Refactored server code - HTTP related code moved to ArtifactsHelper and CollectionHelper which makes us able to combine Artifact and Collection protocol stuff in a single RPC service.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 845
diff changeset
50 Recommendation recom
843
78ef14dc1877 Forward recommendations as a structure to RPC service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 807
diff changeset
51 )
215
e02f50a3ad59 Improved the exception handling of artifact / collection specific operations. Warning dialog are displayed after such an exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
52 throws ServerException
e02f50a3ad59 Improved the exception handling of artifact / collection specific operations. Warning dialog are displayed after such an exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
53 {
8203
238fc722f87a sed 's/logger/log/g' src/**/*.java
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6040
diff changeset
54 log.info("ArtifactServiceImpl.create");
229
924da6695800 Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
55
1425
bc06a671ef60 Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
56 String url = getServletContext().getInitParameter("server-url");
bc06a671ef60 Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
57
bc06a671ef60 Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
58 return ArtifactHelper.createArtifact(url, locale, factory, recom);
845
4db672cdacb2 Added outs/facet filters when creation new artifacts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 843
diff changeset
59 }
3865
436eec3be6ff Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2890
diff changeset
60
6040
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
61
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
62 /**
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
63 * Create a new GaugeDischageCurveArtifact and MainValueArtifact, stuff
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
64 * them into a collection.
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
65 *
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
66 * @param river the river.
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
67 * @param gaugeref reference id of the gauge.
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
68 */
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
69 public Artifact createGaugeDischargeView(
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
70 Collection collection,
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
71 String locale,
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
72 String river,
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
73 Long gaugeRef)
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
74 throws ServerException
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
75 {
8203
238fc722f87a sed 's/logger/log/g' src/**/*.java
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6040
diff changeset
76 log.info("ArtifactServiceImpl.createGaugeDischargeCurveView");
6040
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
77 String url = getServletContext().getInitParameter("server-url");
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
78
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
79 Artifact artifact = ArtifactHelper.createGaugeDischargeCurveArtifact(url,
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
80 locale, river, gaugeRef);
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
81 if (artifact == null) {
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
82 return null;
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
83 }
8203
238fc722f87a sed 's/logger/log/g' src/**/*.java
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6040
diff changeset
84 log.info("GaugeDischargeCurveArtifact created successfully");
6040
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
85
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
86 CollectionHelper.addArtifact(collection, artifact, url, locale);
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
87 Artifact mainVArtifact = ArtifactHelper.createMainvalueArtifact(url,
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
88 locale, river, gaugeRef);
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
89 if (mainVArtifact == null) {
8203
238fc722f87a sed 's/logger/log/g' src/**/*.java
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6040
diff changeset
90 log.info("Failed to create MainValueArtifact");
6040
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
91 return null;
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
92 }
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
93 CollectionHelper.addArtifact(collection, mainVArtifact, url, locale);
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
94
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
95 return artifact;
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
96 }
cbdf839008a7 Add a new function to create a GaugeDischarge+MainValueArtifact collection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6039
diff changeset
97
3865
436eec3be6ff Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2890
diff changeset
98 /**
436eec3be6ff Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2890
diff changeset
99 * Create a new GaugeDischageCurveArtifact
436eec3be6ff Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2890
diff changeset
100 *
436eec3be6ff Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2890
diff changeset
101 * @param river the river
436eec3be6ff Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2890
diff changeset
102 * @param gaugeref reference id of the gauge
436eec3be6ff Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2890
diff changeset
103 */
436eec3be6ff Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2890
diff changeset
104 public Artifact createGaugeDischargeCurveArtifact(
436eec3be6ff Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2890
diff changeset
105 Collection collection,
436eec3be6ff Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2890
diff changeset
106 String locale,
436eec3be6ff Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2890
diff changeset
107 String river,
436eec3be6ff Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2890
diff changeset
108 Long gaugeref)
436eec3be6ff Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2890
diff changeset
109 throws ServerException
436eec3be6ff Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2890
diff changeset
110 {
8203
238fc722f87a sed 's/logger/log/g' src/**/*.java
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6040
diff changeset
111 log.info("ArtifactServiceImpl.createGaugeDischargeCurveArtifact");
3865
436eec3be6ff Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2890
diff changeset
112 String url = getServletContext().getInitParameter("server-url");
436eec3be6ff Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2890
diff changeset
113
436eec3be6ff Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2890
diff changeset
114 Artifact artifact = ArtifactHelper.createGaugeDischargeCurveArtifact(url,
436eec3be6ff Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2890
diff changeset
115 locale, river, gaugeref);
436eec3be6ff Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2890
diff changeset
116 if (artifact == null) {
436eec3be6ff Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2890
diff changeset
117 return null;
436eec3be6ff Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2890
diff changeset
118 }
8203
238fc722f87a sed 's/logger/log/g' src/**/*.java
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6040
diff changeset
119 log.info("GaugeDischargeCurveArtifact created successfully");
3865
436eec3be6ff Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2890
diff changeset
120
436eec3be6ff Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2890
diff changeset
121 CollectionHelper.addArtifact(collection, artifact, url, locale);
436eec3be6ff Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2890
diff changeset
122
436eec3be6ff Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2890
diff changeset
123 return artifact;
436eec3be6ff Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2890
diff changeset
124 }
436eec3be6ff Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 2890
diff changeset
125
5503
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 3865
diff changeset
126 @Override
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 3865
diff changeset
127 public Artifact createSQRelationArtifact(
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 3865
diff changeset
128 Collection collection,
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 3865
diff changeset
129 String locale,
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 3865
diff changeset
130 String river,
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 3865
diff changeset
131 int measurementStation)
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 3865
diff changeset
132 throws ServerException
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 3865
diff changeset
133 {
8203
238fc722f87a sed 's/logger/log/g' src/**/*.java
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6040
diff changeset
134 log.info("ArtifactServiceImpl.createSQRelationArtifact");
5503
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 3865
diff changeset
135 String url = getServletContext().getInitParameter("server-url");
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 3865
diff changeset
136
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 3865
diff changeset
137 Artifact artifact = ArtifactHelper.createSQRelationArtifact(url,
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 3865
diff changeset
138 locale, river, measurementStation);
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 3865
diff changeset
139 if (artifact == null) {
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 3865
diff changeset
140 return null;
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 3865
diff changeset
141 }
8203
238fc722f87a sed 's/logger/log/g' src/**/*.java
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6040
diff changeset
142 log.info("SQRelationArtifact created successfully");
5503
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 3865
diff changeset
143
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 3865
diff changeset
144 CollectionHelper.addArtifact(collection, artifact, url, locale);
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 3865
diff changeset
145
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 3865
diff changeset
146 return artifact;
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 3865
diff changeset
147 }
b660090b417d Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents: 3865
diff changeset
148
11
6aeb4072eeb4 Added interfaces and a stub implementation of an artifact service the should provide the methods for communicating with the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
149 }
6aeb4072eeb4 Added interfaces and a stub implementation of an artifact service the should provide the methods for communicating with the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
150 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org