Changeset 5332

Show
Ignore:
Timestamp:
09/01/10 15:58:37 (17 months ago)
Author:
mtld
Message:

module enhancements (Ticket #118 + #119)

Location:
branches/release-0.15.x/pustefix-core/src/main
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • branches/release-0.15.x/pustefix-core/src/main/java/de/schlund/pfixxml/ImageThemedSrc.java

    r5063 r5332  
    7878            if(dynamic) { 
    7979                String uri =  "dynamic:/"+src+"?project="+gen.getName(); 
    80                 if(module != null) uri += "&module="+module; 
     80                if(module != null && !module.equalsIgnoreCase("WEBAPP")) uri += "&module="+module; 
    8181                Resource res = ResourceUtil.getResource(uri); 
    8282                URI resUri = res.toURI(); 
     
    9090                return src; 
    9191            } else { 
    92                 if(module!=null) src =  "modules/"+module+"/"+src; 
     92                if(module!=null && !module.equalsIgnoreCase("WEBAPP")) src =  "modules/"+module+"/"+src; 
    9393                DependencyTracker.logImage(context, src, parent_part_in, parent_product_in, targetGen, targetKey, "image"); 
    9494                return src; 
     
    109109                String uri =  "dynamic:/" + themed_path +"/THEME/" + themed_img +"?project="+gen.getName(); 
    110110                uri += themeParam; 
    111                 if(module != null) uri += "&module="+module; 
     111                if(module != null && !module.equalsIgnoreCase("WEBAPP")) uri += "&module="+module; 
    112112                Resource res = ResourceUtil.getResource(uri); 
    113113                URI resUri = res.toURI(); 
     
    128128                testsrc = themed_path + "/" + currtheme + "/" + themed_img; 
    129129                 
    130                 if(module!=null) { 
     130                if(module!=null && !module.equalsIgnoreCase("WEBAPP")) { 
    131131                    testsrc =  "modules/"+module+"/"+testsrc; 
    132132                } 
  • branches/release-0.15.x/pustefix-core/src/main/java/de/schlund/pfixxml/IncludeDocumentExtension.java

    r5274 r5332  
    132132            if(dynamic) { 
    133133                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                    } 
    137139                } 
    138140            } 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                    } 
    143147                } 
    144148            } 
  • branches/release-0.15.x/pustefix-core/src/main/java/de/schlund/pfixxml/targets/TargetGenerator.java

    r5326 r5332  
    281281        iresolver.registerListener(listener); 
    282282        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         
    283291        fullXml = Xml.serialize(confDoc, false, true); 
    284292 
     
    453461                String value = par.getAttribute("value"); 
    454462                params.put(parname, value); 
     463            } 
     464            String defModule = node.getAttribute("defining-module"); 
     465            if(!defModule.equals("")) { 
     466                params.put("__defining_module", defModule); 
    455467            } 
    456468            // 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  
    3131  <xsl:param name="themes"/> 
    3232  <xsl:param name="prohibitEdit">no</xsl:param> 
     33  <xsl:param name="__defining_module"/> 
    3334 
    3435  <xsl:template match="pfx:langselect"> 
     
    207208    <xsl:param name="module"><xsl:value-of select="@module"/></xsl:param> 
    208209    <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> 
    209220    <xsl:variable name="href_int"> 
    210221      <xsl:if test="$href"> 
     
    238249                      select="include:get(string($realpath), string($part), 
    239250                              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)"/> 
    241252        <xsl:variable name="__resolveduri"><xsl:value-of select="include:getResolvedURI()"/></xsl:variable> 
    242253        <!-- Start image of edited region --> 
     
    274285            <xsl:call-template name="pfx:missinc"> 
    275286              <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"/> 
    277288              <xsl:with-param name="part" select="$part"/> 
    278289            </xsl:call-template> 
     
    427438    <xsl:param name="module"/> 
    428439    <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> 
    429450    <xsl:choose> 
    430451      <xsl:when test="($src and not($src = '') and (not($themed-path) or $themed-path = '') and (not($themed-img) or $themed-img = '')) or 
     
    434455        <xsl:value-of select="image:getSrc(string($src),string($themed-path),string($themed-img), 
    435456                              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))"/>           
    437458      </xsl:when> 
    438459      <xsl:otherwise> 
  • branches/release-0.15.x/pustefix-core/src/main/resources/pustefix/xsl/depend.xsl

    r5109 r5332  
    101101      <xsl:if test="@variant"> 
    102102        <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> 
    103106      </xsl:if> 
    104107      <xsl:call-template name="render_themes"> 
     
    142145        <xsl:with-param name="local_themes" select="@themes"/> 
    143146      </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> 
    144150      <depxml name="{@xml}"> 
    145151        <xsl:if test="@module"><xsl:attribute name="module"><xsl:value-of select="@module"/></xsl:attribute></xsl:if>