You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by philguillard <ph...@gmail.com> on 2006/03/07 18:33:16 UTC

Re: How to catch an InvalidContinuationException?

This should work, you should be able to generate what you want this way, 
  i did it today. I don't know what is <map:generate type="request"/>, 
but i know you can keep the main sitemap error handling and do a custom 
one in any sub-sitemap.

Phil

Brian Maddy wrote:
> Has anyone successfully been able to catch an 
> InvalidContinuationException?  I've basically copied exactly what is 
> described here:
> http://cocoon.apache.org/2.1/userdocs/flow/tutor.html
> but Cocoon still uses the default handling of an exception (showing the 
> stacktrace and such).  I believe it's the one defined in the root 
> sitemap.  Has anyone else run into this or figured it out?
> 
> In my map:components section:
>    <map:selector name="exception" 
> src="org.apache.cocoon.selection.XPathExceptionSelector">
>      <exception name="invalid-continuation"
>                 
> class="org.apache.cocoon.components.flow.InvalidContinuationException"/>
>      <exception class="java.lang.Throwable" unroll="true"/>
>    </map:selector>
> 
> At the end of my pipeline:
>            <map:match pattern="public/continue-form">
>                <map:call 
> continuation="{request-param:continuation-id}"/>     <!-- exception 
> occurs here -->
>            </map:match>
>    <map:handle-errors>
>      <map:select type="exception">
>        <map:when test="invalid-continuation">
>                <map:generate type="request"/>
>                <map:serialize type="xml"/>
>        </map:when>
>      </map:select>
>    </map:handle-errors>
> 
> Thanks!
> Brian
> 
> 
> ---------------------------------------------------------------------
> 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


Re: i18n transformer doesn't translates attributes

Posted by br...@univ.trieste.it.
Quoting Simone Gianni <s....@thebug.it>:

> brosich@univ.trieste.it wrote:
>
>> Follow a fragment of xsp code that generate xml:
>> <xsp:page
>>          language="java"
>>          xmlns:xsp="http://apache.org/xsp"
>>          xmlns:esql="http://apache.org/cocoon/SQL/v2"
>>          xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
>>          space="strip">
>> ...
>> <xsp:element name="area">
>>    <xsp:attribute name="id"><esql:get-int column="pos" /></xsp:attribute>
>>    <xsp:attribute name="name"><esql:get-string column="name"   
>> /></xsp:attribute>
>>    <xsp:attribute name="colour"><esql:get-string column="colour"    
>> /></xsp:attribute>
>>    <xsp:attribute name="label"><esql:get-string   
>> column="name"/></xsp:attribute>
>>    <xsp:attribute name="i18n:attr">label</xsp:attribute>
>> ...
>
>
> I think you should try to generate this attribute this way :
>
> <xsp:attribute name="attr" prefix="i18n"
> uri="http://apache.org/cocoon/i18n/2.1">label</xsp:attribute>

Yes! It works!

Thank you very much.

Alberto



>
> I'm not an XSP expert, but the
> /cocoon-2.1.X/src/blocks/xsp/java/org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl file (that transforms your xsp to a java class) apparently uses this   
> parameters
> :
>
> name : is the attribute name (which is not i18n:attr, but just attr)
> prefix : is the prefix you want to map the namespace of this attribute to.
> uri : is the namespace uri
>
> Hope this helps,
> ciao,
> Simone
>
>
> -- 
> Simone Gianni
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



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


Re: i18n transformer doesn't translates attributes

Posted by Simone Gianni <s....@thebug.it>.
brosich@univ.trieste.it wrote:

> Follow a fragment of xsp code that generate xml:
> <xsp:page
>           language="java"
>           xmlns:xsp="http://apache.org/xsp"
>           xmlns:esql="http://apache.org/cocoon/SQL/v2"
>           xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
>           space="strip">
> ...
> <xsp:element name="area">
>     <xsp:attribute name="id"><esql:get-int column="pos" 
> /></xsp:attribute>
>     <xsp:attribute name="name"><esql:get-string column="name" 
> /></xsp:attribute>
>     <xsp:attribute name="colour"><esql:get-string column="colour"  
> /></xsp:attribute>
>     <xsp:attribute name="label"><esql:get-string 
> column="name"/></xsp:attribute>
>     <xsp:attribute name="i18n:attr">label</xsp:attribute>
> ...


I think you should try to generate this attribute this way :

<xsp:attribute name="attr" prefix="i18n" 
uri="http://apache.org/cocoon/i18n/2.1">label</xsp:attribute>

I'm not an XSP expert, but the 
/cocoon-2.1.X/src/blocks/xsp/java/org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl 
file (that transforms your xsp to a java class) apparently uses this 
parameters :

name : is the attribute name (which is not i18n:attr, but just attr)
prefix : is the prefix you want to map the namespace of this attribute to.
uri : is the namespace uri

Hope this helps,
ciao,
Simone


-- 
Simone Gianni

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


Re: i18n transformer doesn't translates attributes

Posted by Simone Gianni <s....@thebug.it>.
Ciao Alberto,
it should work correctly, but before further investigations, are you 
sure about the following :
- i18n namespace is correctly declared in a node parent of the <area> 
element
- there is a <message key="about_area">something</message> in your i18n 
bundle
- the <area> element makes it thru the i18n transformer (no xsl before 
the i18n transformer that could alter the area element)

could you post the sitemap fragment and some more xml lines?

Simone


brosich@univ.trieste.it wrote:

> I have a strange problem.
>
> Out of a generator i have the following tag
>
> ...
> <area id="1" name="about_area" colour="FF0000" label="about_area"  
> i18n:attr="label">
> ...
>
> After an i18n transformer, all "<i18n:text>" tags are correctly  
> translated but the tag above is unchanged and the attribute "label" 
> is  untranslated.
>
> Any suggest?
>
> Alberto Brosich
>
> Cocoon 2.1.8
> Jetty
> Linux Debian 3.1
> Kernel 2.6.15
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
-- 
Simone Gianni

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


i18n transformer doesn't translates attributes

Posted by br...@univ.trieste.it.
I have a strange problem.

Out of a generator i have the following tag

...
<area id="1" name="about_area" colour="FF0000" label="about_area"  
i18n:attr="label">
...

After an i18n transformer, all "<i18n:text>" tags are correctly  
translated but the tag above is unchanged and the attribute "label" is  
untranslated.

Any suggest?

Alberto Brosich

Cocoon 2.1.8
Jetty
Linux Debian 3.1
Kernel 2.6.15

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



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