You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Carsten Ziegeler <cz...@sundn.de> on 2001/02/28 16:10:30 UTC
[C2]: Problems with Actions and Parameters
Hi,
when I use action and parameters in this way:
<map:match pattern="forms/employee">
<map:act set="employee">
<parameter name="hallo" value="value"/>
<map:generate type="serverpages" src="docs/samples/forms/employee.xsp"/>
<map:transform src="stylesheets/dynamic-page2html.xsl"/>
<map:serialize/>
</map:act>
</map:match>
the generated java code is not compilable:
param = new Parameters ();
param.setParameter ("hallo", substitute(listOfMaps, "value"));
if ((map = action_set_employee (cocoon_action, listOfMaps,
environment, objectModel,
substitute(listOfMaps, null), param)) != null) {
getLogger().debug("Action action_set_employee");
listOfMaps.add (map);
.setParameter ("hallo", substitute(listOfMaps, "value"));
The parameter is processed twice! If the map:generate etc. is used outside the map:act the generated code is ok:
<map:act set="employee">
<parameter name="hallo" value="value"/>
</map:act>
<map:generate type="serverpages" src="docs/samples/forms/employee.xsp"/>
<map:transform src="stylesheets/dynamic-page2html.xsl"/>
<map:serialize/>
I search through the sitemap.xsl for the reason but I think it will take me some days to find the problem.
Any hints or ideas?
Carsten
Open Source Group sunShine - Lighting up e:Business
================================================================
Carsten Ziegeler, S&N AG, Klingenderstrasse 5, D-33100 Paderborn
www.sundn.de mailto:cziegeler@sundn.de
================================================================
AW: [C2]: Problems with Actions and Parameters
Posted by Carsten Ziegeler <cz...@sundn.de>.
> Berin Loritsch wrote:
>
> Ok. I got it fixed, and applied it to the sitemap in the distro.
> It even makes the action-set reusable in many places. This is
> awesome stuff.
>
Great, it works again. Thanks Berin
Carsten
> >
> > Carsten Ziegeler wrote:
> > >
> > > Hi,
> > >
> > > when I use action and parameters in this way:
> > >
> > > <map:match pattern="forms/employee">
> > > <map:act set="employee">
> > > <parameter name="hallo" value="value"/>
> > >
> > > <map:generate type="serverpages" src
> ="docs/samples/forms/employee.xsp"/>
> > > <map:transform src="stylesheets/dynamic-page2html.xsl"/>
> > > <map:serialize/>
> > > </map:act>
> > > </map:match>
> >
> > Unless you are using objectMap variables, this is not necessary anyways.
> >
> > > the generated java code is not compilable:
> > >
> > > param = new Parameters ();
> > > param.setParameter ("hallo", substitute(listOfMaps, "value"));
> > >
> > > if ((map = action_set_employee (cocoon_action, listOfMaps,
> > > environment, objectModel,
> > > substitute(listOfMaps, null),
> param)) != null) {
> > > getLogger().debug("Action action_set_employee");
> > > listOfMaps.add (map);
> > >
> > > .setParameter ("hallo", substitute(listOfMaps, "value"));
> >
> > That is a problem. This is probably a side affect of the change I made
> to key the
> > param value off of an xsl:param. I can change the code so that if the
> parameter
> > is not set, then it won't output the call anyway.
> >
> > > The parameter is processed twice! If the map:generate etc. is used
> outside the map:act the generated code is ok:
> > > <map:act set="employee">
> > > <parameter name="hallo" value="value"/>
> > > </map:act>
> > > <map:generate type="serverpages" src
> ="docs/samples/forms/employee.xsp"/>
> > > <map:transform src="stylesheets/dynamic-page2html.xsl"/>
> > > <map:serialize/>
> > >
> > > I search through the sitemap.xsl for the reason but I think it will
> take me some days to find the problem.
> >
> > Is it being called instead of applied? Let me apply my change, and it
> will get rid of _any_ instance where
> > the parameter is not set.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> > For additional commands, email: cocoon-dev-help@xml.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>
Re: [C2]: Problems with Actions and Parameters
Posted by Berin Loritsch <bl...@apache.org>.
Berin Loritsch wrote:
Ok. I got it fixed, and applied it to the sitemap in the distro.
It even makes the action-set reusable in many places. This is
awesome stuff.
>
> Carsten Ziegeler wrote:
> >
> > Hi,
> >
> > when I use action and parameters in this way:
> >
> > <map:match pattern="forms/employee">
> > <map:act set="employee">
> > <parameter name="hallo" value="value"/>
> >
> > <map:generate type="serverpages" src="docs/samples/forms/employee.xsp"/>
> > <map:transform src="stylesheets/dynamic-page2html.xsl"/>
> > <map:serialize/>
> > </map:act>
> > </map:match>
>
> Unless you are using objectMap variables, this is not necessary anyways.
>
> > the generated java code is not compilable:
> >
> > param = new Parameters ();
> > param.setParameter ("hallo", substitute(listOfMaps, "value"));
> >
> > if ((map = action_set_employee (cocoon_action, listOfMaps,
> > environment, objectModel,
> > substitute(listOfMaps, null), param)) != null) {
> > getLogger().debug("Action action_set_employee");
> > listOfMaps.add (map);
> >
> > .setParameter ("hallo", substitute(listOfMaps, "value"));
>
> That is a problem. This is probably a side affect of the change I made to key the
> param value off of an xsl:param. I can change the code so that if the parameter
> is not set, then it won't output the call anyway.
>
> > The parameter is processed twice! If the map:generate etc. is used outside the map:act the generated code is ok:
> > <map:act set="employee">
> > <parameter name="hallo" value="value"/>
> > </map:act>
> > <map:generate type="serverpages" src="docs/samples/forms/employee.xsp"/>
> > <map:transform src="stylesheets/dynamic-page2html.xsl"/>
> > <map:serialize/>
> >
> > I search through the sitemap.xsl for the reason but I think it will take me some days to find the problem.
>
> Is it being called instead of applied? Let me apply my change, and it will get rid of _any_ instance where
> the parameter is not set.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [C2]: Problems with Actions and Parameters
Posted by Berin Loritsch <bl...@apache.org>.
Carsten Ziegeler wrote:
>
> Hi,
>
> when I use action and parameters in this way:
>
> <map:match pattern="forms/employee">
> <map:act set="employee">
> <parameter name="hallo" value="value"/>
>
> <map:generate type="serverpages" src="docs/samples/forms/employee.xsp"/>
> <map:transform src="stylesheets/dynamic-page2html.xsl"/>
> <map:serialize/>
> </map:act>
> </map:match>
Unless you are using objectMap variables, this is not necessary anyways.
> the generated java code is not compilable:
>
> param = new Parameters ();
> param.setParameter ("hallo", substitute(listOfMaps, "value"));
>
> if ((map = action_set_employee (cocoon_action, listOfMaps,
> environment, objectModel,
> substitute(listOfMaps, null), param)) != null) {
> getLogger().debug("Action action_set_employee");
> listOfMaps.add (map);
>
> .setParameter ("hallo", substitute(listOfMaps, "value"));
That is a problem. This is probably a side affect of the change I made to key the
param value off of an xsl:param. I can change the code so that if the parameter
is not set, then it won't output the call anyway.
> The parameter is processed twice! If the map:generate etc. is used outside the map:act the generated code is ok:
> <map:act set="employee">
> <parameter name="hallo" value="value"/>
> </map:act>
> <map:generate type="serverpages" src="docs/samples/forms/employee.xsp"/>
> <map:transform src="stylesheets/dynamic-page2html.xsl"/>
> <map:serialize/>
>
> I search through the sitemap.xsl for the reason but I think it will take me some days to find the problem.
Is it being called instead of applied? Let me apply my change, and it will get rid of _any_ instance where
the parameter is not set.