You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mygrp <md...@gmail.com> on 2005/01/17 08:21:16 UTC
flowscript
hi,
I have a simple flowscript with a function which will call a certain url.
The flowscript is calurl.js
function main()
{
var id=cocoon.request.get("id");
cocoon.sendPage("http://www.abc.org/er.php?id=" + id);
}
The sitemap pipeline is as follows
<map:match pattern="fspa">
<map:call function="main"/>
<map:serialize type="html" />
</map:match>
However on execution the following error is seen:
file:/usr/local/src/cocoon-2.1.3/build/webapp/headlines/calurl.js",
line 4: uncaught JavaScript exception: at main
(file:/usr/local/src/cocoon-2.1.3/build/webapp/headlines/calurl.js,
Line 4): java.lang.Exception: uri is not allowed to contain a scheme
(cocoon:/ is always automatically used)
What is this error .....how do i correct this.
regds.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: flowscript
Posted by Reinhard Poetz <re...@apache.org>.
Mygrp wrote:
> im getting the same error again
> Im using cocoon 2.1.3
I'm not sure, if this module is available in 2.1.3. Maybe it was introduced
later ... :-(
>
> where actually is this in cocoon.xconf?
WEB-INF/cocoon.xconf
--
Reinhard
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: flowscript
Posted by Mygrp <md...@gmail.com>.
im getting the same error again
Im using cocoon 2.1.3
where actually is this in cocoon.xconf?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: flowscript
Posted by Reinhard Poetz <re...@apache.org>.
Mygrp wrote:
> tried this...but i get an error
>
> org.apache.avalon.framework.component.ComponentException:
> input-modules: ComponentSelector could not find the component for hint
> [flow-attr] (key [flow-attr])
hmmm. maybe you use an older Cocoon version. Try {flow-attribute:id} which seems
to be the older, in the meanwhile deprecated name for this input module. See
cocoon.xconf for details.
--
Reinhard
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: flowscript
Posted by Mygrp <md...@gmail.com>.
tried this...but i get an error
org.apache.avalon.framework.component.ComponentException:
input-modules: ComponentSelector could not find the component for hint
[flow-attr] (key [flow-attr])
do i need to declare it before ??
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: flowscript
Posted by Reinhard Poetz <re...@apache.org>.
Mygrp wrote:
> if i do something like
>
> cocoon.sendPage("/abc/xyz") where abc/xyz is a cocoon pipeline.....how
> is it possible to pass the parameter id ??
>
> the pipeline will be
>
> <map:match pattern="xyz">
> <map:generate src="http://www.abc.org/er.php?id=" (what comes here??)>
cocoon.sendPage("/abc/xyz", {id=4711});
<map:generate src="http://www.abc.org/er.php?id={flow-attr:id}"/>
--
Reinhard
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: flowscript
Posted by Mygrp <md...@gmail.com>.
if i do something like
cocoon.sendPage("/abc/xyz") where abc/xyz is a cocoon pipeline.....how
is it possible to pass the parameter id ??
the pipeline will be
<map:match pattern="xyz">
<map:generate src="http://www.abc.org/er.php?id=" (what comes here??)>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: flowscript
Posted by Reinhard Poetz <re...@apache.org>.
Mygrp wrote:
> hi,
>
> I have a simple flowscript with a function which will call a certain url.
>
> The flowscript is calurl.js
>
> function main()
> {
> var id=cocoon.request.get("id");
> cocoon.sendPage("http://www.abc.org/er.php?id=" + id);
> }
>
> The sitemap pipeline is as follows
>
> <map:match pattern="fspa">
> <map:call function="main"/>
> <map:serialize type="html" />
> </map:match>
>
> However on execution the following error is seen:
>
> file:/usr/local/src/cocoon-2.1.3/build/webapp/headlines/calurl.js",
> line 4: uncaught JavaScript exception: at main
> (file:/usr/local/src/cocoon-2.1.3/build/webapp/headlines/calurl.js,
> Line 4): java.lang.Exception: uri is not allowed to contain a scheme
> (cocoon:/ is always automatically used)
>
cocoon.sendPage(AndWait) can only send Cocoon pipelines and NOT something else.
You either have to encapsulate your external call into a Cocoon pipeline
(FileGenerator calling your URL) or you redirect to the URL. cocoon.redirectTo(url).
HTH
--
Reinhard
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org