I'm new at cocoon, but it seems to me a little blurry where the right place
to do something... And I don't know for example, what can I do with an
action, so I was experimenting some "techniques" to have my objective done,
but what I'm looking for, is:

I've made a form to search for a term. When a user submit's the form, I
merge that querystring (I know how to do it in XSP) with an URL, for
instance:

http://www.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term="trans
genic"&retmax=200

In that example I've used "trangenic" as a search term.

Them that site will return me XML data (mainly id's of related articles),
and I must write it in a repository. Then I must build an harvester that
will go the repository and fetch the metadata of each article id.

I'm actually having trouble to understand, in what state of the pipeline
will I do every task I need, I know that I can use a serializer to write the
XML on disc, I can get querystring's in XSP, i can write XML on disc with a
XSL also, so there are many many ways, and for newbies it's a little bit
difficult to start with :|

Currently I have the form like this in my sitemap.xmap:

<map:match pattern="search">
     <map:generate type="file" src="documents/search.xml"/>
     <map:transform type="xslt" src="stylesheets/page2html.xsl"/>
     <map:serialize type="html"/>
</map:match>

The form action is do-search and method POST. I wrote the next step like
this:

<map:match pattern="do-search">

    <!-- validate form data -->
    <map:act type="form-validator">
       <map:parameter name="descriptor"
value="context://pubmed/descriptors/params.xml"/>
       <map:parameter name="validate" value="username"/>

       <!-- merge querystring with url and fetch data to repository -->

       here I don't know what's the best way to follow:
        - a transformer?
        - send the querystring (how to?) to a XSP that will do the rest

    </map:act>

<!-- form data is null -->
    <map:redirect-to uri="error-form"/>
</map:match>

Another aproach i have is in the form, the action is "search.xsp" (I skip
the validation procedure)
and then I defined:

<map:match pattern="procura.xsp">
    <map:generate type="serverpages" src="xsp/procura.xsp"/>
    <map:transform type= "write-source"/>
    <map:serialize type="xml"/>
</map:match>

and in the XSP I can get the querystring (i've done it) but I don't know how
to grab the XML data :|

Can anyone give tips ?
Thanks in advance for helping.

João César
[EMAIL PROTECTED]







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

Reply via email to