Debugging options help sought

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

Debugging options help sought

Alex Sharaz
Chaps, I'm looking at expanding the wizard with pfc example to produce a
page orientated questionnaire. While I've had some success, my main
problem is debugging something if things go wrong.

Eg.
I've generate my own version of the wizard with pfc example which has
the following


    <page id="hd-survey4-intro" path-info="/hd-survey4"
default-submission="orig-xforms-model.xml" view="intro.xhtml">
        <action when="/survey/action = 'next'" >
            <result page="hd-survey4-question1" transform="oxf:xupdate">
                <xu:transformations>
                    <xu:update select="/survey/action"/>
                    <xu:update select="/survey/title"/>
                    <xu:update select="/survey/user"><xu:copy-of
select="document('input:instance')/survey/user/*"/></xu:update>
                    <xu:update select="/survey/questions"><xu:copy-of
select="document('input:instance')/survey/questions/*"/></xu:update>
                </xu:transformations>
            </result>
        </action>
    </page>

    <page id="hd-survey4-question1" path-info="/hd-survey4/question1"
view="question1.xhtml">
        <action when="/survey/action = 'previous'">
            <result page="hd-survey4-intro" transform="oxf:xupdate">
                <xu:transformations>
Etc .....

Where orig-xforms-model.xml has
    <survey >
            <action>hohoho</action>
            <user>
               <userid>[hidden email]</userid>
               <date>2004-01-01</date>
           </user>
            <title>Customer Satisfaction Survey</title>
            <questions>
            <action>BOO BOO BOO</action>
            <question1>
                <info>Tell us how you raised your problem last
month</info>
                <howraised />
            </question1>
            <question2>
                <info>Where did you raise the problem</info>
                <whereraised />
            </question2>
            <question3>
                <info>What was your experience of the problem raising
process last month?</info>
                <response />
            </question3>
            <question4>
                <info>What is the current status of the problem you
raised last month</info>
                <resolution />
            </question4>
            <question5>
                <info>Where you have had calls resolved last month - how
timely did you consider this resolution to be?</info>
                <responsetime />
            </question5>
            <question6>
                <info>What is your experience of the way that helpdek
communicated with you when working on your problem(s) last month</info>
                <communication />
            </question6>
            <question7>
                <info>Based upon your experience last month, would you
use one of the helpdesks to obtain a resolution to your IT problem in t
he future?</info>
                <useagain />
            </question7>
            <question8>
                <info>Do you have any thing else you would like to tell
us at this time?</info>
                <message />
            </question8>
</questions>
        </survey>

When I run this as an example, everything works as I'd expect.

If I replace the orig-xforms-model.xml with page-flow.xpl
#################


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

    <p:param name="data" type="output"/>

    <p:processor name="oxf:java">
        <p:input name="config">
            <config sourcepath="." class="SessionAttributes"/>
        </p:input>
        <p:output name="data" id="sessionInfo"/>
    </p:processor>
<p:processor name="oxf:identity">
         <p:input  name="data"
href="aggregate('survey',statement.xml,#sessionInfo,xforms-model.xml)"/>
         <p:output name="data" ref="data"/>
</p:processor>
</p:config>

###############################################

Which should produce
<survey><action/><user><userid>[hidden email]</userid><date>2004-01
-01</date></user><questions>......</questions></survey> i.e. the same as
the static xml file I passed into it.

And pass it into the 1st page defined in page-flow.xml.

However, all that happens when I click the "next" button is ... nothing.
The same page is displayed again. I'm running PresentationServer Release
3.0.1.200606141411

Looking in the log4j.log file associated with ops shows huge reams of
logging that just wants to make your eyes glaze over.

What do other people do when attempting to debug a "complicated"
page-flow application.

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: Debugging options help sought

Alessandro  Vernet
Administrator
Hi Alex,

Using the "debug" attribute in XPL can help. For instance adding a
debug on the output of your pipeline:

<p:param name="data" type="output" debug="Output of XPL"/>

If you did this, you will notice that nothing is logged, which means
that the pipeline didn't run. This is because the default submission
can only be a static XML file, so if you reference an XPL file there,
that XPL file will be your initial instance.

A better way to have an initial instance is to use in your XForms:
<xforms:instance id="i18n" src="i18n-resources"/>

And have in your page flow:
<page path-info="/xforms-i18n/i18n-resources" model="i18n-resources.xpl"/>

This way the pipeline i18n-resources.xpl generates the initial value
for the instance. This code is taken from the i18n example in
src\examples\web\examples\xforms\xforms-i18n.

Alex

On 6/20/06, Alex Sharaz <[hidden email]> wrote:

