Help with sharing instance between pages

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

Help with sharing instance between pages

sparks-2
Hi,

Hi All,

I would appreciate your help on this. Hopefully for the experts the problem should be obvious.

I've installed ops.war on windows with tomcat 4.1.31 and can browse through the examples with no problem.

I had been unsuccessful at building ops.war from source code and deploying it on Sun's AppServer, JBOSS 4.0 or even tomcat for that matter.

I wasn't sure how I could practically get rid of the default Orbeon Presentation Server look and feel with the example applications without trying to modify the source code and build a lighter version where I would have only files related to me application. I'm just starting with OPS...

The OPS guide doesn't go into how an application can be developed from scratch but rather as a sub-application within the examples application and then it just goes straight into how to use the different modules and processors (of course as far I could tell, I'm probably wrong about this too).

So after wasting a lot of time I decided to go back to basics and follow the tutorial as much as possible. I created a subfolder underneath resources/examples. I modified the examples-list.xml and now I can get to my very own sub app as an entry in a new section of the OPS examples frame/pane.

However I'm now stuck at figuring out why the xu:update which is meant to copy instance data from one page to another seems not to copy anything.

Here's the page-flow.xml

<config xmlns="http://www.orbeon.com/oxf/controller"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:xu="http://www.xmldb.org/xupdate"
        xmlns:oxf="http://www.orbeon.com/oxf/processors">
   
   <page id="ask-name" path-info="/nnl-mts1" xforms="xforms-model.xml" view="ask-name-view.xhtml">
      <action when="/myform/action = 'next'">
         <result page="display-name">
            <xu:update select="/myform/name">
               <xu:value-of select="document('oxf:instance')/myform/name"/>
            </xu:update>
         </result>
      </action>
   </page>
   
   <page id="display-name" path-info="/nnl-mts1/display-name" xforms="xforms-model.xml" view="display-name-view.xhtml">  
      <action when="/myform/action = 'back'">
         <result page="ask-name"/>
      </action>  
   </page>
   <epilogue url="oxf:/config/epilogue.xpl"/> </config>

Here's the ask-name-view.xhtml

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xforms="http://www.w3.org/2002/xforms"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xsl:version="2.0">
      <head>
         <title>mFATE Test Server</title>
      </head>
      <body>
         <xforms:group>
            <p>
               Please enter testsuite:
               <xforms:input ref="/myform/name"/>
               <xforms:submit>
                  <xforms:label>Search</xforms:label>
                  <xforms:setvalue ref="/myform/action">next</xforms:setvalue>
               </xforms:submit>
            </p>
         </xforms:group>
      </body>
</html>

The display-name-view.xhtml

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xforms="http://www.w3.org/2002/xforms"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xsl:version="2.0">
      <head>
         <title>mFATE Test Server</title>
      </head>
      <body>
         <xforms:group>
            <p>Name <xsl:value-of select="/myform/name" /> Launched!</p>  
            <xforms:submit>
               <xforms:label>Back</xforms:label>
               <xforms:setvalue ref="/myform/action">back</xforms:setvalue>
            </xforms:submit>            
         </xforms:group>
      </body>
</html>

The xforms-model.xml

<xforms:model xmlns:xforms="http://www.w3.org/2002/xforms">
   <xforms:instance xmlns="">
      <myform>
         <action/>      
         <name/>
         <description/>
      </myform>
   </xforms:instance>
</xforms:model>

The relevant bit in the examples-list.xml is

   <section label="Newport Networks">
      <example id="nnl-mts1" path="nnl/mts1" label="mFATE Test Server"/>
      <example id="nnl-mfate" path="nnl/mfate" label="mFATE Web Application Server 1.0"/>
   </section>

The Next and Back buttons work alright. But the xsl:value-of in display-name-view.xhtml instance seems to be empty because I only see Name ! instead of Name <whatever I typed in the other page>!

Any ideas?

MZ



--
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: Help with sharing instance between pages

Henrik Pettersen
Marwan,

here is how I am using OPS:

