# HG changeset patch # User Ingo Weinzierl # Date 1304439995 0 # Node ID cc6840cbe503d68273f7ca09be5e66426e39621e # Parent 6c63e3c3f77df09bc2f37b892b86418ce6898b63 Introduced an export output target on collection level that enables collections to be exported. flys-artifacts/trunk@1809 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 6c63e3c3f77d -r cc6840cbe503 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Tue May 03 13:23:00 2011 +0000 +++ b/flys-artifacts/ChangeLog Tue May 03 16:26:35 2011 +0000 @@ -1,3 +1,10 @@ +2011-05-03 Ingo Weinzierl + + * src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java: + Introduced an "export" output target. If the target is "export", a + facet (read from the incoming xml document) is a necessary parameter + that determines which facets are written to the output. + 2011-05-03 Ingo Weinzierl * src/main/resources/messages_en.properties: Bugfix: replaced german diff -r 6c63e3c3f77d -r cc6840cbe503 flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java --- a/flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java Tue May 03 13:23:00 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java Tue May 03 16:26:35 2011 +0000 @@ -134,6 +134,9 @@ String type = XMLUtils.xpathString( format, XPATH_OUT_TYPE, ArtifactNamespaceContext.INSTANCE); + log.debug("Output name = " + name); + log.debug("Output type = " + type); + OutGenerator generator = getOutGenerator(context, name, type); if (generator == null) { log.error("There is no generator specified for output: " + type); @@ -145,7 +148,7 @@ generator.init(format, out, context); try { - doOut(generator, name, getAttribute(context, name), context); + doOut(generator, name, type, getAttribute(context, name), context); } catch (ArtifactDatabaseException adbe) { log.error(adbe, adbe); @@ -165,6 +168,7 @@ protected void doOut( OutGenerator generator, String outName, + String facet, Document attributes, CallContext context) throws IOException @@ -195,6 +199,10 @@ String facetName = theme.getName(); + if (outName.equals("export") && !facetName.equals(facet)) { + continue; + } + generator.doOut( getArtifact(art, context), facetName, @@ -604,7 +612,7 @@ return null; } - Class clazz = generators.get(type); + Class clazz = generators.get(name); try { return clazz != null ? (OutGenerator) clazz.newInstance() : null;