Jasha Joachimsthal | 2 Jan 12:29 2012

Re: JX template generator leaves trace behind (jx namespace is added to final result tree)


On 7 December 2011 11:22, Robby Pelssers <Robby.Pelssers <at> nxp.com> wrote:

Hi guys,

 

When using the jx:template generator I noticed (actually on regular occasions) it leaves behind xmlns:jx=”http://apache.org/cocoon/templates/jx/1.0” 

After googling a bit around I noticed people having the same issue: http://marc.info/?l=xml-cocoon-users&m=118064449609598

 

But cleaning up any left behind namespace using xslt seems like a cumbersome solution and avoiding the root cause.  Does anyone if this is a bug in the generator itself?

 

Kind regards,

Robby


Not sure if it's a bug or a feature, but to clean up we have a StripNamespacesTransformer that removes all namespaces a lot faster than XSLT.

Jasha
Robby Pelssers | 2 Jan 13:39 2012

RE: JX template generator leaves trace behind (jx namespace is added to final result tree)

Hi Jasha,

 

Thx for the pointer.  I will take a look if it fits my needs.

 

Robby

 

From: Jasha Joachimsthal [mailto:j.joachimsthal <at> onehippo.com]
Sent: Monday, January 02, 2012 12:30 PM
To: users <at> cocoon.apache.org
Subject: Re: JX template generator leaves trace behind (jx namespace is added to final result tree)

 

 

On 7 December 2011 11:22, Robby Pelssers <Robby.Pelssers <at> nxp.com> wrote:

Hi guys,

 

When using the jx:template generator I noticed (actually on regular occasions) it leaves behind xmlns:jx=”http://apache.org/cocoon/templates/jx/1.0” 

After googling a bit around I noticed people having the same issue: http://marc.info/?l=xml-cocoon-users&m=118064449609598

 

But cleaning up any left behind namespace using xslt seems like a cumbersome solution and avoiding the root cause.  Does anyone if this is a bug in the generator itself?

 

Kind regards,

Robby

 

Not sure if it's a bug or a feature, but to clean up we have a StripNamespacesTransformer that removes all namespaces a lot faster than XSLT.

 

Jasha

Paul Joseph | 3 Jan 15:19 2012
Picon

how do I specify function parameters in the URL

Hi there,

I know that I can call a function with parameters using the sitemap as 
for ex.:

         <map:flow language="javascript">
            <map:script src="myApplication.js"/>
         </map:flow>
         <map:pipelines>
            <map:pipeline>
               <map:match pattern="index.html">
                  <map:call function="showIndexPage">
                    <map:parameter name="paramName" value="Value"/>
                  </map:call>
               </map:match>
            </map:pipeline>
         </map:pipelines>

and:

Then in myApplication.js you would define a JavaScript function called 
showIndexPage() such as:

function showIndexPage() { var param = cocoon.parameters.paramName; 
sendPage("private/index.html", {param: param}); }

But how would I use this to call a function whose arguments are in the 
calling URL.

Ex. say I wanted to login any user where the user's name is specified in 
the URLhow could I do this?  For example if I wanted to call a function 
using the user's login name that I specify in the URL (say the user is 
jsmith), and I used a URL as below, how would I pass on jsmith on to the 
flowscript?:

Ex.: http://myserver:8080/myApp/login/jsmith

thx.
Paul
Robby Pelssers | 3 Jan 15:25 2012

RE: how do I specify function parameters in the URL

Not sure if your setup is working like the sample below, but you can easily pass a parameter which you extract
from the URI or just pass a request parameter

Example 1:
<map:match pattern="login/*">
  <map:call function="showIndexPage">
    <map:parameter name="paramName" value="{1}"/>
  </map:call>
</map:match>

Example 2:

<map:match pattern="login.html">
  <map:call function="showIndexPage">
    <map:parameter name="paramName" value="{request-param:userId}"/>
  </map:call>
</map:match>

Kind regards,
Robby

-----Original Message-----
From: Paul Joseph [mailto:pjoseph <at> gmail.com] 
Sent: Tuesday, January 03, 2012 3:19 PM
To: users <at> cocoon.apache.org
Subject: how do I specify function parameters in the URL

Hi there,

I know that I can call a function with parameters using the sitemap as 
for ex.:

         <map:flow language="javascript">
            <map:script src="myApplication.js"/>
         </map:flow>
         <map:pipelines>
            <map:pipeline>
               <map:match pattern="index.html">
                  <map:call function="showIndexPage">
                    <map:parameter name="paramName" value="Value"/>
                  </map:call>
               </map:match>
            </map:pipeline>
         </map:pipelines>

and:

Then in myApplication.js you would define a JavaScript function called 
showIndexPage() such as:

function showIndexPage() { var param = cocoon.parameters.paramName; 
sendPage("private/index.html", {param: param}); }

But how would I use this to call a function whose arguments are in the 
calling URL.

