Attachment

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

Attachment

Aldjia MAHIOU
je travail sur orbeon form 4.4, je vous upload an attachment dans un formulaire mais j'arrive pas a déterminer le bon chemin pour sauvegarder mes pièces jointe (attachment)

s'il vous plaît si vous avez un solution pour m'aider.

Bien cordialement
 

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Attachment

Alessandro  Vernet
Administrator
Bonjour Aldjia,

Que voulez-vous dire par "sauvegarder mes pièces jointe"? Voulez-vous dire
que vous avez votre propre code qui interagit avec la l'API de persistance
de Orbeon Forms, et que vous souhaitez sauvegarder un fichier au travers de
cette API?

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Attachment

Aldjia MAHIOU
Bonjour Alex,

je voulais dire par "sauvegarder mes pièces jointe",

dans notre application on a un champ dans le formulaire xml Fichier, on veut faire un bouton upload pour upload la pièce jointe et à coté de cette pièce on veut deux doutons ( edit, delette)pour la gérer .et une fois on upload cette pièce on volait préciser le chemin d'enregistrement.
est ce que c'est possible ou bien dans orbeon 4.4 il y a un chemin définit pour sauvegarder  les pièces jointes?

voilà mon code sur la partie orbeon et dans application on utilise java EE et glassFish.

dans le fichier read.xml {
                        <xhtml:span class="field read">
<xslcomp:one-file-read ref="file-container-with-files/company-files/company-file">
<xforms:label>Fichier : </xforms:label>
<xforms:hint>Activer pour télécharger le fichier joint.</xforms:hint>
</xslcomp:one-file-read>
</xhtml:span>
}

               write.xml {
                       <xhtml:span class="field write">
<xslcomp:one-file-write ref="file-container-with-files/company-files/company-file" accept="image/*">
<xforms:label>Fichier : </xforms:label>
<xforms:hint>Activer pour télécharger le fichier joint.</xforms:hint>
</xslcomp:one-file-write>
</xhtml:span>
}

et dans le fichier copy-section-content.xsl {
<!--pèces jointes  -->
<xsl:template match="xslcomp:one-file-read">
<xsl:param name="part"/>
<!--  TODO: replace by a group. -->
<xhtml:span class="xforms-control xforms-output an-company-file vertical">
<xhtml:label class="sectionLabel xforms-label"><xsl:value-of select="xforms:label" /></xhtml:label>
<xhtml:label class="sectionLabel xforms-label"></xhtml:label>
<xhtml:table style="" cellspacing="0">
<xhtml:tr>
<xhtml:td class="download">
<xforms:output ref="{@ref}/download"
incremental="true" appearance="xxforms:download">
<xforms:filename ref="../@filename" />
<xforms:mediatype ref="../@mime-type" />
<xforms:label><xforms:output ref="../@filename"/></xforms:label>
<xsl:copy-of select="xforms:hint"></xsl:copy-of>
</xforms:output>
<xforms:output value="if(normalize-space({@ref}/@filename) = '') then '(Pas de fichier)' else ''">
<xsl:attribute name="style">
<xsl:text>{if(normalize-space(</xsl:text>
<xsl:value-of select="@ref"/>
<xsl:text>/@filename) = '') then '' else 'display: none'}</xsl:text>
</xsl:attribute>
</xforms:output>
</xhtml:td>
</xhtml:tr>
<xhtml:tr>
<xhtml:td class="vignette">
<xforms:output mediatype="image/*" ref="{@ref}/vignette" />
</xhtml:td>
</xhtml:tr>
</xhtml:table>
</xhtml:span>
</xsl:template>
<!--pèces jointes  -->
<xsl:template match="xslcomp:one-file-write">
<xsl:param name="part"/>
<xhtml:span class="xforms-control xforms-output an-company-file vertical" >
<xhtml:label class="sectionLabel xforms-label"><xsl:value-of select="xforms:label" /></xhtml:label>
<xhtml:label class="sectionLabel xforms-label"></xhtml:label>
<xhtml:table style="" cellspacing="0">
<xhtml:tr>
<!-- <fr:attachment ref="my-data"
<xf:label>Attached file</xf:label>
Optional
<xf:filename ref="@filename" />
<xf:mediatype ref="@mediatype" />
<xxf:size ref="@size" />
</fr:attachment> -->
<xhtml:td class="download">
<xforms:upload ref="{@ref}/url" accept="{@accept}">
<xforms:filename ref="../@filename" />
<xforms:mediatype ref="../@mime-type" />
<xxforms:size ref="../@length" />
<xsl:copy-of select="xforms:hint"></xsl:copy-of>
</xforms:upload>
</xhtml:td>
</xhtml:tr>
<xhtml:tr>
<xhtml:td class="vignette">
<xforms:output mediatype="image/*" ref="{@ref}/vignette" />
</xhtml:td>
</xhtml:tr>
</xhtml:table>
</xhtml:span>
</xsl:template>
}

