Retrieving all "app"-"form"-"data" for "Form Runner"

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

Retrieving all "app"-"form"-"data" for "Form Runner"

msalmadan@yahoo.com
I am trying to retrieve a list of the submitted data for a form against eXist XML DB.
I tried to duplicate the functionality of list.xpl, and list-submission.xml by modifying the
 
page-flow.xml to include:
 
  <page path-info="/fr/service/exist/list_docs/([^/]+)/([^/]+)" matcher="oxf:perl5-matcher"
          default-submission="persistence/exist/list-document-submission.xml"
          view="persistence/exist/list-document.xpl">
        <setvalue ref="/*/app" matcher-group="1"/>
  <setvalue ref="/*/form" matcher-group="2"/>
    </page>
 
and my list-document.xpl looks like this
<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
        xmlns:sql="http://orbeon.org/oxf/xml/sql"
        xmlns:odt="http://orbeon.org/oxf/xml/datatypes"
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:saxon="http://saxon.sf.net/"
        xmlns:oxf="http://www.orbeon.com/oxf/processors"
        xmlns:xi="http://www.w3.org/2001/XInclude"
        xmlns:xforms="http://www.w3.org/2002/xforms"
        xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
        xmlns:ev="http://www.w3.org/2001/xml-events">
    <!-- Search instance -->
    <p:param name="instance" type="input"/>
    <!-- Search result -->
    <p:param name="data" type="output"/>
    <!-- Prepare submission -->
    <p:processor name="oxf:xslt">
        <p:input name="data" href="#instance"/>
        <p:input name="config">
            <xforms:submission xsl:version="2.0" method="get"
                               resource="{{xxforms:property('oxf.fr.persistence.service.exist.uri')}}/{/*/app}/{/*/form
                                            }/data/?_howmany={/*/page-size}&amp;_start={/*/page-number}" replace="instance">
                <!-- Move resulting <document> element as root element -->
                <xforms:insert ev:event="xforms-submit-done" nodeset="/*" origin="/*/*[1]"/>
                <!-- Copy eXist error -->
                <xforms:action ev:event="xforms-submit-error">
                    <!--<xforms:insert context="/" origin="xxforms:element('error')"/>-->
                    <!--<xforms:insert context="/" origin="xxforms:html-to-xml(event('response-body'))"/>-->
                    <xforms:delete while="/*/*" nodeset="/*/*"/>
                    <xforms:setvalue ref="/*" value="event('response-body')"/>
                    <xforms:message level="xxforms:log-error"><xforms:output value="event('response-body')"/></xforms:message>
                    <!-- TODO: Propagate error to caller -->
                </xforms:action>
            </xforms:submission>
        </p:input>
        <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" href="#instance"/>
        <p:output name="response" id="response"/>
    </p:processor>
    <!-- Format response -->
    <p:processor name="oxf:xslt">
        <p:input name="data" href="#response"/>
        <p:input name="config">
            <forms xsl:version="2.0" xmlns:exist="http://exist.sourceforge.net/NS/exist">
                <xsl:for-each select="/exist:collection/exist:collection">
                    <form name="[hidden email]}" created="[hidden email]>
                </xsl:for-each>
            </forms>
        </p:input>
        <p:output name="data" ref="data"/>
    </p:processor>
</p:config>
 
and my list-document-submission.xml looks like this:
 
<request>
    <!-- Name of the application requested -->
    <app/>
  <!-- Name of the form requested -->
    <form/>
    <!-- Max page size -->
    <page-size>10</page-size>
    <!-- Page requested (1-based) -->
    <page-number>1</page-number>
</request>
I get no errors but I get an empty xml document with </form>.
 
I am wondering if someone can point me in the right direction or tell me what I am doing wrong. Any help is appriciated.
 
 
Thanks,
Majeed Almadan



--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Retrieving all "app"-"form"-"data" for "Form Runner"

Alessandro Vernet
Administrator
Majeed,

On Feb 11, 2009, at 8:50 AM, Majeed Almadan wrote:

> I am trying to retrieve a list of the submitted data for a form  
> against eXist XML DB.
> I tried to duplicate the functionality of list.xpl, and list-
> submission.xml by modifying the
> [...]

Hard to say without running your code. I'd check:

* Adding a "debug" attribute on the pipeline "instance" input if you  
get there the document with the app/form as you'd expect.
* Adding a "debug" attribute on the output of the XSLT, if the output  
is indeed what you expect.
* Adding a "debug" attribute on the output of the submission, what is  
returned by the submission.

I hope this helps,

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet



--
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
OW2 mailing lists service home page: http://www.ow2.org/wws