problem with the bizdoc example

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

problem with the bizdoc example

marc.natale
Hi
In order to understand better the ops, I try to modify the bizdoc example.
In the page-flow.xml:

<!-- View XML -->
        <action when="/form/action = 'show-xml'" action="summary/find-document-action.xpl">
            <result page="xml-detail" instance-passing="redirect-exit-portal">
                <xu:update select="/document-id">
                    <xu:value-of select="document('input:action')/document-info/document-id"/>
                </xu:update>
            </result>
        </action>

enables to display the xml document on the browser.
In the same time, I would like to save it in a file of the drive, but I failed at making those two actions.
What part of code should I put to succeed in?

Thanks a lot for helping !!!!



--
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: problem with the bizdoc example

Alexander Žaťko
During development - to see the xml doc. my pages are built from, I
insert this snippet into the view.xml pages:

                 <p> The instance looks currently like this: </p>
                 <textarea rows="10" cols="100">
                     <xsl:copy-of select="/*"/>
                 </textarea>

It renders a textarea form filed where the XML produced by the page's
.xpl file is shown. I place this snippet right after the <body> element
which places the form field at the top of the page.

To debug the xpl files, I use the oxf:file-serializer to write outputs
of processors into disk. You can insert these at any point in the xpl
file to see what the XMLs look like at any point of the pipeline
processing.

     <!--for debug purposes write p-action xml content to disk -->
     <p:processor name="oxf:file-serializer">
         <p:input name="config">
             <config>
                 <file>p-action.xml</file>
                 <directory>/debug/</directory>
             </config>
         </p:input>
         <p:input name="data" href="#p-action"/>
     </p:processor>

I did not have time yet to investigate (probably) more intelligent
debuging methods that OPS, Studio provide.

A.


On Aug 5, 2005, at 10:31 AM, [hidden email] wrote:

> Hi
> In order to understand better the ops, I try to modify the bizdoc
> example.
> In the page-flow.xml:
>
> <!-- View XML -->
>         <action when="/form/action = 'show-xml'"
> action="summary/find-document-action.xpl">
>             <result page="xml-detail"
> instance-passing="redirect-exit-portal">
>                 <xu:update select="/document-id">
>                     <xu:value-of
> select="document('input:action')/document-info/document-id"/>
>                 </xu:update>
>             </result>
>         </action>
>
> enables to display the xml document on the browser.
> In the same time, I would like to save it in a file of the drive, but
> I failed at making those two actions.
> What part of code should I put to succeed in?
>
> Thanks a lot for helping !!!!
>
>
> --
> 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: problem with the bizdoc example

Erik Bruchez
Administrator
In reply to this post by marc.natale
Marc,

You should put this code into an action pipeline. Replace:

   summary/find-document-action.xpl

with:

   summary/whatever-action.xpl

Then in summary/whatever-action.xpl, save the file on disk with the File
serializer, then call summary/find-document-action.xpl.

-Erik

[hidden email] wrote:

> Hi
> In order to understand better the ops, I try to modify the bizdoc example.
> In the page-flow.xml:
>
> <!-- View XML -->
>         <action when="/form/action = 'show-xml'" action="summary/find-document-action.xpl">
>             <result page="xml-detail" instance-passing="redirect-exit-portal">
>                 <xu:update select="/document-id">
>                     <xu:value-of select="document('input:action')/document-info/document-id"/>
>                 </xu:update>
>             </result>
>         </action>
>
> enables to display the xml document on the browser.
> In the same time, I would like to save it in a file of the drive, but I failed at making those two actions.
> What part of code should I put to succeed in?
>
> Thanks a lot for helping !!!!


--
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: problem with the bizdoc example

Erik Bruchez
Administrator
In reply to this post by Alexander Žaťko
Alexander Zatko wrote:

> During development - to see the xml doc. my pages are built from, I
> insert this snippet into the view.xml pages:
>
>                 <p> The instance looks currently like this: </p>
>                 <textarea rows="10" cols="100">
>                     <xsl:copy-of select="/*"/>
>                 </textarea>
>
> It renders a textarea form filed where the XML produced by the page's
> .xpl file is shown. I place this snippet right after the <body> element
> which places the form field at the top of the page.
>
> To debug the xpl files, I use the oxf:file-serializer to write outputs
> of processors into disk. You can insert these at any point in the xpl
> file to see what the XMLs look like at any point of the pipeline
> processing.
>
>     <!--for debug purposes write p-action xml content to disk -->
>     <p:processor name="oxf:file-serializer">
>         <p:input name="config">
>             <config>
>                 <file>p-action.xml</file>
>                 <directory>/debug/</directory>
>             </config>
>         </p:input>
>         <p:input name="data" href="#p-action"/>
>     </p:processor>
>
> I did not have time yet to investigate (probably) more intelligent
> debuging methods that OPS, Studio provide.
You can use the "debug" (which should really be called "trace")
attribute in XPL on inputs and outputs. With Studio, these will be
displayed in a nice list, and the XML documents produced are visualized
in an XML editor with syntax coloring.

