Home > Default > How can I create a XMP List with multiple selection

How can I create a XMP List with multiple selection

October 11Hits:0
Advertisement
Hello,
I try to build my own XMP custom panel. Herefore I need a couple of lists with the possibility for multiple selections (e.g. the choice for one language or multiple languages).
But how is it possible to integrate a list into a panel? There is no XMPList inside the custom folder. I have experimented with the standard mx:list and an array collection for data binding into the list. But how can I write the user selection into an XMP field? Example: In the List the user choose three languages (DE, EN, FR). Is it possible to collect the choice into a string and to write the result into an XMP standard field (e.g. dc:description)?
A further question is, if it's possible to use the "HTTPService" to bind an external xml-file with the languages and other informations into the panel or is it only possible to work with an array collection inside the code?
Here is my code:
<?xml version="1.0" encoding="utf-8"?>
<fi:XMPForm
          xmlns:mx="http://www.adobe.com/2006/mxml"
          xmlns:fi="com.adobe.xmp.components.*" width="100%" height="100%"
          xmlns:Iptc4xmpCore ="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/"
          label="XMP-Custom Panel"
          initialize="ds.send()"
          >
     <!-- Each namespace prefix that is used within an xmpPath-attribute,
           MUST BE registered at the top of EACH panel where it is referenced -->
     <fi:XMPNamespaces>
          <fi:XMPNamespace prefix="dc" value="http://purl.org/dc/elements/1.1/"/>
     </fi:XMPNamespaces>
     <fi:XMPForm>
          <mx:HBox width="100%" height="26" verticalAlign="middle">
               <mx:HRule width="50%"/>
               <mx:Label text="Allgemeine Metadaten" fontSize="12" fontWeight="bold"/>
               <fi:XMPSeparator width="50%"/>
          </mx:HBox>
          <fi:XMPFormItem
                    label="Titel"
                    labelTooltip="$$$/xmp/sdk/custompanels/Test/TitleToolTip=Dateiname" fontSize="11" width="100%">
               <fi:XMPTextInput xmpPath="dc:title" xmpType="Localized" width="100%"/>
          </fi:XMPFormItem>
          <fi:XMPFormItem
                    label="Titel"
                    labelTooltip="$$$/xmp/sdk/custompanels/Test/TitleToolTip=Dateiname" fontSize="11" width="100%">
               <fi:XMPTextInput xmpPath="dc:title" xmpType="Localized" width="100%"/>
          </fi:XMPFormItem>
          <fi:XMPFormItem
                    label="Druckkennzeichen"
                    labelTooltip="$$$/xmp/sdk/custompanels/Test/TitleToolTip=Dateiname" fontSize="11" width="100%">
               <fi:XMPTextInput xmpPath="dc:title" xmpType="Localized" width="100%"/>
          </fi:XMPFormItem>
          <fi:XMPFormItem
                    label="Verfasser"
                    labelTooltip="$$$/xmp/sdk/custompanels/Test/TitleToolTip=Erzeuger des Dokumentes" fontSize="11" width="100%">
               <fi:XMPComboBox xmpPath="dc:creator" width="100%"/>
          </fi:XMPFormItem>
          <fi:XMPFormItem
                    label="Versionsnummer"
                    labelTooltip="$$$/xmp/sdk/custompanels/Test/TitleToolTip=Dateiname" fontSize="11" width="100%">
               <fi:XMPComboBox xmpPath="dc:creator" width="100%"/>
          </fi:XMPFormItem>
          <mx:HBox width="100%" height="26" verticalAlign="middle">
               <mx:HRule width="50%"/>
               <mx:Label text="Enthaltene Sprachen" fontSize="12" fontWeight="bold"/>
               <fi:XMPSeparator width="50%"/>
          </mx:HBox>
          <!-- Beginn der Auswahl-Liste für die Sprachen -->
             <mx:Script>
        <![CDATA[
            import flash.events.MouseEvent;
            import mx.controls.Alert;
            import mx.collections.ArrayCollection;
            private const NL:String = "\r";
            // A data provider created by using ActionScript
            [Bindable]
            private var subscriptions:ArrayCollection =
                new ArrayCollection
                        {data:0, label:"Deutsch"},
                        {data:1, label:"Englisch"},
                        {data:2, label:"Französisch"},
                        {data:3, label:"Italienisch"}
            [Bindable]
            private var market:ArrayCollection =
                new ArrayCollection
                        {data:0, label:"(Bitte Marktversion auswählen)"},
                        {data:1, label:"Marktversion Deutsch (M_DE)"},
                        {data:2, label:"Marktversion Englisch (M_EN)"},
                        {data:3, label:"Marktversion Frankreich (M_FR)"},
                        {data:4, label:"Marktversion Italien (M_IT)"}
            [Bindable]
            private var documenttyp:ArrayCollection =
                new ArrayCollection
                        {data:0, label:"(Bitte Dokumenttyp auswählen)"},
                              {data:1, label:"Gebrauchsanweisung"},
                        {data:2, label:"Ersatzteilkatalog"},
                        {data:3, label:"Service-Anleitung"},
                        {data:4, label:"Etikett"}
        ]]>
    </mx:Script>
                <fi:XMPFormItem label="Sprachauswahl" width="100%">
                <mx:List
                    id="userSubscriptions" rowCount="4"
                    allowMultipleSelection="true" width="100%"
                    dataProvider="{subscriptions}"
                />
            </fi:XMPFormItem>
                <mx:Text text="* Mehrfachauswahl möglich." fontWeight="normal" fontSize="10"/>
            <!-- Ende der Liste für die Auswahl von Sprachen -->
          <fi:XMPFormItem
                    label="Marktvariante"
                    labelTooltip="$$$/xmp/sdk/custompanels/Test/TitleToolTip=Dateiname" fontSize="11" width="100%">
               <fi:XMPComboBox xmpPath="dc:creator" width="100%" dataProvider="{market}"/>
          </fi:XMPFormItem>
          <fi:XMPFormItem
                    label="Dokumenttyp"
                    labelTooltip="$$$/xmp/sdk/custompanels/Test/TitleToolTip=Dateiname" fontSize="11" width="100%">
               <fi:XMPComboBox xmpPath="dc:creator" width="100%" dataProvider="{documenttyp}"/>
          </fi:XMPFormItem>
          <fi:XMPFormItem
                    label="Stichworte"
                    labelTooltip="$$$/xmp/sdk/custompanels/Test/TitleToolTip=Erzeuger des Dokumentes" fontSize="11" width="100%">
               <fi:XMPTextArea/>
          </fi:XMPFormItem>
          <mx:HBox width="100%" height="26" verticalAlign="middle">
               <mx:HRule width="50%"/>
               <mx:Label text="Metadaten Photoshop" fontSize="12" fontWeight="bold"/>
               <fi:XMPSeparator width="50%"/>
          </mx:HBox>
          <fi:XMPFormItem
                    label="Originalname FA"
                    labelTooltip="$$$/xmp/sdk/custompanels/Test/TitleToolTip=Dateiname" fontSize="11" width="100%" id="PS1">
               <fi:XMPTextInput xmpPath="dc:title" xmpType="Localized" width="100%"/>
          </fi:XMPFormItem>
          <fi:XMPFormItem
                    label="Fotoauftragsnummer"
                    labelTooltip="$$$/xmp/sdk/custompanels/Test/TitleToolTip=Dateiname" fontSize="11" width="100%" id="PS2">
               <fi:XMPTextInput xmpPath="dc:title" xmpType="Localized" width="100%"/>
          </fi:XMPFormItem>
          <fi:XMPFormItem
                    label="Interne Anmerkungen"
                    labelTooltip="$$$/xmp/sdk/custompanels/Test/TitleToolTip=Erzeuger des Dokumentes" fontSize="11" width="100%" id="PS3">
               <fi:XMPTextArea/>
          </fi:XMPFormItem>
          <mx:Text text="* hier steht eine kleine Erläuterung" fontWeight="normal" fontSize="10"/>
     </fi:XMPForm>
</fi:XMPForm>
Any suggestions?
Thank you in advance.
Markus

Answers

Hi Markus,
the FileInfo SDK does not offer a ready-made list component allowing for multi-selection.
So you would need to implement one using the FileInfo SDK API. Your component "XMPList" would inherit from mx:list and would need to implement the XMPRead and XMPWrite events and talk to the XMP using the IXMPAccess interface within those event handlers.
Please have a look at the Programmer's Guide, section "XMP Flex components" and at the API description available in "docs" for further guidanc.
Hope this helps
Kind Regards
Jörg
Adobe XMP

Read other 2 answers

Tags:

Related Articles

Copyright (C) 2019 wisumpire.com, All Rights Reserved. webmaster#wisumpire.com 14 q. 0.785 s.