C:\dev\source\editor>ls -al
total 43
drwxrwxrwt+ 13 Administrator None     0 Aug 31 11:39 .
drwxrwxrwt+ 16 Administrator None     0 Aug 25 14:03 ..
drwxrwxrwt+  4 Administrator None     0 Aug 31 11:40 build
-rwxrwxrwx+  1 Administrator None   127 Aug 25 14:10 build.properties
-rwxrwxrwx+  1 Administrator None 22435 Aug 25 14:10 build.xml
drwxrwxrwt+  5 Administrator None     0 Aug 31 03:24 docs
drwxrwxrwt+  6 Administrator None     0 Aug 31 03:25 lib
drwxrwxrwt+  5 Administrator None     0 Aug 31 03:27 src
drwxrwxrwt+  5 Administrator None     0 Aug 31 03:27 web

The src folder above contains my java source code.
The build folder contains my deployable application, with all libs,
resources and jars, ready to be copied to $TOMCAT_HOME/webapps/editor.

C:\dev\source\editor\lib>ls -al
total 864
drwxrwxrwt+  6 Administrator None      0 Aug 31 03:25 .
drwxrwxrwt+ 13 Administrator None      0 Aug 31 11:39 ..
-rwxrwxrwx+  1 Administrator None  26354 Aug 25 14:08 catalina-ant.jar
-rwxrwxrwx+  1 Administrator None 324238 Aug 25 14:08 cglib-nodep-2.1_3.jar
drwxrwxrwt+  3 Administrator None      0 Aug 31 03:24 hibernate
drwxrwxrwt+  3 Administrator None      0 Aug 31 03:25 jibx
-rwxrwxrwx+  1 Administrator None 446464 Aug 25 14:08
mysql-connector-java-3.1.12-bin.jar
drwxrwxrwt+  3 Administrator None      0 Aug 31 03:25 orbeon
-rwxrwxrwx+  1 Administrator None  78350 Aug 25 14:08 servlet-2_3-4_0_4.jar

The Orbeon folder above contains all the libs from the deflated
OPS.war (which I built from the orbeon source using the default ant
target, and not build.bat), including ops.jar.

C:\dev\source\editor\web>ls -al
total 0
drwxrwxrwt+  5 Administrator None 0 Aug 31 13:10 .
drwxrwxrwt+ 13 Administrator None 0 Aug 31 11:39 ..
drwxrwxrwt+  3 Administrator None 0 Aug 31 03:27 META-INF
drwxrwxrwt+  5 Administrator None 0 Aug 31 03:27 WEB-INF

C:\dev\source\editor\web\WEB-INF>ls -al
total 64
drwxrwxrwt+  5 Administrator None     0 Aug 31 03:27 .
drwxrwxrwt+  5 Administrator None     0 Aug 31 13:10 ..
drwxrwxrwt+  3 Administrator None     0 Aug 31 03:27 classes
-rwxrwxrwx+  1 Administrator None  2086 Aug 25 14:10 cli-ops.jar
-rwxrwxrwx+  1 Administrator None 30117 Aug 25 14:10 commons-cli-1_0.jar
-rwxrwxrwx+  1 Administrator None  9079 Aug 25 14:10 exist-conf.xml
drwxrwxrwt+ 17 Administrator None     0 Aug 31 03:29 resources
-rwxrwxrwx+  1 Administrator None 13788 Aug 25 14:10 web.xml

C:\dev\source\editor\web\WEB-INF\resources>ls -al
total 12
drwxrwxrwt+ 17 Administrator None    0 Aug 31 03:29 .
drwxrwxrwt+  5 Administrator None    0 Aug 31 03:27 ..
drwxrwxrwt+  4 Administrator None    0 Aug 31 03:27 config
drwxrwxrwt+  3 Administrator None    0 Aug 31 03:27 context
drwxrwxrwt+  5 Administrator None    0 Aug 31 03:27 images
drwxrwxrwt+ 12 Administrator None    0 Aug 31 03:29 ops
-rwxrwxrwx+  1 Administrator None 9686 Aug 30 22:16 page-flow.xml
drwxrwxrwt+  6 Administrator None    0 Aug 31 03:29 unit-tests

