XPL create-collection problem

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

XPL create-collection problem

stacyladnier
I am new to Orbeon and having difficulty with XPL. Please help me understand what I am doing wrong, or if there is a better way to accomplish this I am open to new ideas.

I have an XForms submitting to an XPL that should create a new collection. Logs show the submit is done and no errors are reported. However, the new collection is never created in the embedded exist database. One interesting behavior is when I remove replace="none" from the submission element, my result page is displayed. If I leave it in there, the result page is never displayed. Regardless, the new collection is never created.


<xforms:submission id="add-collection" ref="instance('collection')" method="post" action="/mermaid/collection/add" replace="none"/>

....

<xforms:trigger>
   <xforms:label> Create</xforms:label>
   <xforms:action ev:event="DOMActivate">
      <xforms:send submission="add-collection"/>
   </xforms:action>
</xforms:trigger>


<page id="collectionadd" path-info="/mermaid/collection/add">
   <action action="collection/addCollection.xpl">
      <result page="contentsMain"/>
   </action>
</page>


<p:processor name="oxf:xmldb-query">
   <p:input name="datasource" href="../services/datasource.xml"/>
   <p:input name="query">
      <xdb:query>
           xmldb:create-collection('/db/orbeon/mermaid', 'newCollection')
      </xdb:query>
   </p:input>
   <p:output name="data" ref="success"/>
</p:processor>

-Stacy
Reply | Threaded
Open this post in threaded view
|

Re: XPL create-collection problem

stacyladnier
Corrected my own issue. The addCollection.xpl needed to have the
collection and create-collection attributes as follows:

<!-- addCollection.xpl -->
 <p:processor name="oxf:xmldb-query">
   <p:input name="datasource" href="../services/datasource.xml"/>
   <p:input name="query">
      <xdb:query collection="/db/orbeon/mermaid" create-collection="true">
         xmldb:create-collection('/db/orbeon/mermaid', 'newCollection')
     
      </xdb:query>
   </p:input>
   <p:output name="data" ref="success"/>
 </p:processor>



--
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