comparison gnv-artifacts/src/main/java/de/intevation/gnv/state/StateBase.java @ 796:a5526908f92f

Added javadoc in state package. gnv-artifacts/trunk@878 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 01 Apr 2010 09:15:36 +0000
parents c4156275c1e1
children feae2f9d6c6f
comparison
equal deleted inserted replaced
795:cdade5005cba 796:a5526908f92f
53 import org.w3c.dom.Element; 53 import org.w3c.dom.Element;
54 import org.w3c.dom.Node; 54 import org.w3c.dom.Node;
55 import org.w3c.dom.NodeList; 55 import org.w3c.dom.NodeList;
56 56
57 /** 57 /**
58 * This is the major implementation of <code>State</code>. Nearly every other
59 * state is derived by this class.
60 *
58 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> 61 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
59 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> 62 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
60 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> 63 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a>
61 */ 64 */
62 public abstract class StateBase implements State { 65 public abstract class StateBase implements State {
69 /** 72 /**
70 * the logger, used to log exceptions and additonaly information 73 * the logger, used to log exceptions and additonaly information
71 */ 74 */
72 private static Logger log = Logger.getLogger(StateBase.class); 75 private static Logger log = Logger.getLogger(StateBase.class);
73 76
77 /**
78 *
79 */
74 protected final static String MINVALUEFIELDNAME = "minvalue"; 80 protected final static String MINVALUEFIELDNAME = "minvalue";
81 /**
82 *
83 */
75 protected final static String MAXVALUEFIELDNAME = "maxvalue"; 84 protected final static String MAXVALUEFIELDNAME = "maxvalue";
76 85
77 private final static String NODATASELECTIONKEY = "n/n"; 86 private final static String NODATASELECTIONKEY = "n/n";
78 87
88 /**
89 *
90 */
79 public final static String DESCRIBEDATAKEY = "_DESCRIBEDATA"; 91 public final static String DESCRIBEDATAKEY = "_DESCRIBEDATA";
80 92
93 /**
94 *
95 */
81 public final static String XPATH_STATIC_UI = "art:static"; 96 public final static String XPATH_STATIC_UI = "art:static";
97 /**
98 *
99 */
82 public final static String XPATH_DYNAMIC_UI = "art:dynamic"; 100 public final static String XPATH_DYNAMIC_UI = "art:dynamic";
83 101
102 /**
103 *
104 */
84 public static final String EXCEPTION_NO_INPUT = "no.input.data"; 105 public static final String EXCEPTION_NO_INPUT = "no.input.data";
106 /**
107 *
108 */
85 public static final String EXCEPTION_INVALID_INPUT = 109 public static final String EXCEPTION_INVALID_INPUT =
86 "input.is.not.valid"; 110 "input.is.not.valid";
87 111
88 /** input value names which should not be rendered from State itself */ 112 /** input value names which should not be rendered from State itself */
89 public final static String[] BLACKLIST = {"sourceid", "fisname"}; 113 public final static String[] BLACKLIST = {"sourceid", "fisname"};
90 114
91 private String id = null; 115 private String id = null;
92 116
117 /**
118 *
119 */
93 protected String hash; 120 protected String hash;
94 121
95 private String description = null; 122 private String description = null;
96 123
124 /**
125 *
126 */
97 protected String dataName = null; 127 protected String dataName = null;
98 128
129 /**
130 *
131 */
99 protected String preSettingsName = null; 132 protected String preSettingsName = null;
100 133
134 /**
135 *
136 */
101 protected boolean dataMultiSelect = false; 137 protected boolean dataMultiSelect = false;
102 138
139 /**
140 *
141 */
103 protected boolean dataNoSelect = false; 142 protected boolean dataNoSelect = false;
104 143
144 /**
145 *
146 */
105 protected String queryID = null; 147 protected String queryID = null;
106 148
149 /**
150 *
151 */
107 protected Collection<String> inputValueNames = null; 152 protected Collection<String> inputValueNames = null;
108 153
154 /**
155 *
156 */
109 protected Map<String, InputValue> inputValues = null; 157 protected Map<String, InputValue> inputValues = null;
110 158
159 /**
160 *
161 */
111 protected State parent = null; 162 protected State parent = null;
112 163
164 /**
165 *
166 */
113 protected Map<String, InputData> inputData = null; 167 protected Map<String, InputData> inputData = null;
114 168
169 /**
170 *
171 */
115 protected Map<String, InputData> preSettings = null; 172 protected Map<String, InputData> preSettings = null;
116 173
117 /** 174 /**
118 * Constructor 175 * Constructor
119 */ 176 */
120 public StateBase() { 177 public StateBase() {
121 super(); 178 super();
122 } 179 }
123 180
124 /** 181 /**
125 * @see de.intevation.gnv.state.State#getID() 182 * @return
126 */ 183 */
127 public String getID() { 184 public String getID() {
128 return this.id; 185 return this.id;
129 } 186 }
130 187
131 /** 188 /**
132 * @see de.intevation.gnv.state.State#getDescription() 189 * @return
133 */ 190 */
134 public String getDescription() { 191 public String getDescription() {
135 return this.description; 192 return this.description;
136 } 193 }
137 194
138 195
139 196
140 /** 197 /**
141 * @see de.intevation.gnv.state.State#getRequiredInputValues() 198 * @return
142 */ 199 */
143 public Collection<InputValue> getRequiredInputValues() { 200 public Collection<InputValue> getRequiredInputValues() {
144 return this.inputValues.values(); 201 return this.inputValues.values();
145 } 202 }
146 203
147 204
205 /**
206 *
207 * @param uuid
208 */
148 public void reset(String uuid) { 209 public void reset(String uuid) {
149 inputData.remove(dataName); 210 inputData.remove(dataName);
150 } 211 }
151 212
152 213
153 /** 214 /**
215 * @param configuration
154 * @see de.intevation.gnv.state.State#setup(org.w3c.dom.Node) 216 * @see de.intevation.gnv.state.State#setup(org.w3c.dom.Node)
155 */ 217 */
156 public void setup(Node configuration) { 218 public void setup(Node configuration) {
157 this.id = ((Element)configuration).getAttribute("id"); 219 this.id = ((Element)configuration).getAttribute("id");
158 this.description = ((Element)configuration).getAttribute("description"); 220 this.description = ((Element)configuration).getAttribute("description");
205 this.preSettingsName = Config.getStringXPath(configuration, "presettings-name"); 267 this.preSettingsName = Config.getStringXPath(configuration, "presettings-name");
206 268
207 } 269 }
208 270
209 /** 271 /**
272 * @return
210 * @see de.intevation.gnv.state.State#getParent() 273 * @see de.intevation.gnv.state.State#getParent()
211 */ 274 */
212 public State getParent() { 275 public State getParent() {
213 return this.parent; 276 return this.parent;
214 } 277 }
215 278
216 /** 279 /**
280 * @param state
217 * @see de.intevation.gnv.state.State#setParent(de.intevation.gnv.state.State) 281 * @see de.intevation.gnv.state.State#setParent(de.intevation.gnv.state.State)
218 */ 282 */
219 public void setParent(State state) { 283 public void setParent(State state) {
220 this.parent = state; 284 this.parent = state;
221 } 285 }
222 286
223 287
288 /**
289 *
290 * @param context
291 * @param inputData
292 * @param uuid
293 * @return
294 * @throws StateException
295 */
224 public Document feed( 296 public Document feed(
225 CallContext context, 297 CallContext context,
226 Collection<InputData> inputData, 298 Collection<InputData> inputData,
227 String uuid) 299 String uuid)
228 throws StateException 300 throws StateException
242 if (this.inputData == null) { 314 if (this.inputData == null) {
243 this.inputData = new HashMap<String, InputData>( 315 this.inputData = new HashMap<String, InputData>(
244 inputData.size()); 316 inputData.size());
245 } 317 }
246 318
247 boolean valid = iv.isInputValid(tmpItem.getValue(), 319 @SuppressWarnings("static-access")
320 boolean valid = InputValidator.isInputValid(tmpItem.getValue(),
248 inputValue.getType()); 321 inputValue.getType());
249 if (valid) { 322 if (valid) {
250 323
251 if (tmpItem.getName().equals(this.dataName)){ 324 if (tmpItem.getName().equals(this.dataName)){
252 String[] desc = getDescriptionForInputData(tmpItem, uuid); 325 String[] desc = getDescriptionForInputData(tmpItem, uuid);
283 return feedFailure(msg); 356 return feedFailure(msg);
284 } 357 }
285 } 358 }
286 359
287 360
361 /**
362 *
363 * @return
364 */
288 protected Document feedSuccess() { 365 protected Document feedSuccess() {
289 return ArtifactXMLUtilities.createSuccessReport( 366 return ArtifactXMLUtilities.createSuccessReport(
290 "Initialize success", XMLUtils.newDocument()); 367 "Initialize success", XMLUtils.newDocument());
291 } 368 }
292 369
293 370
371 /**
372 *
373 * @param msg
374 * @return
375 */
294 protected Document feedFailure(String msg) { 376 protected Document feedFailure(String msg) {
295 return ArtifactXMLUtilities.createInputExceptionReport( 377 return ArtifactXMLUtilities.createInputExceptionReport(
296 msg, XMLUtils.newDocument()); 378 msg, XMLUtils.newDocument());
297 } 379 }
298 380
299 381
382 /**
383 *
384 * @param data
385 * @param uuid
386 * @return
387 */
300 protected String[] getDescriptionForInputData(InputData data, String uuid) { 388 protected String[] getDescriptionForInputData(InputData data, String uuid) {
301 // there is only one element in the list, so take the first 389 // there is only one element in the list, so take the first
302 Object obj = getDescibeData(uuid).get(0); 390 Object obj = getDescibeData(uuid).get(0);
303 List descs = new ArrayList(); 391 List descs = new ArrayList();
304 392
334 return (String[]) descs.toArray(new String[descs.size()]); 422 return (String[]) descs.toArray(new String[descs.size()]);
335 } 423 }
336 424
337 425
338 /** 426 /**
427 * @param inputData
428 * @param uuid
429 * @throws StateException
339 * @see de.intevation.gnv.state.State#putInputData(java.util.Collection) 430 * @see de.intevation.gnv.state.State#putInputData(java.util.Collection)
340 */ 431 */
432 @SuppressWarnings({"static-access", "static-access", "static-access", "static-access"})
341 public void putInputData(Collection<InputData> inputData, String uuid) 433 public void putInputData(Collection<InputData> inputData, String uuid)
342 throws StateException { 434 throws StateException {
343 if (inputData != null) { 435 if (inputData != null) {
344 Iterator<InputData> it = inputData.iterator(); 436 Iterator<InputData> it = inputData.iterator();
345 InputValidator iv = new InputValidator(); 437 InputValidator iv = new InputValidator();
350 if (this.inputData == null) { 442 if (this.inputData == null) {
351 this.inputData = new HashMap<String, InputData>( 443 this.inputData = new HashMap<String, InputData>(
352 inputData.size()); 444 inputData.size());
353 } 445 }
354 446
355 boolean valid = iv.isInputValid(tmpItem.getValue(), 447 @SuppressWarnings("static-access")
448 boolean valid = InputValidator.isInputValid(tmpItem.getValue(),
356 inputValue.getType()); 449 inputValue.getType());
357 if (valid) { 450 if (valid) {
358 if (tmpItem.getName().equals(MINVALUEFIELDNAME)){ 451 if (tmpItem.getName().equals(MINVALUEFIELDNAME)){
359 String minValue = tmpItem.getValue(); 452 String minValue = tmpItem.getValue();
360 String maxValue = this.getInputValue4ID(inputData, MAXVALUEFIELDNAME); 453 String maxValue = this.getInputValue4ID(inputData, MAXVALUEFIELDNAME);
361 valid = iv.isInputValid(maxValue,inputValue.getType()); 454 valid = InputValidator.isInputValid(maxValue,inputValue.getType());
362 if (!valid){ 455 if (!valid){
363 String errMsg = "Wrong input for " + tmpItem.getValue() 456 String errMsg = "Wrong input for " + tmpItem.getValue()
364 + " is not an " + inputValue.getType() 457 + " is not an " + inputValue.getType()
365 + " Value."; 458 + " Value.";
366 log.warn(errMsg); 459 log.warn(errMsg);
367 throw new StateException(errMsg); 460 throw new StateException(errMsg);
368 } 461 }
369 462
370 valid = iv.isInputValid(minValue, 463 valid = InputValidator.isInputValid(minValue,
371 maxValue, 464 maxValue,
372 inputValue.getType()); 465 inputValue.getType());
373 if (!valid){ 466 if (!valid){
374 String errMsg = "MaxValue-Input is less than MinValue-Input "; 467 String errMsg = "MaxValue-Input is less than MinValue-Input ";
375 log.warn(errMsg); 468 log.warn(errMsg);
376 throw new StateException(errMsg); 469 throw new StateException(errMsg);
377 } 470 }
378 }else if (tmpItem.getName().equals(MAXVALUEFIELDNAME)){ 471 }else if (tmpItem.getName().equals(MAXVALUEFIELDNAME)){
379 String minValue = this.getInputValue4ID(inputData, MINVALUEFIELDNAME); 472 String minValue = this.getInputValue4ID(inputData, MINVALUEFIELDNAME);
380 String maxValue = tmpItem.getValue(); 473 String maxValue = tmpItem.getValue();
381 valid = iv.isInputValid(minValue,inputValue.getType()); 474 valid = InputValidator.isInputValid(minValue,inputValue.getType());
382 if (!valid){ 475 if (!valid){
383 String errMsg = "Wrong input for " + tmpItem.getValue() 476 String errMsg = "Wrong input for " + tmpItem.getValue()
384 + " is not an " + inputValue.getType() 477 + " is not an " + inputValue.getType()
385 + " Value."; 478 + " Value.";
386 log.warn(errMsg); 479 log.warn(errMsg);
387 throw new StateException(errMsg); 480 throw new StateException(errMsg);
388 } 481 }
389 482
390 valid = iv.isInputValid(minValue, 483 valid = InputValidator.isInputValid(minValue,
391 maxValue, 484 maxValue,
392 inputValue.getType()); 485 inputValue.getType());
393 if (!valid){ 486 if (!valid){
394 String errMsg = "MaxValue-Input is less than MinValue-Input "; 487 String errMsg = "MaxValue-Input is less than MinValue-Input ";
395 log.warn(errMsg); 488 log.warn(errMsg);
420 } 513 }
421 514
422 515
423 /** 516 /**
424 * 517 *
518 * @param preSettings
425 * @see de.intevation.gnv.state.State#setPreSettings(java.util.Map) 519 * @see de.intevation.gnv.state.State#setPreSettings(java.util.Map)
426 */ 520 */
427 public void setPreSettings(Map<String, InputData> preSettings) { 521 public void setPreSettings(Map<String, InputData> preSettings) {
428 this.preSettings = preSettings; 522 this.preSettings = preSettings;
429 } 523 }
430 524
431 525
432 526
527 /**
528 *
529 * @return
530 */
433 public Map<String, InputData> getPreSettings() { 531 public Map<String, InputData> getPreSettings() {
434 return this.preSettings; 532 return this.preSettings;
435 } 533 }
436 534
535 /**
536 *
537 * @param inputData
538 * @param inputName
539 * @return
540 */
437 protected String getInputValue4ID(Collection<InputData> inputData, String inputName){ 541 protected String getInputValue4ID(Collection<InputData> inputData, String inputName){
438 Iterator<InputData> it = inputData.iterator(); 542 Iterator<InputData> it = inputData.iterator();
439 while (it.hasNext()) { 543 while (it.hasNext()) {
440 InputData tmpItem = it.next(); 544 InputData tmpItem = it.next();
441 if (tmpItem.getName().equals(inputName)){ 545 if (tmpItem.getName().equals(inputName)){
445 return null; 549 return null;
446 } 550 }
447 551
448 552
449 /** 553 /**
554 * @param uuid
555 * @param context
556 * @throws StateException
450 * @see de.intevation.gnv.state.State#advance(java.lang.String, 557 * @see de.intevation.gnv.state.State#advance(java.lang.String,
451 * de.intevation.artifacts.CallMeta) 558 * de.intevation.artifacts.CallMeta)
452 */ 559 */
453 public void advance(String uuid, CallContext context) 560 public void advance(String uuid, CallContext context)
454 throws StateException 561 throws StateException
455 { 562 {
456 } 563 }
457 564
565 /**
566 *
567 * @param uuid
568 * @param context
569 * @throws StateException
570 */
458 public void initialize(String uuid, CallContext context) 571 public void initialize(String uuid, CallContext context)
459 throws StateException 572 throws StateException
460 { 573 {
461 } 574 }
462 575
493 } 606 }
494 String[] filterValues = list.toArray(new String[list.size()]); 607 String[] filterValues = list.toArray(new String[list.size()]);
495 return filterValues; 608 return filterValues;
496 } 609 }
497 610
611 /**
612 *
613 * @param value
614 * @return
615 */
498 protected String prepareInputData4RegionDBQuery(String value){ 616 protected String prepareInputData4RegionDBQuery(String value){
499 return value; 617 return value;
500 } 618 }
501 619
502 private String prepareInputData4DateDBQuery(String value) { 620 private String prepareInputData4DateDBQuery(String value) {
534 652
535 } 653 }
536 654
537 /** 655 /**
538 * @param result 656 * @param result
657 * @param uuid
658 * @return
539 */ 659 */
540 protected List<Object> purifyResult(Collection<Result> result, String uuid) { 660 protected List<Object> purifyResult(Collection<Result> result, String uuid) {
541 List<Object> describeData = new ArrayList<Object>(); 661 List<Object> describeData = new ArrayList<Object>();
542 662
543 NamedCollection<KeyValueDescibeData> keyValueDescibeData = 663 NamedCollection<KeyValueDescibeData> keyValueDescibeData =
548 return describeData; 668 return describeData;
549 } 669 }
550 670
551 /** 671 /**
552 * @param result 672 * @param result
673 * @param keyid
674 * @param valueid
553 * @return 675 * @return
554 */ 676 */
555 protected NamedCollection<KeyValueDescibeData> extractKVP(Collection<Result> result, 677 protected NamedCollection<KeyValueDescibeData> extractKVP(Collection<Result> result,
556 String keyid, 678 String keyid,
557 String valueid) { 679 String valueid) {
612 } 734 }
613 return keyValueDescibeData; 735 return keyValueDescibeData;
614 } 736 }
615 737
616 738
739 /**
740 *
741 * @param key
742 * @return
743 */
617 public static boolean inBlackList(String key) { 744 public static boolean inBlackList(String key) {
618 int length = BLACKLIST.length; 745 int length = BLACKLIST.length;
619 for (int i = 0; i < length; i++) { 746 for (int i = 0; i < length; i++) {
620 if (BLACKLIST[i].equals(key)) { 747 if (BLACKLIST[i].equals(key)) {
621 return true; 748 return true;
624 751
625 return false; 752 return false;
626 } 753 }
627 754
628 /** 755 /**
756 * @param document
757 * @param rootNode
758 * @param context
759 * @param uuid
629 * @see de.intevation.gnv.state.State#describe(org.w3c.dom.Document, 760 * @see de.intevation.gnv.state.State#describe(org.w3c.dom.Document,
630 * org.w3c.dom.Node, de.intevation.artifacts.CallMeta, 761 * org.w3c.dom.Node, de.intevation.artifacts.CallMeta,
631 * java.lang.String) 762 * java.lang.String)
632 */ 763 */
633 public void describe( 764 public void describe(
673 creator,xCreator, document, staticNode, context,uuid); 804 creator,xCreator, document, staticNode, context,uuid);
674 } 805 }
675 } 806 }
676 807
677 808
809 /**
810 *
811 * @param artCreator
812 * @param creator
813 * @param document
814 * @param dynamic
815 * @param context
816 * @param uuid
817 */
678 protected void describeDynamic( 818 protected void describeDynamic(
679 XMLUtils.ElementCreator artCreator, 819 XMLUtils.ElementCreator artCreator,
680 XMLUtils.ElementCreator creator, 820 XMLUtils.ElementCreator creator,
681 Document document, 821 Document document,
682 Node dynamic, 822 Node dynamic,
701 } 841 }
702 } 842 }
703 } 843 }
704 844
705 845
846 /**
847 *
848 * @param artCreator
849 * @param creator
850 * @param document
851 * @param staticNode
852 * @param context
853 * @param uuid
854 */
706 protected void describeStatic( 855 protected void describeStatic(
707 XMLUtils.ElementCreator artCreator, 856 XMLUtils.ElementCreator artCreator,
708 XMLUtils.ElementCreator creator, 857 XMLUtils.ElementCreator creator,
709 Document document, 858 Document document,
710 Node staticNode, 859 Node staticNode,
720 CallMeta callMeta = context.getMeta(); 869 CallMeta callMeta = context.getMeta();
721 appendToStaticNode(artCreator, creator, document, staticNode, callMeta); 870 appendToStaticNode(artCreator, creator, document, staticNode, callMeta);
722 } 871 }
723 872
724 873
874 /**
875 *
876 * @param artCreator
877 * @param creator
878 * @param document
879 * @param staticNode
880 * @param callMeta
881 */
725 protected void appendToStaticNode( 882 protected void appendToStaticNode(
726 XMLUtils.ElementCreator artCreator, 883 XMLUtils.ElementCreator artCreator,
727 XMLUtils.ElementCreator creator, 884 XMLUtils.ElementCreator creator,
728 Document document, 885 Document document,
729 Node staticNode, 886 Node staticNode,
773 930
774 staticNode.appendChild(selectNode); 931 staticNode.appendChild(selectNode);
775 } 932 }
776 933
777 934
935 /**
936 *
937 * @param artCreator
938 * @param creator
939 * @param document
940 * @param dynamicNode
941 * @param callMeta
942 * @param o
943 */
778 protected void appendToDynamicNode( 944 protected void appendToDynamicNode(
779 XMLUtils.ElementCreator artCreator, 945 XMLUtils.ElementCreator artCreator,
780 XMLUtils.ElementCreator creator, 946 XMLUtils.ElementCreator creator,
781 Document document, 947 Document document,
782 Node dynamicNode, 948 Node dynamicNode,
846 o); 1012 o);
847 } 1013 }
848 } 1014 }
849 1015
850 1016
1017 /**
1018 *
1019 * @param artCreator
1020 * @param creator
1021 * @param document
1022 * @param node
1023 * @param callMeta
1024 * @param o
1025 */
851 protected void appendMinMaxDescribeData( 1026 protected void appendMinMaxDescribeData(
852 XMLUtils.ElementCreator artCreator, 1027 XMLUtils.ElementCreator artCreator,
853 XMLUtils.ElementCreator creator, 1028 XMLUtils.ElementCreator creator,
854 Document document, 1029 Document document,
855 Node node, 1030 Node node,
912 1087
913 node.appendChild(groupNode); 1088 node.appendChild(groupNode);
914 } 1089 }
915 1090
916 1091
1092 /**
1093 *
1094 * @param artCreator
1095 * @param creator
1096 * @param document
1097 * @param node
1098 * @param callMeta
1099 * @param o
1100 */
917 protected void appendSingleValueDescribeData( 1101 protected void appendSingleValueDescribeData(
918 XMLUtils.ElementCreator artCreator, 1102 XMLUtils.ElementCreator artCreator,
919 XMLUtils.ElementCreator creator, 1103 XMLUtils.ElementCreator creator,
920 Document document, 1104 Document document,
921 Node node, 1105 Node node,
951 1135
952 node.appendChild(groupNode); 1136 node.appendChild(groupNode);
953 } 1137 }
954 1138
955 1139
1140 /**
1141 *
1142 * @param uuid
1143 */
956 protected void setHash(String uuid) { 1144 protected void setHash(String uuid) {
957 this.hash = uuid + id + inputData.hashCode(); 1145 this.hash = uuid + id + inputData.hashCode();
958 } 1146 }
959 1147
960 1148
1149 /**
1150 *
1151 * @return
1152 */
961 protected String getHash() { 1153 protected String getHash() {
962 return this.hash; 1154 return this.hash;
963 } 1155 }
964 1156
965 1157
966 /** 1158 /**
1159 * @param uuid
1160 * @return
967 * @see de.intevation.gnv.state.State#getDescibeData() 1161 * @see de.intevation.gnv.state.State#getDescibeData()
968 */ 1162 */
969 public List<Object> getDescibeData(String uuid) { 1163 public List<Object> getDescibeData(String uuid) {
970 CacheFactory factory = CacheFactory.getInstance(); 1164 CacheFactory factory = CacheFactory.getInstance();
971 if (factory.isInitialized()) { 1165 if (factory.isInitialized()) {
1014 } 1208 }
1015 1209
1016 return null; 1210 return null;
1017 } 1211 }
1018 1212
1213 /**
1214 *
1215 * @param filterValues
1216 * @param uuid
1217 * @return
1218 * @throws QueryException
1219 */
1019 protected List<Object> queryDatabase(String[] filterValues, String uuid) 1220 protected List<Object> queryDatabase(String[] filterValues, String uuid)
1020 throws QueryException { 1221 throws QueryException {
1021 Collection<Result> result = null; 1222 Collection<Result> result = null;
1022 1223
1023 if (queryID != null) { 1224 if (queryID != null) {
1028 } 1229 }
1029 return purifyResult(result, uuid); 1230 return purifyResult(result, uuid);
1030 } 1231 }
1031 1232
1032 1233
1234 /**
1235 *
1236 * @return
1237 */
1033 public Map<String, InputData> inputData() { 1238 public Map<String, InputData> inputData() {
1034 return inputData; 1239 return inputData;
1035 } 1240 }
1036 1241
1037 /** 1242 /**
1243 * @return
1244 * @throws StateException
1038 * @see de.intevation.gnv.state.State#getInputData() 1245 * @see de.intevation.gnv.state.State#getInputData()
1039 */ 1246 */
1040 public Collection<InputData> getInputData() throws StateException { 1247 public Collection<InputData> getInputData() throws StateException {
1041 return this.inputData != null ? this.inputData.values() : null; 1248 return this.inputData != null ? this.inputData.values() : null;
1042 } 1249 }
1043 1250
1251 /**
1252 *
1253 * @param name
1254 * @return
1255 */
1044 public InputData getInputDataByName(String name) { 1256 public InputData getInputDataByName(String name) {
1045 State state = this; 1257 State state = this;
1046 1258
1047 while (state != null) { 1259 while (state != null) {
1048 InputData data = state.inputData().get(name); 1260 InputData data = state.inputData().get(name);
1054 } 1266 }
1055 1267
1056 return null; 1268 return null;
1057 } 1269 }
1058 1270
1271 /**
1272 *
1273 * @param globalContext
1274 */
1059 public void endOfLife(Object globalContext) { 1275 public void endOfLife(Object globalContext) {
1060 } 1276 }
1061 1277
1062 1278
1279 /**
1280 *
1281 * @param context
1282 */
1063 public void cleanup(Object context) { 1283 public void cleanup(Object context) {
1064 } 1284 }
1065 } 1285 }
1066 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: 1286 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org