You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Brian Topping <to...@digidemic.com> on 2002/06/06 12:46:15 UTC

Parameterizing Sitemap with XMLForms

Hi all,

So I am trying to parameterize a sitemap that I am using with forms and running into an interesting situation.  I don't know enough about components and actions yet, but this may be a bug in AbstractXMLFormAction.  (I've changed the names in the code below, but it's just Heidi's example...)

Sitemap snippet:

	<map:match pattern="bill2forms/*.html">
		<map:act type="HowtoWizardAction">
			<!-- XMLForm parameters for the HowtoWizardAction -->
			<map:parameter name="xmlform-validator-schema-ns" value="http://www.ascc.net/xml/schematron"/>
			<map:parameter name="xmlform-validator-schema" value="forms/{1}/xmlform-sch-report.xml"/>
			<map:parameter name="xmlform-id" value="form-{1}"/>
			<map:parameter name="xmlform-scope" value="session"/>
			<map:parameter name="xmlform-model" value="com.bill2.site.xmlform.HowtoBean"/>
			<!-- Content transformation logic -->
			<map:generate src="forms/{../1}/{page}.xml"/>
			<map:transform type="xmlform" label="xml"/>
			<map:transform src="forms/{../1}/wizard2html.xsl"/>
			<map:transform src="context://stylesheets/xmlform/xmlform2html.xsl"/>
			<map:serialize type="html"/>
		</map:act>
	</map:match>

If you look at the parameterization, all of the <map:parameters> use "{1}", but all the other components are sent "{../1}".  This is what it takes to get the sitemap interpreter to be happy and put the start page on the screen.  But when it comes to clicking on the "Start" link on the first form page, the following exception is generated:

org.apache.avalon.framework.CascadingRuntimeException:  Failed loading validating schema 
	at org.apache.cocoon.acting.AbstractXMLFormAction.getFormValidator(AbstractXMLFormAction.java:365)
	at org.apache.cocoon.acting.AbstractXMLFormAction.getForm(AbstractXMLFormAction.java:179)
	at org.apache.cocoon.acting.AbstractXMLFormAction.act(AbstractXMLFormAction.java:202)
	at org.apache.cocoon.components.treeprocessor.sitemap.ActTypeNode.invoke(ActTypeNode.java:133)

I wouldn't mind submitting the patch, but I'm not confident enough yet of the semantics of parameterization to know if I am doing the right thing.  I presume that the problem is in AbstractXMLFormAction by the fact that the other components weren't changed, but that kind of hunch is not a very responsible manner in which to submit a patch...

