xforms:upload updating two parts of the model

I'm developing a XForms front-end to create a METS manifest.


>    1. <mets>
>    2.   <fileSec>
>    3.     <fileGrp>
>    4.       <file ID="" MIMETYPE="">
>    5.         <FContent>
>    6.           <binData xsi:type="xsd:base64Binary"/>
>    7.         </FContent>
>    8.       </file>
>    9.     </fileGrp>
>    10.   </fileSec>
>    11.   <structMap>
>    12.     <div TYPE="file:categories">
>    13.       <div TYPE="file:categories:report">
>    14.         <fptr FILEID=""/>
>    15.       </div>
>    16.     </div>
>    17.   </structMap>
>    18. </mets>
>
> My problem is that when someone put the value in the xform:upload i need
to update the three colored places. I'm ok with the green parts but the red
part I simply have no clue how to do it. When you choose a file and the
category of that file, the file should be stored in binData (achieved), the
ID and MIMETYPE should be updated (achieved) and a new fptr with the FILEID
should be created in the div of the specified category (this is what I don't
have a clue on how to do).


>    1.             <xforms:repeat id="files-repeat"
>    2.                            nodeset="/mets/fileSec/fileGrp/file">
>    3.               <xforms:group id="file-group" class="container">
>    4.                 <xforms:output value="concat('Filename #',
>    @ID)"/>
>    5.                 <xforms:select1
>    ref="mets/structMap/div[@ID==id]/div" appearance="compact">
>    6.                   <xforms:label>Section</xforms:label>
>    7.                   <xforms:itemset model="sections-model"
>    8.                                   nodeset="//section">
>    9.                     <xforms:label ref="name"/>
>    10.                     <xforms:value ref="id"/>
>    11.                     <xforms:hint ref="description"/>
>    12.                   </xforms:itemset>
>    13.                 </xforms:select1>
>    14.                 <xforms:upload ref="FContent/binData">
>    15.                   <xforms:label>File</xforms:label>
>    16.                   <xforms:filename
>    ref="/mets/fileSec/fileGrp/file[index('files-repeat')]/@ID"/>
>    17.                   <xforms:mediatype
>    ref="/mets/fileSec/fileGrp/file[index('files-repeat')]/@MIMETYPE"/>
>    18.                 </xforms:upload>
>
> Is this possible? How? I thought of using actions but how can I be sure
the form is synchronized with the model if I go that way?

Thanks so much for the help,

Nuno

Received on Sunday, 24 February 2008 19:29:23 UTC