You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Roman Mario Xerxes Rometsch <xe...@mathematik.uni-ulm.de> on 2005/11/29 18:40:14 UTC

missing varibale, generic language switching

Hello,
i'm trying to implement the generic language switching as mentioned in
http://wiki.apache.org/lenya/HowToLanguageSwitching at the bottom of the
page. Here's my page2xhtml.xls

<?xml version="1.0" encoding="UTF-8" ?>
<!--
  Copyright 1999-2004 The Apache Software Foundation

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<!-- $Id: page2xhtml.xsl 170255 2005-05-15 19:58:26Z gregor $ -->

<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:xhtml="http://www.w3.org/1999/xhtml"
    xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0"
    xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:dcterms="http://purl.org/dc/terms/"
    xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
    exclude-result-prefixes="page xhtml"
    >


<!-- {context-prefix}/{publication-id}/{area} -->
<xsl:param name="root"/>

<xsl:param name="document-id"/>
<xsl:param name="raw"/>

<xsl:param name="contextprefix"/>
<xsl:param name="publicationid"/>
<xsl:param name="area"/>
<xsl:param name="documentextension"/>
<xsl:param name="chosenlanguage"/>
<xsl:param name="tab"/>

<!-- i.e. doctypes/xhtml-document -->
<xsl:param name="document-type"/>

<!-- The rquest url i.e. /lenya/doctypes/xhtml-document_en.html -->
<xsl:param name="url"/>

<!-- The chosen language -->
<xsl:param name="language"/>

<!-- All available languages for the specific page in a comma-separated
list
-->
<xsl:param name="languages"/>

<xsl:variable name="extension"><xsl:if test="$documentextension !=
''">.</xsl:if><xsl:value-of select="$documentextension"/></xsl:variable>

<xsl:template match="cmsbody">
  <html>
    <head>
      <link rel="stylesheet" href="{$root}/css/screen.css" type="text/css"
media="screen"/>
      <meta content="Apache Lenya" name="generator"/>
      <meta http-equiv="Content-Type" content="application/xhtml+xml;
charset=UTF-8"/>
      <script type="text/javascript" src="{$root}/javascript/layout.js">
      </script>
      <title><xsl:value-of select="//lenya:meta/dc:title"/></title>
    </head>
    <body onload="correct_layout()">
      <div id="page">
        <div id="top_section">
          <xsl:choose>
            <xsl:when test="$language = 'de'">
              <img src="{$root}/images/unilogo.png" id ="unilogo"
alt="Logo
der Universität Ulm"/>
              <a class="title" href="http://www.uni-ulm.de" hreflang="de">
                Universit&#228;t Ulm
              </a>
              <a class="subtitle" href="http://www.mathematik.uni-ulm.de"
hreflang="de">
                Fakult&#228;t für Mathematik und
Wirtschaftswissenschaften
              </a>
              <img src="{$root}/images/geb.png" id ="geb"
alt="Fakult&#228;t
f&#252;r Mathematik &#038; Wirtschaftswissenschaften"/>
            </xsl:when>
            <xsl:otherwise>
              <img src="{$root}/images/unilogo.png" id ="unilogo"
alt="logo of
the university of ulm"/>
              <a class="title" href="http://www.uni-ulm.de" hreflang="de">
                University of Ulm
              </a>
              <a class="subtitle" href="http://www.mathematik.uni-ulm.de"
hreflang="de">
                Faculty of Mathematics and Economics
              </a>
              <img src="{$root}/images/geb.png" id ="geb"
alt="Fakult&#228;t
f&#252;r Mathematik &#038; Wirtschaftswissenschaften"/>
            </xsl:otherwise>
          </xsl:choose>
        </div>

        <!-- we need no tabs (horizontal navigation on top
        <xsl:if test="$raw != 'true'">
          <xsl:apply-templates select="xhtml:div[@id = 'tabs']"/>
        </xsl:if>
        -->
        <div id="main_section">
          <div id="navigation">
            <xsl:if test="$raw != 'true'">
              <xsl:apply-templates select="xhtml:div[@id = 'menu']"/>
            </xsl:if>
            <!-- searchfield -->
            <div id="searchbox">
              <xsl:apply-templates select="xhtml:div[@id = 'search']"/>
            </div>
            <div id="w3cbuttons">
              <a href="http://validator.w3.org/check/referer">
                <img class="w3cbutton1" src="{$root}/images/xhtml10.png"
alt="Valid XHTML1.0"/>
              </a>
              <a href="http://jigsaw.w3.org/css-validator/check/referer">
                <img class="w3cbutton2" src="{$root}/images/css.png"
alt="Valid CSS"/>
              </a>
            </div>
          </div>
          <div id="main">
            <div id="main_header">
              Graduiertenkolleg 1100
              <span class="flags">
                <!-- insert flags for the available languages
                     call the flags template with parameter of available
language versions for the specific
                     document -->
                <xsl:call-template name="languageflags">
                  <xsl:with-param name="available_languages">
                    <xsl:value-of select="$languages"/>
                  </xsl:with-param>
                </xsl:call-template>
              </span>
            </div>
            <div id="main_content"
style="background-image:url(images/saeulen.png);background-repeat:no-repeat;">
              <xsl:if test="$raw != 'true'">
                <xsl:apply-templates select="xhtml:div[@id =
'breadcrumb']"/>
              </xsl:if>
              <xsl:apply-templates select="xhtml:div[@id = 'body']"/>
            </div>
            <div id="main_footer">
              <address>
                <xsl:apply-templates
select="lenya:meta/dcterms:modified"/>
                <xsl:apply-templates select="lenya:meta/dc:publisher"/>
              </address>
            </div>
          </div>
        </div>
      </div>
    </body>
  </html>
</xsl:template>

<xsl:template match="dcterms:modified">
  <xsl:variable name="date"><xsl:value-of select="."/></xsl:variable>
  <i18n:text>last_published</i18n:text>:
    <xsl:if test="$date!=''">
    <i18n:date-time src-pattern="yyyy-MM-dd HH:mm:ss" pattern="EEE, d MMM
yyyy
HH:mm:ss z" value="{$date}"/>
  </xsl:if>
</xsl:template>

<xsl:template match="dc:publisher">
  <xsl:variable name="user"><xsl:value-of select="."/></xsl:variable>
  <xsl:variable name="user-id"><xsl:value-of
select="substring-before($user,'|')"/></xsl:variable>
  <xsl:variable name="rest"><xsl:value-of
select="substring-after($user,'|')"/></xsl:variable>
  <xsl:variable name="user-name"><xsl:value-of
select="substring-before($rest,'|')"/></xsl:variable>
  <xsl:variable name="user-email"><xsl:value-of
select="substring-after($rest,'|')"/></xsl:variable>

  <xsl:if test="$user != ''">
    <xsl:choose>
      <xsl:when test="$user-email != ''">
      / <a>
          <xsl:attribute name="href"><xsl:value-of
select="concat('mailto:',
$user-email)"/></xsl:attribute>
          <xsl:value-of select="$user-name"/>
        </a>
      </xsl:when>
      <xsl:otherwise>
       / <xsl:value-of select="$user-name"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:if>
</xsl:template>

<xsl:template match="@*|node()" priority="-1">
  <xsl:copy>
    <xsl:apply-templates select="@*|node()"/>
  </xsl:copy>
</xsl:template>

<xsl:template name="languageflags">
  <xsl:param name="available_languages"/>
  <xsl:choose>
    <xsl:when test="not(contains($available_languages,','))">
      <xsl:call-template name="languageflag">
        <xsl:with-param name="flag_language">
          <xsl:value-of select="$available_languages"/>
        </xsl:with-param>
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
      <xsl:variable name="head">
        <xsl:value-of select =
"substring-before($available_languages,',')" />
      </xsl:variable>
      <xsl:variable name="tail">
        <xsl:value-of select = "substring-after($available_languages,',')"
/>
      </xsl:variable>
      <xsl:call-template name="languageflags">
        <xsl:with-param name="available_languages">
          <xsl:value-of select="$head"/>
        </xsl:with-param>
      </xsl:call-template>
      <xsl:call-template name="languageflags">
        <xsl:with-param name="available_languages">
          <xsl:value-of select="$tail"/>
        </xsl:with-param>
      </xsl:call-template>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

<xsl:template name="languageflag">
  <xsl:param name="flaglanguage"/>
    <a id="{$flaglanguage}"
href="{$root}{$document-id}_{$flaglanguage}.html">
      <img src="{$root}/images/{flaglanguage}.png" alt="{$flaglanguage}"/>
    </a>
</xsl:template>

</xsl:stylesheet>

Now there's the variable $languages, which should contain the available
languages, but it's empty. Maybe someone has a idea where I have to enable
the function, that this variable will be passed to this file.
(Maybe also someone has implemented this feature already and can post his
xsl
file?)

Thanks in advance

Mario Rometsch


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Publishing problem

Posted by John Cherouvim <jc...@eworx.gr>.
Hello

I cannot publish some specific pages inside my publication. I've setup 
my publication on 2 instances of Lenya.
The first one is:
Lenya 1.2.2 (patched with solprovider's easy.zip)
Win xp
Tomcat 5.0.28
Java 1.4.2_04

The other one is:
Lenya 1.2.4
Linux 2.6.10-1.770
Tomcat 5.0.30
1.4.2_06

The error I get on the first instance is:
The prefix "task" for element "task:task" is not bound.
org.apache.cocoon.ProcessingException: Unable to get transformer handler 
for 
cocoon://scheduler/default/authoring/5/EROTISEIS.html.xsl?pipelinehash=5255559324713125381: 
org.apache.excalibur.xml.xslt.XSLTProcessorException: Exception in 
creating Transform Handler

org.apache.cocoon.ProcessingException: Unable to get transformer handler for cocoon://scheduler/default/authoring/5/EROTISEIS.html.xsl?pipelinehash=5255559324713125381: org.apache.excalibur.xml.xslt.XSLTProcessorException: Exception in creating Transform Handler
	at org.apache.cocoon.transformation.TraxTransformer.setup(TraxTransformer.java:320)
	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.setupPipeline(AbstractProcessingPipeline.java:383)
	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.preparePipeline(AbstractProcessingPipeline.java:488)
	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:440)
	at org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:120)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68)
	at org.apache.cocoon.components.treeprocessor.ContainerNode.invoke(ContainerNode.java:31)
	at org.apache.cocoon.components.treeprocessor.sitemap.CallNode.invoke(CallNode.java:93)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:46)
	at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:46)
	at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:46)
	at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:138)