> Chaps, I'm looking at expanding the wizard with pfc example to produce a
> page orientated questionnaire. While I've had some success, my main
> problem is debugging something if things go wrong.
>
> Eg.
> I've generate my own version of the wizard with pfc example which has
> the following
>
>
>     <page id="hd-survey4-intro" path-info="/hd-survey4"
> default-submission="orig-xforms-model.xml" view="intro.xhtml">
>         <action when="/survey/action = 'next'" >
>             <result page="hd-survey4-question1" transform="oxf:xupdate">
>                 <xu:transformations>
>                     <xu:update select="/survey/action"/>
>                     <xu:update select="/survey/title"/>
>                     <xu:update select="/survey/user"><xu:copy-of
> select="document('input:instance')/survey/user/*"/></xu:update>
>                     <xu:update select="/survey/questions"><xu:copy-of
> select="document('input:instance')/survey/questions/*"/></xu:update>
>                 </xu:transformations>
>             </result>
>         </action>
>     </page>
>
>     <page id="hd-survey4-question1" path-info="/hd-survey4/question1"
> view="question1.xhtml">
>         <action when="/survey/action = 'previous'">
>             <result page="hd-survey4-intro" transform="oxf:xupdate">
>                 <xu:transformations>
> Etc .....
>
> Where orig-xforms-model.xml has
>     <survey >
>             <action>hohoho</action>
>             <user>
>                <userid>[hidden email]</userid>
>                <date>2004-01-01</date>
>            </user>
>             <title>Customer Satisfaction Survey</title>
>             <questions>
>             <action>BOO BOO BOO</action>
>             <question1>
>                 <info>Tell us how you raised your problem last
> month</info>
>                 <howraised />
>             </question1>
>             <question2>
>                 <info>Where did you raise the problem</info>
>                 <whereraised />
>             </question2>
>             <question3>
>                 <info>What was your experience of the problem raising
> process last month?</info>
>                 <response />
>             </question3>
>             <question4>
>                 <info>What is the current status of the problem you
> raised last month</info>
>                 <resolution />
>             </question4>
>             <question5>
>                 <info>Where you have had calls resolved last month - how
> timely did you consider this resolution to be?</info>
>                 <responsetime />
>             </question5>
>             <question6>
>                 <info>What is your experience of the way that helpdek
> communicated with you when working on your problem(s) last month</info>
>                 <communication />
>             </question6>
>             <question7>
>                 <info>Based upon your experience last month, would you
> use one of the helpdesks to obtain a resolution to your IT problem in t
> he future?</info>
>                 <useagain />
>             </question7>
>             <question8>
>                 <info>Do you have any thing else you would like to tell
> us at this time?</info>
>                 <message />
>             </question8>
> </questions>
>         </survey>
>
> When I run this as an example, everything works as I'd expect.
>
> If I replace the orig-xforms-model.xml with page-flow.xpl
> #################
>
>
> <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
>           xmlns:oxf="http://www.orbeon.com/oxf/processors">
>
>     <p:param name="data" type="output"/>
>
>     <p:processor name="oxf:java">
>         <p:input name="config">
>             <config sourcepath="." class="SessionAttributes"/>
>         </p:input>
>         <p:output name="data" id="sessionInfo"/>
>     </p:processor>
> <p:processor name="oxf:identity">
>          <p:input  name="data"
> href="aggregate('survey',statement.xml,#sessionInfo,xforms-model.xml)"/>
>          <p:output name="data" ref="data"/>
> </p:processor>
> </p:config>
>
> ###############################################
>
> Which should produce
> <survey><action/><user><userid>[hidden email]</userid><date>2004-01
> -01</date></user><questions>......</questions></survey> i.e. the same as
> the static xml file I passed into it.
>
> And pass it into the 1st page defined in page-flow.xml.
>
> However, all that happens when I click the "next" button is ... nothing.
> The same page is displayed again. I'm running PresentationServer Release
> 3.0.1.200606141411
>
> Looking in the log4j.log file associated with ops shows huge reams of
> logging that just wants to make your eyes glaze over.
>
> What do other people do when attempting to debug a "complicated"
> page-flow application.
>
> 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
>
>
>

--
Blog (XML, Web apps, Open Source):
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Debugging options help sought

Adrian Baker-2
As far as debugging XForms themselves goes, I find it *extremely* helpful being able to display the raw xml instance data on the form, because very often my problems are caused by the instance data not being what I think it is. And because bad or totally incorrect instance data generally doesn't cause actual exceptions but just means that fields don't display or submissions don't work, this can be pretty frustrating. If you look at the Orbeon Controls sample (http://www.orbeon.com/ops/goto-example/xforms-controls) you'll see what I mean - there's a button which you can whack to see a live formatted view of the xml under the form controls.