This is where I put all my application specific resources. All the
folders you see above have been copied from the resources folder of
the exploded ops.war.
The trick here is to notice that any files living in my resources
directory on tomcat, will override the same files contained in
ops.war.
To override the default layout of OPS, I copied the *.template files from here:

C:\dev\source\editor\web\WEB-INF\resources\ops\css>ls -al
total 33
drwxrwxrwt+  3 Administrator None     0 Aug 31 03:27 .
drwxrwxrwt+ 12 Administrator None     0 Aug 31 03:29 ..
-rwxrwxrwx+  1 Administrator None    88 Nov  8  2005 css-constants.properties
-rwxrwxrwx+  1 Administrator None  3786 Jun 20 08:19 menu.css
-rwxrwxrwx+  1 Administrator None 12281 Aug  1 20:33 orbeon.css.template
-rwxrwxrwx+  1 Administrator None  2553 Jun 16 08:14 tree-check.css
-rwxrwxrwx+  1 Administrator None  2338 Jun 16 08:14 tree.css
-rwxrwxrwx+  1 Administrator None  5257 Aug 18 10:08 xforms.css.template

to these *.css files here.

C:\dev\source\editor\web\WEB-INF\resources\config\theme>ls -al
total 28
drwxrwxrwt+ 4 Administrator None     0 Aug 31 03:27 .
drwxrwxrwt+ 4 Administrator None     0 Aug 31 03:27 ..
drwxrwxrwt+ 3 Administrator None     0 Aug 31 03:27 images
-rwxrwxrwx+ 1 Administrator None 11846 Aug 25 13:02 orbeon.css
-rwxrwxrwx+ 1 Administrator None  6707 Aug 18 10:08 theme.xsl
-rwxrwxrwx+ 1 Administrator None  5257 Aug 25 13:02 xforms.css

Start with epilogue.xpl to see how the layout is constructed..

Hope this helps. Not sure about your xupdate problem, though.

Henrik



On 8/31/06, [hidden email] <[hidden email]> wrote:

