Re: xforms:upload updating two parts of the model

Hi Nuno,

Can I just clarify the question? Is the problem as simple as needing
to duplicate the value from filegrp/file/@ID to fptr/@FILEID? Or is it
slightly more complex in that the fptr element must also be created?

Regards,

Mark

-- 
  Mark Birbeck

  mark.birbeck@x-port.net | +44 (0) 20 7689 9232
  http://www.x-port.net | http://internet-apps.blogspot.com

  x-port.net Ltd. is registered in England and Wales, number 03730711
  The registered office is at:

    2nd Floor
    Titchfield House
    69-85 Tabernacle Street
    London
    EC2A 4RR



On 23/02/2008, Nuno Job <nunojobpinto@gmail.com> wrote:
> I'm developing a XForms front-end to create a METS manifest.
>
> >
> >
> > <mets>
> >   <fileSec>
> >     <fileGrp>
> >       <file ID="" MIMETYPE="">
> >         <FContent>
> >           <binData xsi:type="xsd:base64Binary"/>
> >         </FContent>
> >       </file>
> >     </fileGrp>
> >   </fileSec>
> >   <structMap>
> >     <div TYPE="file:categories">
> >       <div TYPE="file:categories:report">
> >         <fptr FILEID=""/>
> >       </div>
> >     </div>
> >   </structMap>
> > </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).
>
> >
> >
> >             <xforms:repeat id="files-repeat"
> >
> nodeset="/mets/fileSec/fileGrp/file">
> >               <xforms:group id="file-group" class="container">
> >                 <xforms:output value="concat('Filename #', @ID)"/>
> >                 <xforms:select1
> ref="mets/structMap/div[@ID==id]/div" appearance="compact">
> >                   <xforms:label>Section</xforms:label>
> >                   <xforms:itemset model="sections-model"
> >                                   nodeset="//section">
> >                     <xforms:label ref="name"/>
> >                     <xforms:value ref="id"/>
> >                     <xforms:hint ref="description"/>
> >                   </xforms:itemset>
> >                 </xforms:select1>
> >                 <xforms:upload ref="FContent/binData">
> >                   <xforms:label>File</xforms:label>
> >                   <xforms:filename
> ref="/mets/fileSec/fileGrp/file[index('files-repeat')]/@ID"/>
> >                   <xforms:mediatype
> ref="/mets/fileSec/fileGrp/file[index('files-repeat')]/@MIMETYPE"/>
> >                 </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 Monday, 25 February 2008 16:27:09 UTC