Josema,

The new revision is excelent.

Please follow the instructions to submit an official HOWTO
http://xml.apache.org/cocoon/howto/howto-author-howto.html

Diana will take it from there.


I would recommend the following minor corrections to the code:

In the fragment below, why use "//". Is it a typo?
"/info" and "/@id are probably more appropriate.
The ref in the textbox case should always resolve to a single node. "//" may
return a nodeset.

 <xf:textbox ref="//@id">
      <xf:caption>Artist identifier:</xf:caption>
    </xf:textbox>
    <xf:textbox ref="//Name">

same applies for

String artistName = (String)getForm().getValue(//@id);
...
v.setPath(//@id);


Do you even need // for
Node result = xi.find(xindiceSubCol, "//Artist[@id='"+ artistName +"']",
"Artist");

this looks like stale code

  //v.setPath("/artistName");



You can remove the reset() method.
Checkboxes are automatically handled for session scope beans.
My experience shows that when representing plain value objects, session
beans are never a memory concern
with the modern app servers.
I would prefer them almost always over request scope.
Much easier to code, which results in less code and less maintanance.




On a different note, I thinkg that your code can be used in the
AbstractXMLFormAction.

For example when the map parameter is prefixed with "java:", like in
"java:org.my.TestBean",
then the existing JavaBean instantiation logic can be used.
In all other cases, the model can be resolved via the SourceResolver.
This will allow benefiting from the InputModules to access xml files from
different sources: file system, xindice, remote URL, etc.
 <map:parameter name="xmlform-model" value="artist/artist-model.xml"/>

If you think this makes sense, please consider submitting a patch to that
effect.



Congratulations for the great job once again.


-=Ivelin=-
----- Original Message -----
From: "Josema Alonso" <[EMAIL PROTECTED]>
To: "Cocoon-Users" <[EMAIL PROTECTED]>
Sent: Tuesday, January 28, 2003 1:06 PM
Subject: XMLForm Xindice howto at Wiki refactored and ready


> Ivelin and all,
>
> I finally had the time to refactor the example. Following the ideas we
> exchanged these past days, I put it altogether at Wiki and I think we have
> now a much better sample :-)
> http://wiki.cocoondev.org/Wiki.jsp?page=XMLFormXindice
>
> Please, review it if you want to and inform me of any faults you can find
so
> i could fix them. I hope i wrote a clear explanation.
>
> If you feel this can be a good addittion to the official how-tos feel free
> of adding it yourself of let me know who I should contact (Diana, maybe?)
or
> where I should start. I still have not contributed anything to the
official
> docs and I'm somewhat lost...
>
> Thanks.
>
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to