> Hi,
>
> Hi All,
>
> I would appreciate your help on this. Hopefully for the experts the problem should be obvious.
>
> I've installed ops.war on windows with tomcat 4.1.31 and can browse through the examples with no problem.
>
> I had been unsuccessful at building ops.war from source code and deploying it on Sun's AppServer, JBOSS 4.0 or even tomcat for that matter.
>
> I wasn't sure how I could practically get rid of the default Orbeon Presentation Server look and feel with the example applications without trying to modify the source code and build a lighter version where I would have only files related to me application. I'm just starting with OPS...
>
> The OPS guide doesn't go into how an application can be developed from scratch but rather as a sub-application within the examples application and then it just goes straight into how to use the different modules and processors (of course as far I could tell, I'm probably wrong about this too).
>
> So after wasting a lot of time I decided to go back to basics and follow the tutorial as much as possible. I created a subfolder underneath resources/examples. I modified the examples-list.xml and now I can get to my very own sub app as an entry in a new section of the OPS examples frame/pane.
>
> However I'm now stuck at figuring out why the xu:update which is meant to copy instance data from one page to another seems not to copy anything.
>
> Here's the page-flow.xml
>
> <config xmlns="http://www.orbeon.com/oxf/controller"
>         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>         xmlns:xu="http://www.xmldb.org/xupdate"
>         xmlns:oxf="http://www.orbeon.com/oxf/processors">
>
>    <page id="ask-name" path-info="/nnl-mts1" xforms="xforms-model.xml" view="ask-name-view.xhtml">
>       <action when="/myform/action = 'next'">
>          <result page="display-name">
>             <xu:update select="/myform/name">
>                <xu:value-of select="document('oxf:instance')/myform/name"/>
>             </xu:update>
>          </result>
>       </action>
>    </page>
>
>    <page id="display-name" path-info="/nnl-mts1/display-name" xforms="xforms-model.xml" view="display-name-view.xhtml">
>       <action when="/myform/action = 'back'">
>          <result page="ask-name"/>
>       </action>
>    </page>
>    <epilogue url="oxf:/config/epilogue.xpl"/> </config>
>
> Here's the ask-name-view.xhtml
>
> <html xmlns="http://www.w3.org/1999/xhtml"
>       xmlns:xforms="http://www.w3.org/2002/xforms"
>       xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>       xsl:version="2.0">
>       <head>
>          <title>mFATE Test Server</title>
>       </head>
>       <body>
>          <xforms:group>
>             <p>
>                Please enter testsuite:
>                <xforms:input ref="/myform/name"/>
>                <xforms:submit>
>                   <xforms:label>Search</xforms:label>
>                   <xforms:setvalue ref="/myform/action">next</xforms:setvalue>
>                </xforms:submit>
>             </p>
>          </xforms:group>
>       </body>
> </html>
>
> The display-name-view.xhtml
>
> <html xmlns="http://www.w3.org/1999/xhtml"
>       xmlns:xforms="http://www.w3.org/2002/xforms"
>       xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>       xsl:version="2.0">
>       <head>
>          <title>mFATE Test Server</title>
>       </head>
>       <body>
>          <xforms:group>
>             <p>Name <xsl:value-of select="/myform/name" /> Launched!</p>
>             <xforms:submit>
>                <xforms:label>Back</xforms:label>
>                <xforms:setvalue ref="/myform/action">back</xforms:setvalue>
>             </xforms:submit>
>          </xforms:group>
>       </body>
> </html>
>
> The xforms-model.xml
>
> <xforms:model xmlns:xforms="http://www.w3.org/2002/xforms">
>    <xforms:instance xmlns="">
>       <myform>
>          <action/>
>          <name/>
>          <description/>
>       </myform>
>    </xforms:instance>
> </xforms:model>
>
> The relevant bit in the examples-list.xml is
>
>    <section label="Newport Networks">
>       <example id="nnl-mts1" path="nnl/mts1" label="mFATE Test Server"/>
>       <example id="nnl-mfate" path="nnl/mfate" label="mFATE Web Application Server 1.0"/>
>    </section>
>
> The Next and Back buttons work alright. But the xsl:value-of in display-name-view.xhtml instance seems to be empty because I only see Name ! instead of Name <whatever I typed in the other page>!
>
> Any ideas?
>
> MZ
>
>
>
>
> --
> 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
>
>
>


--
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: Help with sharing instance between pages

Erik Bruchez
Administrator
In reply to this post by sparks-2
Marwan,

 > I had been unsuccessful at building ops.war from source code and
 > deploying it on Sun's AppServer, JBOSS 4.0 or even tomcat for that
 > matter.

It should be just a matter of running the ant task provided with the
source. Are you saying you did not manage to build, or you did not
manage to deploy? If so, what issues have you encountered?

 > I wasn't sure how I could practically get rid of the default Orbeon
 > Presentation Server look and feel with the example applications
 > without trying to modify the source code and build a lighter version
 > where I would have only files related to me application. I'm just
 > starting with OPS...

 > The OPS guide doesn't go into how an application can be developed
 > from scratch but rather as a sub-application within the examples
 > application and then it just goes straight into how to use the
 > different modules and processors (of course as far I could tell, I'm
 > probably wrong about this too).

I guess we can only apologize about that. We are aware that it is
fairly difficult to get started with OPS. For 3.5, we plan a simpler
directory structure and a new tutorial.

 > So after wasting a lot of time I decided to go back to basics and
 > follow the tutorial as much as possible. I created a subfolder
 > underneath resources/examples. I modified the examples-list.xml and
 > now I can get to my very own sub app as an entry in a new section of
 > the OPS examples frame/pane.
 >
 > However I'm now stuck at figuring out why the xu:update which is
 > meant to copy instance data from one page to another seems not to
 > copy anything.

Your XUpdate works fine, what is incorrect is in the resulting page's
XSLT. Use this instead:

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

Unfortunately, while this example is absolutely correct, it is quite
out of date as per OPS 3.5. While we work on the new tutorial, I
encourage you to look instead only at the examples marked "XForms NG",
as those represent better the state of the art.

-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