URL Extraction

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

URL Extraction

flyingzumwalt
Trying to follow the instructions on extracting parameters from a URL so I can pass them into a pipeline.  Its not working, even when I copy and paste everything from the docs:  http://www.orbeon.com/ops/doc/reference-page-flow#url-extraction

Has default-submission been deprecated for PFC page elements?


Also, is it possible to do something like the following an XPL pipeline, reading values from the submitted instance and inserting them directly into attributes of a processor's config elements?:

<xforms:submission method="put" action="/exist/rest/db/mshlf/{doc('input:instance')/@record}/{doc('input:instance')/@id}"/> 

Same thing in the context of a whole pipeline:

          xmlns:oxf="http://www.orbeon.com/oxf/processors">


<p:param name="instance" type="input"/>
<p:param name="data" type="output"/>


<p:processor name="oxf:xforms-submission">  
<p:input name="submission">  
<xforms:submission method="put" action="/exist/rest/db/mshlf/{doc('input:instance')/@record}/{doc('input:instance')/@id}"/>  
</p:input>  
<p:input name="request" ref="instance"/>  
<p:output name="response" ref="data"/>  
</p:processor>


</p:config>





Matt Zumwalt
MediaShelf, LLC






--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: URL Extraction

Erik Bruchez
Administrator
Matt,

 > Trying to follow the instructions on extracting parameters from a
 > URL so I can pass them into a pipeline.  Its not working, even when
 > I copy and paste everything from the docs:
 > http://www.orbeon.com/ops/doc/reference-page-flow#url-extraction
 >
 > Has default-submission been deprecated for PFC page elements?

No, default-submission is supposed to be alive and well.

 > Also, is it possible to do something like the following an XPL
 > pipeline, reading values from the submitted instance and inserting
 > them directly into attributes of a processor's config elements?

Yes and no. If the document you pass on the request contains the
parameters, then yes, using Attribute Value Templates (AVTs) on the
@action attribute of the submisson. Write for example:

   <xforms:submission method="put"
action="/exist/rest/db/mshlf/{/*/@record}/{/*/@id}"/>

Assuming a request document that looks like:

   <some-element record="..." id="..."/>

If the request document does not contain the value, you can use an
XSLT processor first, which builds the submission input, for example:

   <!-- Create REST submission -->
   <p:processor name="oxf:xslt">
       <p:input name="config">
           <xforms:submission
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                              xsl:version="2.0" method="get"
action="/exist/rest/db/ops/dmv-example/{/*/document-id}"/>
       </p:input>
       <p:input name="data" href="#instance"/>
       <p:output name="data" id="submission"/>
   </p:processor>

   <!-- Execute REST submission -->
   <p:processor name="oxf:xforms-submission">
       <p:input name="submission" href="#submission"/>
       <p:input name="request"><dummy/></p:input>
       <p:output name="response" id="document"/>
   </p:processor>

-Erik

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: URL Extraction

flyingzumwalt
In reply to this post by flyingzumwalt

Those are great tips on constructing the xforms:submissions within XPL, Erik.  Thanks.

Meanwhile, I am still totally stumped on extracting values from a URL.  I must be missing something.  Here is the setup I've got going:



In page-flow.xml:

<page path-info="/mshlf/urltest/([^/]+)"  id="matchertest" matcher="oxf:perl5-matcher" default-submission="my-default-submission.xml" view="repeat-input.xsl">
    <setvalue ref="/submission/instance-path" matcher-group="1"/>
</page>
<page path-info="/mshlf/urltest"  id="paramtest" default-submission="my-default-submission.xml" view="repeat-input.xsl">
    <setvalue ref="/submission/instance-path" parameter="1"/>
</page>


my-default-submission.xml:
<submission>
<instance-path/>
</submission>


repeat-input.xsl:
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" 
version="2.0">


<xsl:template match="/">
<xsl:copy-of select="/"/>
<!--   <xi:include href="input:data"/>  -->
</xsl:template>
</xsl:stylesheet>



With the above configuration, both of these come up blank:

http://localhost:8080/ops/mshlf/urltest/boo

If I change "default-submission" to "model", then I get an exact copy of "my-default-submission.xml" when I hit those URLs.

What am I doing wrong?

-Matt


Matt,

> Trying to follow the instructions on extracting parameters from a
> URL so I can pass them into a pipeline. Its not working, even when
> I copy and paste everything from the docs:
>
> Has default-submission been deprecated for PFC page elements?

