svn-gvsig-desktop / tmp / trunk / servidor / WorkSpace_Servidor / wps-plugin-0.4.0-operation-StreetsMap / src / org / tigris / frogs / plugin / wpsint / impl_0_4_0 / operation / streetsmap / Process_GetMap.java @ 26512
History | View | Annotate | Download (19.4 KB)
1 |
/*
|
---|---|
2 |
* ============================================================================
|
3 |
* Copyright 2006 Government of Canada
|
4 |
*
|
5 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
* you may not use this file except in compliance with the License.
|
7 |
* You may obtain a copy of the License at
|
8 |
*
|
9 |
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
*
|
11 |
* Unless required by applicable law or agreed to in writing, software
|
12 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
* See the License for the specific language governing permissions and
|
15 |
* limitations under the License.
|
16 |
* ============================================================================
|
17 |
*/
|
18 |
/*
|
19 |
$Id:
|
20 |
$HeadURL:
|
21 |
*/
|
22 |
|
23 |
/*
|
24 |
** ** ******* ***** ***** ** ** *****
|
25 |
** ** ** ** ** ** ** ** ** ** **
|
26 |
** ** ** ** ** ** ** *** ** ** ** ***
|
27 |
** ** ** ******* ***** ** * ** ** ** ** * **
|
28 |
** ** ** ** ** *** ** ******* *** **
|
29 |
** ** ** ** ** ** ** ** ** ** ** ** **
|
30 |
******* ** ***** ***** ** ** ** *****
|
31 |
Generated from WPS 0.4.0 Code Generator Tool version 0.9.0 at Thu Feb 21 12:05:11 GMT+01:00 2008 By PS, RC, MC
|
32 |
*/
|
33 |
|
34 |
package org.tigris.frogs.plugin.wpsint.impl_0_4_0.operation.streetsmap; |
35 |
|
36 |
import java.awt.geom.Rectangle2D; |
37 |
import java.io.*; |
38 |
import java.math.BigInteger; |
39 |
import java.util.Iterator; |
40 |
import java.util.List; |
41 |
|
42 |
import org.apache.commons.logging.Log; |
43 |
import org.apache.commons.logging.LogFactory; |
44 |
|
45 |
import org.tigris.frogs.InitParameters; |
46 |
import org.tigris.frogs.OWSExceptionVersion1_0_0; |
47 |
import org.tigris.frogs.commons.*; |
48 |
import org.tigris.frogs.plugin.wpsint.impl_0_4_0.*; |
49 |
import org.tigris.frogs.plugin.wpsint.impl_0_4_0.DataOutputsType.ValueFormChoice; |
50 |
import org.tigris.frogs.StandardSessionDataRequested; |
51 |
import es.logex.callejero.core.Callejero; |
52 |
import es.logex.callejero.core.LayerFile; |
53 |
import es.logex.callejero.modelo.BoundingBox; |
54 |
import es.logex.utils.Manager; |
55 |
import es.logex.utils.WPSConfiguration; |
56 |
/**
|
57 |
* To be documented
|
58 |
*
|
59 |
*/
|
60 |
public class Process_GetMap extends ProcessDeclarationRunnable { |
61 |
|
62 |
// Logger object for logging in this class
|
63 |
protected final Log logger = LogFactory.getLog(getClass()); |
64 |
|
65 |
// ---- DESCRIBEPROCESS REQUEST/RESPONSE SECTION
|
66 |
private final static String VERSION = "0.1.0"; |
67 |
private final static String PROCESSNAME = "GetMap"; |
68 |
private InputType[] inputs = null; |
69 |
private OutputType[] outputs = null; |
70 |
private org.tigris.frogs.ows.CodeType codeProcess = null; |
71 |
|
72 |
// ---- EXECUTE REQUEST/RESPONSE SECTION
|
73 |
private org.tigris.frogs.ows.ExceptionReportType processFailedExceptionReport = null; |
74 |
private DataOutputsType[] responseProcessOutputs = null; |
75 |
private ExecuteRequestType executeProcess = null; |
76 |
private ByteArrayOutputStream pureOutBytes = null; |
77 |
private boolean sendXMLResponseBack = true; |
78 |
|
79 |
private LocalizationTextProcess textProcess = null; |
80 |
|
81 |
// INPUTS and OUTPUTS defined
|
82 |
private InputType argInputdetailLevel = null; |
83 |
private InputType argInputlayerName = null; |
84 |
private InputType argInputbBox = null; |
85 |
private OutputType argOutputUrisOut = null; |
86 |
|
87 |
|
88 |
/* (non-Javadoc)
|
89 |
* @see org.tigris.frogs.plugin.wpsint.impl_0_4_0.ProcessDeclarationRunnable#initialize(java.lang.String)
|
90 |
*/
|
91 |
public void initialize() throws OWSExceptionVersion1_0_0, Throwable { |
92 |
|
93 |
// Create Text Object to retrieve Localization Info
|
94 |
this.textProcess = new LocalizationTextProcess(PROCESSNAME); |
95 |
this.textProcess.setLanguage( getOperationLanguage() );
|
96 |
|
97 |
// Define the process name
|
98 |
this.codeProcess = new org.tigris.frogs.plugin.wpsint.Code(); |
99 |
this.codeProcess.setValue( PROCESSNAME );
|
100 |
|
101 |
// Create all inputs and outputs
|
102 |
this.argInputdetailLevel = getInputdetailLevel();
|
103 |
this.argInputlayerName = getInputlayerName();
|
104 |
this.argInputbBox = getInputbBox();
|
105 |
this.argOutputUrisOut = getOutputUrisOut();
|
106 |
|
107 |
|
108 |
// Put as many Input you want to be used for your process
|
109 |
this.inputs = new InputType[] { |
110 |
this.argInputdetailLevel,
|
111 |
this.argInputlayerName,
|
112 |
this.argInputbBox,
|
113 |
}; |
114 |
|
115 |
// Put as many Ouput you want to be served for output
|
116 |
this.outputs = new OutputType[] { |
117 |
this.argOutputUrisOut,
|
118 |
}; |
119 |
|
120 |
} |
121 |
/* (non-Javadoc)
|
122 |
* @see org.tigris.frogs.plugin.wpsint.impl_0_4_0.ProcessDeclarationRunnable#test()
|
123 |
*/
|
124 |
public void test() throws org.tigris.frogs.OWSExceptionVersion1_0_0, Throwable { |
125 |
// Put your operation unit test here
|
126 |
} |
127 |
|
128 |
/**
|
129 |
* To be documented
|
130 |
*
|
131 |
* @param newExecuteProcess
|
132 |
* @throws org.tigris.frogs.OWSExceptionVersion1_0_0
|
133 |
* @throws Throwable
|
134 |
*
|
135 |
*/
|
136 |
public void run(ExecuteRequestType newExecuteProcess) throws OWSExceptionVersion1_0_0, Throwable { |
137 |
// Compute Elapse Time Total end-to-end
|
138 |
long startTimeTotal = System.currentTimeMillis(); |
139 |
String elapse;
|
140 |
String inputLayerName = ""; |
141 |
|
142 |
// Don't try exception, it will be catch by the PlugIn
|
143 |
this.executeProcess = newExecuteProcess;
|
144 |
|
145 |
// Always direct answer if a direct response to the client is asked with no possibility to store
|
146 |
this.sendXMLResponseBack = true; |
147 |
|
148 |
try {
|
149 |
|
150 |
Callejero callejero = null;
|
151 |
Rectangle2D rec2D = null; |
152 |
inputLayerName = getInputValue(this.argInputlayerName, ""); |
153 |
Double[] lowersExtent = WpsUtils.getRequestInputLowerCorner(this.argInputbBox,this.executeProcess); |
154 |
Double[] uppersExtent = WpsUtils.getRequestInputUpperCorner(this.argInputbBox,this.executeProcess); |
155 |
String crsExtent = WpsUtils.getRequestInputCrs(this.argInputbBox,this.executeProcess); |
156 |
BigInteger dimensionsExtent = WpsUtils.getRequestInputDimensions(this.argInputbBox,this.executeProcess); |
157 |
String inputDetailLevel = getInputValue(this.argInputdetailLevel, ""); |
158 |
|
159 |
if ( this.executeProcess.isSimulation() ) { |
160 |
// This flag indicates that you are being called from the main.
|
161 |
// Useful to test different scenario without any call from the Internet
|
162 |
|
163 |
//OutputComplexData ocd = new OutputComplexData();
|
164 |
ValueFormChoice value = DataOutputs.newValueFormChoiceImpl(); |
165 |
ExecuteComplexDataReference ecd = new ExecuteComplexDataReference();
|
166 |
ecd.setReference("http://www.logex.es");
|
167 |
value.setComplexValueReferenceOr(ecd); |
168 |
|
169 |
|
170 |
DataOutputs dataOutputs = new DataOutputs();
|
171 |
dataOutputs.setOutputFormChoice(value); |
172 |
responseProcessOutputs = new DataOutputsType[] { dataOutputs }; |
173 |
|
174 |
} |
175 |
else {
|
176 |
|
177 |
// Send XML directly to the client. Might override your behavior asked. Just remove it
|
178 |
// this.sendXMLResponseBack = false;
|
179 |
|
180 |
Manager mgr = Manager.getInstance(); |
181 |
|
182 |
/* if (inputLayerName == null || inputLayerName == "") {
|
183 |
//devolvemos todas las layers.
|
184 |
List list = WPSConfiguration.getInstance().getLayerList();
|
185 |
responseProcessOutputs = new DataOutputsType[list.size()];
|
186 |
Iterator itr = list.iterator();
|
187 |
int i = 0;
|
188 |
while (itr.hasNext()) {
|
189 |
String layerName = (String)itr.next();
|
190 |
|
191 |
if (lowersExtent[0] == 0 && lowersExtent[1] == 0 &&
|
192 |
uppersExtent[0] == 0 && uppersExtent[1] == 0) {
|
193 |
//coger el máximo extent de la capa.
|
194 |
callejero = new Callejero(mgr.connect());
|
195 |
rec2D = callejero.getMaxExtent(layerName);
|
196 |
lowersExtent[0] = rec2D.getMinX();
|
197 |
lowersExtent[1] = rec2D.getMinY();
|
198 |
|
199 |
uppersExtent[0] = rec2D.getMaxX();
|
200 |
uppersExtent[1] = rec2D.getMaxY();
|
201 |
|
202 |
}
|
203 |
|
204 |
BoundingBox box = new BoundingBox(lowersExtent, uppersExtent,crsExtent);
|
205 |
|
206 |
LayerFile layer = new LayerFile(layerName, mgr.connect());
|
207 |
File file = layer.FromDbToFile(box);
|
208 |
|
209 |
ValueFormChoice value = DataOutputs.newValueFormChoiceImpl();
|
210 |
ExecuteComplexDataReference ecd = new ExecuteComplexDataReference(WPSConfiguration.getInstance().getHost() + file.getName(), null, "UTF-8", "");
|
211 |
|
212 |
value.setComplexValueReferenceOr(ecd);
|
213 |
DataOutputs dataOutputs = new DataOutputs();
|
214 |
dataOutputs.setOutputFormChoice(value);
|
215 |
|
216 |
responseProcessOutputs[i] = dataOutputs;
|
217 |
layer = null;
|
218 |
|
219 |
i++;
|
220 |
}
|
221 |
|
222 |
|
223 |
} else {*/
|
224 |
/*if (lowersExtent[0] == 0 && lowersExtent[1] == 0 &&
|
225 |
uppersExtent[0] == 0 && uppersExtent[1] == 0) {
|
226 |
//coger el máximo extent de la capa.
|
227 |
callejero = new Callejero(mgr.connect());
|
228 |
rec2D = callejero.getMaxExtent(inputLayerName);
|
229 |
lowersExtent[0] = rec2D.getMinX();
|
230 |
lowersExtent[1] = rec2D.getMinY();
|
231 |
|
232 |
uppersExtent[0] = rec2D.getMaxX();
|
233 |
uppersExtent[1] = rec2D.getMaxY();
|
234 |
|
235 |
} */
|
236 |
|
237 |
BoundingBox box = new BoundingBox(lowersExtent, uppersExtent,crsExtent);
|
238 |
|
239 |
|
240 |
LayerFile layer = new LayerFile(inputLayerName, mgr.connect());
|
241 |
File file = layer.FromDbToFile(box);
|
242 |
|
243 |
ValueFormChoice value = DataOutputs.newValueFormChoiceImpl(); |
244 |
ExecuteComplexDataReference ecd = new ExecuteComplexDataReference(WPSConfiguration.getInstance().getHost() + file.getName(), null, "UTF-8", ""); |
245 |
value.setComplexValueReferenceOr(ecd); |
246 |
|
247 |
DataOutputs dataOutputs = new DataOutputs();
|
248 |
dataOutputs.setOutputFormChoice(value); |
249 |
responseProcessOutputs = new DataOutputsType[] { dataOutputs }; |
250 |
} |
251 |
|
252 |
|
253 |
} |
254 |
// These error must be sent as is to the client
|
255 |
// start
|
256 |
/*catch (OWSException ex) {
|
257 |
throw ex;
|
258 |
}*/
|
259 |
// end
|
260 |
|
261 |
// If we reach this point, the error can't be handled properly
|
262 |
// You could fine tune your exception handling
|
263 |
// start
|
264 |
catch (Throwable ex) { |
265 |
warn("Throwable in running this class [" + this.getClass().getName() + "]"); |
266 |
throw new StreetsMapException("General", getOperationLanguage(), ex); |
267 |
} |
268 |
// end
|
269 |
|
270 |
finally {
|
271 |
long endTimeTotal = System.currentTimeMillis(); |
272 |
elapse = Long.toString( endTimeTotal - startTimeTotal );
|
273 |
warn(this.getClass().getName() + " elapsed time total:" + elapse); |
274 |
} |
275 |
|
276 |
} |
277 |
|
278 |
@Override
|
279 |
public boolean isProcessSucceeded() { |
280 |
return true; |
281 |
} |
282 |
|
283 |
@Override
|
284 |
public boolean isProcessAccepted(){ |
285 |
return false; |
286 |
} |
287 |
|
288 |
@Override
|
289 |
public boolean isProcessStarted(){ |
290 |
return false; |
291 |
} |
292 |
|
293 |
/* (non-Javadoc)
|
294 |
* @see org.tigris.frogs.plugin.wpsint.impl_0_4_0.ProcessDeclarationRunnable#terminate()
|
295 |
*/
|
296 |
public void terminate() { |
297 |
// Clean Up: You should cleanp all your objects before leaving
|
298 |
|
299 |
// Loop inputs and outputs
|
300 |
this.argInputdetailLevel = null; |
301 |
this.argInputlayerName = null; |
302 |
this.argInputbBox = null; |
303 |
this.argOutputUrisOut = null; |
304 |
|
305 |
if ( this.inputs != null ) { |
306 |
for (int index=0; index<this.inputs.length; index++) |
307 |
this.inputs[index] = null; |
308 |
this.inputs = null; |
309 |
} |
310 |
if ( this.outputs != null ) { |
311 |
for (int index=0; index<this.outputs.length; index++) |
312 |
this.outputs[index] = null; |
313 |
this.outputs = null; |
314 |
} |
315 |
this.textProcess = null; |
316 |
} |
317 |
|
318 |
/**
|
319 |
* To be documented
|
320 |
*
|
321 |
* @return org.tigris.frogs.ows.CodeType
|
322 |
*
|
323 |
*/
|
324 |
public org.tigris.frogs.ows.CodeType getIdentifier() {
|
325 |
return this.codeProcess; |
326 |
} |
327 |
|
328 |
/* (non-Javadoc)
|
329 |
* @see org.tigris.frogs.plugin.wpsint.impl_0_4_0.ProcessDeclaration#getAbstract()
|
330 |
*/
|
331 |
public String getAbstract() { |
332 |
return this.textProcess.getAbstract(); |
333 |
} |
334 |
|
335 |
/* (non-Javadoc)
|
336 |
* @see org.tigris.frogs.plugin.wpsint.impl_0_4_0.ProcessDeclaration#getTitle()
|
337 |
*/
|
338 |
public String getTitle() { |
339 |
return this.textProcess.getTitle(); |
340 |
} |
341 |
|
342 |
/**
|
343 |
* To be documented
|
344 |
*
|
345 |
* @return String
|
346 |
*
|
347 |
*/
|
348 |
public String getVersion() { |
349 |
return VERSION;
|
350 |
} |
351 |
|
352 |
/**
|
353 |
* To be documented
|
354 |
*
|
355 |
* @return InputType[]
|
356 |
*
|
357 |
*/
|
358 |
public InputType[] getInputs() { |
359 |
return this.inputs; |
360 |
} |
361 |
|
362 |
|
363 |
/**
|
364 |
* To be documented
|
365 |
*
|
366 |
* @return OutputType[]
|
367 |
*
|
368 |
*/
|
369 |
public OutputType[] getOutputs() { |
370 |
return this.outputs; |
371 |
} |
372 |
|
373 |
|
374 |
/**
|
375 |
* To be documented
|
376 |
*
|
377 |
* @return org.tigris.frogs.ows.ExceptionReportType
|
378 |
*
|
379 |
*/
|
380 |
public org.tigris.frogs.ows.ExceptionReportType getProcessFailedExceptionReport() {
|
381 |
return this.processFailedExceptionReport; |
382 |
} |
383 |
|
384 |
/**
|
385 |
* To be documented
|
386 |
*
|
387 |
* @return DataOutputsType[]
|
388 |
*
|
389 |
*/
|
390 |
public DataOutputsType[] getResponseDataOutputs() { |
391 |
return this.responseProcessOutputs; |
392 |
} |
393 |
|
394 |
/**
|
395 |
* To be documented
|
396 |
*
|
397 |
* @return ByteArrayOutputStream
|
398 |
*
|
399 |
*/
|
400 |
public ByteArrayOutputStream getOut() { |
401 |
return this.pureOutBytes; |
402 |
} |
403 |
|
404 |
/**
|
405 |
* To be documented
|
406 |
*
|
407 |
* @return boolean
|
408 |
*
|
409 |
*/
|
410 |
public boolean isSendXMLResponseBack() { |
411 |
return this.sendXMLResponseBack; |
412 |
} |
413 |
|
414 |
/**
|
415 |
* To be documented
|
416 |
*
|
417 |
* @return String
|
418 |
*
|
419 |
*/
|
420 |
public String getOutCharset() { |
421 |
return "UTF-8"; |
422 |
} |
423 |
|
424 |
|
425 |
/**
|
426 |
* To be documented
|
427 |
*
|
428 |
* @return String
|
429 |
*
|
430 |
*/
|
431 |
public String getOutMimeType() { |
432 |
return "text/xml"; |
433 |
} |
434 |
|
435 |
public boolean getStoreSupported() { |
436 |
return true; |
437 |
} |
438 |
|
439 |
/**
|
440 |
* To be documented
|
441 |
*
|
442 |
* @return boolean
|
443 |
*
|
444 |
*/
|
445 |
public boolean getStatusSupported() { |
446 |
return true; |
447 |
} |
448 |
|
449 |
/**
|
450 |
* To be documented
|
451 |
*
|
452 |
* @return InputType
|
453 |
*
|
454 |
*/
|
455 |
static final String FIELD_NAME_detailLevel = "detailLevel"; |
456 |
private InputType getInputdetailLevel() {
|
457 |
|
458 |
// // Optional
|
459 |
Input input = new Input(FIELD_NAME_detailLevel,false); |
460 |
|
461 |
input.setAbstract( textProcess.getFieldAbstract(FIELD_NAME_detailLevel) ); |
462 |
input.setTitle( textProcess.getFieldTitle(FIELD_NAME_detailLevel) ); |
463 |
|
464 |
WpsUtils.createLiteralValue(input,null,null,null,null,false); |
465 |
|
466 |
return input;
|
467 |
} |
468 |
|
469 |
/**
|
470 |
* To be documented
|
471 |
*
|
472 |
* @return InputType
|
473 |
*
|
474 |
*/
|
475 |
static final String FIELD_NAME_layerName = "layerName"; |
476 |
private InputType getInputlayerName() {
|
477 |
|
478 |
// // Optional
|
479 |
Input input = new Input(FIELD_NAME_layerName,false); |
480 |
|
481 |
input.setAbstract( textProcess.getFieldAbstract(FIELD_NAME_layerName) ); |
482 |
input.setTitle( textProcess.getFieldTitle(FIELD_NAME_layerName) ); |
483 |
|
484 |
WpsUtils.createLiteralValue(input,null,null,null,null,false); |
485 |
|
486 |
return input;
|
487 |
} |
488 |
|
489 |
/**
|
490 |
* To be documented
|
491 |
*
|
492 |
* @return InputType
|
493 |
*
|
494 |
*/
|
495 |
static final String FIELD_NAME_bBox = "bBox"; |
496 |
private InputType getInputbBox() {
|
497 |
|
498 |
// // Mondatory
|
499 |
Input input = new Input(FIELD_NAME_bBox,true); |
500 |
|
501 |
input.setAbstract( textProcess.getFieldAbstract(FIELD_NAME_bBox) ); |
502 |
input.setTitle( textProcess.getFieldTitle(FIELD_NAME_bBox) ); |
503 |
|
504 |
WpsUtils.createBoundingBoxValue(input,null,null); |
505 |
|
506 |
return input;
|
507 |
} |
508 |
|
509 |
/**
|
510 |
* To be documented
|
511 |
*
|
512 |
* @return OutputType
|
513 |
*
|
514 |
*/
|
515 |
static final String FIELD_NAME_UrisOut = "UrisOut"; |
516 |
private OutputType getOutputUrisOut() {
|
517 |
|
518 |
Output output = new Output(FIELD_NAME_UrisOut);
|
519 |
|
520 |
output.setAbstract( textProcess.getFieldAbstract(FIELD_NAME_UrisOut) ); |
521 |
output.setTitle( textProcess.getFieldTitle(FIELD_NAME_UrisOut) ); |
522 |
|
523 |
WpsUtils.createComplexData(output,getOutMimeType(),getOutCharset(),"");
|
524 |
|
525 |
return output;
|
526 |
} |
527 |
|
528 |
/**
|
529 |
* To be documented
|
530 |
*
|
531 |
* @param inputParameter
|
532 |
* @param defaultValue
|
533 |
* @return String
|
534 |
*
|
535 |
*/
|
536 |
private String getInputValue( |
537 |
InputType inputParameter, |
538 |
String defaultValue ) {
|
539 |
|
540 |
Object[] Field_Method_Values = WpsUtils.getRequestInputValue(inputParameter, this.executeProcess); |
541 |
if ( ! Utils.isEmptyObject(Field_Method_Values) )
|
542 |
return (String)Field_Method_Values[0]; |
543 |
else
|
544 |
return defaultValue;
|
545 |
} |
546 |
|
547 |
/**
|
548 |
* To be documented
|
549 |
*
|
550 |
* @param inputParameter
|
551 |
* @param defaultValue
|
552 |
* @return String
|
553 |
*
|
554 |
*/
|
555 |
private String getInputFormat( |
556 |
InputType inputParameter, |
557 |
String defaultValue ) {
|
558 |
|
559 |
String value = WpsUtils.getRequestInputFormat(inputParameter,this.executeProcess); |
560 |
if ( ! Utils.isEmptyString(value) )
|
561 |
return value;
|
562 |
else
|
563 |
return defaultValue;
|
564 |
} |
565 |
|
566 |
/**
|
567 |
* To be documented
|
568 |
*
|
569 |
* @param inputParameter
|
570 |
* @param defaultValue
|
571 |
* @return String
|
572 |
*
|
573 |
*/
|
574 |
private String getInputEncoding( |
575 |
InputType inputParameter, |
576 |
String defaultValue ) {
|
577 |
|
578 |
String value = WpsUtils.getRequestInputEncoding(inputParameter,this.executeProcess); |
579 |
if ( ! Utils.isEmptyString(value) )
|
580 |
return value;
|
581 |
else
|
582 |
return defaultValue;
|
583 |
} |
584 |
|
585 |
|
586 |
/**
|
587 |
* Message to display in debug mode
|
588 |
*
|
589 |
* @param message
|
590 |
*
|
591 |
*/
|
592 |
private void log(String message) { |
593 |
if ( logger.isTraceEnabled() ) { logger.debug(message) ; }
|
594 |
} |
595 |
|
596 |
/**
|
597 |
* Message to display in warning mode with a tracable Exception
|
598 |
*
|
599 |
* @param message
|
600 |
* @param exception
|
601 |
*
|
602 |
*/
|
603 |
private void warn(String message) { |
604 |
logger.warn(message); |
605 |
} |
606 |
|
607 |
/**
|
608 |
* Message to display in error mode with a tracable Exception
|
609 |
*
|
610 |
* @param message
|
611 |
* @param exception
|
612 |
*
|
613 |
*/
|
614 |
private void error(String message, Throwable ex) { |
615 |
logger.error(message,ex); |
616 |
} |
617 |
|
618 |
|
619 |
/**
|
620 |
* Main Unit Test without be invked by the FROGS Framework
|
621 |
*/
|
622 |
public static void main(String[] args) { |
623 |
|
624 |
System.out.println("Simulating from main..."); |
625 |
|
626 |
try {
|
627 |
InitParameters inits = new InitParameters();
|
628 |
// If needed
|
629 |
//inits.add("name", "value", "decription");
|
630 |
|
631 |
ProcessDeclarationRunnable.simulateCallProcess |
632 |
( |
633 |
new StandardSessionDataRequested(
|
634 |
"http://server/test123",
|
635 |
"http://server/test123",
|
636 |
org.tigris.frogs.plugin.wpsint.Constants.REQUEST_EXECUTE, |
637 |
StandardSessionDataRequested.NOT_DEFINED_YET, |
638 |
StandardSessionDataRequested.NOT_DEFINED_YET, |
639 |
StandardSessionDataRequested.NOT_DEFINED_YET, |
640 |
StandardSessionDataRequested.NOT_DEFINED_YET, |
641 |
false,false,false, |
642 |
Language.getDefaultCode()), |
643 |
inits, |
644 |
new Process_GetMap(),
|
645 |
new SimulateDataValueType[] { |
646 |
new SimulateDataValueLiteral(FIELD_NAME_detailLevel, "test", null, null) |
647 |
, new SimulateDataValueLiteral(FIELD_NAME_layerName, "test", null, null) |
648 |
, new SimulateDataValueBoundingBox(FIELD_NAME_bBox, new Double[] { new Double(0), new Double(1) }, new Double[] { new Double(3), new Double(4) }, new java.math.BigInteger("2"), "EPSG" ) |
649 |
, } |
650 |
); |
651 |
System.out.println("Execute done!"); |
652 |
} |
653 |
// Throw Error
|
654 |
catch (Throwable ex) { |
655 |
System.err.println("nop???"); |
656 |
} |
657 |
|
658 |
System.out.println("Over!!!"); |
659 |
} |
660 |
|
661 |
} |