You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Sy...@swisscom.com on 2003/12/04 12:56:17 UTC

error when using my own transformer

Hello,

I have created a new transformer called "RoleTransformer". It doesn't have lot of features at this moment: it simply adds some XML tags in a document.

I have declared this new transformer in the main sitemap like:
<map:transformer logger="sitemap.transformer.role" name="role" src="com.itservices.woc.transformation.RoleTransformer"/>

And I use it in another sitemap:
<map:transform type="role">
	<map:parameter name="username" value="{request-param:name}"/>
</map:transform>

But it seems that Cocoon doesn't find it. The error below occurs.

Do I have forget something?

Thanks for any help
Sylvain

**error**
ERROR   (2003-12-04) 12:41.09:390 Lookup of transformer for role 'role' failed.: org.apache.avalon.framework.component.ComponentException: transformers: ComponentSelector could not access the Component for hint [role] (key [role])
	at org.apache.cocoon.webapps.authentication.components.PipelineAuthenticator.authenticate(PipelineAuthenticator.java:199)
	at org.apache.cocoon.webapps.authentication.components.DefaultAuthenticationManager.login(DefaultAuthenticationManager.java:238)
etc...
**error**

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


RE: Woody - open new window on form submit

Posted by Jan Hoskens <jh...@schaubroeck.be>.
Hi again,

If you don't know the name of your new window until the button is clicked, I
think you have two options:
1) try to extract the name from your form with a javascript in your html
page (just an idea, don't know how:-)
   and using a javascript function call in your
onclick='see_what_was_clicked'
2) Open a new window with a default name and try to set the windowname
afterwards (if that's possible somehow, don't know, never done it, maybe
redirecting the default-page to the correct one?)
Sorry can't help you any further, never had to do something alike!

Greetz,
Jan

-----Oorspronkelijk bericht-----
Van: Katharina Weimer [mailto:katharina_Weimer@gmx.de] 
Verzonden: donderdag 4 december 2003 14:36
Aan: users@cocoon.apache.org
Onderwerp: RE: Woody - open new window on form submit


Thanks so far, Jan !

Yes you're right - it's possible opening a new window with 
<input type="submit" onclick="window.open('mynewwindow')"/>.

But unfortunately in my case I just know the name under which the window
should be opened when the form is submitted. The Javascript below selects
the selected value from a selection list (in this case "projekt") and sends
a request to the sitemap which looks for the adequate pipeline.

So what I need is to tell this input button to open the generated svg in a
new window...

 function selectForm() {
     var form = new Form("forms/formselector_form.xml");
     form.showForm("formselector-view");
     var project_no = form.getWidget("projekt");
     cocoon.request.setAttribute("formselectorform", form.getWidget());
     cocoon.sendPage(Project_no.getValue());    
 }


Any ideas ?
Katharina 




> Hello,
> 
> As far as I know, everything that has the namespace wt will be handled
> by
> the woodyTemplateTransformer, if you use <input type="submit"
> onclick="window.open('mynewwindow')"/> this tag(or any other tag 
> without
> namespace wt:) will just be copied by the transformer. So this code 
> should
> work fine to open a new window.
> 
> Bye,
> 
> Jan
> 
> -----Oorspronkelijk bericht-----
> Van: Katharina Weimer [mailto:katharina_Weimer@gmx.de]
> Verzonden: donderdag 4 december 2003 13:55
> Aan: users@cocoon.apache.org
> Onderwerp: Woody - open new window on form submit
> 
> 
> Hi,
> 
> does anyone have an idea how to open a new window on a form submit in
> woody
> ?
> 
> I have the following template:
> 
> <wt:form-template action="formselector" method="POST">
> 	<wt:continuation-id/>
> 	<table border="0">
>                                  .
>                                  .
>                                  .
>                                  .
> 		<tr>
> 		<td valign="top">
> 		<wt:widget-label id="typ"/>
> 		</td>
> 		<td valign="top">
> 		<wt:widget id="typ">
> 		<wi:styling submit-on-change="true"/>
> 		</wt:widget>
> 		</td>
> 		</tr>
> 	</table>
> 	<br/>
> 		<wt:widget id="message"/>
> 		<br/>
> 		<br/>
> 		<input type="submit" value="Go!"/>
> </wt:form-template>
> 
> 
> My javascript function looks like this:
> 
> function selectForm() {
>     var form = new Form("forms/formselector_form.xml");
>     form.showForm("formselector-view");
>     var project_no = form.getWidget("projekt");
>     cocoon.request.setAttribute("formselectorform", form.getWidget());
>     cocoon.sendPage(Project_no.getValue());    
> }
> 
> 
> On submitting the above form Woody selects a pipline and generates a 
> svg graphic. I'd like to have this svg on a new window, but I have no 
> clue how to do this, since putting an onclick="..." into the 
> <input>Tag in the template does not work as WoodytemplateTransformer 
> does not support this.
> 
> Is there anybody out there who can help me out ?
> Greetz,
> Katharina
> 
> p.s: maybe there's a possibility for opening a new window with 
> cocoon.sendPage(), but I was looking at the docs and couldn't find 
> anything...
> 
> --
> HAKUNA MATATA !!!
> 
> +++ GMX - die erste Adresse für Mail, Message, More +++
> Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net
> 
> 
> 
> ---------------------------------------------------------------------
> 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
> 

