comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/StaticWKmsArtifact.java @ 1771:c62ff9e72cea

Restore mapping of state id to facets (revert, rev 3083 and 3088). flys-artifacts/trunk@3092 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 27 Oct 2011 09:32:05 +0000
parents 5d8b3880a553
children f3be8fa1ec62
comparison
equal deleted inserted replaced
1770:e8a98eee816d 1771:c62ff9e72cea
41 41
42 /** XPath to access initial parameter. */ 42 /** XPath to access initial parameter. */
43 public static final String XPATH_DATA = 43 public static final String XPATH_DATA =
44 "/art:action/art:ids/@value"; 44 "/art:action/art:ids/@value";
45 45
46 public static final String STATIC_STATE_NAME =
47 "state.additional_wkms.static";
48
49
46 /** One and only state to be in. */ 50 /** One and only state to be in. */
47 protected transient State state = null; 51 protected transient State state = null;
48 52
49 53
50 /** 54 /**
67 Document data) 71 Document data)
68 { 72 {
69 logger.debug("StaticWKmsArtifact.setup"); 73 logger.debug("StaticWKmsArtifact.setup");
70 74
71 state = new StaticState( 75 state = new StaticState(
72 "state.additional_wkms.static", 76 STATIC_STATE_NAME,
73 "state.additional_wkms.static"); 77 STATIC_STATE_NAME);
74 78
79 List<Facet> fs = new ArrayList<Facet>();
75 logger.debug(XMLUtils.toString(data)); 80 logger.debug(XMLUtils.toString(data));
76 String code = XMLUtils.xpathString( 81 String code = XMLUtils.xpathString(
77 data, XPATH_DATA, ArtifactNamespaceContext.INSTANCE); 82 data, XPATH_DATA, ArtifactNamespaceContext.INSTANCE);
78 83
79 logger.debug("makes: " + code); 84 logger.debug("makes: " + code);
96 Facet facet = new WKmsFacet( 101 Facet facet = new WKmsFacet(
97 Resources.getMsg( 102 Resources.getMsg(
98 callMeta, 103 callMeta,
99 wkmsName, 104 wkmsName,
100 wkmsName)); 105 wkmsName));
101 106 fs.add(facet);
102 facets.add(facet); 107 facets.put(state.getID(), fs);
103 } 108 }
104 catch (Exception e) {} 109 catch (Exception e) {}
105 } 110 }
106 } 111 }
107 112
114 * Initialize the static state with output. 119 * Initialize the static state with output.
115 * @return static state 120 * @return static state
116 */ 121 */
117 protected State spawnState() { 122 protected State spawnState() {
118 state = new StaticState( 123 state = new StaticState(
119 "state.additional_wkms.static", 124 STATIC_STATE_NAME,
120 "state.additional_wkms.static"); 125 STATIC_STATE_NAME);
126 List<Facet> fs = facets.get(STATIC_STATE_NAME);
121 DefaultOutput output1 = new DefaultOutput( 127 DefaultOutput output1 = new DefaultOutput(
122 "w_differences", 128 "w_differences",
123 "w_differences.longitudinal_section", "image/png", 129 "w_differences.longitudinal_section", "image/png",
124 facets, 130 fs,
125 "chart"); 131 "chart");
126 DefaultOutput output2 = new DefaultOutput( 132 DefaultOutput output2 = new DefaultOutput(
127 "longitudinal_section", 133 "longitudinal_section",
128 "longitudinal_section.longitudinal_section", "image/png", 134 "longitudinal_section.longitudinal_section", "image/png",
129 facets, 135 fs,
130 "chart"); 136 "chart");
131 137
132 state.getOutputs().add(output1); 138 state.getOutputs().add(output1);
133 state.getOutputs().add(output2); 139 state.getOutputs().add(output2);
134 return state; 140 return state;

http://dive4elements.wald.intevation.org