Ex. say I wanted to login any user where the user's name is specified in 
the URLhow could I do this?  For example if I wanted to call a function 
using the user's login name that I specify in the URL (say the user is 
jsmith), and I used a URL as below, how would I pass on jsmith on to the 
flowscript?:

Ex.: http://myserver:8080/myApp/login/jsmith

thx.
Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe <at> cocoon.apache.org
For additional commands, e-mail: users-help <at> cocoon.apache.org
Paul Joseph | 3 Jan 15:36 2012
Picon

Re: how do I specify function parameters in the URL

Ah...yes, got it, thanks!
Paul

On 1/3/2012 9:25 AM, Robby Pelssers wrote:
> Not sure if your setup is working like the sample below, but you can easily pass a parameter which you
extract from the URI or just pass a request parameter
>
> Example 1:
> <map:match pattern="login/*">
>    <map:call function="showIndexPage">
>      <map:parameter name="paramName" value="{1}"/>
>    </map:call>
> </map:match>
>
>
> Example 2:
>
> <map:match pattern="login.html">
>    <map:call function="showIndexPage">
>      <map:parameter name="paramName" value="{request-param:userId}"/>
>    </map:call>
> </map:match>
>
>
> Kind regards,
> Robby
>
> -----Original Message-----
> From: Paul Joseph [mailto:pjoseph <at> gmail.com]
> Sent: Tuesday, January 03, 2012 3:19 PM
> To: users <at> cocoon.apache.org
> Subject: how do I specify function parameters in the URL
>
> Hi there,
>
> I know that I can call a function with parameters using the sitemap as
> for ex.:
>
>           <map:flow language="javascript">
>              <map:script src="myApplication.js"/>
>           </map:flow>
>           <map:pipelines>
>              <map:pipeline>
>                 <map:match pattern="index.html">
>                    <map:call function="showIndexPage">
>                      <map:parameter name="paramName" value="Value"/>
>                    </map:call>
>                 </map:match>
>              </map:pipeline>
>           </map:pipelines>
>
> and:
>
> Then in myApplication.js you would define a JavaScript function called
> showIndexPage() such as:
>
> function showIndexPage() { var param = cocoon.parameters.paramName;
> sendPage("private/index.html", {param: param}); }
>
>
>
> But how would I use this to call a function whose arguments are in the
> calling URL.
>
> Ex. say I wanted to login any user where the user's name is specified in
> the URLhow could I do this?  For example if I wanted to call a function
> using the user's login name that I specify in the URL (say the user is
> jsmith), and I used a URL as below, how would I pass on jsmith on to the
> flowscript?:
>
> Ex.: http://myserver:8080/myApp/login/jsmith
>
> thx.
> Paul
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe <at> cocoon.apache.org
> For additional commands, e-mail: users-help <at> cocoon.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe <at> cocoon.apache.org
> For additional commands, e-mail: users-help <at> cocoon.apache.org
>
>
Thorsten Scherler | 3 Jan 19:22 2012
Picon

Re: how do I specify function parameters in the URL

On Tue, 2012-01-03 at 09:19 -0500, Paul Joseph wrote:
> Hi there,
> 
> I know that I can call a function with parameters using the sitemap as 
> for ex.:
> 
>          <map:flow language="javascript">
>             <map:script src="myApplication.js"/>
>          </map:flow>
>          <map:pipelines>
>             <map:pipeline>
>                <map:match pattern="index.html">
>                   <map:call function="showIndexPage">
>                     <map:parameter name="paramName" value="Value"/>
>                   </map:call>
>                </map:match>
>             </map:pipeline>
>          </map:pipelines>
> 
> and:
> 
> Then in myApplication.js you would define a JavaScript function called 
> showIndexPage() such as:
> 
> function showIndexPage() { var param = cocoon.parameters.paramName; 
> sendPage("private/index.html", {param: param}); }
> 
> 
> 
> But how would I use this to call a function whose arguments are in the 
> calling URL.
> 
> Ex. say I wanted to login any user where the user's name is specified in 
> the URLhow could I do this?  For example if I wanted to call a function 
> using the user's login name that I specify in the URL (say the user is 
> jsmith), and I used a URL as below, how would I pass on jsmith on to the 
> flowscript?:
> 
> Ex.: http://myserver:8080/myApp/login/jsmith

Depends a bit on your version of cocoon but the following will work in
all version (replace {1} with {map:1} for c3).

<map:flow language="javascript">
    <map:script src="myApplication.js"/>
  </map:flow>
  <map:pipelines>
    <map:pipeline>
      <map:match pattern="index.html">
        <map:call function="showIndexPage">
          <map:parameter name="paramName" value="Value"/>
        </map:call>
      </map:match>
      <map:match pattern="login/*">
        <map:call function="login">
          <map:parameter name="user" value="{1}"/>
        </map:call>
      </map:match>
    </map:pipeline>
  </map:pipelines>

