diff flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java @ 1828:9562ca537143

Added new optional condition for theme-mappings: the output name. flys-artifacts/trunk@3158 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 04 Nov 2011 08:59:42 +0000
parents 6ed439ff61bf
children 0585bf8af41b
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java	Fri Nov 04 08:52:33 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java	Fri Nov 04 08:59:42 2011 +0000
@@ -525,7 +525,7 @@
         Document attr = db.getCollectionItemAttribute(identifier(), uuid, meta);
 
         if (attr == null) {
-            attr = initItemAttribute(uuid, facet, pattern, index, context);
+            attr = initItemAttribute(uuid, facet, pattern, index, outName, context);
 
             if (attr == null) {
                 return null;
@@ -557,7 +557,8 @@
         if (theme == null) {
             log.warn("Could not find the theme in attribute of: " + uuid);
 
-            Theme t = getThemeForFacet(uuid, facet, pattern, index, context);
+            Theme t = getThemeForFacet(
+                uuid, facet, pattern, index, outName, context);
 
             if (t == null) {
                 log.warn("No theme found for facet: " + facet);
@@ -565,7 +566,7 @@
             }
 
             addThemeToAttribute(uuid, attr, t, context);
-            theme   = t.toXML().getFirstChild();
+            theme = t.toXML().getFirstChild();
         }
 
         Document doc = XMLUtils.newDocument();
@@ -652,11 +653,12 @@
         String      facet,
         String      pattern,
         int         index,
+        String      outName,
         CallContext context)
     {
         log.info("FLYSArtifactCollection.initItemAttribute");
 
-        Theme t = getThemeForFacet(uuid, facet, pattern, index, context);
+        Theme t = getThemeForFacet(uuid, facet, pattern, index, outName, context);
 
         if (t == null) {
             log.info("Could not find theme for facet. Cancel initialization.");
@@ -715,6 +717,7 @@
         String facet,
         String pattern,
         int    index,
+        String outName,
         CallContext context)
     {
         log.info("FLYSArtifactCollection.getThemeForFacet: " + facet);
@@ -734,7 +737,7 @@
             log.error("Exception caught when trying to get art.", e);
         }
 
-        Theme t = ThemeFactory.getTheme(flysContext, facet, pattern);
+        Theme t = ThemeFactory.getTheme(flysContext, facet, pattern, outName);
 
         if (t != null) {
             t.setFacet(facet);

http://dive4elements.wald.intevation.org