cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrzej Radzki" <arad...@wp.pl>
Subject RE: parameters
Date Sat, 09 Aug 2003 11:42:27 GMT
> Andrzej Radzki wrote:
> 
> > Hello!
> >
> > I want to add to the all links (<a href="..."/>) in my site
> 
> Where does the code come from?
Several transforms xsp|xml->xsl->xsl->html

> 
> > additional
> > parameter (eg. ?param=value), without changing all files... is it
> > possible do this in the sitemap?
> 
> How does the sitemap look like?

Main problem is that caching pages by proxy or browser using expire
header with complete URL. My site contains most static content but in
several languages, the locale parameter is attribute in session.

When I put for example:
<map:parameter name="expires" value="access plus 1 days"/>

Browser or proxy do not recognize language changes in session... so I
need always to pass parameter '?locale=xx' or '..&locale=xx' in URL. 

Some part of my sitemap:

<map:match pattern="step0_llf">
  <map:aggregate element="aggregate">
    <map:part src="cocoon:/step0_cf"/>
    <map:part src="cocoon://search/specs"/>
  </map:aggregate>
  <map:transform src="xsl/step0_cf.xsl"/>
  <map:serialize type="xml"/>
</map:match>

<map:match pattern="step0">
  <map:aggregate element="sitepage">
    <map:part src="cocoon://common/header/header_llf"
element="siteheader"/>
    <map:part src="cocoon://common/sitemenu/sitemenu_llf"
element="siterightmenu"/>
    <map:part src="cocoon:/step0_llf" element="sitebody"/>
    <map:part src="cocoon://common/footer/footer_llf"
element="sitefooter"/>
  </map:aggregate>
  <map:transform src="xsl/step0_llf.xsl"/>
  <map:serialize type="html"/>
</map:match>

<map:match pattern="step0_cf">
  <map:generate type="serverpages" src="xsp/step0.xsp"/>
  <map:act type="locale">
    <map:transform type="i18n">
      <map:parameter name="locale" value="{locale}"/>
    </map:transform>
  </map:act>
  <map:serialize type="xml"/>
</map:match>

> 
> It's possible using an additional transformer:
> 
> <xsl:template match="node()|@*">
>    <xsl:copy>
>      <xsl:apply-templates select="node()|@*"/>
>    </xsl:copy>
> </xsl:template>
> 
> <xsl:template match="a/@href">
>    <xsl:attribute name="href">
>      <xsl:value-of select="."/>
>      <xsl:text>?param=value</xsl:text>
>    </xsl:attribute>
> </xsl:template>
> 
> Of course you can add a better logic to the second template for
testing
> if @href already contains parameters and if yes replace the ? with
&amp;.

It could be a solution but value /locale/ is dynamic... :(

> 
> Regards,
> 
> Joerg
> 
regards, 

ar

> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message