-- 
HAKUNA MATATA !!!

+++ GMX - die erste Adresse für Mail, Message, More +++
Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net



---------------------------------------------------------------------
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: Woody - open new window on form submit

Posted by Katharina Weimer <ka...@gmx.de>.
Thanks so far, Jan !

Yes you're right - it's possible opening a new window with 
<input type="submit" onclick="window.open('mynewwindow')"/>.

But unfortunately in my case I just know the name under which the window
should be opened when the form is submitted.
The Javascript below selects the selected value from a selection list (in
this case "projekt") and sends a request to the sitemap which looks for the
adequate pipeline.

So what I need is to tell this input button to open the generated svg in a
new window...

 function selectForm() {
     var form = new Form("forms/formselector_form.xml");
     form.showForm("formselector-view");
     var project_no = form.getWidget("projekt");
     cocoon.request.setAttribute("formselectorform", form.getWidget());
     cocoon.sendPage(Project_no.getValue());    
 }


Any ideas ?
Katharina 




> Hello,
> 
> As far as I know, everything that has the namespace wt will be handled 
> by
> the woodyTemplateTransformer, if you use <input type="submit"
> onclick="window.open('mynewwindow')"/> this tag(or any other tag 
> without
> namespace wt:) will just be copied by the transformer. So this code 
> should
> work fine to open a new window.
> 
> Bye,
> 
> Jan
> 
> -----Oorspronkelijk bericht-----
> Van: Katharina Weimer [mailto:katharina_Weimer@gmx.de] 
> Verzonden: donderdag 4 december 2003 13:55
> Aan: users@cocoon.apache.org
> Onderwerp: Woody - open new window on form submit
> 
> 
> Hi, 
> 
> does anyone have an idea how to open a new window on a form submit in 
> woody
> ?
> 
> I have the following template:
> 
> <wt:form-template action="formselector" method="POST">
> 	<wt:continuation-id/>
> 	<table border="0">
>                                  .
>                                  .
>                                  .
>                                  .
> 		<tr>
> 		<td valign="top">
> 		<wt:widget-label id="typ"/>
> 		</td>
> 		<td valign="top">
> 		<wt:widget id="typ">
> 		<wi:styling submit-on-change="true"/>
> 		</wt:widget>
> 		</td>
> 		</tr>
> 	</table>
> 	<br/>
> 		<wt:widget id="message"/>
> 		<br/>
> 		<br/>
> 		<input type="submit" value="Go!"/>
> </wt:form-template>
> 
> 
> My javascript function looks like this:
> 
> function selectForm() {
>     var form = new Form("forms/formselector_form.xml");
>     form.showForm("formselector-view");
>     var project_no = form.getWidget("projekt");
>     cocoon.request.setAttribute("formselectorform", form.getWidget());
>     cocoon.sendPage(Project_no.getValue());    
> }
> 
> 
> On submitting the above form Woody selects a pipline and generates a svg
> graphic. I'd like to have this svg on a new window, but I have no clue 
> how
> to do this, since putting an onclick="..." into the <input>Tag in the
> template does not work as WoodytemplateTransformer does not support 
> this.
> 
> Is there anybody out there who can help me out ?
> Greetz,
> Katharina
> 
> p.s: maybe there's a possibility for opening a new window with
> cocoon.sendPage(), but I was looking at the docs and couldn't find
> anything...
> 
> -- 
> HAKUNA MATATA !!!
> 
> +++ GMX - die erste Adresse für Mail, Message, More +++
> Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net
> 
> 
> 
> ---------------------------------------------------------------------
> 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
> 

-- 
HAKUNA MATATA !!!

+++ GMX - die erste Adresse für Mail, Message, More +++
Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net



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


RE: Woody - open new window on form submit

Posted by Jan Hoskens <jh...@schaubroeck.be>.
Hello,

As far as I know, everything that has the namespace wt will be handled by
the woodyTemplateTransformer, if you use <input type="submit"
onclick="window.open('mynewwindow')"/> this tag(or any other tag without
namespace wt:) will just be copied by the transformer. So this code should
work fine to open a new window.

Bye,

Jan

-----Oorspronkelijk bericht-----
Van: Katharina Weimer [mailto:katharina_Weimer@gmx.de] 
Verzonden: donderdag 4 december 2003 13:55
Aan: users@cocoon.apache.org
Onderwerp: Woody - open new window on form submit


Hi, 

does anyone have an idea how to open a new window on a form submit in woody
?

I have the following template:

<wt:form-template action="formselector" method="POST">
	<wt:continuation-id/>
	<table border="0">
                                 .
                                 .
                                 .
                                 .
		<tr>
		<td valign="top">
		<wt:widget-label id="typ"/>
		</td>
		<td valign="top">
		<wt:widget id="typ">
		<wi:styling submit-on-change="true"/>
		</wt:widget>
		</td>
		</tr>
	</table>
	<br/>
		<wt:widget id="message"/>
		<br/>
		<br/>
		<input type="submit" value="Go!"/>
</wt:form-template>


My javascript function looks like this:

function selectForm() {
    var form = new Form("forms/formselector_form.xml");
    form.showForm("formselector-view");
    var project_no = form.getWidget("projekt");
    cocoon.request.setAttribute("formselectorform", form.getWidget());
    cocoon.sendPage(Project_no.getValue());    
}


On submitting the above form Woody selects a pipline and generates a svg
graphic. I'd like to have this svg on a new window, but I have no clue how
to do this, since putting an onclick="..." into the <input>Tag in the
template does not work as WoodytemplateTransformer does not support this.

Is there anybody out there who can help me out ?
Greetz,
Katharina

p.s: maybe there's a possibility for opening a new window with
cocoon.sendPage(), but I was looking at the docs and couldn't find
anything...

-- 
HAKUNA MATATA !!!

+++ GMX - die erste Adresse für Mail, Message, More +++
Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net



---------------------------------------------------------------------
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


Woody - open new window on form submit

Posted by Katharina Weimer <ka...@gmx.de>.
Hi, 

does anyone have an idea how to open a new window on a form submit in woody
?

I have the following template:

<wt:form-template action="formselector" method="POST">
	<wt:continuation-id/>
	<table border="0">
                                 .
                                 .
                                 .
                                 .
		<tr>
		<td valign="top">
		<wt:widget-label id="typ"/>
		</td>
		<td valign="top">
		<wt:widget id="typ">
		<wi:styling submit-on-change="true"/>
		</wt:widget>
		</td>
		</tr>
	</table>
	<br/>
		<wt:widget id="message"/>
		<br/>
		<br/>
		<input type="submit" value="Go!"/>
</wt:form-template>


My javascript function looks like this:

function selectForm() {
    var form = new Form("forms/formselector_form.xml");
    form.showForm("formselector-view");
    var project_no = form.getWidget("projekt");
    cocoon.request.setAttribute("formselectorform", form.getWidget());
    cocoon.sendPage(Project_no.getValue());    
}


On submitting the above form Woody selects a pipline and generates a svg
graphic.
I'd like to have this svg on a new window, but I have no clue how to do
this, since putting an onclick="..." into the <input>Tag in the template does not
work as WoodytemplateTransformer does not support this.

Is there anybody out there who can help me out ?
Greetz,
Katharina

p.s: maybe there's a possibility for opening a new window with
cocoon.sendPage(), but I was looking at the docs and couldn't find anything...

-- 
HAKUNA MATATA !!!

+++ GMX - die erste Adresse für Mail, Message, More +++
Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net



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


AW: error when using my own transformer

Posted by Marco Rolappe <m_...@web.de>.
hi sylvain,

your transformer probably throws an exception in one of the lifecycle
methods (setup, initialize, whatever...). quickest way to find out (if not
obvious from the logs) is to set breakpoints on those methods (and maybe on
exceptions thown) and see what happens.


> -----Ursprüngliche Nachricht-----
> Von: users-return-59478-m_rolappe=web.de@cocoon.apache.org
> [mailto:users-return-59478-m_rolappe=web.de@cocoon.apache.org]Im Auftrag
> von Sylvain.Thevoz@swisscom.com
> Gesendet: Donnerstag, 4. Dezember 2003 12:56
> An: users@cocoon.apache.org
> Betreff: error when using my own transformer
>
>
> Hello,
>
> I have created a new transformer called "RoleTransformer". It
> doesn't have lot of features at this moment: it simply adds some
> XML tags in a document.
>
> I have declared this new transformer in the main sitemap like:
> <map:transformer logger="sitemap.transformer.role" name="role"
> src="com.itservices.woc.transformation.RoleTransformer"/>
>
> And I use it in another sitemap:
> <map:transform type="role">
> 	<map:parameter name="username" value="{request-param:name}"/>
> </map:transform>
>
> But it seems that Cocoon doesn't find it. The error below occurs.
>
> Do I have forget something?
>
> Thanks for any help
> Sylvain
>
> **error**
> ERROR   (2003-12-04) 12:41.09:390 Lookup of transformer for role
> 'role' failed.:
> org.apache.avalon.framework.component.ComponentException:
> transformers: ComponentSelector could not access the Component
> for hint [role] (key [role])
> 	at
> org.apache.cocoon.webapps.authentication.components.PipelineAuthen
> ticator.authenticate(PipelineAuthenticator.java:199)
> 	at
> org.apache.cocoon.webapps.authentication.components.DefaultAuthent
> icationManager.login(DefaultAuthenticationManager.java:238)
> etc...
> **error**
>
> ---------------------------------------------------------------------
> 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