HTH

salu2
--

-- 
Thorsten Scherler <thorsten.at.apache.org>
codeBusters S.L. - web based systems
<consulting, training and solutions>
http://www.codebusters.es/
Paul Joseph | 3 Jan 19:24 2012
Picon

Re: how do I specify function parameters in the URL

Thanks Thorsten, appreciate it!
Paul

On 1/3/2012 1:22 PM, Thorsten Scherler wrote:
> On Tue, 2012-01-03 at 09:19 -0500, Paul Joseph wrote:
>> Hi there,
>>
>> I know that I can call a function with parameters using the sitemap as
>> for ex.:
>>
>>           <map:flow language="javascript">
>>              <map:script src="myApplication.js"/>
>>           </map:flow>
>>           <map:pipelines>
>>              <map:pipeline>
>>                 <map:match pattern="index.html">
>>                    <map:call function="showIndexPage">
>>                      <map:parameter name="paramName" value="Value"/>
>>                    </map:call>
>>                 </map:match>
>>              </map:pipeline>
>>           </map:pipelines>
>>
>> and:
>>
>> Then in myApplication.js you would define a JavaScript function called
>> showIndexPage() such as:
>>
>> function showIndexPage() { var param = cocoon.parameters.paramName;
>> sendPage("private/index.html", {param: param}); }
>>
>>
>>
>> But how would I use this to call a function whose arguments are in the
>> calling URL.
>>
>> Ex. say I wanted to login any user where the user's name is specified in
>> the URLhow could I do this?  For example if I wanted to call a function
>> using the user's login name that I specify in the URL (say the user is
>> jsmith), and I used a URL as below, how would I pass on jsmith on to the
>> flowscript?:
>>
>> Ex.: http://myserver:8080/myApp/login/jsmith
> Depends a bit on your version of cocoon but the following will work in
> all version (replace {1} with {map:1} for c3).
>
> <map:flow language="javascript">
>      <map:script src="myApplication.js"/>
>    </map:flow>
>    <map:pipelines>
>      <map:pipeline>
>        <map:match pattern="index.html">
>          <map:call function="showIndexPage">
>            <map:parameter name="paramName" value="Value"/>
>          </map:call>
>        </map:match>
>        <map:match pattern="login/*">
>          <map:call function="login">
>            <map:parameter name="user" value="{1}"/>
>          </map:call>
>        </map:match>
>      </map:pipeline>
>    </map:pipelines>
>
> HTH
>
> salu2
Blanco, Jose | 6 Jan 00:17 2012
Picon

revelet not repsonding

I am using cocoon and have the following servlet mappings:

  <servlet-mapping>
        <servlet-name>Cocoon</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>

  <servlet-mapping>
    <servlet-name>webiso-login</servlet-name>
    <url-pattern>/webiso-login</url-pattern>
  </servlet-mapping>

    <servlet-mapping>
        <servlet-name>Cocoon</servlet-name>
        <url-pattern>*.jsp</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>Cocoon</servlet-name>
        <url-pattern>*.html</url-pattern>
    </servlet-mapping>

I have a filter that traps for /webiso-login and the filter seems to be getting activated just fine, but when
it is done I'm expecting it to go the servlet file, but it's not getting there.  Does my setup make sense?

Thank you!
Jose
Jos Snellings | 6 Jan 07:59 2012

classnotfound

Dear cocooners,

When trying to load cocoon-optional, spring complains loudly about not being able to find class:

org/apache/cocoon/components/serializers/util/XMLSerializer

In effect, this class is not within the cocoon distribution.
To my best knowledge, there is no sub project
cocoon-components

The problematic declaration is:
public class EncodingXMLSerializer extends org.apache.cocoon.components.serializers.util.XMLSerializer implements
SAXPipelineComponent, Finisher, SAXConsumer, CachingPipelineComponent {

Can anybody shed some light upon this one?


Thank you !
Jos

Simone Tripodi | 6 Jan 11:07 2012
Picon

Re: classnotfound

Hi Jos!

please check the reply I provided in the dev ML that maybe will help!

All the best, have a nice day!
-Simo

http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/

On Fri, Jan 6, 2012 at 7:59 AM, Jos Snellings
<jos.snellings <at> upperware.biz> wrote:
> Dear cocooners,
>
> When trying to load cocoon-optional, spring complains loudly about not being
> able to find class:
>
> org/apache/cocoon/components/serializers/util/XMLSerializer
>
> In effect, this class is not within the cocoon distribution.
> To my best knowledge, there is no sub project
> cocoon-components
>
> The problematic declaration is:
> public class EncodingXMLSerializer extends
> org.apache.cocoon.components.serializers.util.XMLSerializer implements
> SAXPipelineComponent, Finisher, SAXConsumer, CachingPipelineComponent {
>
> Can anybody shed some light upon this one?
>
>
> Thank you !
> Jos
>

Gmane