Support is planned for trace attributes in the PFC itself, which will
help visualizing what is going on there.

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

Re: problem with the bizdoc example

marc.natale
Thanks for your answer!

Actually, it works well: the file is saved on my disk, but an error
remains when I use the "save" button:
message:"There is no <param type="output" name="data"/>"
location:"oxf:/examples/bizdoc/detail/save-document-action.xpl"

here is the code:

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

        <p:param name="instance" type="input"/>
       
        <!--for debug purposes write instance.xml content to disk -->
        <p:processor name="oxf:file-serializer">
                <p:input name="config">
                        <config>
                                <file>instance.xml</file>
                                <directory>c:/temp</directory>
                        </config>
                </p:input>
                <p:input name="data" href="#instance"/>
        </p:processor>

    <!-- Call find doc-->
        <p:processor name="oxf:pipeline">
                <p:input name="config" href="find-document.xpl"/>
                <p:input name="instance" href="#instance"/>
                <p:output name="data" id="result"/>
        </p:processor>
</p:config>


and save-document-action.xpl
<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
          xmlns:oxf="http://www.orbeon.com/oxf/processors"
          xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

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

    <!-- Strip instance of XForms annotations -->
    <p:processor name="oxf:xslt">
        <p:input name="data" href="#instance"/>
        <p:input name="config">
            <xsl:transform version="2.0"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
                <xsl:import href="oxf:/oxf/xslt/utils/copy.xsl"/>
                <xsl:template match="@xxforms:*"/>
            </xsl:transform>
        </p:input>
        <p:output name="data" id="stripped-instance"/>
    </p:processor>

    <!-- Retrieve existing document if possible -->
    <p:processor name="oxf:pipeline">
        <p:input name="config" href="../summary/whatever-action.xpl"/>
        <p:input name="instance" href="#stripped-instance"/>
        <p:output name="data" id="result"/>
    </p:processor>

    <!-- Update or insert -->
    <p:choose href="#result">
        <p:when test="/document-info/document-id != ''">
            <!-- Document exists already, call the data access layer
to update it -->
            <p:processor name="oxf:pipeline">
                <p:input name="config"
href="../data-access/delegate/update-document.xpl"/>
                <p:input name="document-info"
href="aggregate('document-info',
#stripped-instance#xpointer(/form/document-id | /form/document))"/>
            </p:processor>
        </p:when>
        <p:otherwise>
            <!-- Document does not exist, call the data access layer
to insert it -->
            <p:processor name="oxf:pipeline">
                <p:input name="config"
href="../data-access/delegate/create-document.xpl"/>
                <p:input name="document-info"
href="aggregate('document-info',
#stripped-instance#xpointer(/form/document-id | /form/document))"/>
            </p:processor>
        </p:otherwise>
    </p:choose>
</p:config>

It's surely a basic error, but I cannot find the problem.
Thanks for helping me (again)...



--
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: problem with the bizdoc example

Alexander Žaťko
I think you just need to put line:

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

right below the...

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

...line. Your xpl doc needs to have declared output .

A.

On Aug 8, 2005, at 4:47 AM, Marc Natale wrote:

> Thanks for your answer!
>
> Actually, it works well: the file is saved on my disk, but an error
> remains when I use the "save" button:
> message:"There is no <param type="output" name="data"/>"
> location:"oxf:/examples/bizdoc/detail/save-document-action.xpl"
>
> here is the code:
>
> whatever-action.xpl
> <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
>           xmlns:oxf="http://www.orbeon.com/oxf/processors">
>
> <p:param name="instance" type="input"/>
>
> <!--for debug purposes write instance.xml content to disk -->
> <p:processor name="oxf:file-serializer">
> <p:input name="config">
> <config>
> <file>instance.xml</file>
> <directory>c:/temp</directory>
> </config>
> </p:input>
> <p:input name="data" href="#instance"/>
> </p:processor>
>
>     <!-- Call find doc-->
> <p:processor name="oxf:pipeline">
> <p:input name="config" href="find-document.xpl"/>
> <p:input name="instance" href="#instance"/>
> <p:output name="data" id="result"/>
> </p:processor>
> </p:config>
>
> and save-document-action.xpl
> <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
>           xmlns:oxf="http://www.orbeon.com/oxf/processors"
>           xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>
>     <p:param name="instance" type="input"/>
>
>     <!-- Strip instance of XForms annotations -->
>     <p:processor name="oxf:xslt">
>         <p:input name="data" href="#instance"/>
>         <p:input name="config">
>             <xsl:transform version="2.0"
> xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
>                 <xsl:import href="oxf:/oxf/xslt/utils/copy.xsl"/>
>                 <xsl:template match="@xxforms:*"/>
>             </xsl:transform>
>         </p:input>
>         <p:output name="data" id="stripped-instance"/>
>     </p:processor>
>
>     <!-- Retrieve existing document if possible -->
>     <p:processor name="oxf:pipeline">
>         <p:input name="config" href="../summary/whatever-action.xpl"/>
>         <p:input name="instance" href="#stripped-instance"/>
>         <p:output name="data" id="result"/>
>     </p:processor>
>
>     <!-- Update or insert -->
>     <p:choose href="#result">
>         <p:when test="/document-info/document-id != ''">
>             <!-- Document exists already, call the data access layer
> to update it -->
>             <p:processor name="oxf:pipeline">
>                 <p:input name="config"
> href="../data-access/delegate/update-document.xpl"/>
>                 <p:input name="document-info"
> href="aggregate('document-info',
> #stripped-instance#xpointer(/form/document-id | /form/document))"/>
>             </p:processor>
>         </p:when>
>         <p:otherwise>
>             <!-- Document does not exist, call the data access layer
> to insert it -->
>             <p:processor name="oxf:pipeline">
>                 <p:input name="config"
> href="../data-access/delegate/create-document.xpl"/>
>                 <p:input name="document-info"
> href="aggregate('document-info',
> #stripped-instance#xpointer(/form/document-id | /form/document))"/>
>             </p:processor>
>         </p:otherwise>
>     </p:choose>
> </p:config>
>
> It's surely a basic error, but I cannot find the problem.
> Thanks for helping me (again)...
>
>
> --
> 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
|

