Jeff,

There are two ways of doing this right now:

1. Use an XForms instance and a matcher in the Page Flow. For example:

   <page path-info="/orbeon/localdetail/(.*)" matcher="oxf:perl5-matcher"
         xforms="oxf:/my-xforms-model.xml"
         model="..."
         view="...">
       <param ref="/my-form/id"/>
   </page>

   What this does is of course matching on the given path-info, so all
   paths starting with "/orbeon/localdetail/" are matched.

   But also, this extracts the region matched between parenthesis and
   stores it into the XForms instance, here as the value of the
   "/my-form/id " element of your instance. Let's assume your XForms
   model in my-xforms-model.xml looks like:

   <xforms:model>
     <xforms:instance>
       <my-form>
          <id/>
       </my-form>
     </xforms:instance>
   </xforms:model>

   Then the following instance is available both in your page model
   and page view:

   <my-form>
     <id>90210</id>
   </my-form>

   Even if you don't plan to use XForms controls in your pages, you
   can use the XForms instance to extract parameters from URLs.

   You can add as many regions between parenthesis in the regexp, and
   add as many <param> elements within the <page> element to store
   those regions into the instance.

2. Do things manually and connect a Request generator to a
   perl5-matcher processor to extract the value. You basically are
   manually doing what the Page Flow Controller is doing for you
   above.

-Erik

Jeff Jones wrote:

> I am looking for a way to peel the "extra path info" out of a request so
> I can pass it as a parameter to an OXF pipeline, as if it were a query
> parameter. I've looked at the request generator, and I can get the
> "path-info" element from it easily enough, but that gives me the
> path-info from the servlet's perspective, not from the matcher's
> perspective. To be more specific:
>
> I have a URL like this:
>    /orbeon/localdetail/90210
>
> I would like all requests for "/orbeon/localdetail" to be passed to one
> pipeline, with "90210" (with or without leading slash) available as a
> parameter to pass to that pipeline's input.
>
> If OXF is mapped to "/orbeon", then the request will contain a
> "path-info" element with a value of "/localdetail/90210", which is the
> "extra path info" from the servlet engine's perspective. What I'd like
> to have, then, is a facility in OXF that would perform the same
> function, namely, to recognize that "This pipeline was invoked by a URL
> beginning with '/orbeon/localdetail', and here's the extra information
> after the match."
>
> I realize that this can be approximated using regular expressions in the
>  perl5 matcher, but that's kind of a kludge, and I'd rather not have to
> deal with the overhead. I also realize that I could encode the
> information as a query parameter instead, i.e.
> "/orbeon/localdetail?zip=90210", but for historical reasons, I need to
> be able to do both.
>
> Does anyone have any suggestions? If this isn't currently available, is
> it a feature worth having?
>
> Thanks in advance for your help.
>
> Jeff Jones
> The Weather Channel Interactive



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
orbeon-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/orbeon-user

Reply via email to