If it takes longer to describe than it does to fix, I can wait for the next bug in order to put some work in.  But I do want to learn about the semantics of parameterization more, and I only really know about {../*} from a post that Vadim made a long time back.  Is there a full explanation of this anywhere?  (RTFM?)

best,

-b

_________________________________________________________ 
If you have some ice cream, I will give it to you. 
If you have no ice cream, I will take it away from you. 
         - Ice Cream Koan


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


Re: Parameterizing Sitemap with XMLForms

Posted by Ivelin Ivanov <iv...@apache.org>.
Brian,

The cause for the exception is

<map:parameter name="xmlform-validator-schema"
value="forms/{1}/xmlform-sch-report.xml"/>


The value should point to a path which the SourceResolver passed to the
AbstractXMLFormAction can locate and load.

I am not quite sure what is the layout of the directories in your case.

A sitemap expert should be able to help with this one.
If I am not mistaken {1} references the first variable in the current
sitemap,
while {../1} references the first variable in the parent sitemap.


What do you think the bug in AbstractXMLFormAction is?



Ivelin



----- Original Message -----
From: "Brian Topping" <to...@digidemic.com>
To: <co...@xml.apache.org>
Sent: Thursday, June 06, 2002 5:46 AM
Subject: Parameterizing Sitemap with XMLForms


Hi all,

So I am trying to parameterize a sitemap that I am using with forms and
running into an interesting situation.  I don't know enough about components
and actions yet, but this may be a bug in AbstractXMLFormAction.  (I've
changed the names in the code below, but it's just Heidi's example...)

Sitemap snippet:

<map:match pattern="bill2forms/*.html">
<map:act type="HowtoWizardAction">
<!-- XMLForm parameters for the HowtoWizardAction -->
<map:parameter name="xmlform-validator-schema-ns"
value="http://www.ascc.net/xml/schematron"/>
<map:parameter name="xmlform-validator-schema"
value="forms/{1}/xmlform-sch-report.xml"/>
<map:parameter name="xmlform-id" value="form-{1}"/>
<map:parameter name="xmlform-scope" value="session"/>
<map:parameter name="xmlform-model"
value="com.bill2.site.xmlform.HowtoBean"/>
<!-- Content transformation logic -->
<map:generate src="forms/{../1}/{page}.xml"/>
<map:transform type="xmlform" label="xml"/>
<map:transform src="forms/{../1}/wizard2html.xsl"/>
<map:transform src="context://stylesheets/xmlform/xmlform2html.xsl"/>
<map:serialize type="html"/>
</map:act>
</map:match>

If you look at the parameterization, all of the <map:parameters> use "{1}",
but all the other components are sent "{../1}".  This is what it takes to
get the sitemap interpreter to be happy and put the start page on the
screen.  But when it comes to clicking on the "Start" link on the first form
page, the following exception is generated:

org.apache.avalon.framework.CascadingRuntimeException:  Failed loading
validating schema
at
org.apache.cocoon.acting.AbstractXMLFormAction.getFormValidator(AbstractXMLF
ormAction.java:365)
at
org.apache.cocoon.acting.AbstractXMLFormAction.getForm(AbstractXMLFormAction
.java:179)
at
org.apache.cocoon.acting.AbstractXMLFormAction.act(AbstractXMLFormAction.jav
a:202)
at
org.apache.cocoon.components.treeprocessor.sitemap.ActTypeNode.invoke(ActTyp
eNode.java:133)

I wouldn't mind submitting the patch, but I'm not confident enough yet of
the semantics of parameterization to know if I am doing the right thing.  I
presume that the problem is in AbstractXMLFormAction by the fact that the
other components weren't changed, but that kind of hunch is not a very
responsible manner in which to submit a patch...

If it takes longer to describe than it does to fix, I can wait for the next
bug in order to put some work in.  But I do want to learn about the
semantics of parameterization more, and I only really know about {../*} from
a post that Vadim made a long time back.  Is there a full explanation of
this anywhere?  (RTFM?)

best,

-b

_________________________________________________________
If you have some ice cream, I will give it to you.
If you have no ice cream, I will take it away from you.
         - Ice Cream Koan


---------------------------------------------------------------------
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: Parameterizing Sitemap with XMLForms

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Brian Topping [mailto:topping@digidemic.com]
> 
> Hi all,
> 
> So I am trying to parameterize a sitemap that I am using with forms
and
> running into an interesting situation.  I don't know enough about
components
> and actions yet, but this may be a bug in AbstractXMLFormAction.
(I've
> changed the names in the code below, but it's just Heidi's example...)
> 
> Sitemap snippet:
> 
> 	<map:match pattern="bill2forms/*.html">
> 		<map:act type="HowtoWizardAction">
> 			<!-- XMLForm parameters for the
HowtoWizardAction -->
> 			<map:parameter
name="xmlform-validator-schema-ns"
> value="http://www.ascc.net/xml/schematron"/>
> 			<map:parameter name="xmlform-validator-schema"
> value="forms/{1}/xmlform-sch-report.xml"/>
> 			<map:parameter name="xmlform-id"
value="form-{1}"/>
> 			<map:parameter name="xmlform-scope"
value="session"/>
> 			<map:parameter name="xmlform-model"
> value="com.bill2.site.xmlform.HowtoBean"/>
> 			<!-- Content transformation logic -->
> 			<map:generate src="forms/{../1}/{page}.xml"/>
> 			<map:transform type="xmlform" label="xml"/>
> 			<map:transform
src="forms/{../1}/wizard2html.xsl"/>
> 			<map:transform
> src="context://stylesheets/xmlform/xmlform2html.xsl"/>
> 			<map:serialize type="html"/>
> 		</map:act>
> 	</map:match>
> 
> If you look at the parameterization, all of the <map:parameters> use
"{1}",
> but all the other components are sent "{../1}".  This is what it takes
to get
> the sitemap interpreter to be happy and put the start page on the
screen.  But
> when it comes to clicking on the "Start" link on the first form page,
the
> following exception is generated:
> 
> org.apache.avalon.framework.CascadingRuntimeException:  Failed loading
> validating schema
> 	at
>
org.apache.cocoon.acting.AbstractXMLFormAction.getFormValidator(Abstract
XMLFor
> mAction.java:365)
> 	at
>
org.apache.cocoon.acting.AbstractXMLFormAction.getForm(AbstractXMLFormAc
tion.j
> ava:179)
> 	at
>
org.apache.cocoon.acting.AbstractXMLFormAction.act(AbstractXMLFormAction
.java:
> 202)
> 	at
>
org.apache.cocoon.components.treeprocessor.sitemap.ActTypeNode.invoke(Ac
tTypeN
> ode.java:133)
> 
> I wouldn't mind submitting the patch, but I'm not confident enough yet
of the
> semantics of parameterization to know if I am doing the right thing.
I
> presume that the problem is in AbstractXMLFormAction by the fact that
the
> other components weren't changed, but that kind of hunch is not a very
> responsible manner in which to submit a patch...
> 
> If it takes longer to describe than it does to fix, I can wait for the
next
> bug in order to put some work in.  But I do want to learn about the
semantics
> of parameterization more, and I only really know about {../*} from a
post that
> Vadim made a long time back.  Is there a full explanation of this
anywhere?
> (RTFM?)

There is no one good document explaining this... I believe should be
explained somewhere
(http://xml.apache.org/cocoon/userdocs/concepts/sitemap.html ?), but it
is not.

Here is some info about parameters:

http://xml.apache.org/cocoon/faq.html#faq-19

http://xml.apache.org/cocoon/userdocs/concepts/actions.html
"Communication between Sitemap and Action"
(the same is for matchers)


Vadim

 
> best,
> 
> -b


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