beginner with ops needs some help

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

beginner with ops needs some help

Alex Sharaz
Chaps,
I'm just staring out with ops and xforms and it looks like I need a wee
bit of help

I've installed the latest version of ops on my Resin based java
application server and having looked at the examples provide have
started to develop my own set.

We have a requirement for a questionnaire which has 8 questions each on
its own page. The last page is to summarise the user input and write the
into into an sql database (db2)

In /usr/web/comms/deploy/ops/WEB-INF/resources/examples I've modified
examples-list.xml to have

  <example id="computing-survey-paged" path="tutorial/survey2"
label="Computing Survey-paged" xforms-ng="true"/>


I've created a directory for my example and followed the presentation
server tutorial for section 5 managing multiple pages.


Xforms-model.xml has my instance in it which is of the  form

<survey>
<action>
<title>frhrhrh</title>
<question1>
<info>some text</info>
<howraised/>
</question1>

<question2>.....</question2>

</survey>


page-flow.xml defines where to go and what to instance data to pass to
the next page



<page id="intro" path-info="/computing-survey-paged"
xforms="xforms-model.xml" view="intro-view.xhtml">  

   <action when="/survey/action = 'next'">  
      <result page="question1"/>
   </action>  
</page>  

<page id="question1" path-info="/computing-survey-paged/question1"
xforms="xforms-model.xml" view="question1-view.xhtml">  

<action when="/survey/action = 'next'">  
   <result page="question2">  
       <xu:update select="/survey/question1/howraised"
xmlns:xu="http://www.xmldb.org/xupdate">  

   <xu:value-of
select="document('oxf:instance')/survey/question1/howraised"/>
 </xu:update>  
</result>  
</action>  
<action when="/survey/action = 'prev'">
 <result page="intro"/>  
</action>
</page>
.... and so on till I get to the  end

<epilogue url="oxf:/config/epilogue.xpl"/>  

</config>

Intro-view.xhtml
Is the basic blurb about the questionnaire and then has

<xforms:submit xmlns:xforms="http://www.w3.org/2002/xforms">
   <xforms:label>Enter Questionnaire</xforms:label>  
   <xforms:setvalue ref="/survey/action">next</xforms:setvalue>
 </xforms:submit>

At then end of it.

This all, as far as I can see, is the same as the example outlined.

When I try and run the example, I get an ops error page saying
"An empty sequence is not allowed as the first argument of
xxforms:form-id()"


So what have I done wrong?

Alex

*****************************************************************************************
To view the terms under which this email is distributed, please go to http://www.hull.ac.uk/legal/email_disclaimer.html
*****************************************************************************************

--
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: beginner with ops needs some help

Erik Bruchez
Administrator
Alex,

Two high-level comments:

1. I don't think you should necessarily try to create a new "example",
    although that is certainly doable.

    The reasons are that:

    o Running examples though the examples portal is much slower than
      running them standalone. This is because the portal is itself
      implemented with OPS, and everything runs twice, plus the portal
      has not been optimized.

    o For the reasons above, we plan to upgrade the examples portal
      soon to *not* go through an actual portal. But we also plan to
      keep examples showing how to use JSR-168 portlets, since those
      are now starting to work quite well in Liferay, in particular.

    So I recommend you bypass the examples portal. See how this is done
    in the main page-flow.xml, for example, for the DMV Forms example:

    <!-- Standalone Forms example -->
    <page path-info="/forms*" model="/examples/forms/page-flow.xpl"/>

    You can also directly implement your pages in the top-level page
    flow.

    Note that we plan to ship a better sample WAR or set of resources
    to make it easier to get started.

2. To implement a Wizard, I would follow the "Wizard WITH Switch"
    example:

    http://www.orbeon.com/ops/goto-example/xforms-wizard-switch

    This uses XForms NG and greatly reduces the number of pages you
    have to add to the PFC.

    You can still go the way of several pages, but then you will have a
    much heavier PFC.

The error you are seeing comes from the old XForms Classic engine. If
you switch to the new engine, which I think you should do anyway as we
are not maintaining the old one anymore, the error will go away.

-Erik

Alex Sharaz wrote:
 > Chaps,
 > I'm just staring out with ops and xforms and it looks like I need a wee
 > bit of help
 >
 > I've installed the latest version of ops on my Resin based java
 > application server and having looked at the examples provide have
 > started to develop my own set.
 >
 > We have a requirement for a questionnaire which has 8 questions each on
 > its own page. The last page is to summarise the user input and write the
 > into into an sql database (db2)
 >
 > In /usr/web/comms/deploy/ops/WEB-INF/resources/examples I've modified
 > examples-list.xml to have
 >
 >   <example id="computing-survey-paged" path="tutorial/survey2"
 > label="Computing Survey-paged" xforms-ng="true"/>
 >
 >
 > I've created a directory for my example and followed the presentation
 > server tutorial for section 5 managing multiple pages.
 >
 >
 > Xforms-model.xml has my instance in it which is of the  form
 >
 > <survey>
 > <action>
 > <title>frhrhrh</title>
 > <question1>
 > <info>some text</info>
 > <howraised/>
 > </question1>
 >
 > <question2>.....</question2>
 >
 > </survey>
 >
 >
 > page-flow.xml defines where to go and what to instance data to pass to
 > the next page
 >
 >
 >
 > <page id="intro" path-info="/computing-survey-paged"
 > xforms="xforms-model.xml" view="intro-view.xhtml">
 >
 >    <action when="/survey/action = 'next'">
 >       <result page="question1"/>
 >    </action>
 > </page>
 >
 > <page id="question1" path-info="/computing-survey-paged/question1"
 > xforms="xforms-model.xml" view="question1-view.xhtml">
 >
 > <action when="/survey/action = 'next'">
 >    <result page="question2">
 >        <xu:update select="/survey/question1/howraised"
 > xmlns:xu="http://www.xmldb.org/xupdate">
 >
 >    <xu:value-of
 > select="document('oxf:instance')/survey/question1/howraised"/>
 >  </xu:update>
 > </result>
 > </action>
 > <action when="/survey/action = 'prev'">
 >  <result page="intro"/>
 > </action>
 > </page>
 > .... and so on till I get to the  end
 >
 > <epilogue url="oxf:/config/epilogue.xpl"/>
 >
 > </config>
 >
 > Intro-view.xhtml
 > Is the basic blurb about the questionnaire and then has
 >
 > <xforms:submit xmlns:xforms="http://www.w3.org/2002/xforms">
 >    <xforms:label>Enter Questionnaire</xforms:label>
 >    <xforms:setvalue ref="/survey/action">next</xforms:setvalue>
 >  </xforms:submit>
 >
 > At then end of it.
 >
 > This all, as far as I can see, is the same as the example outlined.
 >
 > When I try and run the example, I get an ops error page saying
 > "An empty sequence is not allowed as the first argument of
 > xxforms:form-id()"
 >
 >
 > So what have I done wrong?
 >
 > Alex

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