comparison flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java @ 1709:f643ea084213

Allow simple codepaths to have Facets initially being 'inactive' (wrt rendering). flys-artifacts/trunk@2969 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 14 Oct 2011 08:52:44 +0000
parents bdb05dc9b763
children a70e0cbc5e02
comparison
equal deleted inserted replaced
1708:e99b4bd32cd5 1709:f643ea084213
43 */ 43 */
44 public class FLYSArtifactCollection extends DefaultArtifactCollection { 44 public class FLYSArtifactCollection extends DefaultArtifactCollection {
45 45
46 /** The logger used in this class. */ 46 /** The logger used in this class. */
47 private static Logger log = Logger.getLogger(FLYSArtifactCollection.class); 47 private static Logger log = Logger.getLogger(FLYSArtifactCollection.class);
48
49 48
50 /** Constant XPath that points to the outputmodes of an artifact. */ 49 /** Constant XPath that points to the outputmodes of an artifact. */
51 public static final String XPATH_ARTIFACT_OUTPUTMODES = 50 public static final String XPATH_ARTIFACT_OUTPUTMODES =
52 "/art:result/art:outputmodes"; 51 "/art:result/art:outputmodes";
53 52
126 125
127 126
128 /** 127 /**
129 * Merge the current art:outputs nodes with the the outputs provided by the 128 * Merge the current art:outputs nodes with the the outputs provided by the
130 * artifacts in the Collection. 129 * artifacts in the Collection.
130 * @param uuids Artifact uuids.
131 */ 131 */
132 protected Node mergeAttributes( 132 protected Node mergeAttributes(
133 ArtifactDatabase db, 133 ArtifactDatabase db,
134 CallContext context, 134 CallContext context,
135 Document oldAttrs, 135 Document oldAttrs,
300 } 300 }
301 301
302 302
303 /** 303 /**
304 * Return merged output document. 304 * Return merged output document.
305 * @param items List of artifact uuids. 305 * @param uuids List of artifact uuids.
306 */ 306 */
307 protected Document buildOutAttributes( 307 protected Document buildOutAttributes(
308 ArtifactDatabase db, 308 ArtifactDatabase db,
309 CallContext context, 309 CallContext context,
310 Document oldAttr, 310 Document oldAttr,
311 String[] items) 311 String[] uuids)
312 { 312 {
313 Document doc = XMLUtils.newDocument(); 313 Document doc = XMLUtils.newDocument();
314 314
315 XMLUtils.ElementCreator ec = new XMLUtils.ElementCreator( 315 XMLUtils.ElementCreator ec = new XMLUtils.ElementCreator(
316 doc, 316 doc,
318 ArtifactNamespaceContext.NAMESPACE_PREFIX); 318 ArtifactNamespaceContext.NAMESPACE_PREFIX);
319 319
320 AttributeParser aParser = new AttributeParser(); 320 AttributeParser aParser = new AttributeParser();
321 OutputParser oParser = new OutputParser(db, context); 321 OutputParser oParser = new OutputParser(db, context);
322 322
323 if (items != null) { 323 if (uuids != null) {
324 for (String uuid: items) { 324 for (String uuid: uuids) {
325 try { 325 try {
326 oParser.parse(uuid); 326 oParser.parse(uuid);
327 } 327 }
328 catch (ArtifactDatabaseException ade) { 328 catch (ArtifactDatabaseException ade) {
329 log.warn(ade, ade); 329 log.warn(ade, ade);
331 } 331 }
332 } 332 }
333 333
334 aParser.parse(oldAttr); 334 aParser.parse(oldAttr);
335 335
336 return new AttributeWriter(aParser.getOuts(), oParser.getOuts()).write(); 336 return new AttributeWriter(
337 db,
338 aParser.getOuts(),
339 oParser.getOuts()).write();
337 } 340 }
338 341
339 342
340 /** 343 /**
341 * Returns the attribute for a specific output type. 344 * Returns the attribute for a specific output type.

http://dive4elements.wald.intevation.org