This is pretty cool, but it's a bit impractical for production forms because you need to manually add debug markup to each form definition to use it. Also it's a pain that you can't control which instance you see.

What I've done is add logic to our standard form pre-processing stylesheet which inserts similar markup into the form based on a XSLT parameter (which is driven from a log4j debug flag). It also adds a dropdown so you can choose which instance to view (I've attached a screenshot):

<xsl:param name="configuration-debug" select="'false'"/>

...
(in the model of the form):
<xsl:if test="$configuration-debug = 'true'">
    <xsl:variable name="instanceIds" select="//xforms:instance/@id"/>

    <xforms:instance id="forms-debug" xmlns="">
       <debug>
          <show-formatted-instance>false</show-formatted-instance>
          <selected-instance><xsl:value-of select="$instanceIds[1]"/></selected-instance>
          <available-instances>
             <xsl:for-each select="$instanceIds">
                <instanceId><xsl:value-of select="."/></instanceId>
             </xsl:for-each>
          </available-instances>
          <formated-instance>
             <span>
             </span>
          </formated-instance>
       </debug>
    </xforms:instance>
  
    <xforms:bind nodeset="instance('forms-debug')/formated-instance"
          calculate="if(../show-formatted-instance = 'false') then '' else saxon:serialize(xxforms:call-xpl
             ('oxf:/config/theme/format.xpl', 'data', xxforms:evaluate(concat('instance(&quot;',instance('forms-debug')/selected-instance, '&quot;)')), 'data')/*, 'html')"/>
</xsl:if>

...
(at the bottom of the xhtml:body):
<xsl:if test="$configuration-debug = 'true'">
    <xforms:switch>
       <xforms:case id="instance-hidden">
          <xforms:trigger appearance="">
             <xforms:label>Show raw XML</xforms:label>
             <xforms:toggle ev:event="DOMActivate" case="instance-visible"/>
             <xforms:setvalue ev:event="DOMActivate"  ref="instance('forms-debug')/show-formatted-instance" value="true()"/>
          </xforms:trigger>
       </xforms:case>
       <xforms:case id="instance-visible">
          <xforms:trigger appearance="">
             <xforms:label>Hide raw XML</xforms:label>
             <xforms:toggle ev:event="DOMActivate" case="instance-hidden"/>
             <xforms:setvalue ev:event="DOMActivate" ref="instance('forms-debug')/show-formatted-instance" value="false()"/>
          </xforms:trigger>
          <xforms:select1 ref="instance('forms-debug')/selected-instance">
             <xforms:label>Instance</xforms:label>
             <xforms:itemset nodeset="instance('forms-debug')/available-instances/instanceId">
                <xforms:label ref="."/>
                <xforms:value ref="."/>
             </xforms:itemset>
          </xforms:select1>
          <xforms:group>
             <xforms:output ref="instance('forms-debug')/formated-instance" mediatype="text/html"/>
          </xforms:group>
       </xforms:case>
    </xforms:switch>  
</xsl:if>

Maybe something similar could be added to xforms-epilogue.xpl so this is available by default, perhaps with the debug flag check in the XPL rather than the stylesheet itself? The test in my case is against a log4j logger because it's easy to change at runtime from the JOnAS web administration console, but could be made against a property in properties.xml, which can also be changed at runtime?

Adrian

Alessandro Vernet wrote:
Hi Alex,

Using the "debug" attribute in XPL can help. For instance adding a
debug on the output of your pipeline:

<p:param name="data" type="output" debug="Output of XPL"/>

If you did this, you will notice that nothing is logged, which means
that the pipeline didn't run. This is because the default submission
can only be a static XML file, so if you reference an XPL file there,
that XPL file will be your initial instance.

A better way to have an initial instance is to use in your XForms:
<xforms:instance id="i18n" src="i18n-resources"/>

And have in your page flow:
<page path-info="/xforms-i18n/i18n-resources" model="i18n-resources.xpl"/>

This way the pipeline i18n-resources.xpl generates the initial value
for the instance. This code is taken from the i18n example in
src\examples\web\examples\xforms\xforms-i18n.

Alex

On 6/20/06, Alex Sharaz [hidden email] wrote:
Chaps, I'm looking at expanding the wizard with pfc example to produce a
page orientated questionnaire. While I've had some success, my main
problem is debugging something if things go wrong.

Eg.
I've generate my own version of the wizard with pfc example which has
the following


    <page id="hd-survey4-intro" path-info="/hd-survey4"
default-submission="orig-xforms-model.xml" view="intro.xhtml">
        <action when="/survey/action = 'next'" >
            <result page="hd-survey4-question1" transform="oxf:xupdate">
                <xu:transformations>
                    <xu:update select="/survey/action"/>
                    <xu:update select="/survey/title"/>
                    <xu:update select="/survey/user"><xu:copy-of
select="document('input:instance')/survey/user/*"/></xu:update>
                    <xu:update select="/survey/questions"><xu:copy-of
select="document('input:instance')/survey/questions/*"/></xu:update>
                </xu:transformations>
            </result>
        </action>
    </page>

    <page id="hd-survey4-question1" path-info="/hd-survey4/question1"
view="question1.xhtml">
        <action when="/survey/action = 'previous'">
            <result page="hd-survey4-intro" transform="oxf:xupdate">
                <xu:transformations>
Etc .....

Where orig-xforms-model.xml has
    <survey >
            <action>hohoho</action>
            <user>
               <userid>[hidden email]</userid>
               <date>2004-01-01</date>
           </user>
            <title>Customer Satisfaction Survey</title>
            <questions>
            <action>BOO BOO BOO</action>
            <question1>
                <info>Tell us how you raised your problem last
month</info>
                <howraised />
            </question1>
            <question2>
                <info>Where did you raise the problem</info>
                <whereraised />
            </question2>
            <question3>
                <info>What was your experience of the problem raising
process last month?</info>
                <response />
            </question3>
            <question4>
                <info>What is the current status of the problem you
raised last month</info>
                <resolution />
            </question4>
            <question5>
                <info>Where you have had calls resolved last month - how
timely did you consider this resolution to be?</info>
                <responsetime />
            </question5>
            <question6>
                <info>What is your experience of the way that helpdek
communicated with you when working on your problem(s) last month</info>
                <communication />
            </question6>
            <question7>
                <info>Based upon your experience last month, would you
use one of the helpdesks to obtain a resolution to your IT problem in t
he future?</info>
                <useagain />
            </question7>
            <question8>
                <info>Do you have any thing else you would like to tell
us at this time?</info>
                <message />
            </question8>
</questions>
        </survey>

When I run this as an example, everything works as I'd expect.

If I replace the orig-xforms-model.xml with page-flow.xpl
#################


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

    <p:param name="data" type="output"/>

    <p:processor name="oxf:java">
        <p:input name="config">
            <config sourcepath="." class="SessionAttributes"/>
        </p:input>
        <p:output name="data" id="sessionInfo"/>
    </p:processor>
<p:processor name="oxf:identity">
         <p:input  name="data"
href="aggregate('survey',statement.xml,#sessionInfo,xforms-model.xml)"/>
         <p:output name="data" ref="data"/>
</p:processor>
</p:config>

###############################################

Which should produce
<survey><action/><user><userid>[hidden email]</userid><date>2004-01
-01</date></user><questions>......</questions></survey> i.e. the same as
the static xml file I passed into it.

And pass it into the 1st page defined in page-flow.xml.

However, all that happens when I click the "next" button is ... nothing.
The same page is displayed again. I'm running PresentationServer Release
3.0.1.200606141411

Looking in the log4j.log file associated with ops shows huge reams of
logging that just wants to make your eyes glaze over.

What do other people do when attempting to debug a "complicated"
page-flow application.

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: [hidden email]
For general help: [hidden email]
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: [hidden email] For general help: [hidden email] ObjectWeb mailing lists service home page: http://www.objectweb.org/wws


show-instance-data.JPG (41K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Debugging options help sought

Adrian Baker-2
Adrian Baker wrote:
...
  
    <xforms:bind nodeset="instance('forms-debug')/formated-instance"
          calculate="if(../show-formatted-instance = 'false') then '' else saxon:serialize(xxforms:call-xpl
             ('oxf:/config/theme/format.xpl', 'data', xxforms:evaluate(concat('instance(&quot;',instance('forms-debug')/selected-instance, '&quot;)')), 'data')/*, 'html')"/>
</xsl:if>


...except I'm not sure why I've got that mystery call to xxforms:evaluate - it should just be:
    <xforms:bind nodeset="instance('forms-debug')/formated-instance"
           calculate="if(../show-formatted-instance = 'false') then '' else saxon:serialize(xxforms:call-xpl
               ('oxf:/config/theme/format.xpl', 'data', instance(instance('forms-debug')/selected-instance), 'data')/*, '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: Debugging options help sought

Alessandro  Vernet
Administrator
Hi Adrian,

Automatically adding through XSL a button and a drop down to show any
of the instance used on the current page is a pretty cool. However, I
am not sure we want to add this in default epilogue, as even just
adding a test there would have an impact on performance.

If you can share the stylesheet you use and the modification you did
to the epilogue, then we can list this somewhere an people can include
that modification in their epilogue if they want to see the instances.

In the long run (still hopefully not too far in the future!), we would
like to allow the form author to view the instances in the web page.
We had the concept of a console in mind, but I am now thinking that we
could simply provide a JavaScript function like xformsInstance([ID],
[model]) that returns the XML for the specified instance. It would
make a request to the server. This capability of the XForms server
could be disabled if exposing the whole instance to the browser is a
security concern. With FireBug installed on Firefox, then the instance
can be logged with console.log("%x", xformsInstance('my-instance')).
This will display a nicely navigable XML tree.

Alex

On 6/21/06, Adrian Baker <[hidden email]> wrote:

>
>  Adrian Baker wrote:
>  ...
>
>
>      <xforms:bind
> nodeset="instance('forms-debug')/formated-instance"
>            calculate="if(../show-formatted-instance =
> 'false') then '' else saxon:serialize(xxforms:call-xpl
>               ('oxf:/config/theme/format.xpl', 'data',
> xxforms:evaluate(concat('instance(&quot;',instance('forms-debug')/selected-instance,
> '&quot;)')), 'data')/*, 'html')"/>
>  </xsl:if>
>
>
>
>  ...except I'm not sure why I've got that mystery call to xxforms:evaluate -
> it should just be:
>
>      <xforms:bind
> nodeset="instance('forms-debug')/formated-instance"
>             calculate="if(../show-formatted-instance =
> 'false') then '' else saxon:serialize(xxforms:call-xpl
>                 ('oxf:/config/theme/format.xpl', 'data',
> instance(instance('forms-debug')/selected-instance),
> 'data')/*, '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
>
>
>

--
Blog (XML, Web apps, Open Source):
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Debugging options help sought

Adrian Baker-2
Hi Alex,

Well that's a pity - I wouldn't have thought a test against a property in XPL would have any impact, but no matter.

I don't actually use the epilogue to insert the debug, that was just a suggestion (I insert it prior to handing the form to OPS).

The XSLT that inserts the debug markup does a whole bunch of other stuff too, so I don't have a standalone stylesheet - but I pasted all the relevant xsl in in my earlier email.

Using the FireBug extension is pretty cool approach which nicely does away the need for a debug flag or property. But keep in mind that lots of forms get used on client machines which don't have FireBug installed or, more likely, use IE instead of Firefox. Sadly you can't even access our forms on Firefox because you need to go through a portal product which runs only on IE :) So ideally the standard debugging solution would still be easily available on these clients...

Adrian

Alessandro Vernet wrote:
Hi Adrian,

Automatically adding through XSL a button and a drop down to show any
of the instance used on the current page is a pretty cool. However, I
am not sure we want to add this in default epilogue, as even just
adding a test there would have an impact on performance.

If you can share the stylesheet you use and the modification you did
to the epilogue, then we can list this somewhere an people can include
that modification in their epilogue if they want to see the instances.

In the long run (still hopefully not too far in the future!), we would
like to allow the form author to view the instances in the web page.
We had the concept of a console in mind, but I am now thinking that we
could simply provide a JavaScript function like xformsInstance([ID],
[model]) that returns the XML for the specified instance. It would
make a request to the server. This capability of the XForms server
could be disabled if exposing the whole instance to the browser is a
security concern. With FireBug installed on Firefox, then the instance
can be logged with console.log("%x", xformsInstance('my-instance')).
This will display a nicely navigable XML tree.

Alex

On 6/21/06, Adrian Baker [hidden email] wrote:

 Adrian Baker wrote:
 ...


     <xforms:bind
nodeset="instance('forms-debug')/formated-instance"
           calculate="if(../show-formatted-instance =
'false') then '' else saxon:serialize(xxforms:callxpl
              ('oxf:/config/theme/format.xpl', 'data',
xxforms:evaluate(concat('instance(&quot;',instance('forms-debug')/selected-instance,
'&quot;)')), 'data')/*, 'html')"/>
 </xsl:if>



 ...except I'm not sure why I've got that mystery call to xxforms:evaluate -
it should just be:

     <xforms:bind
nodeset="instance('forms-debug')/formated-instance"
            calculate="if(../show-formatted-instance =
'false') then '' else saxon:serialize(xxforms:call-xpl
                ('oxf:/config/theme/format.xpl', 'data',
instance(instance('forms-debug')/selected-instance),
'data')/*, 'html')"/>


--
You receive this message as a subscriber of the [hidden email]
mailing list.
To unsubscribe: [hidden email]
For general help: [hidden email]
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: [hidden email] For general help: [hidden email] 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: Debugging options help sought

Erik Bruchez
Administrator
Adrian and Alex,

I don't want to make too many forward-looking statements here, but we do
have some pretty good ideas about a (web-based, written with XForms)
XForms Monitoring Console that will greatly help debugging. Stay tuned,
and keep the great ideas coming ;-)

-Erik

Adrian Baker wrote:

> Hi Alex,
>
> Well that's a pity - I wouldn't have thought a test against a property
> in XPL would have any impact, but no matter.
>
> I don't actually use the epilogue to insert the debug, that was just a
> suggestion (I insert it prior to handing the form to OPS).
>
> The XSLT that inserts the debug markup does a whole bunch of other stuff
> too, so I don't have a standalone stylesheet - but I pasted all the
> relevant xsl in in my earlier email.
>
> Using the FireBug extension is pretty cool approach which nicely does
> away the need for a debug flag or property. But keep in mind that lots
> of forms get used on client machines which don't have FireBug installed
> or, more likely, use IE instead of Firefox. Sadly you can't even access
> our forms on Firefox because you need to go through a portal product
> which runs only on IE :) So ideally the standard debugging solution
> would still be easily available on these clients...
>
> Adrian
>
> Alessandro Vernet wrote:
>> Hi Adrian,
>>
>> Automatically adding through XSL a button and a drop down to show any
>> of the instance used on the current page is a pretty cool. However, I
>> am not sure we want to add this in default epilogue, as even just
>> adding a test there would have an impact on performance.
>>
>> If you can share the stylesheet you use and the modification you did
>> to the epilogue, then we can list this somewhere an people can include
>> that modification in their epilogue if they want to see the instances.
>>
>> In the long run (still hopefully not too far in the future!), we would
>> like to allow the form author to view the instances in the web page.
>> We had the concept of a console in mind, but I am now thinking that we
>> could simply provide a JavaScript function like xformsInstance([ID],
>> [model]) that returns the XML for the specified instance. It would
>> make a request to the server. This capability of the XForms server
>> could be disabled if exposing the whole instance to the browser is a
>> security concern. With FireBug installed on Firefox, then the instance
>> can be logged with console.log("%x", xformsInstance('my-instance')).
>> This will display a nicely navigable XML tree.
>>
>> Alex
>>
>> On 6/21/06, Adrian Baker <[hidden email]> wrote:
>>>
>>>  Adrian Baker wrote:
>>>  ...
>>>
>>>
>>>      <xforms:bind
>>> nodeset="instance('forms-debug')/formated-instance"
>>>            calculate="if(../show-formatted-instance =
>>> 'false') then '' else saxon:serialize(xxforms:callxpl
>>>               ('oxf:/config/theme/format.xpl', 'data',
>>> xxforms:evaluate(concat('instance(&quot;',instance('forms-debug')/selected-instance,
>>>
>>> '&quot;)')), 'data')/*, 'html')"/>
>>>  </xsl:if>
>>>
>>>
>>>
>>>  ...except I'm not sure why I've got that mystery call to
>>> xxforms:evaluate -
>>> it should just be:
>>>
>>>      <xforms:bind
>>> nodeset="instance('forms-debug')/formated-instance"
>>>             calculate="if(../show-formatted-instance =
>>> 'false') then '' else saxon:serialize(xxforms:call-xpl
>>>                 ('oxf:/config/theme/format.xpl', 'data',
>>> instance(instance('forms-debug')/selected-instance),
>>> 'data')/*, '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
>>>
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>> --
>> 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

--
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
Reply | Threaded
Open this post in threaded view
|

RE: Debugging options help sought

Alex Sharaz
In reply to this post by Adrian Baker-2

Hi,

Many thanks. I agree with you, viewing the xml instance data would help a  lot. There is nothing worse than trying to get to grips with something like creating an xforms file and then having a choice of nothing apparently happening ( e.g. clicking a submission button to no effect) or looking in a log file to see that a few hundred lines of debug code has been generated that doesn’t mean much to a poor newbie L(

Alex

 

 

 


From: Adrian Baker [mailto:[hidden email]]
Sent: Wednesday, June 21, 2006 3:23 AM
To: [hidden email]
Subject: Re: [ops-users] Debugging options help sought

 

As far as debugging XForms themselves goes, I find it *extremely* helpful being able to display the raw xml instance data on the form, because very often my problems are caused by the instance data not being what I think it is. And because bad or totally incorrect instance data generally doesn't cause actual exceptions but just means that fields don't display or submissions don't work, this can be pretty frustrating. If you look at the Orbeon Controls sample (http://www.orbeon.com/ops/goto-example/xforms-controls) you'll see what I mean - there's a button which you can whack to see a live formatted view of the xml under the form controls.

This is pretty cool, but it's a bit impractical for production forms because you need to manually add debug markup to each form definition to use it. Also it's a pain that you can't control which instance you see.

What I've done is add logic to our standard form pre-processing stylesheet which inserts similar markup into the form based on a XSLT parameter (which is driven from a log4j debug flag). It also adds a dropdown so you can choose which instance to view (I've attached a screenshot):

<xsl:param name="configuration-debug" select="'false'"/>

...
(in the model of the form):
<xsl:if test="$configuration-debug = 'true'">
    <xsl:variable name="instanceIds" select="//xforms:instance/@id"/>

    <xforms:instance id="forms-debug" xmlns="">
       <debug>
          <show-formatted-instance>false</show-formatted-instance>
          <selected-instance><xsl:value-of select="$instanceIds[1]"/></selected-instance>
          <available-instances>
             <xsl:for-each select="$instanceIds">
                <instanceId><xsl:value-of select="."/></instanceId>
             </xsl:for-each>
          </available-instances>
          <formated-instance>
             <span>
             </span>
          </formated-instance>
       </debug>
    </xforms:instance>
  
    <xforms:bind nodeset="instance('forms-debug')/formated-instance"
          calculate="if(../show-formatted-instance = 'false') then '' else saxon:serialize(xxforms:call-xpl
             ('oxf:/config/theme/format.xpl', 'data', xxforms:evaluate(concat('instance(&quot;',instance('forms-debug')/selected-instance, '&quot;)')), 'data')/*, 'html')"/>
</xsl:if>

...
(at the bottom of the xhtml:body):
<xsl:if test="$configuration-debug = 'true'">
    <xforms:switch>
       <xforms:case id="instance-hidden">
          <xforms:trigger appearance="">
             <xforms:label>Show raw XML</xforms:label>
             <xforms:toggle ev:event="DOMActivate" case="instance-visible"/>
             <xforms:setvalue ev:event="DOMActivate"  ref="instance('forms-debug')/show-formatted-instance" value="true()"/>
          </xforms:trigger>
       </xforms:case>
       <xforms:case id="instance-visible">
          <xforms:trigger appearance="">
             <xforms:label>Hide raw XML</xforms:label>
             <xforms:toggle ev:event="DOMActivate" case="instance-hidden"/>
             <xforms:setvalue ev:event="DOMActivate" ref="instance('forms-debug')/show-formatted-instance" value="false()"/>
          </xforms:trigger>
          <xforms:select1 ref="instance('forms-debug')/selected-instance">
             <xforms:label>Instance</xforms:label>
             <xforms:itemset nodeset="instance('forms-debug')/available-instances/instanceId">
                <xforms:label ref="."/>
                <xforms:value ref="."/>
             </xforms:itemset>
          </xforms:select1>
          <xforms:group>
             <xforms:output ref="instance('forms-debug')/formated-instance" mediatype="text/html"/>
          </xforms:group>
       </xforms:case>
    </xforms:switch>  
</xsl:if>

Maybe something similar could be added to xforms-epilogue.xpl so this is available by default, perhaps with the debug flag check in the XPL rather than the stylesheet itself? The test in my case is against a log4j logger because it's easy to change at runtime from the JOnAS web administration console, but could be made against a property in properties.xml, which can also be changed at runtime?

Adrian

Alessandro Vernet wrote:

Hi Alex,

Using the "debug" attribute in XPL can help. For instance adding a
debug on the output of your pipeline:

<p:param name="data" type="output" debug="Output of XPL"/>

If you did this, you will notice that nothing is logged, which means
that the pipeline didn't run. This is because the default submission
can only be a static XML file, so if you reference an XPL file there,
that XPL file will be your initial instance.

A better way to have an initial instance is to use in your XForms:
<xforms:instance id="i18n" src="i18n-resources"/>

And have in your page flow:
<page path-info="/xforms-i18n/i18n-resources" model="i18n-resources.xpl"/>

This way the pipeline i18n-resources.xpl generates the initial value
for the instance. This code is taken from the i18n example in
src\examples\web\examples\xforms\xforms-i18n.

Alex

On 6/20/06, Alex Sharaz [hidden email] wrote:

Chaps, I'm looking at expanding the wizard with pfc example to produce a
page orientated questionnaire. While I've had some success, my main
problem is debugging something if things go wrong.

Eg.
I've generate my own version of the wizard with pfc example which has
the following


    <page id="hd-survey4-intro" path-info="/hd-survey4"
default-submission="orig-xforms-model.xml" view="intro.xhtml">
        <action when="/survey/action = 'next'" >
            <result page="hd-survey4-question1" transform="oxf:xupdate">
                <xu:transformations>
                    <xu:update select="/survey/action"/>
                    <xu:update select="/survey/title"/>
                    <xu:update select="/survey/user"><xu:copy-of
select="document('input:instance')/survey/user/*"/></xu:update>
                    <xu:update select="/survey/questions"><xu:copy-of
select="document('input:instance')/survey/questions/*"/></xu:update>
                </xu:transformations>
            </result>
        </action>
    </page>

    <page id="hd-survey4-question1" path-info="/hd-survey4/question1"
view="question1.xhtml">
        <action when="/survey/action = 'previous'">
            <result page="hd-survey4-intro" transform="oxf:xupdate">
                <xu:transformations>
Etc .....

Where orig-xforms-model.xml has
    <survey >
            <action>hohoho</action>
            <user>
               <userid>[hidden email]</userid>
               <date>2004-01-01</date>
           </user>
            <title>Customer Satisfaction Survey</title>
            <questions>
            <action>BOO BOO BOO</action>
            <question1>
                <info>Tell us how you raised your problem last
month</info>
                <howraised />
            </question1>
            <question2>
                <info>Where did you raise the problem</info>
                <whereraised />
            </question2>
            <question3>
                <info>What was your experience of the problem raising
process last month?</info>
                <response />
            </question3>
            <question4>
                <info>What is the current status of the problem you
raised last month</info>
                <resolution />
            </question4>
            <question5>
                <info>Where you have had calls resolved last month - how
timely did you consider this resolution to be?</info>
                <responsetime />
            </question5>
            <question6>
                <info>What is your experience of the way that helpdek
communicated with you when working on your problem(s) last month</info>
                <communication />
            </question6>
            <question7>
                <info>Based upon your experience last month, would you
use one of the helpdesks to obtain a resolution to your IT problem in t
he future?</info>
                <useagain />
            </question7>
            <question8>
                <info>Do you have any thing else you would like to tell
us at this time?</info>
                <message />
            </question8>
</questions>
        </survey>

When I run this as an example, everything works as I'd expect.

If I replace the orig-xforms-model.xml with page-flow.xpl
#################


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

    <p:param name="data" type="output"/>

    <p:processor name="oxf:java">
        <p:input name="config">
            <config sourcepath="." class="SessionAttributes"/>
        </p:input>
        <p:output name="data" id="sessionInfo"/>
    </p:processor>
<p:processor name="oxf:identity">
         <p:input  name="data"
href="aggregate('survey',statement.xml,#sessionInfo,xforms-model.xml)"/>
         <p:output name="data" ref="data"/>
</p:processor>
</p:config>

###############################################

Which should produce
<survey><action/><user><userid>[hidden email]</userid><date>2004-01
-01</date></user><questions>......</questions></survey> i.e. the same as
the static xml file I passed into it.

And pass it into the 1st page defined in page-flow.xml.

However, all that happens when I click the "next" button is ... nothing.
The same page is displayed again. I'm running PresentationServer Release
3.0.1.200606141411

Looking in the log4j.log file associated with ops shows huge reams of
logging that just wants to make your eyes glaze over.

What do other people do when attempting to debug a "complicated"
page-flow application.

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: [hidden email]
For general help: [hidden email]
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: [hidden email]
For general help: [hidden email]
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
  

 


*****************************************************************************************
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: Debugging options help sought

Alessandro  Vernet
Administrator
In reply to this post by Adrian Baker-2
On 6/22/06, Adrian Baker <[hidden email]> wrote:
> Using the FireBug extension is pretty cool approach which nicely does away
> the need for a debug flag or property. But keep in mind that lots of forms
> get used on client machines which don't have FireBug installed or, more
> likely, use IE instead of Firefox. Sadly you can't even access our forms on
> Firefox because you need to go through a portal product which runs only on
> IE :) So ideally the standard debugging solution would still be easily
> available on these clients...

Adrian,

This is a good point. I was under the assumption that, in development
mode at least, it would always be possible to use Firefox with
FireBug. This assumption is obviously not always correct, which calls
for a more comprehensive solution, like the suggested XForms Console.

Alex
--
Blog (XML, Web apps, Open Source):
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet