El dom, 04-06-2006 a las 02:50 +0200, Jörn Nettingsmeier escribió:
> Jörn Nettingsmeier wrote:
> > hi thorsten, hi everyone!
> 
> ok, here's my first attempt.

will try to apply your patches this week if nobody beats me to it.

salu2


> the first patch changes all private methods in LenyaMetaDataGenerator to 
> "protected".
> 
> the second file is a new subclass, LenyaSaneMetaDataGenerator (NOI 
> thorsten ;), that attempts to parse the messy metadata into something 
> more xmlish, which can then be handled more gracefully with xslts.
> if you want to try it, just drop it into 
> src/java/org/apache/lenya/cms/cocoon/generation.
> 
> the third patch activates the new generator in the default sitemap.
> after rebuilding, browse default/authoring/meta&docid=index&lang=en and 
> check out the output. for maximum enjoyment, it is advisable to submit 
> the current document, otherwise there will be no workflow metadata to view.
> 
> 
> if you wonder why bother at all: i'm doing a "last changed on ... by 
> ..." footer with it:
> 
> <div id="fusszeile">
>    &#169; <i18n:text key="name_uni"/>, <i18n:text key="name_dept"/>.
>    <xsl:variable name="date">
>      <xsl:value-of 
> select="//lenya:meta/lenya:internal/lenya:workflow/lenya:version[last()]/lenya:timestamp/lenya:date"/>
>    </xsl:variable>
>    <xsl:variable name="time">
>      <xsl:value-of 
> select="//lenya:meta/lenya:internal/lenya:workflow/lenya:version[last()]/lenya:timestamp/lenya/time"/>
>    </xsl:variable>
>    <!-- avoid i18n "unparseable date" exception -->
>    <xsl:if test="$date and $time">
>      <i18n:translate>
>        <i18n:text i18n:key="last_change"/>
>        <i18n:param name="last_change_date">
>          <i18n:date src-pattern="yyyy-mm-dd" locale="{$language}" 
> value="{$date}"/>
>          <xsl:text>,&#160;</xsl:text>
>          <i18n:time src-pattern="hh:mm:ss" locale="{$language}" 
> value="{$time}"/>
>        </i18n:param>
>        <i18n:param name="last_change_by">
>          <xsl:value-of select="//lenya:meta/lenya:internal/ 
>    lenya:workflow/lenya:version[lenya:event = 
> 'edit'][last()]/lenya:user"/>
>        </i18n:param>
>      </i18n:translate>
>    </xsl:if>
> </div>
> 
> caveat: i don't know zilch about java, and this thing hasn't seen much 
> testing yet. i would welcome suggestions re style and implementation.
> 
> 
> regards,
> 
> jörn
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to