Changeset 5332
- Timestamp:
- 09/01/10 15:58:37 (17 months ago)
- Location:
- branches/release-0.15.x/pustefix-core/src/main
- Files:
-
- 5 modified
-
java/de/schlund/pfixxml/ImageThemedSrc.java (modified) (4 diffs)
-
java/de/schlund/pfixxml/IncludeDocumentExtension.java (modified) (1 diff)
-
java/de/schlund/pfixxml/targets/TargetGenerator.java (modified) (2 diffs)
-
resources/PUSTEFIX-INF/xsl/include.xsl (modified) (6 diffs)
-
resources/pustefix/xsl/depend.xsl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/release-0.15.x/pustefix-core/src/main/java/de/schlund/pfixxml/ImageThemedSrc.java
r5063 r5332 78 78 if(dynamic) { 79 79 String uri = "dynamic:/"+src+"?project="+gen.getName(); 80 if(module != null ) uri += "&module="+module;80 if(module != null && !module.equalsIgnoreCase("WEBAPP")) uri += "&module="+module; 81 81 Resource res = ResourceUtil.getResource(uri); 82 82 URI resUri = res.toURI(); … … 90 90 return src; 91 91 } else { 92 if(module!=null ) src = "modules/"+module+"/"+src;92 if(module!=null && !module.equalsIgnoreCase("WEBAPP")) src = "modules/"+module+"/"+src; 93 93 DependencyTracker.logImage(context, src, parent_part_in, parent_product_in, targetGen, targetKey, "image"); 94 94 return src; … … 109 109 String uri = "dynamic:/" + themed_path +"/THEME/" + themed_img +"?project="+gen.getName(); 110 110 uri += themeParam; 111 if(module != null ) uri += "&module="+module;111 if(module != null && !module.equalsIgnoreCase("WEBAPP")) uri += "&module="+module; 112 112 Resource res = ResourceUtil.getResource(uri); 113 113 URI resUri = res.toURI(); … … 128 128 testsrc = themed_path + "/" + currtheme + "/" + themed_img; 129 129 130 if(module!=null ) {130 if(module!=null && !module.equalsIgnoreCase("WEBAPP")) { 131 131 testsrc = "modules/"+module+"/"+testsrc; 132 132 } -
branches/release-0.15.x/pustefix-core/src/main/java/de/schlund/pfixxml/IncludeDocumentExtension.java
r5274 r5332 132 132 if(dynamic) { 133 133 uriStr = "dynamic:/" + path_str + "?part=" + part + "&parent=" + parent_uri_str; 134 if(module != null) uriStr += "&module="+module; 135 else if("module".equals(parentURI.getScheme())) { 136 uriStr += "&module="+parentURI.getAuthority(); 134 if(!"WEBAPP".equalsIgnoreCase(module)) { 135 if(module != null) uriStr += "&module="+module; 136 else if("module".equals(parentURI.getScheme())) { 137 uriStr += "&module="+parentURI.getAuthority(); 138 } 137 139 } 138 140 } else { 139 if(module != null) { 140 uriStr = "module://" + module + "/" + path_str; 141 } else if("module".equals(parentURI.getScheme())) { 142 uriStr = "module://" + parentURI.getAuthority() + "/" + path_str; 141 if(!"WEBAPP".equalsIgnoreCase(module)) { 142 if(module != null) { 143 uriStr = "module://" + module + "/" + path_str; 144 } else if("module".equals(parentURI.getScheme())) { 145 uriStr = "module://" + parentURI.getAuthority() + "/" + path_str; 146 } 143 147 } 144 148 } -
branches/release-0.15.x/pustefix-core/src/main/java/de/schlund/pfixxml/targets/TargetGenerator.java
r5326 r5332 281 281 iresolver.registerListener(listener); 282 282 iresolver.resolveIncludes(confDoc); 283 284 NodeList pageNodes = confDoc.getElementsByTagName("standardpage"); 285 for(int i = 0; i < pageNodes.getLength(); i++) { 286 Element pageElem = (Element)pageNodes.item(i); 287 String module = (String)pageElem.getUserData("module"); 288 if(module != null) pageElem.setAttribute("defining-module", module); 289 } 290 283 291 fullXml = Xml.serialize(confDoc, false, true); 284 292 … … 453 461 String value = par.getAttribute("value"); 454 462 params.put(parname, value); 463 } 464 String defModule = node.getAttribute("defining-module"); 465 if(!defModule.equals("")) { 466 params.put("__defining_module", defModule); 455 467 } 456 468 // TODO Check that docroot really is not needed by targets -
branches/release-0.15.x/pustefix-core/src/main/resources/PUSTEFIX-INF/xsl/include.xsl
r5108 r5332 31 31 <xsl:param name="themes"/> 32 32 <xsl:param name="prohibitEdit">no</xsl:param> 33 <xsl:param name="__defining_module"/> 33 34 34 35 <xsl:template match="pfx:langselect"> … … 207 208 <xsl:param name="module"><xsl:value-of select="@module"/></xsl:param> 208 209 <xsl:param name="search"><xsl:value-of select="@search"/></xsl:param> 210 <xsl:variable name="module_name"> 211 <xsl:choose> 212 <xsl:when test="@module='PAGEDEF' or @module='pagedef'"> 213 <xsl:value-of select="$__defining_module"/> 214 </xsl:when> 215 <xsl:otherwise> 216 <xsl:value-of select="$module"/> 217 </xsl:otherwise> 218 </xsl:choose> 219 </xsl:variable> 209 220 <xsl:variable name="href_int"> 210 221 <xsl:if test="$href"> … … 238 249 select="include:get(string($realpath), string($part), 239 250 string($__target_gen), string($__target_key), 240 string($parent_part), string($parent_theme), $computed_inc, $module , $search)"/>251 string($parent_part), string($parent_theme), $computed_inc, $module_name, $search)"/> 241 252 <xsl:variable name="__resolveduri"><xsl:value-of select="include:getResolvedURI()"/></xsl:variable> 242 253 <!-- Start image of edited region --> … … 274 285 <xsl:call-template name="pfx:missinc"> 275 286 <xsl:with-param name="href" select="include:getResolvedURI()"/> 276 <xsl:with-param name="module" select="$module "/>287 <xsl:with-param name="module" select="$module_name"/> 277 288 <xsl:with-param name="part" select="$part"/> 278 289 </xsl:call-template> … … 427 438 <xsl:param name="module"/> 428 439 <xsl:param name="search"/> 440 <xsl:variable name="module_name"> 441 <xsl:choose> 442 <xsl:when test="$module='PAGEDEF' or $module='pagedef'"> 443 <xsl:value-of select="$__defining_module"/> 444 </xsl:when> 445 <xsl:otherwise> 446 <xsl:value-of select="$module"/> 447 </xsl:otherwise> 448 </xsl:choose> 449 </xsl:variable> 429 450 <xsl:choose> 430 451 <xsl:when test="($src and not($src = '') and (not($themed-path) or $themed-path = '') and (not($themed-img) or $themed-img = '')) or … … 434 455 <xsl:value-of select="image:getSrc(string($src),string($themed-path),string($themed-img), 435 456 string($parent_part),string($parent_theme), 436 string($__target_gen),string($__target_key),string($module ),string($search))"/>457 string($__target_gen),string($__target_key),string($module_name),string($search))"/> 437 458 </xsl:when> 438 459 <xsl:otherwise> -
branches/release-0.15.x/pustefix-core/src/main/resources/pustefix/xsl/depend.xsl
r5109 r5332 101 101 <xsl:if test="@variant"> 102 102 <xsl:attribute name="variant"><xsl:value-of select="@variant"/></xsl:attribute> 103 </xsl:if> 104 <xsl:if test="@defining-module"> 105 <xsl:attribute name="defining-module"><xsl:value-of select="@defining-module"/></xsl:attribute> 103 106 </xsl:if> 104 107 <xsl:call-template name="render_themes"> … … 142 145 <xsl:with-param name="local_themes" select="@themes"/> 143 146 </xsl:call-template> 147 <xsl:if test="@defining-module"> 148 <xsl:attribute name="defining-module"><xsl:value-of select="@defining-module"/></xsl:attribute> 149 </xsl:if> 144 150 <depxml name="{@xml}"> 145 151 <xsl:if test="@module"><xsl:attribute name="module"><xsl:value-of select="@module"/></xsl:attribute></xsl:if>