...



The error I get on the second instance is:
org.apache.cocoon.ProcessingException: java.lang.NullPointerException
org.apache.cocoon.ProcessingException: java.lang.NullPointerException
	at org.apache.cocoon.www.lenya.content.publishing.screen_xsp.generate(org.apache.cocoon.www.lenya.content.publishing.screen_xsp:791)
	at org.apache.cocoon.generation.ServerPagesGenerator.generate(ServerPagesGenerator.java:228)
	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processXMLPipeline(AbstractProcessingPipeline.java:581)
	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:483)
	at org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:120)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68)
	at org.apache.cocoon.components.treeprocessor.ContainerNode.invoke(ContainerNode.java:31)
	at org.apache.cocoon.components.treeprocessor.sitemap.CallNode.invoke(CallNode.java:93)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:46)
	at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:46)
	at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:46)
	at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:138)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68)
...
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:92)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:68)



This happens when trying to publish or schedule some specific items.

I've searched the archive for 'The prefix "task" for element "task:task" 
is not bound' but I couldn't find any useful info. Does this have 
anything to do with the endorsed folder? Or is my publication 
broken/damaged?

Thanks,
J.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Upgrading Lenya 1.2.x

Posted by Dave Sunerton-Burl <da...@lledr-solutions.co.uk>.
Michael Wechner wrote:

> you might just want to make a copy of your "data" and setup another 
> server parallel (e.g. another Tomcat) parallel to your productive 
> system, install
> there Lenya 1.2.4 and then copy the "data" (content, resources, 
> config/ac/..)
> into this new system and then test it.
Yes, I'll give it a go. You've highlighted what I think my real problem 
is - identifying what is the "data" and where it is. Also, there's all 
the changed config files and layout/look etc. etc. (not to mention all 
the little bug fixes which we've put in from various sources). I think I 
may be spending some quality time with a diff program......

So, in your list (content, resources, config/ac/) is that it? Or are 
there other purely content locations? If anyone can point me to a 
detailed description of the structure of the default pub that would be 
really helpfull.

Thanks
-- 
Dave Sunerton-Burl
Lledr Solutions

Email : dave@lledr-solutions.co.uk
Phone : +44 (0)1690 750446
Web : www.lledr-solutions.com


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Upgrading Lenya 1.2.x

Posted by Michael Wechner <mi...@wyona.com>.
Dave Sunerton-Burl wrote:

> I'm currently running Lenya 1.2.2 on our server and I'd like to 
> upgrade to 1.2.4. I'm a bit nervous about doing this as it's a live 
> server and I don't want to lose anything. Is there a good (tried and 
> tested) way of upgrading without losing content and history?


you might just want to make a copy of your "data" and setup another 
server parallel (e.g. another Tomcat) parallel to your productive 
system, install
there Lenya 1.2.4 and then copy the "data" (content, resources, 
config/ac/..)
into this new system and then test it.

HTH

Michi


-- 
Michael Wechner
Wyona      -   Open Source Content Management   -    Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
michael.wechner@wyona.com                        michi@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Upgrading Lenya 1.2.x

Posted by Dave Sunerton-Burl <da...@lledr-solutions.co.uk>.
I'm currently running Lenya 1.2.2 on our server and I'd like to upgrade 
to 1.2.4. I'm a bit nervous about doing this as it's a live server and I 
don't want to lose anything. Is there a good (tried and tested) way of 
upgrading without losing content and history?

-- 
Dave Sunerton-Burl
Lledr Solutions

Email : dave@lledr-solutions.co.uk
Phone : +44 (0)1690 750446
Web : www.lledr-solutions.com


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: missing varibale, generic language switching

Posted by so...@apache.org.
On 11/29/05, Roman Mario Xerxes Rometsch <xe...@mathematik.uni-ulm.de> wrote:
> i'm trying to implement the generic language switching as mentioned in
> http://wiki.apache.org/lenya/HowToLanguageSwitching at the bottom of the
> page. stylesheet>
>
> Now there's the variable $languages, which should contain the available
> languages, but it's empty. Maybe someone has a idea where I have to enable
> the function, that this variable will be passed to this file.
> (Maybe also someone has implemented this feature already and can post his
> xsl
> file?)

Did you add this line from the instructions to your XMAP?
<map:parameter name="languages"
value="{page-envelope:publication-languages-csv}"/>

You might want to read these pages:
http://solprovider.com/lenya/variables
http://solprovider.com/lenya/&cat=Language

I have not written a generic language switcher yet.  (Our production
website has two languages.)  Maybe I will have time tomorrow if you
still have issues.

solprovider

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org