log4j debugging (was Re: problem with the bizdoc example)

Alexander Žaťko
In reply to this post by Erik Bruchez
How do I configure logging into a file with log4j? I added an attribute  
debug="1" (I tried also debug="true") into an output of one processor  
and also modified the log4j.xml file by specifying what looks like a  
path to where the log should be saved, but I do not see a file created  
in that location.

This is the section of the log4j.xml file I modified:

     <appender name="FileAppender" class="org.apache.log4j.FileAppender">
         <param name="File"  
value="/Applications/jakarta-tomcat-5.0.28/webapps/orbeon/WEB-INF/
resources/examples/iEDI/oxf.log"/>
         <param name="Append" value="true" />
         <layout class="org.apache.log4j.PatternLayout">
             <param name="ConversionPattern" value="%t %-5p %c{2} -  
%m%n"/>
         </layout>
     </appender>

Thanks.


On Aug 5, 2005, at 2:52 PM, Erik Bruchez wrote:

> Alexander Zatko wrote:
>> During development - to see the xml doc. my pages are built from, I  
>> insert this snippet into the view.xml pages:
>>                 <p> The instance looks currently like this: </p>
>>                 <textarea rows="10" cols="100">
>>                     <xsl:copy-of select="/*"/>
>>                 </textarea>
>> It renders a textarea form filed where the XML produced by the page's  
>> .xpl file is shown. I place this snippet right after the <body>  
>> element which places the form field at the top of the page.
>> To debug the xpl files, I use the oxf:file-serializer to write  
>> outputs of processors into disk. You can insert these at any point in  
>> the xpl file to see what the XMLs look like at any point of the  
>> pipeline processing.
>>     <!--for debug purposes write p-action xml content to disk -->
>>     <p:processor name="oxf:file-serializer">
>>         <p:input name="config">
>>             <config>
>>                 <file>p-action.xml</file>
>>                 <directory>/debug/</directory>
>>             </config>
>>         </p:input>
>>         <p:input name="data" href="#p-action"/>
>>     </p:processor>
>> I did not have time yet to investigate (probably) more intelligent  
>> debuging methods that OPS, Studio provide.
>
> You can use the "debug" (which should really be called "trace")  
> attribute in XPL on inputs and outputs. With Studio, these will be  
> displayed in a nice list, and the XML documents produced are  
> visualized in an XML editor with syntax coloring.
>
> Support is planned for trace attributes in the PFC itself, which will  
> help visualizing what is going on there.
>
> -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



--
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: log4j debugging (was Re: problem with the bizdoc example)

Alessandro  Vernet
Administrator
--- Alexander Zatko <[hidden email]> wrote:
> How do I configure logging into a file with log4j? I added an attribute
> debug="1" (I tried also debug="true") into an output of one processor  
> and also modified the log4j.xml file by specifying what looks like a  
> path to where the log should be saved, but I do not see a file created  
> in that location.

In your log4j.xml, check that you have a reference to the FileAppender
under the <root> element:

    <root>
        <priority value="info"/>
        <appender-ref ref="FileAppender"/>
    </root>

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

Re: log4j debugging (was Re: problem with the bizdoc example)

Alexander Žaťko
That (and restarting Tomcat) did the trick.

Thanks.

On Aug 8, 2005, at 3:20 PM, Alessandro Vernet wrote:

> --- Alexander Zatko <[hidden email]> wrote:
>> How do I configure logging into a file with log4j? I added an
>> attribute
>> debug="1" (I tried also debug="true") into an output of one processor
>> and also modified the log4j.xml file by specifying what looks like a
>> path to where the log should be saved, but I do not see a file created
>> in that location.
>
> In your log4j.xml, check that you have a reference to the FileAppender
> under the <root> element:
>
>     <root>
>         <priority value="info"/>
>         <appender-ref ref="FileAppender"/>
>     </root>
>
> 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



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