No, default-submission is supposed to be alive and well.

> Also, is it possible to do something like the following an XPL
> pipeline, reading values from the submitted instance and inserting
> them directly into attributes of a processor's config elements?

Yes and no. If the document you pass on the request contains the
parameters, then yes, using Attribute Value Templates (AVTs) on the
@action attribute of the submisson. Write for example:

<xforms:submission method="put" action="/exist/rest/db/mshlf/{/*/@record}/{/*/@id}"/>

Assuming a request document that looks like:

<some-element record="..." id="..."/>

If the request document does not contain the value, you can use an
XSLT processor first, which builds the submission input, for example:

<!-- Create REST submission -->
<p:processor name="oxf:xslt">
<p:input name="config">
<xforms:submission xmlns:xforms="http://www.w3.org/2002/xforms"; xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xsl:version="2.0" method="get" action="/exist/rest/db/ops/dmv-example/{/*/document-id}"/>
</p:input>
<p:input name="data" href="#instance"/>
<p:output name="data" id="submission"/>
</p:processor>

<!-- Execute REST submission -->
<p:processor name="oxf:xforms-submission">
<p:input name="submission" href="#submission"/>
<p:input name="request"><dummy/></p:input>
<p:output name="response" id="document"/>
</p:processor>

-Erik


Matt Zumwalt
MediaShelf, LLC






--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: URL Extraction

Erik Bruchez
Administrator
You are not accessing the XML submission anywhere in your XSLT document.
That may be the problem.

Try:

   <xsl:copy-of select="doc('input:instance')"/>

-Erik

Matt Zumwalt wrote:

>
> Those are great tips on constructing the xforms:submissions within XPL,
> Erik.  Thanks.
>
> Meanwhile, I am still totally stumped on extracting values from a URL.  
> I must be missing something.  Here is the setup I've got going:
>
>
>
> In page-flow.xml:
>
> <page path-info="/mshlf/urltest/([^/]+)"  id="matchertest"
> matcher="oxf:perl5-matcher"
> default-submission="my-default-submission.xml" view="repeat-input.xsl">
>     <setvalue ref="/submission/instance-path" matcher-group="1"/>
> </page>
> <page path-info="/mshlf/urltest"  id="paramtest"
> default-submission="my-default-submission.xml" view="repeat-input.xsl">
>     <setvalue ref="/submission/instance-path" parameter="1"/>
> </page>
>
>
> my-default-submission.xml:
> <submission>
> <instance-path/>
> </submission>
>
>
> repeat-input.xsl:
> <xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:xi="http://www.w3.org/2001/XInclude"
> xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
> version="2.0">
>
>
> <xsl:template match="/">
> <xsl:copy-of select="/"/>
> <!--   <xi:include href="input:data"/>  -->
> </xsl:template>
> </xsl:stylesheet>
>
>
>
> With the above configuration, both of these come up blank:
>
> http://localhost:8080/ops/mshlf/urltest?instance-path=boo
> http://localhost:8080/ops/mshlf/urltest/boo
>
> If I change "default-submission" to "model", then I get an exact copy of
> "my-default-submission.xml" when I hit those URLs.
>
> What am I doing wrong?
>
> -Matt
>
>
>> Matt,
>>
>> > Trying to follow the instructions on extracting parameters from a
>> > URL so I can pass them into a pipeline. Its not working, even when
>> > I copy and paste everything from the docs:
>> > http://www.orbeon.com/ops/doc/reference-page-flow#url-extraction
>> >
>> > Has default-submission been deprecated for PFC page elements?
>>
>> No, default-submission is supposed to be alive and well.
>>
>> > Also, is it possible to do something like the following an XPL
>> > pipeline, reading values from the submitted instance and inserting
>> > them directly into attributes of a processor's config elements?
>>
>> Yes and no. If the document you pass on the request contains the
>> parameters, then yes, using Attribute Value Templates (AVTs) on the
>> @action attribute of the submisson. Write for example:
>>
>> <xforms:submission method="put"
>> action="/exist/rest/db/mshlf/{/*/@record}/{/*/@id}"/>
>>
>> Assuming a request document that looks like:
>>
>> <some-element record="..." id="..."/>
>>
>> If the request document does not contain the value, you can use an
>> XSLT processor first, which builds the submission input, for example:
>>
>> <!-- Create REST submission -->
>> <p:processor name="oxf:xslt">
>> <p:input name="config">
>> <xforms:submission xmlns:xforms="http://www.w3.org/2002/xforms";
>> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
>> xsl:version="2.0" method="get"
>> action="/exist/rest/db/ops/dmv-example/{/*/document-id}"/>
>> </p:input>
>> <p:input name="data" href="#instance"/>
>> <p:output name="data" id="submission"/>
>> </p:processor>
>>
>> <!-- Execute REST submission -->
>> <p:processor name="oxf:xforms-submission">
>> <p:input name="submission" href="#submission"/>
>> <p:input name="request"><dummy/></p:input>
>> <p:output name="response" id="document"/>
>> </p:processor>
>>
>> -Erik
>
>
> Matt Zumwalt
> MediaShelf, LLC
> http://www.yourmediashelf.com
>
>
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: URL Extraction

flyingzumwalt
That fixed it Erik.  Thanks a million.

I'll have to put instructions for this up on the wiki.

Matt Zumwalt
MediaShelf, LLC




On Oct 26, 2006, at 6:56 AM, Erik Bruchez wrote:

You are not accessing the XML submission anywhere in your XSLT document. That may be the problem.

Try:

  <xsl:copy-of select="doc('input:instance')"/>

-Erik

Matt Zumwalt wrote:
Those are great tips on constructing the xforms:submissions within XPL, Erik.  Thanks.
Meanwhile, I am still totally stumped on extracting values from a URL.  I must be missing something.  Here is the setup I've got going:
In page-flow.xml:
<page path-info="/mshlf/urltest/([^/]+)"  id="matchertest" matcher="oxf:perl5-matcher" default-submission="my-default-submission.xml" view="repeat-input.xsl">
    <setvalue ref="/submission/instance-path" matcher-group="1"/>
</page>
<page path-info="/mshlf/urltest"  id="paramtest" default-submission="my-default-submission.xml" view="repeat-input.xsl">
    <setvalue ref="/submission/instance-path" parameter="1"/>
</page>
my-default-submission.xml:
<submission>
<instance-path/>
</submission>
repeat-input.xsl:
version="2.0">
<xsl:template match="/">
<xsl:copy-of select="/"/>
<!--   <xi:include href="input:data"/>  -->
</xsl:template>
</xsl:stylesheet>
With the above configuration, both of these come up blank:
If I change "default-submission" to "model", then I get an exact copy of "my-default-submission.xml" when I hit those URLs.
What am I doing wrong?
-Matt
Matt,

> Trying to follow the instructions on extracting parameters from a
> URL so I can pass them into a pipeline. Its not working, even when
> I copy and paste everything from the docs:
>
> Has default-submission been deprecated for PFC page elements?

No, default-submission is supposed to be alive and well.

> Also, is it possible to do something like the following an XPL
> pipeline, reading values from the submitted instance and inserting
> them directly into attributes of a processor's config elements?

Yes and no. If the document you pass on the request contains the
parameters, then yes, using Attribute Value Templates (AVTs) on the
@action attribute of the submisson. Write for example:

<xforms:submission method="put" action="/exist/rest/db/mshlf/{/*/@record}/{/*/@id}"/>

Assuming a request document that looks like:

<some-element record="..." id="..."/>

If the request document does not contain the value, you can use an
XSLT processor first, which builds the submission input, for example:

<!-- Create REST submission -->
<p:processor name="oxf:xslt">
<p:input name="config">
<xforms:submission xmlns:xforms="http://www.w3.org/2002/xforms"; xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xsl:version="2.0" method="get" action="/exist/rest/db/ops/dmv-example/{/*/document-id}"/>
</p:input>
<p:input name="data" href="#instance"/>
<p:output name="data" id="submission"/>
</p:processor>

<!-- Execute REST submission -->
<p:processor name="oxf:xforms-submission">
<p:input name="submission" href="#submission"/>
<p:input name="request"><dummy/></p:input>
<p:output name="response" id="document"/>
</p:processor>

-Erik
Matt Zumwalt
MediaShelf, LLC
------------------------------------------------------------------------
--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: [hidden email]
For general help: [hidden email]
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws


-- 
Orbeon - XForms Everywhere:


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: [hidden email]
For general help: [hidden email]
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws