# HG changeset patch # User Ingo Weinzierl # Date 1306853778 0 # Node ID d299e220d89c62e6a8248cce80c91e4bec98ac19 # Parent 433f67a076aa7f443a0a5ce106b08bff0483159a Added support for the 'type' parameter of the collection's out() operation. flys-artifacts/trunk@2031 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 433f67a076aa -r d299e220d89c flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Tue May 31 09:35:19 2011 +0000 +++ b/flys-artifacts/ChangeLog Tue May 31 14:56:18 2011 +0000 @@ -1,3 +1,9 @@ +2011-05-31 Ingo Weinzierl + + * src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java: + Added support for the 'type' paramter of the collection's out() + operation. + 2011-05-31 Sascha L. Teichmann * src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java, diff -r 433f67a076aa -r d299e220d89c 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 31 09:35:19 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java Tue May 31 14:56:18 2011 +0000 @@ -123,7 +123,11 @@ @Override - public void out(Document format, OutputStream out, CallContext context) + public void out( + String type, + Document format, + OutputStream out, + CallContext context) throws IOException { log.info("FLYSArtifactCollection.out"); @@ -131,13 +135,26 @@ String name = XMLUtils.xpathString( format, XPATH_OUT_NAME, ArtifactNamespaceContext.INSTANCE); - String type = XMLUtils.xpathString( + String subtype = XMLUtils.xpathString( format, XPATH_OUT_TYPE, ArtifactNamespaceContext.INSTANCE); - log.debug("Output name = " + name); - log.debug("Output type = " + type); + log.info("-> Output name = " + name); + log.info("-> Output type = " + type); + log.info("-> Output subtype = " + subtype); - OutGenerator generator = getOutGenerator(context, name, type); + OutGenerator generator = null; + if (type != null && type.length() > 0) { + if (type.indexOf("chartinfo") > 0) { + generator = getOutGenerator(context, type, subtype); + } + else { + generator = getOutGenerator(context, name, subtype); + } + } + else { + generator = getOutGenerator(context, name, subtype); + } + if (generator == null) { log.error("There is no generator specified for output: " + name); // TODO throw an exception. @@ -150,7 +167,8 @@ // TODO Determine the correct master artifact here! try { - doOut(generator, name, type, getAttribute(context, name), context); + Document attr = getAttribute(context, name); + doOut(generator, name, subtype, attr, context); } catch (ArtifactDatabaseException adbe) { log.error(adbe, adbe); @@ -175,7 +193,7 @@ CallContext context) throws IOException { - log.debug("FLYSArtifactCollection.doOut: " + outName); + log.info("FLYSArtifactCollection.doOut: " + outName); ThemeList themeList = new ThemeList(attributes);