Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/OutputHelper.java @ 6905:1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 22 Aug 2013 23:31:38 +0200 |
parents | 42856353a222 |
children | fe32a7f9655e |
comparison
equal
deleted
inserted
replaced
6904:d710bd3df387 | 6905:1b35b2ddfc28 |
---|---|
38 import org.dive4elements.river.artifacts.D4EArtifact; | 38 import org.dive4elements.river.artifacts.D4EArtifact; |
39 import org.dive4elements.river.artifacts.context.RiverContext; | 39 import org.dive4elements.river.artifacts.context.RiverContext; |
40 import org.dive4elements.river.artifacts.model.ManagedDomFacet; | 40 import org.dive4elements.river.artifacts.model.ManagedDomFacet; |
41 import org.dive4elements.river.artifacts.model.ManagedFacet; | 41 import org.dive4elements.river.artifacts.model.ManagedFacet; |
42 import org.dive4elements.river.themes.Theme; | 42 import org.dive4elements.river.themes.Theme; |
43 import org.dive4elements.river.themes.ThemeDocument; | |
43 import org.dive4elements.river.themes.ThemeFactory; | 44 import org.dive4elements.river.themes.ThemeFactory; |
44 | 45 |
45 public class OutputHelper { | 46 public class OutputHelper { |
46 /** The logger used in this class. */ | 47 /** The logger used in this class. */ |
47 private static Logger log = Logger.getLogger(OutputHelper.class); | 48 private static Logger log = Logger.getLogger(OutputHelper.class); |
74 log.debug("OutputHelper.doOut: " + outName); | 75 log.debug("OutputHelper.doOut: " + outName); |
75 } | 76 } |
76 | 77 |
77 ThemeList themeList = new ThemeList(attributes); | 78 ThemeList themeList = new ThemeList(attributes); |
78 | 79 |
80 ThemeDocument themeDoc = new ThemeDocument(attributes); | |
81 | |
79 List<ArtifactAndFacet> dataProviders = | 82 List<ArtifactAndFacet> dataProviders = |
80 doBlackboardPass(themeList, context, outName); | 83 doBlackboardPass(themeList, context, outName); |
81 | 84 |
82 try { | 85 try { |
83 for (int i = 0; i < themeList.size(); i++) { | 86 for (int i = 0; i < themeList.size(); i++) { |
107 } | 110 } |
108 | 111 |
109 if (outName.equals("sq_overview")) { | 112 if (outName.equals("sq_overview")) { |
110 generator.doOut( | 113 generator.doOut( |
111 dataProviders.get(i), | 114 dataProviders.get(i), |
112 attributes, | 115 themeDoc, |
113 theme.getActive() == 1); | 116 theme.getActive() == 1); |
114 } | 117 } |
115 else { | 118 else { |
116 generator.doOut( | 119 generator.doOut( |
117 dataProviders.get(i), | 120 dataProviders.get(i), |
139 * @param facet The name of the requested facet. | 142 * @param facet The name of the requested facet. |
140 * @param context The CallContext. | 143 * @param context The CallContext. |
141 * | 144 * |
142 * @return an attribute in form of a document. | 145 * @return an attribute in form of a document. |
143 */ | 146 */ |
144 protected Document getFacetThemeFromAttribute( | 147 protected ThemeDocument getFacetThemeFromAttribute( |
145 String uuid, | 148 String uuid, |
146 String outName, | 149 String outName, |
147 String facet, | 150 String facet, |
148 String pattern, | 151 String pattern, |
149 int index, | 152 int index, |
217 } | 220 } |
218 | 221 |
219 Document doc = XMLUtils.newDocument(); | 222 Document doc = XMLUtils.newDocument(); |
220 doc.appendChild(doc.importNode(theme, true)); | 223 doc.appendChild(doc.importNode(theme, true)); |
221 | 224 |
222 return doc; | 225 return new ThemeDocument(doc); |
223 } | 226 } |
224 /** | 227 /** |
225 * Adds the theme of a facet to a CollectionItem's attribute. | 228 * Adds the theme of a facet to a CollectionItem's attribute. |
226 * | 229 * |
227 * @param uuid The uuid of the artifact. | 230 * @param uuid The uuid of the artifact. |