et dans le fichier make-stuff.xsl  {

<!-- Binds  pièce j -->
<xsl:template match="part/bind">
<xsl:if test="../action">
<xsl:apply-templates  select="doc(concat('oxf:', ../section/form-xhtml/@url, ../action/@file ))/*"><xsl:with-param name="part" select=".." /></xsl:apply-templates>
</xsl:if>

<!-- TODO: use id-selector-Xpath -->
<xforms:bind nodeset="instance('{../instance-name}')/root">
<!-- what must be drawn where the section is in read state -->
<xforms:bind ref="@ui:mode-read">
<xforms:bind
relevant="instance('{../instance-name}')/root/@ui:mode-read = 'true'" >
</xforms:bind>
<xforms:bind
relevant="not(instance('{../instance-name}'){./bind-Xpath-id} ='0' or instance('{../instance-name}'){./bind-Xpath-id} = '')" >
</xforms:bind>
</xforms:bind>
<!-- what must be drawn where the section is in write state -->
<xforms:bind ref="@ui:mode-write"
relevant="instance('{../instance-name}')/root/@ui:mode-write = 'true'" />
<!-- the section is open or not -->
<xforms:bind ref="@ui:open"
relevant="instance('{../instance-name}')/root/@ui:open = 'true'" />


<!-- I must draw the edit button -->
<xforms:bind ref="@ui:edit">
<xforms:bind
relevant="instance('{../instance-name}')/root/@ui:mode-read = 'true'" >
</xforms:bind>
<xforms:bind
relevant="not(instance('{../instance-name}'){./bind-Xpath-status} = 'TRASHED') and not(instance('{../instance-name}'){./bind-Xpath-status} = 'FROZEN')" >
</xforms:bind>
<xsl:if test="../section/configuration/draw-edit/@dynamic and ../section/configuration/draw-edit/@dynamic = 'true'">
<xforms:bind
relevant="{../section/configuration/draw-edit}" >
</xforms:bind>
</xsl:if>
</xforms:bind>
<!-- I must draw the ??? button -->
<xforms:bind ref="@ui:add"
relevant="instance('{../instance-name}'){./bind-Xpath-id} = '0' or instance('{../instance-name}'){./bind-Xpath-id} = ''" >
</xforms:bind>
<!-- I must draw the save for update button -->
<xforms:bind ref="@ui:update">
<xforms:bind
relevant="instance('{../instance-name}')/root/@ui:mode-write = 'true'" >
</xforms:bind>
<!--
  Allow update when Frozen to allow putting now data in frozen state (if not allowed, you cannot save after choosing "FROZEN"
  <xforms:bind
relevant="not(instance('{../instance-name}'){./bind-Xpath-status} = 'TRASHED') and not(instance('{../instance-name}'){./bind-Xpath-status} = 'FROZEN')" >
 -->
  <xforms:bind
relevant="not(instance('{../instance-name}'){./bind-Xpath-status} = 'TRASHED')" >
</xforms:bind>
<xforms:bind
relevant="not(instance('{../instance-name}'){./bind-Xpath-id} ='0' or instance('{../instance-name}'){./bind-Xpath-id} = '')" >
</xforms:bind>
<xsl:if test="../section/configuration/draw-update/@dynamic and ../section/configuration/draw-update/@dynamic = 'true'">
<xforms:bind
relevant="{../section/configuration/draw-update}" >
</xforms:bind>
</xsl:if>
</xforms:bind>
<!-- I must draw the trash button -->
<xforms:bind ref="@ui:trash">
<xforms:bind
relevant="not(instance('{../instance-name}'){./bind-Xpath-id} ='0' or instance('{../instance-name}'){./bind-Xpath-id} = '')" >
</xforms:bind>
<xforms:bind
relevant="instance('{../instance-name}')/root/@ui:mode-write = 'true'" >
</xforms:bind>
<xforms:bind
relevant="instance('{../instance-name}'){./bind-Xpath-status} ='CURRENT'" >
</xforms:bind>
<xsl:if test="../section/configuration/draw-trash/@dynamic and ../section/configuration/draw-trash/@dynamic = 'true'">
<xforms:bind
relevant="{../section/configuration/draw-trash}" >
</xforms:bind>
</xsl:if>
</xforms:bind>
<!-- I must draw the delete button -->
<xforms:bind ref="@ui:delete">
<xforms:bind
relevant="not(instance('{../instance-name}'){./bind-Xpath-id} ='0' or instance('{../instance-name}'){./bind-Xpath-id} = '')" >
</xforms:bind>
<xforms:bind
relevant="(instance('{../instance-name}')/root/@ui:mode-read = 'true' and instance('{../instance-name}'){./bind-Xpath-status} = 'TRASHED') or (instance('{../instance-name}')/root/@ui:mode-write = 'true' and instance('{../instance-name}'){./bind-Xpath-status} = 'DRAFT')" >
</xforms:bind>
<xsl:if test="../section/configuration/draw-delete/@dynamic and ../section/configuration/draw-delete/@dynamic = 'true'">
<xforms:bind
relevant="{../section/configuration/draw-delete}" >
</xforms:bind>
</xsl:if>
</xforms:bind>

<!-- I must draw the restore button -->
<xforms:bind ref="@ui:restore">
<xforms:bind
relevant="not(instance('{../instance-name}'){./bind-Xpath-id} ='0' or instance('{../instance-name}'){./bind-Xpath-id} = '')" >
</xforms:bind>
<xforms:bind
relevant="instance('{../instance-name}')/root/@ui:mode-read = 'true'" >
</xforms:bind>
<xforms:bind
relevant="instance('{../instance-name}'){./bind-Xpath-status} = 'TRASHED'" >
</xforms:bind>
<xsl:if test="../section/configuration/draw-restore/@dynamic and ../section/configuration/draw-restore/@dynamic = 'true'">
<xforms:bind
relevant="{../section/configuration/draw-restore}" >
</xforms:bind>
</xsl:if>
</xforms:bind>

<xsl:if test="../multiple/is-multiple = 'true' and ../multiple/is-show-unique = 'true'">
<!-- Cas sans tableau, alors maintient l'id de la selection 
calculate="instance('{../instance-name}'){./bind-Xpath-calculate}" 
-->
ICI il FAUT FINIR ligne 233 make-stuff.xsl : ../multiple/is-multiple = 'true' and ../multiple/is-show-unique = 'true'
<xforms:bind ref="instance('{../instance-name}'){./bind-Xpath-id}" >
<xsl:attribute name="calculate"><xsl:call-template name="calculate-path-group"><xsl:with-param name="part" select="parent::part"/></xsl:call-template><xsl:value-of select="../bind-Xpath-item-id" /></xsl:attribute>
</xforms:bind>
</xsl:if>
</xforms:bind>
<!--  Lorsque les valeurs fournies étaient null c'est que l'utilisateur a rempli le champ, mettre null a faux. -->
<!-- Pour chaque instance du document. -->
<xforms:bind nodeset="instance('{../instance-name}')//@xsi:nil" calculate=".. = ''"/>

<!-- POUR CACHER UNE SECTION ENTIERE -->
<!-- <xforms:bind ref="instance('{./instance-name}'){./section/Xpath-group-ref}" relevant="false()" /> -->
<!-- ici test de confidentialitée -->
<!-- ici test de droit de lecture de l'instance -->


<!--  Warning, '..' because part is parent of current. -->
<xforms:bind nodeset="instance('{../instance-name}')/{./bind-xpath-root}">
<!-- for the upload files -->
<xforms:bind nodeset="//company-file">
<xforms:bind ref="@length" calculate="if(normalize-space(.) = '') then 0 else ."/>
<xforms:bind ref="url" type="xs:anyURI" />
<!-- TODO: make the service -->
<!-- Pour une vignette qui serait contruite avec l'url suffixé par -v -->
<!-- <xforms:bind ref="vignette" type="xs:anyURI"  calculate="if (not(ends-with(../url, '-v'))) then concat(../url, '-v') else ../url" relevant="not(string-length(../@filename) = 0) and starts-with( ../@mime-type, 'image')" /> -->
<xforms:bind ref="vignette" type="xs:anyURI"  calculate="../url" relevant="not(normalize-space(../@filename) = '') and starts-with( ../@mime-type, 'image')" />
<xforms:bind ref="download" type="xs:anyURI" calculate="../url" relevant="not(normalize-space(../@filename) = '')" />
</xforms:bind>
<xsl:if test="../section/form-xhtml and ../section/form-xhtml/@url and ../section/form-xhtml/@specific-binds-file-name and ../section/form-xhtml/@specific-binds-file-name!= ''">
<xsl:apply-templates select="doc(concat('oxf:', ../section/form-xhtml/@url, '/',../section/form-xhtml/@specific-binds-file-name, '.xml' ))/binds/*"><xsl:with-param name="part" select=".." /></xsl:apply-templates>
</xsl:if>
<xsl:if test="../section/form-xhtml and ../section/form-xhtml/@url and (not(../section/form-xhtml/@specific-binds-file-name) or ../section/form-xhtml/@specific-binds-file-name= '')">
<xsl:apply-templates select="doc(concat('oxf:', ../section/form-xhtml/@url, '/binds.xml' ))/binds/*"><xsl:with-param name="part" select=".." /></xsl:apply-templates>
</xsl:if>
</xforms:bind>
</xsl:template>

}

2018-03-28 7:00 GMT+02:00 Alessandro Vernet <[hidden email]>:
Bonjour Aldjia,

Que voulez-vous dire par "sauvegarder mes pièces jointe"? Voulez-vous dire
que vous avez votre propre code qui interagit avec la l'API de persistance
de Orbeon Forms, et que vous souhaitez sauvegarder un fichier au travers de
cette API?

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to a topic in the Google Groups "Orbeon Forms" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orbeon/LpPyNUbQVsE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To post to this group, send email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Attachment

Alessandro  Vernet
Administrator
Bonjour Aldjia,

J'imagine que le bouton "Edit" permettrait de changer le fichier, et le
bouton "Delete" de la supprimer. C'est ce que fait par défaut le champs
`<fr:attachment>`. Je ne sais pas s'il était déjà disponible dans Orbeon
Forms 4.4, et dans le cas contraire, ma recommandation serait de mettre à
jour Orbeon Forms à une version plus récente, et d'utiliser
`<fr:attachment>`. Est-ce que vous pensez que ce soit possible?

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Attachment

Alessandro  Vernet
Administrator
Bonjour Aldjia,

Est-ce que vous avez eu l'occasion de considérer une mise à jour de Orbeon
Forms, et l'utilisation du composant `<fr:attachment>`, suite à mon message
précédent?

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Attachment

Aldjia MAHIOU
Bonjour Alex, 
Non, je n'ai utilisé le composant  `<fr:attachment>`, car je n'ai pas arrivé a mettre à jour la version de Orbeon (4.4 vers 4.5 ou bien vers la dernière version).
j'aimerai bien si vous pouvez m'aidez pour faire la mise à jour de Orbeon   

2018-04-09 20:48 GMT+02:00 Alessandro Vernet <[hidden email]>:
Bonjour Aldjia,

Est-ce que vous avez eu l'occasion de considérer une mise à jour de Orbeon
Forms, et l'utilisation du composant `<fr:attachment>`, suite à mon message
précédent?

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to a topic in the Google Groups "Orbeon Forms" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orbeon/LpPyNUbQVsE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To post to this group, send email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Attachment

Alessandro  Vernet
Administrator
Bonjour Aldjia,

Entendu. Je ne crois que cette discussion soit particulièrement intéressante
pour les autres lecteurs de ce forum, et vais donc vous contacter
directement par email.

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet