Hello all,
I decided to use Form-Runner as the base of an audit system project I am actually building up. We choosed it for being open-source and based on standards highly interoperable. I have some question about it and hope you could help. First of all, we are building the grid in XML files that are transformed according to an XSL stylesheet. What we actually do is using saxon to build the form.xhtml file. Does exist a way to do it dynamically ? I mean that form runner would read form.xsl instead of form.xhtml. Then we have a multi-level form structure we wanted to be reflected in the table of content. I saw in apps/fr/components/view.xsl that you had to implement it and I did it so. Here attached you will find the patch file. It's the first time I work with XSL, so I'm not sure of the quality of what I did, particularly concerning the match pattern, but it works. Finally, we are considering using a paged form thanks to xforms:switch instead of having all the form in one page. For this we would create a property indicating what kind of table we want. For example oxf.fr.detail.toc-type.*.*. Any recommandation on the name of the property to be integrated upstream ? Thank you in advance for your response. Sincerely, -- Laurent Sibilla Vice President and International Manager FBJE asbl - vzw Rue Archimède 1 B-1348 Louvain-la-Neuve Belgium +32 (0)485 48 10 55 [hidden email] http://www.jadebelgium.eu --- view.xsl.orig 2009-11-13 17:32:20.000000000 +0100 +++ view.xsl 2010-01-03 13:40:07.988913126 +0100 @@ -575,34 +575,42 @@ <xhtml:h2> <xforms:output value="$fr-resources/summary/titles/toc"/> </xhtml:h2> - <xhtml:ol> - <xsl:for-each select="/xhtml:html/xhtml:body//fr:section"> - <!-- Reference bind so that entry for section disappears if the section is non-relevant --> - <xsl:choose> - <!-- TODO: must handle @ref/@bind/inline text --> - <xsl:when test="@bind"> - <xforms:group bind="{@bind}"> - <xhtml:li> - <xhtml:a href="#{@id}"><xforms:output value="{xforms:label/@ref}"/></xhtml:a> - <!-- NOTE: Will have to add sub-sections when necessary --> - </xhtml:li> - </xforms:group> - </xsl:when> - <xsl:otherwise> - <xhtml:li> - <xhtml:a href="#{@id}"><xsl:value-of select="xforms:label"/></xhtml:a> - <!-- NOTE: Will have to add sub-sections when necessary --> - </xhtml:li> - </xsl:otherwise> - </xsl:choose> - </xsl:for-each> - </xhtml:ol> + <xsl:apply-templates select="(/xhtml:html/xhtml:body//fr:section)[1]/.." mode="fr-toc-sections"/> </xforms:group> </xhtml:div> <xhtml:div class="fr-separator"> </xhtml:div> </xsl:if> </xsl:template> + <xsl:template match="*" mode="fr-toc-sections"> + <xhtml:ol> + <xsl:for-each select="./fr:section"> + <!-- Reference bind so that entry for section disappears if the section is non-relevant --> + <xsl:choose> + <!-- TODO: must handle @ref/@bind/inline text --> + <xsl:when test="@bind"> + <xforms:group bind="{@bind}"> + <xhtml:li> + <xhtml:a href="#{@id}"><xforms:output value="{xforms:label/@ref}"/></xhtml:a> + <xsl:if test="count(./fr:section)"> + <xsl:apply-templates select="." mode="fr-toc-sections"/> + </xsl:if> + </xhtml:li> + </xforms:group> + </xsl:when> + <xsl:otherwise> + <xhtml:li> + <xhtml:a href="#{@id}"><xsl:value-of select="xforms:label"/></xhtml:a> + <xsl:if test="count(./fr:section)"> + <xsl:apply-templates select="." mode="fr-toc-sections"/> + </xsl:if> + </xhtml:li> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + </xhtml:ol> + </xsl:template> + <!-- Add a default xforms:alert for those fields which don't have one. Only do this within grids and dialogs. --> <xsl:template match="xhtml:body//fr:grid//xforms:*[local-name() = ('input', 'textarea', 'select', 'select1', 'upload') and not(xforms:alert) and not(@appearance = 'fr:in-place')] | xhtml:body//xxforms:dialog//xforms:*[local-name() = ('input', 'textarea', 'select', 'select1', 'upload') and not(xforms:alert) and not(@appearance = 'fr:in-place')]"> -- 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 OW2 mailing lists service home page: http://www.ow2.org/wws |
Administrator
|
Laurent,
1) Form Runner retrieves the form through the persistence API, and right now assumes that it got the "final" form, not an XSLT stylesheet it needs to run to get the final form. But Form Runner could be enhanced to look at the type of the documents it gets, and if it is a stylesheet, execute it as such. What would be the input of the stylesheet in this case? 2) Thank you for the patch attached. I changed the code a bit and committed this. It will be included in the next nightly build. You'll let me know if the code still works in your case. 3) By paged form, you mean that clicking on a title in the TOC would display the relevant section below, and only that section? Another way to render this would be with a tabview, using the sections label as label for the tab (see the fr:tabview component). (Regarding the name of the property, I'll need to better understand what you are planning to do here before I can suggest anything.) Alex On Jan 6, 2010, at 8:47 AM, Laurent Sibilla <[hidden email]> wrote: > Hello all, > > > I decided to use Form-Runner as the base of an audit system project > I am actually building up. We choosed it for being open-source and > based on standards highly interoperable. > > I have some question about it and hope you could help. > > First of all, we are building the grid in XML files that are > transformed according to an XSL stylesheet. What we actually do is > using saxon to build the form.xhtml file. Does exist a way to do it > dynamically ? I mean that form runner would read form.xsl instead > of form.xhtml. > > Then we have a multi-level form structure we wanted to be reflected > in the table of content. I saw in apps/fr/components/view.xsl that > you had to implement it and I did it so. Here attached you will find > the patch file. It's the first time I work with XSL, so I'm not sure > of the quality of what I did, particularly concerning the match > pattern, but it works. > > Finally, we are considering using a paged form thanks to > xforms:switch instead of having all the form in one page. For this > we would create a property indicating what kind of table we want. > For example oxf.fr.detail.toc-type.*.*. Any recommandation on the > name of the property to be integrated upstream ? > > Thank you in advance for your response. > > Sincerely, > > -- > Laurent Sibilla > Vice President and International Manager > > FBJE asbl - vzw > Rue Archimède 1 > B-1348 Louvain-la-Neuve > Belgium > > +32 (0)485 48 10 55 > [hidden email] > > http://www.jadebelgium.eu > > --- view.xsl.orig 2009-11-13 17:32:20.000000000 +0100 +++ view.xsl > 2010-01-03 13:40:07.988913126 +0100 @@ -575,34 +575,42 @@ - - - - - > - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + > + + + + + + + + + + + + + + > > -- > 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 > OW2 mailing lists service home page: http://www.ow2.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 OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Alessandro Vernet a écrit :
> Laurent, > > 1) Form Runner retrieves the form through the persistence API, and right > now assumes that it got the "final" form, not an XSLT stylesheet it > needs to run to get the final form. But Form Runner could be enhanced to > look at the type of the documents it gets, and if it is a stylesheet, > execute it as such. What would be the input of the stylesheet in this case? > Allright ! I will do it so that if form.xsl exists it would process it with form.xml. If form.xhtml exists, it will get the priority to ensure retro-compatibility. > 2) Thank you for the patch attached. I changed the code a bit and > committed this. It will be included in the next nightly build. You'll > let me know if the code still works in your case. > > 3) By paged form, you mean that clicking on a title in the TOC would > display the relevant section below, and only that section? Another way > to render this would be with a tabview, using the sections label as > label for the tab (see the fr:tabview component). (Regarding the name of > the property, I'll need to better understand what you are planning to do > here before I can suggest anything.) Well I just finished to implement it using switch. It actually works but tabview may be more suited. I will have a look into this. Thank you. Laurent -- 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 OW2 mailing lists service home page: http://www.ow2.org/wws |
Well, tabview seems to have a restricted appearance. I mean you can't
avoid having the tabs appearing at the top of the box. Right ? If this is the case, I would prefer the xforms:switch way. I mainly need it because we have a really huge form (At least 100 questions). Having like 6 or 7 sections will make the tabs being on 2 lines. Moreover, we need a 2 level TOC which can be confusing for the user with fr:tabview. The TOC, helps to have a clear view of the form hierarchy. For all those reasons, I would prefer use switch. I will continue to develop this solution and submit you a patch. Laurent Laurent Sibilla a écrit : > Alessandro Vernet a écrit : >> Laurent, >> >> 1) Form Runner retrieves the form through the persistence API, and >> right now assumes that it got the "final" form, not an XSLT stylesheet >> it needs to run to get the final form. But Form Runner could be >> enhanced to look at the type of the documents it gets, and if it is a >> stylesheet, execute it as such. What would be the input of the >> stylesheet in this case? >> > > Allright ! I will do it so that if form.xsl exists it would process it > with form.xml. > > If form.xhtml exists, it will get the priority to ensure > retro-compatibility. > >> 2) Thank you for the patch attached. I changed the code a bit and >> committed this. It will be included in the next nightly build. You'll >> let me know if the code still works in your case. >> >> 3) By paged form, you mean that clicking on a title in the TOC would >> display the relevant section below, and only that section? Another way >> to render this would be with a tabview, using the sections label as >> label for the tab (see the fr:tabview component). (Regarding the name >> of the property, I'll need to better understand what you are planning >> to do here before I can suggest anything.) > > This is what I mean yes. > > Well I just finished to implement it using switch. It actually works but > tabview may be more suited. I will have a look into this. Thank you. > > > > Laurent -- 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 OW2 mailing lists service home page: http://www.ow2.org/wws |
Administrator
|
In reply to this post by Laurent Sibilla
Laurent,
Regarding running XSLT on the form, I wouldn't do this based on the extension of the file. You even don't know the extension of the file, depending on where it is stored. Instead, it should be simple enough to look at the root element and check if you have an xsl:stylesheet or xsl:transform. Regarding displaying one section at a time, then yes, I think the name of your property makes sense. Maybe "appearance" instead of "type" would be more in the spirit of XForms, i.e.: oxf.fr.detail.toc.appearance="all | only-selected | tabview" (imagining that someone implements it using the fr:tabview at some point). Alex On Jan 6, 2010, at 8:47 AM, Laurent Sibilla <[hidden email]> wrote: > Hello all, > > > I decided to use Form-Runner as the base of an audit system project > I am actually building up. We choosed it for being open-source and > based on standards highly interoperable. > > I have some question about it and hope you could help. > > First of all, we are building the grid in XML files that are > transformed according to an XSL stylesheet. What we actually do is > using saxon to build the form.xhtml file. Does exist a way to do it > dynamically ? I mean that form runner would read form.xsl instead > of form.xhtml. > > Then we have a multi-level form structure we wanted to be reflected > in the table of content. I saw in apps/fr/components/view.xsl that > you had to implement it and I did it so. Here attached you will find > the patch file. It's the first time I work with XSL, so I'm not sure > of the quality of what I did, particularly concerning the match > pattern, but it works. > > Finally, we are considering using a paged form thanks to > xforms:switch instead of having all the form in one page. For this > we would create a property indicating what kind of table we want. > For example oxf.fr.detail.toc-type.*.*. Any recommandation on the > name of the property to be integrated upstream ? > > Thank you in advance for your response. > > Sincerely, > > -- > Laurent Sibilla > Vice President and International Manager > > FBJE asbl - vzw > Rue Archimède 1 > B-1348 Louvain-la-Neuve > Belgium > > +32 (0)485 48 10 55 > [hidden email] > > http://www.jadebelgium.eu > > --- view.xsl.orig 2009-11-13 17:32:20.000000000 +0100 +++ view.xsl > 2010-01-03 13:40:07.988913126 +0100 @@ -575,34 +575,42 @@ - - - - - > - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + > + + + + + + + + + + + + + + > > -- > 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 > OW2 mailing lists service home page: http://www.ow2.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 OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Administrator
|
In reply to this post by Laurent Sibilla-2
Laurent,
Understood, and indeed if you have lots of sections, with maybe long labels, and you want to support sub-sections, then using the fr:tabview wouldn't work. Alex On Jan 10, 2010, at 8:44 AM, Laurent Sibilla <[hidden email]> wrote: > Well, tabview seems to have a restricted appearance. I mean you > can't avoid having the tabs appearing at the top of the box. Right ? > > If this is the case, I would prefer the xforms:switch way. > > I mainly need it because we have a really huge form (At least 100 > questions). Having like 6 or 7 sections will make the tabs being on > 2 lines. Moreover, we need a 2 level TOC which can be confusing for > the user with fr:tabview. The TOC, helps to have a clear view of the > form hierarchy. > > For all those reasons, I would prefer use switch. I will continue to > develop this solution and submit you a patch. > > > Laurent > > > Laurent Sibilla a écrit : >> Alessandro Vernet a écrit : >>> Laurent, >>> >>> 1) Form Runner retrieves the form through the persistence API, and >>> right now assumes that it got the "final" form, not an XSLT >>> stylesheet it needs to run to get the final form. But Form Runner >>> could be enhanced to look at the type of the documents it gets, >>> and if it is a stylesheet, execute it as such. What would be the >>> input of the stylesheet in this case? >>> >> Allright ! I will do it so that if form.xsl exists it would process >> it with form.xml. >> If form.xhtml exists, it will get the priority to ensure retro- >> compatibility. >>> 2) Thank you for the patch attached. I changed the code a bit and >>> committed this. It will be included in the next nightly build. >>> You'll let me know if the code still works in your case. >>> >>> 3) By paged form, you mean that clicking on a title in the TOC >>> would display the relevant section below, and only that section? >>> Another way to render this would be with a tabview, using the >>> sections label as label for the tab (see the fr:tabview >>> component). (Regarding the name of the property, I'll need to >>> better understand what you are planning to do here before I can >>> suggest anything.) >> This is what I mean yes. >> Well I just finished to implement it using switch. It actually >> works but tabview may be more suited. I will have a look into this. >> Thank you. >> Laurent > > > -- > 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 > OW2 mailing lists service home page: http://www.ow2.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 OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
In reply to this post by Alessandro Vernet
Alessandro Vernet a écrit :
> Laurent, > > Regarding running XSLT on the form, I wouldn't do this based on the > extension of the file. You even don't know the extension of the file, > depending on where it is stored. Instead, it should be simple enough to > look at the root element and check if you have an xsl:stylesheet or > xsl:transform. > Doing it, I figured out quickly that it was better doing it your way. Here is the patch. Note that using the #document variable led to me to xsl:include issues. So I had to use href to take the real URL in account. I didn't find any way to put a xsl variable as href value. As a workaround, I used an xsl transformation to create a processor to do the wanted xsl transformation. I'm not sure this is the most straightforward way to do it and if you know a better way, I would be really happy to know it. > Regarding displaying one section at a time, then yes, I think the name > of your property makes sense. Maybe "appearance" instead of "type" would > be more in the spirit of XForms, i.e.: oxf.fr.detail.toc.appearance="all > | only-selected | tabview" (imagining that someone implements it using > the fr:tabview at some point). Attached is the patch. What is in it : - Add a $toc-appearance variable in component.xsl - If $toc-appearance = 'selected-only' : - Put xforms:cases in sections.xsl - Create xforms:switch in view.xsl and put all non fr:section before it - Use xforms:trigger instead of xhtml:a in toc The results seems good enough for our needs. What do you think about it ? Kind regards, Laurent > > Alex > > > > On Jan 6, 2010, at 8:47 AM, Laurent Sibilla <[hidden email]> > wrote: > >> Hello all, >> >> >> I decided to use Form-Runner as the base of an audit system project I >> am actually building up. We choosed it for being open-source and based >> on standards highly interoperable. >> >> I have some question about it and hope you could help. >> >> First of all, we are building the grid in XML files that are >> transformed according to an XSL stylesheet. What we actually do is >> using saxon to build the form.xhtml file. Does exist a way to do it >> dynamically ? I mean that form runner would read form.xsl instead of >> form.xhtml. >> >> Then we have a multi-level form structure we wanted to be reflected in >> the table of content. I saw in apps/fr/components/view.xsl that you >> had to implement it and I did it so. Here attached you will find the >> patch file. It's the first time I work with XSL, so I'm not sure of >> the quality of what I did, particularly concerning the match pattern, >> but it works. >> >> Finally, we are considering using a paged form thanks to xforms:switch >> instead of having all the form in one page. For this we would create a >> property indicating what kind of table we want. For example >> oxf.fr.detail.toc-type.*.*. Any recommandation on the name of the >> property to be integrated upstream ? >> >> Thank you in advance for your response. >> >> Sincerely, >> >> -- >> Laurent Sibilla >> Vice President and International Manager >> >> FBJE asbl - vzw >> Rue Archimède 1 >> B-1348 Louvain-la-Neuve >> Belgium >> >> +32 (0)485 48 10 55 >> [hidden email] >> >> http://www.jadebelgium.eu >> >> --- view.xsl.orig 2009-11-13 17:32:20.000000000 +0100 +++ >> view.xsl 2010-01-03 13:40:07.988913126 +0100 @@ -575,34 +575,42 @@ >> - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + >> + + + + + + + + + + + + + + + + + + >> >> -- >> 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 >> OW2 mailing lists service home page: http://www.ow2.org/wws diff -Naur -x '*~' -x '.*.sw?' -x page-flow.xml -x '*.orig' -x '*.patch' fr.orig/detail/read-form.xpl fr/detail/read-form.xpl --- fr.orig/detail/read-form.xpl 2009-08-26 14:32:00.000000000 +0200 +++ fr/detail/read-form.xpl 2010-01-12 18:19:52.152150493 +0100 @@ -62,11 +62,46 @@ <p:output name="data" id="document"/> </p:processor> - <!-- Handle XInclude (mainly for "resource" type of persistence) --> - <p:processor name="oxf:xinclude"> - <p:input name="config" href="#document"/> - <p:output name="data" id="after-xinclude" ref="data"/> - </p:processor> + <p:choose href="#document"> + <p:when test="name(/*[1])='xsl:stylesheet'"> + <!-- The read document is an XSLT stylesheet --> + <p:processor name="oxf:pipeline"> + + <p:input name="config" transform="oxf:unsafe-xslt" href="#instance"> + <p:config xsl:version="2.0"> + <p:param type="output" name="data"/> + + <!-- We can't use an xsl variable for href atribute of the config input. Using XSL to create subpipeline --> + <p:processor name="oxf:unsafe-xslt"> + <xsl:variable name="document" select="/*/document" as="xs:string"/> + + <!-- Create URI based on properties --> + <xsl:variable name="resource" as="xs:string" + select="concat(pipeline:property(string-join(('oxf.fr.persistence.app.uri', /*/app, /*/form, 'form'), '.')), + '/crud/', /*/app, '/', /*/form, '/form/', + if ($document != '') then concat('?document=', $document) else '')"/> + <p:input name="config"> + <xsl:attribute name="href" select="pipeline:rewriteServiceURI(concat($resource,'form.xhtml'), true())"/> + </p:input> + <p:input name="data"> + <xsl:attribute name="href" select="pipeline:rewriteServiceURI(concat($resource,'form.xml'), true())"/> + </p:input> + <p:output name="data" id="final-document" ref="data"/> + </p:processor> + </p:config> + </p:input> + + <p:output name="data" id="final-document" ref="data"/> + </p:processor> + </p:when> + <p:otherwise> + <!-- Handle XInclude (mainly for "resource" type of persistence) --> + <p:processor name="oxf:xinclude"> + <p:input name="config" href="#document"/> + <p:output name="data" id="final-document" ref="data"/> + </p:processor> + </p:otherwise> + </p:choose> <!-- Store document in the request for further access down the line --> <p:processor name="oxf:scope-serializer"> @@ -76,7 +111,7 @@ <scope>request</scope> </config> </p:input> - <p:input name="data" href="#after-xinclude"/> + <p:input name="data" href="#final-document"/> </p:processor> </p:when> <p:otherwise> diff -Naur -x '*~' -x '.*.sw?' -x page-flow.xml -x '*.orig' -x '*.patch' fr.orig/components/components.xsl fr/components/components.xsl --- fr.orig/components/components.xsl 2009-11-20 13:00:04.000000000 +0100 +++ fr/components/components.xsl 2010-01-12 18:26:16.463371194 +0100 @@ -49,6 +49,7 @@ <!-- Properties --> <xsl:variable name="has-version" select="pipeline:property(string-join(('oxf.fr.version', $app, $form), '.'))" as="xs:boolean?"/> <xsl:variable name="has-noscript-link" select="pipeline:property(string-join(('oxf.fr.noscript-link', $app, $form), '.'))" as="xs:boolean?"/> + <xsl:variable name="toc-appearance" select="(pipeline:property(string-join(('oxf.fr.detail.toc.appearance', $app, $form), '.')), 'summary')[1]" as="xs:string"/> <xsl:variable name="min-toc" select="(pipeline:property(string-join(('oxf.fr.detail.toc', $app, $form), '.')), -1)[1]" as="xs:integer"/> <xsl:variable name="has-toc" select="$min-toc ge 0" as="xs:boolean"/> <xsl:variable name="error-summary" select="pipeline:property(string-join(('oxf.fr.detail.error-summary', $app, $form), '.'))" as="xs:string?"/> diff -Naur -x '*~' -x '.*.sw?' -x page-flow.xml -x '*.orig' -x '*.patch' fr.orig/components/section.xsl fr/components/section.xsl --- fr.orig/components/section.xsl 2009-11-09 12:12:30.000000000 +0100 +++ fr/components/section.xsl 2010-01-12 18:25:27.132122738 +0100 @@ -38,97 +38,124 @@ <!-- Section content area --> - <xforms:group id="{$section-id}-group"> - <!-- Support single-node bindings and context --> - <xsl:copy-of select="@ref | @bind | @context"/> - <xsl:attribute name="class" select="string-join(('fr-section-container', @class), ' ')"/> - - <!-- Section title area: open/close button, title, help --> - <xsl:element name="{if ($ancestor-sections = 0) then 'xhtml:h2' else 'xhtml:h3'}"> - <xsl:attribute name="class" select="'fr-section-title'"/> - - <!-- Open/close button --> - <xforms:group appearance="xxforms:internal"> - <xsl:if test="$is-section-collapse"> - <xforms:switch id="switch-button-{$section-id}" xxforms:readonly-appearance="dynamic"> - <xforms:case id="case-button-{$section-id}-closed" selected="{if (not($open)) then 'true' else 'false'}"> - <!-- "+" trigger --> - <xforms:trigger appearance="minimal" id="button-{$section-id}-open" class="fr-section-open-close"> - <xforms:label> - <xhtml:img width="12" height="12" src="/apps/fr/style/images/mozilla/arrow-rit-hov.gif" alt="" title="{{$fr-resources/components/labels/open-section}}"/> - </xforms:label> - </xforms:trigger> - </xforms:case> - <xforms:case id="case-button-{$section-id}-open" selected="{if ($open) then 'true' else 'false'}"> - <!-- "-" trigger --> - <xforms:trigger appearance="minimal" id="button-{$section-id}-close" class="fr-section-open-close"> - <xforms:label> - <xhtml:img width="12" height="12" src="/apps/fr/style/images/mozilla/arrow-dn-hov.gif" alt="" title="{{$fr-resources/components/labels/close-section}}"/> - </xforms:label> - </xforms:trigger> - </xforms:case> - </xforms:switch> - - <!-- Handle DOMActivate event to open/close the switches --> - <xforms:action ev:event="DOMActivate" ev:target="{$section-id} button-{$section-id}-open button-{$section-id}-close"> - <xforms:setvalue model="fr-sections-model" ref="instance('fr-current-section-instance')/id"> - <xsl:value-of select="$section-id"/> - </xforms:setvalue> - <xforms:setvalue model="fr-sections-model" ref="instance('fr-current-section-instance')/repeat-indexes" value="event('xxforms:repeat-indexes')"/> - <!-- Dispatch fr-collapse or fr-expand --> - <xforms:dispatch target="fr-sections-model" - name="fr-{{if (xxforms:case('switch-{$section-id}') = 'case-{$section-id}-open') then 'collapse' else 'expand'}}"/> - </xforms:action> - </xsl:if> - - <xsl:choose> - <xsl:when test="@editable = 'true'"> - <xsl:variable name="input" as="element(fr:inplace-input)"> - <fr:inplace-input id="{$section-id}-input-closed" ref="{xforms:label/@ref}"> - <xsl:apply-templates select="xforms:hint | xforms:alert"/> - <!-- Put a hidden label for the error summary --> - <xforms:label class="fr-hidden" ref="$fr-resources/components/labels/section-name"/> - </fr:inplace-input> - </xsl:variable> - <xsl:apply-templates select="$input"/> - <span class="fr-section-buttons"> - <xsl:apply-templates select="fr:buttons/node()"/> - </span> - </xsl:when> - <xsl:when test="$is-section-collapse"> - <!-- Set the section id to this trigger: this id matching is needed for noscript help --> - <xforms:trigger id="{$section-id}" appearance="minimal"> - <xsl:apply-templates select="xforms:label | xforms:help | xforms:alert"/> - </xforms:trigger> - </xsl:when> - <xsl:otherwise> - <!-- Set the section id to this output: this id matching is needed for noscript help --> - <xforms:output id="{$section-id}" appearance="minimal" value="''"> + <xsl:choose> + <xsl:when test="$toc-appearance='only-selected'"> + <xforms:case id="{$section-id}-case"> + <xsl:copy-of select="@select"/> + <xsl:attribute name="class" select="string-join(('fr-section-container', @class), ' ')"/> + + <!-- Section title area: ancestor titles and help --> + <xsl:for-each select="ancestor-or-self::fr:section"> + <xsl:element name="{concat('xhtml:h', 2+count(ancestor::fr:section))}"> + <xsl:attribute name="class" select="'fr-section-title'"/> + <xforms:output appearance="minimal" value="''"> <xsl:apply-templates select="xforms:label | xforms:help | xforms:alert"/> </xforms:output> - </xsl:otherwise> - </xsl:choose> - - </xforms:group> - - </xsl:element> - - <xforms:switch id="switch-{$section-id}" xxforms:readonly-appearance="dynamic"> - <!-- Closed section --> - <xforms:case id="case-{$section-id}-closed" selected="{if (not($open)) then 'true' else 'false'}"/> - <!-- Open section --> - <xforms:case id="case-{$section-id}-open" selected="{if ($open) then 'true' else 'false'}"> + </xsl:element> + </xsl:for-each> + <xhtml:div> - <xhtml:div class="fr-collapsible"> - <!-- Section content except label, event handlers, and buttons --> - <xsl:apply-templates select="* except (xforms:label, *[@ev:*], fr:buttons)"/> - </xhtml:div> + <xsl:copy-of select="@ref | @bind | @context"/> + <!-- Section content except subsection, label, event handlers, and buttons --> + <xsl:apply-templates select="* except (fr:section, xforms:label, *[@ev:*], fr:buttons)"/> </xhtml:div> + <!-- Event handlers children of fr:section --> + <xsl:apply-templates select="*[@ev:*]"/> </xforms:case> - </xforms:switch> - <!-- Event handlers children of fr:section --> - <xsl:apply-templates select="*[@ev:*]"/> - </xforms:group> - + </xsl:when> + <xsl:otherwise> + <xforms:group id="{$section-id}-group"> + <!-- Support single-node bindings and context --> + <xsl:copy-of select="@ref | @bind | @context"/> + <xsl:attribute name="class" select="string-join(('fr-section-container', @class), ' ')"/> + + <!-- Section title area: open/close button, title, help --> + <xsl:element name="{if ($ancestor-sections = 0) then 'xhtml:h2' else 'xhtml:h3'}"> + <xsl:attribute name="class" select="'fr-section-title'"/> + + <!-- Open/close button --> + <xforms:group appearance="xxforms:internal"> + <xsl:if test="$is-section-collapse"> + <xforms:switch id="switch-button-{$section-id}" xxforms:readonly-appearance="dynamic"> + <xforms:case id="case-button-{$section-id}-closed" selected="{if (not($open)) then 'true' else 'false'}"> + <!-- "+" trigger --> + <xforms:trigger appearance="minimal" id="button-{$section-id}-open" class="fr-section-open-close"> + <xforms:label> + <xhtml:img width="12" height="12" src="/apps/fr/style/images/mozilla/arrow-rit-hov.gif" alt="" title="{{$fr-resources/components/labels/open-section}}"/> + </xforms:label> + </xforms:trigger> + </xforms:case> + <xforms:case id="case-button-{$section-id}-open" selected="{if ($open) then 'true' else 'false'}"> + <!-- "-" trigger --> + <xforms:trigger appearance="minimal" id="button-{$section-id}-close" class="fr-section-open-close"> + <xforms:label> + <xhtml:img width="12" height="12" src="/apps/fr/style/images/mozilla/arrow-dn-hov.gif" alt="" title="{{$fr-resources/components/labels/close-section}}"/> + </xforms:label> + </xforms:trigger> + </xforms:case> + </xforms:switch> + + <!-- Handle DOMActivate event to open/close the switches --> + <xforms:action ev:event="DOMActivate" ev:target="{$section-id} button-{$section-id}-open button-{$section-id}-close"> + <xforms:setvalue model="fr-sections-model" ref="instance('fr-current-section-instance')/id"> + <xsl:value-of select="$section-id"/> + </xforms:setvalue> + <xforms:setvalue model="fr-sections-model" ref="instance('fr-current-section-instance')/repeat-indexes" value="event('xxforms:repeat-indexes')"/> + <!-- Dispatch fr-collapse or fr-expand --> + <xforms:dispatch target="fr-sections-model" + name="fr-{{if (xxforms:case('switch-{$section-id}') = 'case-{$section-id}-open') then 'collapse' else 'expand'}}"/> + </xforms:action> + </xsl:if> + + <xsl:choose> + <xsl:when test="@editable = 'true'"> + <xsl:variable name="input" as="element(fr:inplace-input)"> + <fr:inplace-input id="{$section-id}-input-closed" ref="{xforms:label/@ref}"> + <xsl:apply-templates select="xforms:hint | xforms:alert"/> + <!-- Put a hidden label for the error summary --> + <xforms:label class="fr-hidden" ref="$fr-resources/components/labels/section-name"/> + </fr:inplace-input> + </xsl:variable> + <xsl:apply-templates select="$input"/> + <span class="fr-section-buttons"> + <xsl:apply-templates select="fr:buttons/node()"/> + </span> + </xsl:when> + <xsl:when test="$is-section-collapse"> + <!-- Set the section id to this trigger: this id matching is needed for noscript help --> + <xforms:trigger id="{$section-id}" appearance="minimal"> + <xsl:apply-templates select="xforms:label | xforms:help | xforms:alert"/> + </xforms:trigger> + </xsl:when> + <xsl:otherwise> + <!-- Set the section id to this output: this id matching is needed for noscript help --> + <xforms:output id="{$section-id}" appearance="minimal" value="''"> + <xsl:apply-templates select="xforms:label | xforms:help | xforms:alert"/> + </xforms:output> + </xsl:otherwise> + </xsl:choose> + + </xforms:group> + + </xsl:element> + + <xforms:switch id="switch-{$section-id}" xxforms:readonly-appearance="dynamic"> + <!-- Closed section --> + <xforms:case id="case-{$section-id}-closed" selected="{if (not($open)) then 'true' else 'false'}"/> + <!-- Open section --> + <xforms:case id="case-{$section-id}-open" selected="{if ($open) then 'true' else 'false'}"> + <xhtml:div> + <xhtml:div class="fr-collapsible"> + <!-- Section content except label, event handlers, and buttons --> + <xsl:apply-templates select="* except (xforms:label, *[@ev:*], fr:buttons)"/> + </xhtml:div> + </xhtml:div> + </xforms:case> + </xforms:switch> + <!-- Event handlers children of fr:section --> + <xsl:apply-templates select="*[@ev:*]"/> + </xforms:group> + </xsl:otherwise> + </xsl:choose> </xsl:template> </xsl:stylesheet> diff -Naur -x '*~' -x '.*.sw?' -x page-flow.xml -x '*.orig' -x '*.patch' fr.orig/components/view.xsl fr/components/view.xsl --- fr.orig/components/view.xsl 2010-01-12 17:11:59.322120773 +0100 +++ fr/components/view.xsl 2010-01-12 18:25:27.972150732 +0100 @@ -115,10 +115,23 @@ <!-- Anchor for navigation --> <xhtml:a name="fr-form"/> <!-- Main form content --> - <xsl:apply-templates select="$body/node()"> - <!-- Dialogs are handled later --> - <xsl:with-param name="include-dialogs" select="false()" tunnel="yes" as="xs:boolean"/> - </xsl:apply-templates> + <xsl:choose> + <xsl:when test="$toc-appearance='only-selected'"> + <xsl:apply-templates select="$body/node()[name()!='fr:section']"> + <!-- Dialogs are handled later --> + <xsl:with-param name="include-dialogs" select="false()" tunnel="yes" as="xs:boolean"/> + </xsl:apply-templates> + <xforms:switch> + <xsl:apply-templates select="$body//fr:section"/> + </xforms:switch> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="$body/node()"> + <!-- Dialogs are handled later --> + <xsl:with-param name="include-dialogs" select="false()" tunnel="yes" as="xs:boolean"/> + </xsl:apply-templates> + </xsl:otherwise> + </xsl:choose> </xforms:group> <!-- Error summary (if at bottom) --> @@ -594,19 +607,37 @@ <xsl:when test="@bind"> <xforms:group bind="{@bind}"> <xhtml:li> - <xhtml:a href="#{@id}"><xforms:output value="{xforms:label/@ref}"/></xhtml:a> + <xsl:apply-templates select="." mode="fr-toc-node"/> <xsl:copy-of select="$sub-sections"/> </xhtml:li> </xforms:group> </xsl:when> <xsl:otherwise> <xhtml:li> - <xhtml:a href="#{@id}"><xsl:value-of select="xforms:label"/></xhtml:a> + <xsl:apply-templates select="." mode="fr-toc-node"/> <xsl:copy-of select="$sub-sections"/> </xhtml:li> </xsl:otherwise> </xsl:choose> </xsl:template> + + <xsl:template match="fr:section" mode="fr-toc-node"> + <xsl:choose> + <xsl:when test="$toc-appearance='only-selected'"> + <xforms:trigger appearance="minimal"> + <xforms:label ref="{xforms:label/@ref}"/> + <xforms:toggle ev:event="DOMActivate"> + <xsl:attribute name="case"> + <xsl:value-of select="concat(@id,'-case')"/> + </xsl:attribute> + </xforms:toggle> + </xforms:trigger> + </xsl:when> + <xsl:otherwise> + <xhtml:a href="#{@id}"><xforms:output value="{xforms:label/@ref}"/></xhtml:a> + </xsl:otherwise> + </xsl:choose> + </xsl:template> <!-- Add a default xforms:alert for those fields which don't have one. Only do this within grids and dialogs. --> <xsl:template match="xhtml:body//fr:grid//xforms:*[local-name() = ('input', 'textarea', 'select', 'select1', 'upload') and not(xforms:alert) and not(@appearance = 'fr:in-place')] -- 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 OW2 mailing lists service home page: http://www.ow2.org/wws |
In reply to this post by Alessandro Vernet
Alessandro,
Alessandro Vernet a écrit : > Laurent, > > 2) Thank you for the patch attached. I changed the code a bit and > committed this. It will be included in the next nightly build. You'll > let me know if the code still works in your case. > It just works and is much more clear. Thank you ! > > Alex > > > > On Jan 6, 2010, at 8:47 AM, Laurent Sibilla <[hidden email]> > wrote: > >> Hello all, >> >> >> I decided to use Form-Runner as the base of an audit system project I >> am actually building up. We choosed it for being open-source and based >> on standards highly interoperable. >> >> I have some question about it and hope you could help. >> >> First of all, we are building the grid in XML files that are >> transformed according to an XSL stylesheet. What we actually do is >> using saxon to build the form.xhtml file. Does exist a way to do it >> dynamically ? I mean that form runner would read form.xsl instead of >> form.xhtml. >> >> Then we have a multi-level form structure we wanted to be reflected in >> the table of content. I saw in apps/fr/components/view.xsl that you >> had to implement it and I did it so. Here attached you will find the >> patch file. It's the first time I work with XSL, so I'm not sure of >> the quality of what I did, particularly concerning the match pattern, >> but it works. >> >> Finally, we are considering using a paged form thanks to xforms:switch >> instead of having all the form in one page. For this we would create a >> property indicating what kind of table we want. For example >> oxf.fr.detail.toc-type.*.*. Any recommandation on the name of the >> property to be integrated upstream ? >> >> Thank you in advance for your response. >> >> Sincerely, >> >> -- >> Laurent Sibilla >> Vice President and International Manager >> >> FBJE asbl - vzw >> Rue Archimède 1 >> B-1348 Louvain-la-Neuve >> Belgium >> >> +32 (0)485 48 10 55 >> [hidden email] >> >> http://www.jadebelgium.eu >> >> --- view.xsl.orig 2009-11-13 17:32:20.000000000 +0100 +++ >> view.xsl 2010-01-03 13:40:07.988913126 +0100 @@ -575,34 +575,42 @@ >> - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + >> + + + + + + + + + + + + + + + + + + >> >> -- >> 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 >> OW2 mailing lists service home page: http://www.ow2.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 OW2 mailing lists service home page: http://www.ow2.org/wws |
In reply to this post by Laurent Sibilla-2
Hello,
I made some bugfixes. PDF view and editing were broken. Here are fixed patches. I just made some changes in components.xsl to take care of $mode and in read-form to not take care of ?document= argument. Best regards, Laurent Laurent Sibilla a écrit : > Alessandro Vernet a écrit : >> Laurent, >> >> Regarding running XSLT on the form, I wouldn't do this based on the >> extension of the file. You even don't know the extension of the file, >> depending on where it is stored. Instead, it should be simple enough >> to look at the root element and check if you have an xsl:stylesheet >> or xsl:transform. >> > > Doing it, I figured out quickly that it was better doing it your way. > > Here is the patch. Note that using the #document variable led to me to > xsl:include issues. So I had to use href to take the real URL in > account. I didn't find any way to put a xsl variable as href value. As > a workaround, I used an xsl transformation to create a processor to do > the wanted xsl transformation. I'm not sure this is the most > straightforward way to do it and if you know a better way, I would be > really happy to know it. > >> Regarding displaying one section at a time, then yes, I think the >> name of your property makes sense. Maybe "appearance" instead of >> "type" would be more in the spirit of XForms, i.e.: >> oxf.fr.detail.toc.appearance="all | only-selected | tabview" >> (imagining that someone implements it using the fr:tabview at some >> point). > > Attached is the patch. > > What is in it : > - Add a $toc-appearance variable in component.xsl > - If $toc-appearance = 'selected-only' : > - Put xforms:cases in sections.xsl > - Create xforms:switch in view.xsl and put all non fr:section before it > - Use xforms:trigger instead of xhtml:a in toc > > The results seems good enough for our needs. > > > What do you think about it ? > > > > Kind regards, > > > Laurent > >> >> Alex >> >> >> >> On Jan 6, 2010, at 8:47 AM, Laurent Sibilla <[hidden email]> >> wrote: >> >>> Hello all, >>> >>> >>> I decided to use Form-Runner as the base of an audit system project >>> I am actually building up. We choosed it for being open-source and >>> based on standards highly interoperable. >>> >>> I have some question about it and hope you could help. >>> >>> First of all, we are building the grid in XML files that are >>> transformed according to an XSL stylesheet. What we actually do is >>> using saxon to build the form.xhtml file. Does exist a way to do it >>> dynamically ? I mean that form runner would read form.xsl instead >>> of form.xhtml. >>> >>> Then we have a multi-level form structure we wanted to be reflected >>> in the table of content. I saw in apps/fr/components/view.xsl that >>> you had to implement it and I did it so. Here attached you will find >>> the patch file. It's the first time I work with XSL, so I'm not sure >>> of the quality of what I did, particularly concerning the match >>> pattern, but it works. >>> >>> Finally, we are considering using a paged form thanks to >>> xforms:switch instead of having all the form in one page. For this >>> we would create a property indicating what kind of table we want. >>> For example oxf.fr.detail.toc-type.*.*. Any recommandation on the >>> name of the property to be integrated upstream ? >>> >>> Thank you in advance for your response. >>> >>> Sincerely, >>> >>> -- >>> Laurent Sibilla >>> Vice President and International Manager >>> >>> FBJE asbl - vzw >>> Rue Archimède 1 >>> B-1348 Louvain-la-Neuve >>> Belgium >>> >>> +32 (0)485 48 10 55 >>> [hidden email] >>> >>> http://www.jadebelgium.eu >>> >>> --- view.xsl.orig 2009-11-13 17:32:20.000000000 +0100 +++ >>> view.xsl 2010-01-03 13:40:07.988913126 +0100 @@ -575,34 +575,42 >>> @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + >>> + + + + + + + + + + + + + + + + + + + + >>> >>> -- >>> 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 >>> OW2 mailing lists service home page: http://www.ow2.org/wws > diff -Naur -x '*~' -x '.*.sw?' -x '*.orig' -x '*.patch' fr.orig/components/components.xsl fr/components/components.xsl --- fr.orig/components/components.xsl 2009-11-20 13:00:04.000000000 +0100 +++ fr/components/components.xsl 2010-01-16 11:21:38.450750837 +0100 @@ -49,6 +49,7 @@ <!-- Properties --> <xsl:variable name="has-version" select="pipeline:property(string-join(('oxf.fr.version', $app, $form), '.'))" as="xs:boolean?"/> <xsl:variable name="has-noscript-link" select="pipeline:property(string-join(('oxf.fr.noscript-link', $app, $form), '.'))" as="xs:boolean?"/> + <xsl:variable name="toc-appearance" select="if ($mode = ('pdf', 'email', 'summary')) then 'all' else (pipeline:property(string-join(('oxf.fr.detail.toc.appearance', $app, $form), '.')), 'summary')[1]" as="xs:string"/> <xsl:variable name="min-toc" select="(pipeline:property(string-join(('oxf.fr.detail.toc', $app, $form), '.')), -1)[1]" as="xs:integer"/> <xsl:variable name="has-toc" select="$min-toc ge 0" as="xs:boolean"/> <xsl:variable name="error-summary" select="pipeline:property(string-join(('oxf.fr.detail.error-summary', $app, $form), '.'))" as="xs:string?"/> diff -Naur -x '*~' -x '.*.sw?' -x '*.orig' -x '*.patch' fr.orig/components/section.xsl fr/components/section.xsl --- fr.orig/components/section.xsl 2009-11-09 12:12:30.000000000 +0100 +++ fr/components/section.xsl 2010-01-12 18:25:27.132122738 +0100 @@ -38,97 +38,124 @@ <!-- Section content area --> - <xforms:group id="{$section-id}-group"> - <!-- Support single-node bindings and context --> - <xsl:copy-of select="@ref | @bind | @context"/> - <xsl:attribute name="class" select="string-join(('fr-section-container', @class), ' ')"/> - - <!-- Section title area: open/close button, title, help --> - <xsl:element name="{if ($ancestor-sections = 0) then 'xhtml:h2' else 'xhtml:h3'}"> - <xsl:attribute name="class" select="'fr-section-title'"/> - - <!-- Open/close button --> - <xforms:group appearance="xxforms:internal"> - <xsl:if test="$is-section-collapse"> - <xforms:switch id="switch-button-{$section-id}" xxforms:readonly-appearance="dynamic"> - <xforms:case id="case-button-{$section-id}-closed" selected="{if (not($open)) then 'true' else 'false'}"> - <!-- "+" trigger --> - <xforms:trigger appearance="minimal" id="button-{$section-id}-open" class="fr-section-open-close"> - <xforms:label> - <xhtml:img width="12" height="12" src="/apps/fr/style/images/mozilla/arrow-rit-hov.gif" alt="" title="{{$fr-resources/components/labels/open-section}}"/> - </xforms:label> - </xforms:trigger> - </xforms:case> - <xforms:case id="case-button-{$section-id}-open" selected="{if ($open) then 'true' else 'false'}"> - <!-- "-" trigger --> - <xforms:trigger appearance="minimal" id="button-{$section-id}-close" class="fr-section-open-close"> - <xforms:label> - <xhtml:img width="12" height="12" src="/apps/fr/style/images/mozilla/arrow-dn-hov.gif" alt="" title="{{$fr-resources/components/labels/close-section}}"/> - </xforms:label> - </xforms:trigger> - </xforms:case> - </xforms:switch> - - <!-- Handle DOMActivate event to open/close the switches --> - <xforms:action ev:event="DOMActivate" ev:target="{$section-id} button-{$section-id}-open button-{$section-id}-close"> - <xforms:setvalue model="fr-sections-model" ref="instance('fr-current-section-instance')/id"> - <xsl:value-of select="$section-id"/> - </xforms:setvalue> - <xforms:setvalue model="fr-sections-model" ref="instance('fr-current-section-instance')/repeat-indexes" value="event('xxforms:repeat-indexes')"/> - <!-- Dispatch fr-collapse or fr-expand --> - <xforms:dispatch target="fr-sections-model" - name="fr-{{if (xxforms:case('switch-{$section-id}') = 'case-{$section-id}-open') then 'collapse' else 'expand'}}"/> - </xforms:action> - </xsl:if> - - <xsl:choose> - <xsl:when test="@editable = 'true'"> - <xsl:variable name="input" as="element(fr:inplace-input)"> - <fr:inplace-input id="{$section-id}-input-closed" ref="{xforms:label/@ref}"> - <xsl:apply-templates select="xforms:hint | xforms:alert"/> - <!-- Put a hidden label for the error summary --> - <xforms:label class="fr-hidden" ref="$fr-resources/components/labels/section-name"/> - </fr:inplace-input> - </xsl:variable> - <xsl:apply-templates select="$input"/> - <span class="fr-section-buttons"> - <xsl:apply-templates select="fr:buttons/node()"/> - </span> - </xsl:when> - <xsl:when test="$is-section-collapse"> - <!-- Set the section id to this trigger: this id matching is needed for noscript help --> - <xforms:trigger id="{$section-id}" appearance="minimal"> - <xsl:apply-templates select="xforms:label | xforms:help | xforms:alert"/> - </xforms:trigger> - </xsl:when> - <xsl:otherwise> - <!-- Set the section id to this output: this id matching is needed for noscript help --> - <xforms:output id="{$section-id}" appearance="minimal" value="''"> + <xsl:choose> + <xsl:when test="$toc-appearance='only-selected'"> + <xforms:case id="{$section-id}-case"> + <xsl:copy-of select="@select"/> + <xsl:attribute name="class" select="string-join(('fr-section-container', @class), ' ')"/> + + <!-- Section title area: ancestor titles and help --> + <xsl:for-each select="ancestor-or-self::fr:section"> + <xsl:element name="{concat('xhtml:h', 2+count(ancestor::fr:section))}"> + <xsl:attribute name="class" select="'fr-section-title'"/> + <xforms:output appearance="minimal" value="''"> <xsl:apply-templates select="xforms:label | xforms:help | xforms:alert"/> </xforms:output> - </xsl:otherwise> - </xsl:choose> - - </xforms:group> - - </xsl:element> - - <xforms:switch id="switch-{$section-id}" xxforms:readonly-appearance="dynamic"> - <!-- Closed section --> - <xforms:case id="case-{$section-id}-closed" selected="{if (not($open)) then 'true' else 'false'}"/> - <!-- Open section --> - <xforms:case id="case-{$section-id}-open" selected="{if ($open) then 'true' else 'false'}"> + </xsl:element> + </xsl:for-each> + <xhtml:div> - <xhtml:div class="fr-collapsible"> - <!-- Section content except label, event handlers, and buttons --> - <xsl:apply-templates select="* except (xforms:label, *[@ev:*], fr:buttons)"/> - </xhtml:div> + <xsl:copy-of select="@ref | @bind | @context"/> + <!-- Section content except subsection, label, event handlers, and buttons --> + <xsl:apply-templates select="* except (fr:section, xforms:label, *[@ev:*], fr:buttons)"/> </xhtml:div> + <!-- Event handlers children of fr:section --> + <xsl:apply-templates select="*[@ev:*]"/> </xforms:case> - </xforms:switch> - <!-- Event handlers children of fr:section --> - <xsl:apply-templates select="*[@ev:*]"/> - </xforms:group> - + </xsl:when> + <xsl:otherwise> + <xforms:group id="{$section-id}-group"> + <!-- Support single-node bindings and context --> + <xsl:copy-of select="@ref | @bind | @context"/> + <xsl:attribute name="class" select="string-join(('fr-section-container', @class), ' ')"/> + + <!-- Section title area: open/close button, title, help --> + <xsl:element name="{if ($ancestor-sections = 0) then 'xhtml:h2' else 'xhtml:h3'}"> + <xsl:attribute name="class" select="'fr-section-title'"/> + + <!-- Open/close button --> + <xforms:group appearance="xxforms:internal"> + <xsl:if test="$is-section-collapse"> + <xforms:switch id="switch-button-{$section-id}" xxforms:readonly-appearance="dynamic"> + <xforms:case id="case-button-{$section-id}-closed" selected="{if (not($open)) then 'true' else 'false'}"> + <!-- "+" trigger --> + <xforms:trigger appearance="minimal" id="button-{$section-id}-open" class="fr-section-open-close"> + <xforms:label> + <xhtml:img width="12" height="12" src="/apps/fr/style/images/mozilla/arrow-rit-hov.gif" alt="" title="{{$fr-resources/components/labels/open-section}}"/> + </xforms:label> + </xforms:trigger> + </xforms:case> + <xforms:case id="case-button-{$section-id}-open" selected="{if ($open) then 'true' else 'false'}"> + <!-- "-" trigger --> + <xforms:trigger appearance="minimal" id="button-{$section-id}-close" class="fr-section-open-close"> + <xforms:label> + <xhtml:img width="12" height="12" src="/apps/fr/style/images/mozilla/arrow-dn-hov.gif" alt="" title="{{$fr-resources/components/labels/close-section}}"/> + </xforms:label> + </xforms:trigger> + </xforms:case> + </xforms:switch> + + <!-- Handle DOMActivate event to open/close the switches --> + <xforms:action ev:event="DOMActivate" ev:target="{$section-id} button-{$section-id}-open button-{$section-id}-close"> + <xforms:setvalue model="fr-sections-model" ref="instance('fr-current-section-instance')/id"> + <xsl:value-of select="$section-id"/> + </xforms:setvalue> + <xforms:setvalue model="fr-sections-model" ref="instance('fr-current-section-instance')/repeat-indexes" value="event('xxforms:repeat-indexes')"/> + <!-- Dispatch fr-collapse or fr-expand --> + <xforms:dispatch target="fr-sections-model" + name="fr-{{if (xxforms:case('switch-{$section-id}') = 'case-{$section-id}-open') then 'collapse' else 'expand'}}"/> + </xforms:action> + </xsl:if> + + <xsl:choose> + <xsl:when test="@editable = 'true'"> + <xsl:variable name="input" as="element(fr:inplace-input)"> + <fr:inplace-input id="{$section-id}-input-closed" ref="{xforms:label/@ref}"> + <xsl:apply-templates select="xforms:hint | xforms:alert"/> + <!-- Put a hidden label for the error summary --> + <xforms:label class="fr-hidden" ref="$fr-resources/components/labels/section-name"/> + </fr:inplace-input> + </xsl:variable> + <xsl:apply-templates select="$input"/> + <span class="fr-section-buttons"> + <xsl:apply-templates select="fr:buttons/node()"/> + </span> + </xsl:when> + <xsl:when test="$is-section-collapse"> + <!-- Set the section id to this trigger: this id matching is needed for noscript help --> + <xforms:trigger id="{$section-id}" appearance="minimal"> + <xsl:apply-templates select="xforms:label | xforms:help | xforms:alert"/> + </xforms:trigger> + </xsl:when> + <xsl:otherwise> + <!-- Set the section id to this output: this id matching is needed for noscript help --> + <xforms:output id="{$section-id}" appearance="minimal" value="''"> + <xsl:apply-templates select="xforms:label | xforms:help | xforms:alert"/> + </xforms:output> + </xsl:otherwise> + </xsl:choose> + + </xforms:group> + + </xsl:element> + + <xforms:switch id="switch-{$section-id}" xxforms:readonly-appearance="dynamic"> + <!-- Closed section --> + <xforms:case id="case-{$section-id}-closed" selected="{if (not($open)) then 'true' else 'false'}"/> + <!-- Open section --> + <xforms:case id="case-{$section-id}-open" selected="{if ($open) then 'true' else 'false'}"> + <xhtml:div> + <xhtml:div class="fr-collapsible"> + <!-- Section content except label, event handlers, and buttons --> + <xsl:apply-templates select="* except (xforms:label, *[@ev:*], fr:buttons)"/> + </xhtml:div> + </xhtml:div> + </xforms:case> + </xforms:switch> + <!-- Event handlers children of fr:section --> + <xsl:apply-templates select="*[@ev:*]"/> + </xforms:group> + </xsl:otherwise> + </xsl:choose> </xsl:template> </xsl:stylesheet> diff -Naur -x '*~' -x '.*.sw?' -x '*.orig' -x '*.patch' fr.orig/components/view.xsl fr/components/view.xsl --- fr.orig/components/view.xsl 2010-01-12 17:11:59.322120773 +0100 +++ fr/components/view.xsl 2010-01-12 18:25:27.972150732 +0100 @@ -115,10 +115,23 @@ <!-- Anchor for navigation --> <xhtml:a name="fr-form"/> <!-- Main form content --> - <xsl:apply-templates select="$body/node()"> - <!-- Dialogs are handled later --> - <xsl:with-param name="include-dialogs" select="false()" tunnel="yes" as="xs:boolean"/> - </xsl:apply-templates> + <xsl:choose> + <xsl:when test="$toc-appearance='only-selected'"> + <xsl:apply-templates select="$body/node()[name()!='fr:section']"> + <!-- Dialogs are handled later --> + <xsl:with-param name="include-dialogs" select="false()" tunnel="yes" as="xs:boolean"/> + </xsl:apply-templates> + <xforms:switch> + <xsl:apply-templates select="$body//fr:section"/> + </xforms:switch> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="$body/node()"> + <!-- Dialogs are handled later --> + <xsl:with-param name="include-dialogs" select="false()" tunnel="yes" as="xs:boolean"/> + </xsl:apply-templates> + </xsl:otherwise> + </xsl:choose> </xforms:group> <!-- Error summary (if at bottom) --> @@ -594,19 +607,37 @@ <xsl:when test="@bind"> <xforms:group bind="{@bind}"> <xhtml:li> - <xhtml:a href="#{@id}"><xforms:output value="{xforms:label/@ref}"/></xhtml:a> + <xsl:apply-templates select="." mode="fr-toc-node"/> <xsl:copy-of select="$sub-sections"/> </xhtml:li> </xforms:group> </xsl:when> <xsl:otherwise> <xhtml:li> - <xhtml:a href="#{@id}"><xsl:value-of select="xforms:label"/></xhtml:a> + <xsl:apply-templates select="." mode="fr-toc-node"/> <xsl:copy-of select="$sub-sections"/> </xhtml:li> </xsl:otherwise> </xsl:choose> </xsl:template> + + <xsl:template match="fr:section" mode="fr-toc-node"> + <xsl:choose> + <xsl:when test="$toc-appearance='only-selected'"> + <xforms:trigger appearance="minimal"> + <xforms:label ref="{xforms:label/@ref}"/> + <xforms:toggle ev:event="DOMActivate"> + <xsl:attribute name="case"> + <xsl:value-of select="concat(@id,'-case')"/> + </xsl:attribute> + </xforms:toggle> + </xforms:trigger> + </xsl:when> + <xsl:otherwise> + <xhtml:a href="#{@id}"><xforms:output value="{xforms:label/@ref}"/></xhtml:a> + </xsl:otherwise> + </xsl:choose> + </xsl:template> <!-- Add a default xforms:alert for those fields which don't have one. Only do this within grids and dialogs. --> <xsl:template match="xhtml:body//fr:grid//xforms:*[local-name() = ('input', 'textarea', 'select', 'select1', 'upload') and not(xforms:alert) and not(@appearance = 'fr:in-place')] diff -Nau -x '*~' -x '.*.sw?' -x page-flow.xml -x '*.orig' -x '*.patch' fr.orig/detail/read-form.xpl fr/detail/read-form.xpl --- fr.orig/detail/read-form.xpl 2009-08-26 14:32:00.000000000 +0200 +++ fr/detail/read-form.xpl 2010-01-16 11:17:22.080755770 +0100 @@ -62,11 +62,45 @@ <p:output name="data" id="document"/> </p:processor> - <!-- Handle XInclude (mainly for "resource" type of persistence) --> - <p:processor name="oxf:xinclude"> - <p:input name="config" href="#document"/> - <p:output name="data" id="after-xinclude" ref="data"/> - </p:processor> + <p:choose href="#document"> + <p:when test="name(/*[1])='xsl:stylesheet'"> + <!-- The read document is an XSLT stylesheet --> + <p:processor name="oxf:pipeline"> + + <p:input name="config" transform="oxf:unsafe-xslt" href="#instance"> + <p:config xsl:version="2.0"> + <p:param type="output" name="data"/> + + <!-- We can't use an xsl variable for href atribute of the config input. Using XSL to create subpipeline --> + <p:processor name="oxf:unsafe-xslt"> + <xsl:variable name="document" select="/*/document" as="xs:string"/> + + <!-- Create URI based on properties --> + <xsl:variable name="resource" as="xs:string" + select="concat(pipeline:property(string-join(('oxf.fr.persistence.app.uri', /*/app, /*/form, 'form'), '.')), + '/crud/', /*/app, '/', /*/form, '/form/')"/> + <p:input name="config"> + <xsl:attribute name="href" select="pipeline:rewriteServiceURI(concat($resource,'form.xhtml'), true())"/> + </p:input> + <p:input name="data"> + <xsl:attribute name="href" select="pipeline:rewriteServiceURI(concat($resource,'form.xml'), true())"/> + </p:input> + <p:output name="data" id="final-document" ref="data"/> + </p:processor> + </p:config> + </p:input> + + <p:output name="data" id="final-document" ref="data"/> + </p:processor> + </p:when> + <p:otherwise> + <!-- Handle XInclude (mainly for "resource" type of persistence) --> + <p:processor name="oxf:xinclude"> + <p:input name="config" href="#document"/> + <p:output name="data" id="final-document" ref="data"/> + </p:processor> + </p:otherwise> + </p:choose> <!-- Store document in the request for further access down the line --> <p:processor name="oxf:scope-serializer"> @@ -76,8 +110,10 @@ <scope>request</scope> </config> </p:input> - <p:input name="data" href="#after-xinclude"/> + <p:input name="data" href="#final-document"/> </p:processor> + + </p:when> <p:otherwise> <!-- Null document --> -- 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 OW2 mailing lists service home page: http://www.ow2.org/wws |
Administrator
|
Laurent,
I got the patch; I will look at this and follow-up here in the next few days. Alex On Sat, Jan 16, 2010 at 2:34 AM, Laurent Sibilla <[hidden email]> wrote: > Hello, > > > I made some bugfixes. PDF view and editing were broken. Here are fixed > patches. > > I just made some changes in components.xsl to take care of $mode and in > read-form to not take care of ?document= argument. > > > > Best regards, > > > Laurent > > Laurent Sibilla a écrit : >> >> Alessandro Vernet a écrit : >>> >>> Laurent, >>> >>> Regarding running XSLT on the form, I wouldn't do this based on the >>> extension of the file. You even don't know the extension of the file, >>> depending on where it is stored. Instead, it should be simple enough to look >>> at the root element and check if you have an xsl:stylesheet or >>> xsl:transform. >>> >> >> Doing it, I figured out quickly that it was better doing it your way. >> >> Here is the patch. Note that using the #document variable led to me to >> xsl:include issues. So I had to use href to take the real URL in account. I >> didn't find any way to put a xsl variable as href value. As a workaround, I >> used an xsl transformation to create a processor to do the wanted xsl >> transformation. I'm not sure this is the most straightforward way to do it >> and if you know a better way, I would be really happy to know it. >> >>> Regarding displaying one section at a time, then yes, I think the name of >>> your property makes sense. Maybe "appearance" instead of "type" would be >>> more in the spirit of XForms, i.e.: oxf.fr.detail.toc.appearance="all | >>> only-selected | tabview" (imagining that someone implements it using the >>> fr:tabview at some point). >> >> Attached is the patch. >> >> What is in it : >> - Add a $toc-appearance variable in component.xsl >> - If $toc-appearance = 'selected-only' : >> - Put xforms:cases in sections.xsl >> - Create xforms:switch in view.xsl and put all non fr:section before it >> - Use xforms:trigger instead of xhtml:a in toc >> >> The results seems good enough for our needs. >> >> >> What do you think about it ? >> >> >> >> Kind regards, >> >> >> Laurent >> >>> >>> Alex >>> >>> >>> >>> On Jan 6, 2010, at 8:47 AM, Laurent Sibilla <[hidden email]> >>> wrote: >>> >>>> Hello all, >>>> >>>> >>>> I decided to use Form-Runner as the base of an audit system project I am >>>> actually building up. We choosed it for being open-source and based on >>>> standards highly interoperable. >>>> >>>> I have some question about it and hope you could help. >>>> >>>> First of all, we are building the grid in XML files that are transformed >>>> according to an XSL stylesheet. What we actually do is using saxon to build >>>> the form.xhtml file. Does exist a way to do it dynamically ? I mean that >>>> form runner would read form.xsl instead of form.xhtml. >>>> >>>> Then we have a multi-level form structure we wanted to be reflected in >>>> the table of content. I saw in apps/fr/components/view.xsl that you had to >>>> implement it and I did it so. Here attached you will find the patch file. >>>> It's the first time I work with XSL, so I'm not sure of the quality of what >>>> I did, particularly concerning the match pattern, but it works. >>>> >>>> Finally, we are considering using a paged form thanks to xforms:switch >>>> instead of having all the form in one page. For this we would create a >>>> property indicating what kind of table we want. For example >>>> oxf.fr.detail.toc-type.*.*. Any recommandation on the name of the property >>>> to be integrated upstream ? >>>> >>>> Thank you in advance for your response. >>>> >>>> Sincerely, >>>> >>>> -- >>>> Laurent Sibilla >>>> Vice President and International Manager >>>> >>>> FBJE asbl - vzw >>>> Rue Archimède 1 >>>> B-1348 Louvain-la-Neuve >>>> Belgium >>>> >>>> +32 (0)485 48 10 55 >>>> [hidden email] >>>> >>>> http://www.jadebelgium.eu >>>> >>>> --- view.xsl.orig 2009-11-13 17:32:20.000000000 +0100 +++ view.xsl >>>> 2010-01-03 13:40:07.988913126 +0100 @@ -575,34 +575,42 @@ - - - - - - - - - >>>> - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + >>>> + + + + + + >>>> >>>> -- >>>> 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 >>>> OW2 mailing lists service home page: http://www.ow2.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 > OW2 mailing lists service home page: http://www.ow2.org/wws > > -- Orbeon Forms - Web forms, open-source, for the Enterprise Orbeon's Blog: http://www.orbeon.com/blog/ My Twitter: http://twitter.com/avernet -- 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 OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Alessandro,
We are at the point to deploy our first application. Did you have a look to this patch ? I would like to ensure that we will be able to follow the orbeon official binaries. Kind regards, Laurent Alessandro Vernet a écrit : Laurent, I got the patch; I will look at this and follow-up here in the next few days. Alex On Sat, Jan 16, 2010 at 2:34 AM, Laurent Sibilla [hidden email] wrote:Hello, I made some bugfixes. PDF view and editing were broken. Here are fixed patches. I just made some changes in components.xsl to take care of $mode and in read-form to not take care of ?document= argument. Best regards, Laurent Laurent Sibilla a écrit :Alessandro Vernet a écrit :Laurent, Regarding running XSLT on the form, I wouldn't do this based on the extension of the file. You even don't know the extension of the file, depending on where it is stored. Instead, it should be simple enough to look at the root element and check if you have an xsl:stylesheet or xsl:transform.Doing it, I figured out quickly that it was better doing it your way. Here is the patch. Note that using the #document variable led to me to xsl:include issues. So I had to use href to take the real URL in account. I didn't find any way to put a xsl variable as href value. As a workaround, I used an xsl transformation to create a processor to do the wanted xsl transformation. I'm not sure this is the most straightforward way to do it and if you know a better way, I would be really happy to know it.Regarding displaying one section at a time, then yes, I think the name of your property makes sense. Maybe "appearance" instead of "type" would be more in the spirit of XForms, i.e.: oxf.fr.detail.toc.appearance="all | only-selected | tabview" (imagining that someone implements it using the fr:tabview at some point).Attached is the patch. What is in it : - Add a $toc-appearance variable in component.xsl - If $toc-appearance = 'selected-only' : - Put xforms:cases in sections.xsl - Create xforms:switch in view.xsl and put all non fr:section before it - Use xforms:trigger instead of xhtml:a in toc The results seems good enough for our needs. What do you think about it ? Kind regards, LaurentAlex On Jan 6, 2010, at 8:47 AM, Laurent Sibilla [hidden email] wrote:Hello all, I decided to use Form-Runner as the base of an audit system project I am actually building up. We choosed it for being open-source and based on standards highly interoperable. I have some question about it and hope you could help. First of all, we are building the grid in XML files that are transformed according to an XSL stylesheet. What we actually do is using saxon to build the form.xhtml file. Does exist a way to do it dynamically ? I mean that form runner would read form.xsl instead of form.xhtml. Then we have a multi-level form structure we wanted to be reflected in the table of content. I saw in apps/fr/components/view.xsl that you had to implement it and I did it so. Here attached you will find the patch file. It's the first time I work with XSL, so I'm not sure of the quality of what I did, particularly concerning the match pattern, but it works. Finally, we are considering using a paged form thanks to xforms:switch instead of having all the form in one page. For this we would create a property indicating what kind of table we want. For example oxf.fr.detail.toc-type.*.*. Any recommandation on the name of the property to be integrated upstream ? Thank you in advance for your response. Sincerely, -- Laurent Sibilla Vice President and International Manager FBJE asbl - vzw Rue Archimède 1 B-1348 Louvain-la-Neuve Belgium +32 (0)485 48 10 55 [hidden email] http://www.jadebelgium.eu --- view.xsl.orig 2009-11-13 17:32:20.000000000 +0100 +++ view.xsl 2010-01-03 13:40:07.988913126 +0100 @@ -575,34 +575,42 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: [hidden email] For general help: [hidden email] OW2 mailing lists service home page: http://www.ow2.org/wws-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: [hidden email] For general help: [hidden email] OW2 mailing lists service home page: http://www.ow2.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 OW2 mailing lists service home page: http://www.ow2.org/wws |
Administrator
|
Hi Laurent,
Sorry for the delay on this. I had a "next action", but it trickled down the list. For the change to read-form.xpl: * I updated the test to determine if we have a stylesheet to use the same XPath expression we have in the implementation of the page flow: namespace-uri(/*) = 'http://www.w3.org/1999/XSL/Transform' or /*/@xsl:version = '2.0'. * But I am confused by what you are doing in the case where you have an XSLT stylesheet. So you have form.xhtml which is XSLT, and you seem to expect to have a form.xml in the same "directory" on which you apply the XSLT? In the next patch, I see changed to: * components/components.xsl * components/section.xsl * components/view.xsl I have patched my files locally, and the code looks good to me. Before I push this to GitHub, could you update the wiki to document the oxf.fr.detail.toc.appearance.*.* property you added (and anything else you think should be documented)? That would be on: http://wiki.orbeon.com/forms/doc/developer-guide/configuration-properties/configuration-properties-form-runner I added your Gmail address to the ACL, so just click on "Sign in" at the bottom of the page, and you'll be able to edit any page of the wiki. Alex On Thu, Mar 4, 2010 at 3:34 AM, Laurent Sibilla <[hidden email]> wrote: > Alessandro, > > > We are at the point to deploy our first application. Did you have a look to > this patch ? > > I would like to ensure that we will be able to follow the orbeon official > binaries. > > > > Kind regards, > > Laurent > > Alessandro Vernet a écrit : > > Laurent, > > I got the patch; I will look at this and follow-up here in the next few > days. > > Alex > > On Sat, Jan 16, 2010 at 2:34 AM, Laurent Sibilla <[hidden email]> wrote: > > > Hello, > > > I made some bugfixes. PDF view and editing were broken. Here are fixed > patches. > > I just made some changes in components.xsl to take care of $mode and in > read-form to not take care of ?document= argument. > > > > Best regards, > > > Laurent > > Laurent Sibilla a écrit : > > > Alessandro Vernet a écrit : > > > Laurent, > > Regarding running XSLT on the form, I wouldn't do this based on the > extension of the file. You even don't know the extension of the file, > depending on where it is stored. Instead, it should be simple enough to look > at the root element and check if you have an xsl:stylesheet or > xsl:transform. > > > > Doing it, I figured out quickly that it was better doing it your way. > > Here is the patch. Note that using the #document variable led to me to > xsl:include issues. So I had to use href to take the real URL in account. I > didn't find any way to put a xsl variable as href value. As a workaround, I > used an xsl transformation to create a processor to do the wanted xsl > transformation. I'm not sure this is the most straightforward way to do it > and if you know a better way, I would be really happy to know it. > > > > Regarding displaying one section at a time, then yes, I think the name of > your property makes sense. Maybe "appearance" instead of "type" would be > more in the spirit of XForms, i.e.: oxf.fr.detail.toc.appearance="all | > only-selected | tabview" (imagining that someone implements it using the > fr:tabview at some point). > > > Attached is the patch. > > What is in it : > - Add a $toc-appearance variable in component.xsl > - If $toc-appearance = 'selected-only' : > - Put xforms:cases in sections.xsl > - Create xforms:switch in view.xsl and put all non fr:section before it > - Use xforms:trigger instead of xhtml:a in toc > > The results seems good enough for our needs. > > > What do you think about it ? > > > > Kind regards, > > > Laurent > > > > Alex > > > > On Jan 6, 2010, at 8:47 AM, Laurent Sibilla <[hidden email]> > wrote: > > > > Hello all, > > > I decided to use Form-Runner as the base of an audit system project I am > actually building up. We choosed it for being open-source and based on > standards highly interoperable. > > I have some question about it and hope you could help. > > First of all, we are building the grid in XML files that are transformed > according to an XSL stylesheet. What we actually do is using saxon to build > the form.xhtml file. Does exist a way to do it dynamically ? I mean that > form runner would read form.xsl instead of form.xhtml. > > Then we have a multi-level form structure we wanted to be reflected in > the table of content. I saw in apps/fr/components/view.xsl that you had to > implement it and I did it so. Here attached you will find the patch file. > It's the first time I work with XSL, so I'm not sure of the quality of what > I did, particularly concerning the match pattern, but it works. > > Finally, we are considering using a paged form thanks to xforms:switch > instead of having all the form in one page. For this we would create a > property indicating what kind of table we want. For example > oxf.fr.detail.toc-type.*.*. Any recommandation on the name of the property > to be integrated upstream ? > > Thank you in advance for your response. > > Sincerely, > > -- > Laurent Sibilla > Vice President and International Manager > > FBJE asbl - vzw > Rue Archimède 1 > B-1348 Louvain-la-Neuve > Belgium > > +32 (0)485 48 10 55 > [hidden email] > > http://www.jadebelgium.eu > > --- view.xsl.orig 2009-11-13 17:32:20.000000000 +0100 +++ view.xsl > 2010-01-03 13:40:07.988913126 +0100 @@ -575,34 +575,42 @@ - - - - - - - - - > - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + > + + + + + + > > -- > 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 > OW2 mailing lists service home page: http://www.ow2.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 > OW2 mailing lists service home page: http://www.ow2.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 > OW2 mailing lists service home page: http://www.ow2.org/wws > > -- Orbeon Forms - Web forms, open-source, for the Enterprise - http://www.orbeon.com/ My Twitter: http://twitter.com/avernet -- 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 OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Hi,
You are right. I use form.xml as data input for the form.xsl stylesheet. I updated the wiki. The other change was to have a toc represented as a tree but I didn't create a property for that. If you don't want to have a tree, let's just have a flat form ! :) Thank you, Laurent Alessandro Vernet a écrit : Hi Laurent, Sorry for the delay on this. I had a "next action", but it trickled down the list. For the change to read-form.xpl: * I updated the test to determine if we have a stylesheet to use the same XPath expression we have in the implementation of the page flow: namespace-uri(/*) = 'http://www.w3.org/1999/XSL/Transform' or /*/@xsl:version = '2.0'. * But I am confused by what you are doing in the case where you have an XSLT stylesheet. So you have form.xhtml which is XSLT, and you seem to expect to have a form.xml in the same "directory" on which you apply the XSLT? In the next patch, I see changed to: * components/components.xsl * components/section.xsl * components/view.xsl I have patched my files locally, and the code looks good to me. Before I push this to GitHub, could you update the wiki to document the oxf.fr.detail.toc.appearance.*.* property you added (and anything else you think should be documented)? That would be on: http://wiki.orbeon.com/forms/doc/developer-guide/configuration-properties/configuration-properties-form-runner I added your Gmail address to the ACL, so just click on "Sign in" at the bottom of the page, and you'll be able to edit any page of the wiki. Alex On Thu, Mar 4, 2010 at 3:34 AM, Laurent Sibilla [hidden email] wrote:Alessandro, We are at the point to deploy our first application. Did you have a look to this patch ? I would like to ensure that we will be able to follow the orbeon official binaries. Kind regards, Laurent Alessandro Vernet a écrit : Laurent, I got the patch; I will look at this and follow-up here in the next few days. Alex On Sat, Jan 16, 2010 at 2:34 AM, Laurent Sibilla [hidden email] wrote: Hello, I made some bugfixes. PDF view and editing were broken. Here are fixed patches. I just made some changes in components.xsl to take care of $mode and in read-form to not take care of ?document= argument. Best regards, Laurent Laurent Sibilla a écrit : Alessandro Vernet a écrit : Laurent, Regarding running XSLT on the form, I wouldn't do this based on the extension of the file. You even don't know the extension of the file, depending on where it is stored. Instead, it should be simple enough to look at the root element and check if you have an xsl:stylesheet or xsl:transform. Doing it, I figured out quickly that it was better doing it your way. Here is the patch. Note that using the #document variable led to me to xsl:include issues. So I had to use href to take the real URL in account. I didn't find any way to put a xsl variable as href value. As a workaround, I used an xsl transformation to create a processor to do the wanted xsl transformation. I'm not sure this is the most straightforward way to do it and if you know a better way, I would be really happy to know it. Regarding displaying one section at a time, then yes, I think the name of your property makes sense. Maybe "appearance" instead of "type" would be more in the spirit of XForms, i.e.: oxf.fr.detail.toc.appearance="all | only-selected | tabview" (imagining that someone implements it using the fr:tabview at some point). Attached is the patch. What is in it : - Add a $toc-appearance variable in component.xsl - If $toc-appearance = 'selected-only' : - Put xforms:cases in sections.xsl - Create xforms:switch in view.xsl and put all non fr:section before it - Use xforms:trigger instead of xhtml:a in toc The results seems good enough for our needs. What do you think about it ? Kind regards, Laurent Alex On Jan 6, 2010, at 8:47 AM, Laurent Sibilla [hidden email] wrote: Hello all, I decided to use Form-Runner as the base of an audit system project I am actually building up. We choosed it for being open-source and based on standards highly interoperable. I have some question about it and hope you could help. First of all, we are building the grid in XML files that are transformed according to an XSL stylesheet. What we actually do is using saxon to build the form.xhtml file. Does exist a way to do it dynamically ? I mean that form runner would read form.xsl instead of form.xhtml. Then we have a multi-level form structure we wanted to be reflected in the table of content. I saw in apps/fr/components/view.xsl that you had to implement it and I did it so. Here attached you will find the patch file. It's the first time I work with XSL, so I'm not sure of the quality of what I did, particularly concerning the match pattern, but it works. Finally, we are considering using a paged form thanks to xforms:switch instead of having all the form in one page. For this we would create a property indicating what kind of table we want. For example oxf.fr.detail.toc-type.*.*. Any recommandation on the name of the property to be integrated upstream ? Thank you in advance for your response. Sincerely, -- Laurent Sibilla Vice President and International Manager FBJE asbl - vzw Rue Archimède 1 B-1348 Louvain-la-Neuve Belgium +32 (0)485 48 10 55 [hidden email] http://www.jadebelgium.eu --- view.xsl.orig 2009-11-13 17:32:20.000000000 +0100 +++ view.xsl 2010-01-03 13:40:07.988913126 +0100 @@ -575,34 +575,42 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: [hidden email] For general help: [hidden email] OW2 mailing lists service home page: http://www.ow2.org/wws -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: [hidden email] For general help: [hidden email] OW2 mailing lists service home page: http://www.ow2.org/wws -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: [hidden email] For general help: [hidden email] OW2 mailing lists service home page: http://www.ow2.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 OW2 mailing lists service home page: http://www.ow2.org/wws |
Administrator
|
Hi Laurent,
1) Regarding the change to run XSLT: It looks to me that assuming that you have in the "database", along form.xhtml (which is not XSLT) another document call form.xml on which you want to run the XSLT is something very specific to your scenario. Where does that form.xml come from? (Initially, I thought you wanted to run the XSLT against an empty document, or some other generic document, like the request.) 2) Regarding the change to have only one section visible at any point in time: Again, thank you for the code contribution! Erik an I tried the implementation and gave some more thought about this. One thing bother us: if a section contains other sub-sections but doesn't contain fields on its own, when clicking on the header for that section, what should happen? Show the section title with nothing else? Show all the subsections with all the fields? Thinking about it, we were thinking that it would be better to get to the same result, not by using the TOC, but by letting users open/close sections the way they do now, but closing other sections that are open when users open a new section. This would be closer to the behavior of a "tree", where you can click on section titles to explore the content. Also, this mode could be used with or without the TOC. Would this be something that would satisfy your requirement? (I apologize for the back and forth on this; we would like to make sure that we don't put in the product something that we'll want to change in the near future, which would be an inconvenience to people who came to rely on the initial implementation.) Alex On Sun, Mar 7, 2010 at 9:59 AM, Laurent Sibilla <[hidden email]> wrote: > Hi, > > > You are right. I use form.xml as data input for the form.xsl stylesheet. > > I updated the wiki. The other change was to have a toc represented as a tree > but I didn't create a property for that. If you don't want to have a tree, > let's just have a flat form ! :) > > > Thank you, > > > Laurent > > Alessandro Vernet a écrit : > > Hi Laurent, > > Sorry for the delay on this. I had a "next action", but it trickled > down the list. > > For the change to read-form.xpl: > > * I updated the test to determine if we have a stylesheet to use the > same XPath expression we have in the implementation of the page flow: > namespace-uri(/*) = 'http://www.w3.org/1999/XSL/Transform' or > /*/@xsl:version = '2.0'. > * But I am confused by what you are doing in the case where you have > an XSLT stylesheet. So you have form.xhtml which is XSLT, and you seem > to expect to have a form.xml in the same "directory" on which you > apply the XSLT? > > In the next patch, I see changed to: > > * components/components.xsl > * components/section.xsl > * components/view.xsl > > I have patched my files locally, and the code looks good to me. Before > I push this to GitHub, could you update the wiki to document the > oxf.fr.detail.toc.appearance.*.* property you added (and anything else > you think should be documented)? That would be on: > > http://wiki.orbeon.com/forms/doc/developer-guide/configuration-properties/configuration-properties-form-runner > > I added your Gmail address to the ACL, so just click on "Sign in" at > the bottom of the page, and you'll be able to edit any page of the > wiki. > > Alex > > On Thu, Mar 4, 2010 at 3:34 AM, Laurent Sibilla <[hidden email]> wrote: > > > Alessandro, > > > We are at the point to deploy our first application. Did you have a look to > this patch ? > > I would like to ensure that we will be able to follow the orbeon official > binaries. > > > > Kind regards, > > Laurent > > Alessandro Vernet a écrit : > > Laurent, > > I got the patch; I will look at this and follow-up here in the next few > days. > > Alex > > On Sat, Jan 16, 2010 at 2:34 AM, Laurent Sibilla <[hidden email]> wrote: > > > Hello, > > > I made some bugfixes. PDF view and editing were broken. Here are fixed > patches. > > I just made some changes in components.xsl to take care of $mode and in > read-form to not take care of ?document= argument. > > > > Best regards, > > > Laurent > > Laurent Sibilla a écrit : > > > Alessandro Vernet a écrit : > > > Laurent, > > Regarding running XSLT on the form, I wouldn't do this based on the > extension of the file. You even don't know the extension of the file, > depending on where it is stored. Instead, it should be simple enough to look > at the root element and check if you have an xsl:stylesheet or > xsl:transform. > > > > Doing it, I figured out quickly that it was better doing it your way. > > Here is the patch. Note that using the #document variable led to me to > xsl:include issues. So I had to use href to take the real URL in account. I > didn't find any way to put a xsl variable as href value. As a workaround, I > used an xsl transformation to create a processor to do the wanted xsl > transformation. I'm not sure this is the most straightforward way to do it > and if you know a better way, I would be really happy to know it. > > > > Regarding displaying one section at a time, then yes, I think the name of > your property makes sense. Maybe "appearance" instead of "type" would be > more in the spirit of XForms, i.e.: oxf.fr.detail.toc.appearance="all | > only-selected | tabview" (imagining that someone implements it using the > fr:tabview at some point). > > > Attached is the patch. > > What is in it : > - Add a $toc-appearance variable in component.xsl > - If $toc-appearance = 'selected-only' : > - Put xforms:cases in sections.xsl > - Create xforms:switch in view.xsl and put all non fr:section before it > - Use xforms:trigger instead of xhtml:a in toc > > The results seems good enough for our needs. > > > What do you think about it ? > > > > Kind regards, > > > Laurent > > > > Alex > > > > On Jan 6, 2010, at 8:47 AM, Laurent Sibilla <[hidden email]> > wrote: > > > > Hello all, > > > I decided to use Form-Runner as the base of an audit system project I am > actually building up. We choosed it for being open-source and based on > standards highly interoperable. > > I have some question about it and hope you could help. > > First of all, we are building the grid in XML files that are transformed > according to an XSL stylesheet. What we actually do is using saxon to build > the form.xhtml file. Does exist a way to do it dynamically ? I mean that > form runner would read form.xsl instead of form.xhtml. > > Then we have a multi-level form structure we wanted to be reflected in > the table of content. I saw in apps/fr/components/view.xsl that you had to > implement it and I did it so. Here attached you will find the patch file. > It's the first time I work with XSL, so I'm not sure of the quality of what > I did, particularly concerning the match pattern, but it works. > > Finally, we are considering using a paged form thanks to xforms:switch > instead of having all the form in one page. For this we would create a > property indicating what kind of table we want. For example > oxf.fr.detail.toc-type.*.*. Any recommandation on the name of the property > to be integrated upstream ? > > Thank you in advance for your response. > > Sincerely, > > -- > Laurent Sibilla > Vice President and International Manager > > FBJE asbl - vzw > Rue Archimède 1 > B-1348 Louvain-la-Neuve > Belgium > > +32 (0)485 48 10 55 > [hidden email] > > http://www.jadebelgium.eu > > --- view.xsl.orig 2009-11-13 17:32:20.000000000 +0100 +++ view.xsl > 2010-01-03 13:40:07.988913126 +0100 @@ -575,34 +575,42 @@ - - - - - - - - - > - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + > + + + + + + > > -- > 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 > OW2 mailing lists service home page: http://www.ow2.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 > OW2 mailing lists service home page: http://www.ow2.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 > OW2 mailing lists service home page: http://www.ow2.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 > OW2 mailing lists service home page: http://www.ow2.org/wws > > -- Orbeon Forms - Web forms, open-source, for the Enterprise - http://www.orbeon.com/ My Twitter: http://twitter.com/avernet -- 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 OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Hello Alessandro,
Alessandro Vernet a écrit : To be clear, my goal is basically the following. I have a file called form.xml that contain the data to be gathered. I mean just the name of the field and the type. It look something similar to this :Hi Laurent, 1) Regarding the change to run XSLT: It looks to me that assuming that you have in the "database", along form.xhtml (which is not XSLT) another document call form.xml on which you want to run the XSLT is something very specific to your scenario. Where does that form.xml come from? <grids tld="audits" element="audit" xmlns="" > <metadata> [...] </metadata> <menu> <grid name="main"> <element name="name" type="xs:string" default="default value"/> <element name="creation-date" type="xs:date"/> <grid name="submain1"> <element name="element111" type="xs:string"/> <element name="element112" type="xs:integer"/> </grid> <grid name="submain2"> <element name="element121" type="xs:integer"/> <element name="element122" type="xs:anyURI" bind-type="xs:anyURI" control="fr:attachment" constraint="@mediatype='application/pdf'"/> </grid> </grid> <grid name="main2"> <element name="element201" type="xs:boolean"/> <grid name="submain3"> <repeat name="repeat1"> <element name="element211" type="xs:string"/> <element name="element212" type="xs:date"/> <element name="element213" type="xs:string"/> </repeat> </grid> </grid> </menu> </grids>Then, I have xform.xhtml (that actually is an XSL stylesheet) that will transform this file to something Form Runner can understand. Meaning, the initial instance It also uses other file in the same directory for resources. It may, indeed, be something really specific to our need. May be a new property would be more suited ? It actually doesn't show subsections anywhere else than in the TOC but showing the titles insied the <xforms:case> can be a good idea.2) Regarding the change to have only one section visible at any point in time: Again, thank you for the code contribution! Erik an I tried the implementation and gave some more thought about this. One thing bother us: if a section contains other sub-sections but doesn't contain fields on its own, when clicking on the header for that section, what should happen? Show the section title with nothing else? Show all the subsections with all the fields? Nice alternative ! It would fit with our needs.Thinking about it, we were thinking that it would be better to get to the same result, not by using the TOC, but by letting users open/close sections the way they do now, but closing other sections that are open when users open a new section. This would be closer to the behavior of a "tree", where you can click on section titles to explore the content. Also, this mode could be used with or without the TOC. Would this be something that would satisfy your requirement? No problem, I can understand it !(I apologize for the back and forth on this; we would like to make sure that we don't put in the product something that we'll want to change in the near future, which would be an inconvenience to people who came to rely on the initial implementation.) Alex On Sun, Mar 7, 2010 at 9:59 AM, Laurent Sibilla [hidden email] wrote:Hi, You are right. I use form.xml as data input for the form.xsl stylesheet. I updated the wiki. The other change was to have a toc represented as a tree but I didn't create a property for that. If you don't want to have a tree, let's just have a flat form ! :) Thank you, Laurent Alessandro Vernet a écrit : Hi Laurent, Sorry for the delay on this. I had a "next action", but it trickled down the list. For the change to read-form.xpl: * I updated the test to determine if we have a stylesheet to use the same XPath expression we have in the implementation of the page flow: namespace-uri(/*) = 'http://www.w3.org/1999/XSL/Transform' or /*/@xsl:version = '2.0'. * But I am confused by what you are doing in the case where you have an XSLT stylesheet. So you have form.xhtml which is XSLT, and you seem to expect to have a form.xml in the same "directory" on which you apply the XSLT? In the next patch, I see changed to: * components/components.xsl * components/section.xsl * components/view.xsl I have patched my files locally, and the code looks good to me. Before I push this to GitHub, could you update the wiki to document the oxf.fr.detail.toc.appearance.*.* property you added (and anything else you think should be documented)? That would be on: http://wiki.orbeon.com/forms/doc/developer-guide/configuration-properties/configuration-properties-form-runner I added your Gmail address to the ACL, so just click on "Sign in" at the bottom of the page, and you'll be able to edit any page of the wiki. Alex On Thu, Mar 4, 2010 at 3:34 AM, Laurent Sibilla [hidden email] wrote: Alessandro, We are at the point to deploy our first application. Did you have a look to this patch ? I would like to ensure that we will be able to follow the orbeon official binaries. Kind regards, Laurent Alessandro Vernet a écrit : Laurent, I got the patch; I will look at this and follow-up here in the next few days. Alex On Sat, Jan 16, 2010 at 2:34 AM, Laurent Sibilla [hidden email] wrote: Hello, I made some bugfixes. PDF view and editing were broken. Here are fixed patches. I just made some changes in components.xsl to take care of $mode and in read-form to not take care of ?document= argument. Best regards, Laurent Laurent Sibilla a écrit : Alessandro Vernet a écrit : Laurent, Regarding running XSLT on the form, I wouldn't do this based on the extension of the file. You even don't know the extension of the file, depending on where it is stored. Instead, it should be simple enough to look at the root element and check if you have an xsl:stylesheet or xsl:transform. Doing it, I figured out quickly that it was better doing it your way. Here is the patch. Note that using the #document variable led to me to xsl:include issues. So I had to use href to take the real URL in account. I didn't find any way to put a xsl variable as href value. As a workaround, I used an xsl transformation to create a processor to do the wanted xsl transformation. I'm not sure this is the most straightforward way to do it and if you know a better way, I would be really happy to know it. Regarding displaying one section at a time, then yes, I think the name of your property makes sense. Maybe "appearance" instead of "type" would be more in the spirit of XForms, i.e.: oxf.fr.detail.toc.appearance="all | only-selected | tabview" (imagining that someone implements it using the fr:tabview at some point). Attached is the patch. What is in it : - Add a $toc-appearance variable in component.xsl - If $toc-appearance = 'selected-only' : - Put xforms:cases in sections.xsl - Create xforms:switch in view.xsl and put all non fr:section before it - Use xforms:trigger instead of xhtml:a in toc The results seems good enough for our needs. What do you think about it ? Kind regards, Laurent Alex On Jan 6, 2010, at 8:47 AM, Laurent Sibilla [hidden email] wrote: Hello all, I decided to use Form-Runner as the base of an audit system project I am actually building up. We choosed it for being open-source and based on standards highly interoperable. I have some question about it and hope you could help. First of all, we are building the grid in XML files that are transformed according to an XSL stylesheet. What we actually do is using saxon to build the form.xhtml file. Does exist a way to do it dynamically ? I mean that form runner would read form.xsl instead of form.xhtml. Then we have a multi-level form structure we wanted to be reflected in the table of content. I saw in apps/fr/components/view.xsl that you had to implement it and I did it so. Here attached you will find the patch file. It's the first time I work with XSL, so I'm not sure of the quality of what I did, particularly concerning the match pattern, but it works. Finally, we are considering using a paged form thanks to xforms:switch instead of having all the form in one page. For this we would create a property indicating what kind of table we want. For example oxf.fr.detail.toc-type.*.*. Any recommandation on the name of the property to be integrated upstream ? Thank you in advance for your response. Sincerely, -- Laurent Sibilla Vice President and International Manager FBJE asbl - vzw Rue Archimède 1 B-1348 Louvain-la-Neuve Belgium +32 (0)485 48 10 55 [hidden email] http://www.jadebelgium.eu --- view.xsl.orig 2009-11-13 17:32:20.000000000 +0100 +++ view.xsl 2010-01-03 13:40:07.988913126 +0100 @@ -575,34 +575,42 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: [hidden email] For general help: [hidden email] OW2 mailing lists service home page: http://www.ow2.org/wws -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: [hidden email] For general help: [hidden email] OW2 mailing lists service home page: http://www.ow2.org/wws -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: [hidden email] For general help: [hidden email] OW2 mailing lists service home page: http://www.ow2.org/wws -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: [hidden email] For general help: [hidden email] OW2 mailing lists service home page: http://www.ow2.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 OW2 mailing lists service home page: http://www.ow2.org/wws |
Administrator
|
Hi Laurent,
1) Regarding the change to run XSLT: Yes, I feel that this is something quite specific to your situation ;). We are struggling with this here as well: when a client has a certain need, it is not for us to say if their need is "valid". It just needs to be implemented. But should the implementation go into Orbeon Forms, or should it stay in a change to Orbeon Forms done just for that client? It is sometimes a hard call, and we often get to the conclusion that the change is too specific to go into the product. Now in your case, I assume that you are somehow populating eXist with that XML and XSLT file, right? Could you at that time run the XSLT and store the output in the database? 2) Regarding the change to have only one section visible at any point in time: We already had a entry reading: "Wizard" appearance for sections, on the list of Future Features for Form Builder / Runner. I changed this into: * Appearance where only one section is visible at a time. This appearance could have multiple sub-appearances: ** A simple mode based on the current UI to expand/collapse section, where when a section is expanded all the other expanded sections are collapsed ** A wizard mode ** A tabview mode http://wiki.orbeon.com/forms/projects/form-builder-future-features Now let's see when we get a chance to do this, or when someone else gets a chance to contribute an implementation. Thank you for helping us clarifying our thoughts on this! Alex On Sun, Mar 14, 2010 at 12:55 PM, Laurent Sibilla <[hidden email]> wrote: > Hello Alessandro, > > Alessandro Vernet a écrit : > > Hi Laurent, > > 1) Regarding the change to run XSLT: > > It looks to me that assuming that you have in the "database", along > form.xhtml (which is not XSLT) another document call form.xml on which > you want to run the XSLT is something very specific to your scenario. > Where does that form.xml come from? > > > To be clear, my goal is basically the following. I have a file called > form.xml that contain the data to be gathered. I mean just the name of the > field and the type. It look something similar to this : > > <grids tld="audits" element="audit" > xmlns="" > > <metadata> > [...] > </metadata> > <menu> > <grid name="main"> > <element name="name" type="xs:string" default="default value"/> > <element name="creation-date" type="xs:date"/> > <grid name="submain1"> > <element name="element111" type="xs:string"/> > <element name="element112" type="xs:integer"/> > </grid> > <grid name="submain2"> > <element name="element121" type="xs:integer"/> > <element name="element122" type="xs:anyURI" > bind-type="xs:anyURI" control="fr:attachment" > constraint="@mediatype='application/pdf'"/> > </grid> > </grid> > <grid name="main2"> > <element name="element201" type="xs:boolean"/> > <grid name="submain3"> > <repeat name="repeat1"> > <element name="element211" type="xs:string"/> > <element name="element212" type="xs:date"/> > <element name="element213" type="xs:string"/> > </repeat> > </grid> > </grid> > </menu> > </grids> > > Then, I have xform.xhtml (that actually is an XSL stylesheet) that will > transform this file to something Form Runner can understand. Meaning, the > initial instance It also uses other file in the same directory for > resources. > > It may, indeed, be something really specific to our need. May be a new > property would be more suited ? > > 2) Regarding the change to have only one section visible at any point in > time: > > Again, thank you for the code contribution! Erik an I tried the > implementation and gave some more thought about this. One thing bother > us: if a section contains other sub-sections but doesn't contain > fields on its own, when clicking on the header for that section, what > should happen? Show the section title with nothing else? Show all the > subsections with all the fields? > > > > It actually doesn't show subsections anywhere else than in the TOC but > showing the titles insied the <xforms:case> can be a good idea. > > Thinking about it, we were thinking that it would be better to get to > the same result, not by using the TOC, but by letting users open/close > sections the way they do now, but closing other sections that are open > when users open a new section. This would be closer to the behavior of > a "tree", where you can click on section titles to explore the > content. Also, this mode could be used with or without the TOC. Would > this be something that would satisfy your requirement? > > > > Nice alternative ! It would fit with our needs. > > (I apologize for the back and forth on this; we would like to make > sure that we don't put in the product something that we'll want to > change in the near future, which would be an inconvenience to people > who came to rely on the initial implementation.) > > > No problem, I can understand it ! > > Alex > > On Sun, Mar 7, 2010 at 9:59 AM, Laurent Sibilla <[hidden email]> wrote: > > > Hi, > > > You are right. I use form.xml as data input for the form.xsl stylesheet. > > I updated the wiki. The other change was to have a toc represented as a tree > but I didn't create a property for that. If you don't want to have a tree, > let's just have a flat form ! :) > > > Thank you, > > > Laurent > > Alessandro Vernet a écrit : > > Hi Laurent, > > Sorry for the delay on this. I had a "next action", but it trickled > down the list. > > For the change to read-form.xpl: > > * I updated the test to determine if we have a stylesheet to use the > same XPath expression we have in the implementation of the page flow: > namespace-uri(/*) = 'http://www.w3.org/1999/XSL/Transform' or > /*/@xsl:version = '2.0'. > * But I am confused by what you are doing in the case where you have > an XSLT stylesheet. So you have form.xhtml which is XSLT, and you seem > to expect to have a form.xml in the same "directory" on which you > apply the XSLT? > > In the next patch, I see changed to: > > * components/components.xsl > * components/section.xsl > * components/view.xsl > > I have patched my files locally, and the code looks good to me. Before > I push this to GitHub, could you update the wiki to document the > oxf.fr.detail.toc.appearance.*.* property you added (and anything else > you think should be documented)? That would be on: > > http://wiki.orbeon.com/forms/doc/developer-guide/configuration-properties/configuration-properties-form-runner > > I added your Gmail address to the ACL, so just click on "Sign in" at > the bottom of the page, and you'll be able to edit any page of the > wiki. > > Alex > > On Thu, Mar 4, 2010 at 3:34 AM, Laurent Sibilla <[hidden email]> wrote: > > > Alessandro, > > > We are at the point to deploy our first application. Did you have a look to > this patch ? > > I would like to ensure that we will be able to follow the orbeon official > binaries. > > > > Kind regards, > > Laurent > > Alessandro Vernet a écrit : > > Laurent, > > I got the patch; I will look at this and follow-up here in the next few > days. > > Alex > > On Sat, Jan 16, 2010 at 2:34 AM, Laurent Sibilla <[hidden email]> wrote: > > > Hello, > > > I made some bugfixes. PDF view and editing were broken. Here are fixed > patches. > > I just made some changes in components.xsl to take care of $mode and in > read-form to not take care of ?document= argument. > > > > Best regards, > > > Laurent > > Laurent Sibilla a écrit : > > > Alessandro Vernet a écrit : > > > Laurent, > > Regarding running XSLT on the form, I wouldn't do this based on the > extension of the file. You even don't know the extension of the file, > depending on where it is stored. Instead, it should be simple enough to look > at the root element and check if you have an xsl:stylesheet or > xsl:transform. > > > > Doing it, I figured out quickly that it was better doing it your way. > > Here is the patch. Note that using the #document variable led to me to > xsl:include issues. So I had to use href to take the real URL in account. I > didn't find any way to put a xsl variable as href value. As a workaround, I > used an xsl transformation to create a processor to do the wanted xsl > transformation. I'm not sure this is the most straightforward way to do it > and if you know a better way, I would be really happy to know it. > > > > Regarding displaying one section at a time, then yes, I think the name of > your property makes sense. Maybe "appearance" instead of "type" would be > more in the spirit of XForms, i.e.: oxf.fr.detail.toc.appearance="all | > only-selected | tabview" (imagining that someone implements it using the > fr:tabview at some point). > > > Attached is the patch. > > What is in it : > - Add a $toc-appearance variable in component.xsl > - If $toc-appearance = 'selected-only' : > - Put xforms:cases in sections.xsl > - Create xforms:switch in view.xsl and put all non fr:section before it > - Use xforms:trigger instead of xhtml:a in toc > > The results seems good enough for our needs. > > > What do you think about it ? > > > > Kind regards, > > > Laurent > > > > Alex > > > > On Jan 6, 2010, at 8:47 AM, Laurent Sibilla <[hidden email]> > wrote: > > > > Hello all, > > > I decided to use Form-Runner as the base of an audit system project I am > actually building up. We choosed it for being open-source and based on > standards highly interoperable. > > I have some question about it and hope you could help. > > First of all, we are building the grid in XML files that are transformed > according to an XSL stylesheet. What we actually do is using saxon to build > the form.xhtml file. Does exist a way to do it dynamically ? I mean that > form runner would read form.xsl instead of form.xhtml. > > Then we have a multi-level form structure we wanted to be reflected in > the table of content. I saw in apps/fr/components/view.xsl that you had to > implement it and I did it so. Here attached you will find the patch file. > It's the first time I work with XSL, so I'm not sure of the quality of what > I did, particularly concerning the match pattern, but it works. > > Finally, we are considering using a paged form thanks to xforms:switch > instead of having all the form in one page. For this we would create a > property indicating what kind of table we want. For example > oxf.fr.detail.toc-type.*.*. Any recommandation on the name of the property > to be integrated upstream ? > > Thank you in advance for your response. > > Sincerely, > > -- > Laurent Sibilla > Vice President and International Manager > > FBJE asbl - vzw > Rue Archimède 1 > B-1348 Louvain-la-Neuve > Belgium > > +32 (0)485 48 10 55 > [hidden email] > > http://www.jadebelgium.eu > > --- view.xsl.orig 2009-11-13 17:32:20.000000000 +0100 +++ view.xsl > 2010-01-03 13:40:07.988913126 +0100 @@ -575,34 +575,42 @@ - - - - - - - - - > - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + > + + + + + + > > -- > 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 > OW2 mailing lists service home page: http://www.ow2.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 > OW2 mailing lists service home page: http://www.ow2.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 > OW2 mailing lists service home page: http://www.ow2.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 > OW2 mailing lists service home page: http://www.ow2.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 > OW2 mailing lists service home page: http://www.ow2.org/wws > > -- Orbeon Forms - Web forms, open-source, for the Enterprise - http://www.orbeon.com/ My Twitter: http://twitter.com/avernet -- 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 OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Alessandro Vernet a écrit :
> Hi Laurent, > > 1) Regarding the change to run XSLT: > > Yes, I feel that this is something quite specific to your situation > ;). We are struggling with this here as well: when a client has a > certain need, it is not for us to say if their need is "valid". It > just needs to be implemented. But should the implementation go into > Orbeon Forms, or should it stay in a change to Orbeon Forms done just > for that client? It is sometimes a hard call, and we often get to the > conclusion that the change is too specific to go into the product. > > Now in your case, I assume that you are somehow populating eXist with > that XML and XSLT file, right? Could you at that time run the XSLT and > store the output in the database? > > to the xml in a separate folder and updating the form.xhtml ! We are doing this way to make easier to evolve the form. > 2) Regarding the change to have only one section visible at any point in time: > > We already had a entry reading: "Wizard" appearance for sections, on > the list of Future Features for Form Builder / Runner. I changed this > into: > > * Appearance where only one section is visible at a time. This > appearance could have multiple sub-appearances: > ** A simple mode based on the current UI to expand/collapse section, > where when a section is expanded all the other expanded sections are > collapsed > ** A wizard mode > ** A tabview mode > > http://wiki.orbeon.com/forms/projects/form-builder-future-features > > Now let's see when we get a chance to do this, or when someone else > gets a chance to contribute an implementation. Thank you for helping > us clarifying our thoughts on this! > > feature afterwards. (I had love to work on it.) By the way, do you plan to participate to GSoC ? The mentoring application already started and I would be pleased to participate ! Laurent -- 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 OW2 mailing lists service home page: http://www.ow2.org/wws |
Administrator
|
Laurent,
On Tue, Mar 16, 2010 at 1:02 PM, Laurent Sibilla <[hidden email]> wrote: > No, they are regular file inside resources/forms/*/*/form. They generate a > "regular" forms.xhtml. It could have been done by applying those xsl to the > xml in a separate folder and updating the form.xhtml ! > > We are doing this way to make easier to evolve the form. Do you have multiple forms or just one forms.xhtml and form.xml? Is the forms.xhtml generic, in the sense that it is always the same, and that only the form.xml changes (if you indeed have multiple forms)? > Ok, we will stick with our "prototype" for this year (the project is to be > launched in less than 2 weeks). May be I will come back on this feature > afterwards. (I had love to work on it.) If you are going to release 2 weeks from now, indeed, that sounds like a reasonable plan :). > By the way, do you plan to participate to GSoC ? The mentoring application > already started and I would be pleased to participate ! It looks like we missed the deadline to register! So I guess the answer is no, unfortunately. Alex -- Orbeon Forms - Web forms, open-source, for the Enterprise - http://www.orbeon.com/ My Twitter: http://twitter.com/avernet -- 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 OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Alessandro Vernet a écrit :
Yes. In the future, the idea would be to have the same form.xhtml for all forms and only having form.xml to change. This said, we also have resources in separated files called resources.*.xml.Laurent, On Tue, Mar 16, 2010 at 1:02 PM, Laurent Sibilla [hidden email] wrote:Do you have multiple forms or just one forms.xhtml and form.xml? Is the forms.xhtml generic, in the sense that it is always the same, and that only the form.xml changes (if you indeed have multiple forms)? Ok, we will stick with our "prototype" for this year (the project is to be launched in less than 2 weeks). May be I will come back on this feature afterwards. (I had love to work on it.)If you are going to release 2 weeks from now, indeed, that sounds like a reasonable plan :).By the way, do you plan to participate to GSoC ? The mentoring application already started and I would be pleased to participate !It looks like we missed the deadline to register! So I guess the answer is no, unfortunately. Alex -- 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 OW2 mailing lists service home page: http://www.ow2.org/wws |
Administrator
|
Laurent,
Interesting; so I imagine that in the future you could could keep that unique "form.xhtml" (which is XSLT) as part of Form Runner instead of having it in eXist. In essence, you have one more level of indirection compared to what we have now: XML in eXist => XSLT in FR transforms this in FR+XForms+XHTML => FR transforms this in XForms+XHTML => XForms engine Alex On Fri, Mar 19, 2010 at 8:29 AM, Laurent Sibilla <[hidden email]> wrote: > Alessandro Vernet a écrit : > > Laurent, > > On Tue, Mar 16, 2010 at 1:02 PM, Laurent Sibilla <[hidden email]> wrote: > > > Do you have multiple forms or just one forms.xhtml and form.xml? Is > the forms.xhtml generic, in the sense that it is always the same, and > that only the form.xml changes (if you indeed have multiple forms)? > > > > Yes. In the future, the idea would be to have the same form.xhtml for all > forms and only having form.xml to change. This said, we also have resources > in separated files called resources.*.xml. > > Ok, we will stick with our "prototype" for this year (the project is to be > launched in less than 2 weeks). May be I will come back on this feature > afterwards. (I had love to work on it.) > > > If you are going to release 2 weeks from now, indeed, that sounds like > a reasonable plan :). > > > > By the way, do you plan to participate to GSoC ? The mentoring application > already started and I would be pleased to participate ! > > > It looks like we missed the deadline to register! So I guess the > answer is no, unfortunately. > > Alex > > > > -- > 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 > OW2 mailing lists service home page: http://www.ow2.org/wws > > -- Orbeon Forms - Web forms, open-source, for the Enterprise - http://www.orbeon.com/ My Twitter: http://twitter.com/avernet -- 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 OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Free forum by Nabble | Edit this page |