Re: Basic output of instance doc?

Posted by Erik Bruchez on
URL: https://discuss.orbeon.com/Basic-output-of-instance-doc-tp26306p26310.html

Duane Gran wrote:

 > Upon further reflection, I believe I may be closer to understanding
 > your answer but I must be overlooking something.  I have two pages,
 > one for data entry and the other for results.  Eventually I want the
 > results page to display the instance document, but in the meantime
 > writing to the filesystem is a good start.  Below is my page flow:
 >
 >     <page id="initial_form" path-info="/xforms-mods" view="mods-
 > editor-view.xml"/>
 >     <page id="results" path-info="/xforms-mods/results"
 > model="model.xpl" view="mods-results-view.xml"/>
 >
 > And here is the model (model.xpl) for the second page (results),  which
 > should create the file, but doesn't:
 >
 > <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
 >   xmlns:oxf="http://www.orbeon.com/oxf/processors">
 >   <p:processor name="oxf:file-serializer">
 >
 >     <p:input name="config">
 >       <config>
 >         <file>mods-result.xml</file>
 >         <directory>/tmp</directory>
 >       </config>
 >     </p:input>
 >     <p:input name="data" href="#instance"/>
 >   </p:processor>
 > </p:config>
 >
 > Any ideas why this may be happening?  I'm at a loss and appreciate  any
 > suggestions on this.

Your pipeline does not declare an "instance" parameter. Then you also
need an oxf:xml-converter processor before the oxf:file-serializer.

<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
           xmlns:oxf="http://www.orbeon.com/oxf/processors">

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

     <p:processor name="oxf:xml-converter">
         <p:input name="config">
             <config/>
         </p:input>
         <p:input name="data" href="#instance"/>
         <p:output name="data" id="converted"/>
     </p:processor>

     <p:processor name="oxf:file-serializer">
         <p:input name="config">
             <config>
                 <file>mods-result.xml</file>
                 <directory>/tmp</directory>
             </config>
         </p:input>
         <p:input name="data" href="#converter"/>
     </p:processor>
</p:config>

Be also sure to check in the logs that your submission in fact is
calling /xforms-mods/results. If it is not, you will have to check
your xforms:submission element. Also remember that a submission will
work only if the instance is valid and if required values are not
empty. Otherwise, an xforms-submit-error event is thrown.

-Erik




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