Changeset 6078

Show
Ignore:
Timestamp:
11/23/11 13:09:13 (6 months ago)
Author:
mtld
Message:

fixed pagealternative handling bugs

Location:
trunk/pustefix-core/src/main
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/pustefix-core/src/main/java/de/schlund/pfixxml/PfixServletRequestImpl.java

    r6028 r6078  
    173173        this.request = req; 
    174174        this.session = req.getSession(false); 
     175        internalPageName = null; 
    175176    } 
    176177 
  • trunk/pustefix-core/src/main/java/org/pustefixframework/http/AbstractPustefixRequestHandler.java

    r6028 r6078  
    456456                        } 
    457457                    } 
     458                } else { 
     459                    List<String> pageAltAliases = siteMap.getPageAlternativeAliases(registeredPage, null); 
     460                    if(pageAltAliases != null) { 
     461                        for(String pageAltAlias: pageAltAliases) { 
     462                            uris.add("/" + pageAltAlias); 
     463                        } 
     464                    } 
    458465                } 
    459466            } 
  • trunk/pustefix-core/src/main/resources/PUSTEFIX-INF/xsl/functions.xsl

    r6050 r6078  
    123123    <xsl:param name="pageName"/> 
    124124    <xsl:param name="language"><xsl:value-of select="$lang"/></xsl:param> 
    125     <xsl:param name="altKey"/> 
     125    <xsl:param name="altKey"><xsl:if test="$page=$pageName and $pageAlternative"><xsl:value-of select="$pageAlternative"/></xsl:if></xsl:param> 
    126126    <func:result select="callback:omitPage($__context__,$__target_gen,$pageName,$language,$altKey)"/> 
    127127  </func:function> 
  • trunk/pustefix-core/src/main/resources/pustefix/xsl/depend.xsl

    r5889 r6078  
    193193    <xsl:variable name="node" select="."/> 
    194194    <xsl:if test="$rec='true'"> 
     195     <xsl:choose> 
     196     <xsl:when test="/make/standardpage-alternative"> 
    195197      <xsl:for-each select="/make/standardpage-alternative"> 
    196198        <xsl:apply-templates select="$node"> 
     
    229231        </xsl:for-each> 
    230232      </xsl:for-each> 
     233     </xsl:when> 
     234     <xsl:otherwise> 
     235       <xsl:for-each select="$node/standardpage-alternative"> 
     236          <xsl:apply-templates select="$node"> 
     237            <xsl:with-param name="variant"> 
     238              <xsl:choose> 
     239                <xsl:when test="$node/@variant"> 
     240                  <xsl:value-of select="concat($node/@variant, ':', .)"/> 
     241                </xsl:when> 
     242                <xsl:otherwise> 
     243                  <xsl:value-of select="."/> 
     244                </xsl:otherwise> 
     245              </xsl:choose> 
     246            </xsl:with-param> 
     247            <xsl:with-param name="rec">false</xsl:with-param> 
     248            <xsl:with-param name="pageAlternative" select="."/> 
     249          </xsl:apply-templates> 
     250        </xsl:for-each> 
     251     </xsl:otherwise> 
     252     </xsl:choose> 
    231253    </xsl:if> 
    232254  </xsl:template>