Loading ...
Sorry, an error occurred while loading the content.

Re: [iptc4xmp] Re: Flex Builder - creating complex arrays for IPTC Extension

Expand Messages
  • Dave Kennard
    Hi Stefan Thanks for posting that workaround, it looks much easier than my workaround. I only wish I d known about it when I first came up against the problem.
    Message 1 of 17 , Jun 9, 2010
    View Source
    • 0 Attachment
      Hi Stefan

      Thanks for posting that workaround, it looks much easier than my workaround. I only wish I'd known about it when I first came up against the problem.

      Cheers

      Dave

      On 08/06/2010 18:38, Stefan wrote:
       

      Hi Dave and Greg,

      I hope that I can solve some of your problems.

      1. Array creation in panels.

      In general you are right that
      xmpAccess.setProperty("dc:subject", null, IXMPConst.ARRAY);
      creates a "bag", while IXMPConst.ARRAY_ORDERED is used for a "seq" and
      IXMPConst.ARRAY_ALTERNATE for an "alt" array. This works in CS5.
      Unfortunately there is a bug in CS4, which does not allow to hand over
      "null" as a parameter, which is required to create an array, because an
      array must not have a simple value, not even an empty string.

      But there is a workaround to create the above array:

      event.xmpAccess.separateArrayItems("dc:subject", "", IXMPConst.ARRAY);

      This call is normally used to convert a comma-separated string into an
      array (like keywords).

      2. "LocationShown"-Properties

      The main problem here is that you want to edit only the first item of
      the "LocationShown" array. With the xmpPath
      "Iptc4xmpExt:LocationCreated[1]/Iptc4xmpExt:Sublocation"
      you link the text edit field to a struct field inside an array's first
      item. As you have noticed, the top-level array is neither automatically
      created nor deleted, once it's empty.
      We faced this problem already for the IPTC Extension panel in CS5 and I
      am happy to share our solution (I send it via mail - is there a way to attach files in this webeditor?).
      Its obvious that this code is not really straight forward, but at least
      it works.

      I hope this helps to create your panel and I would like to hear if it
      worked for you.

      Kind Regards,

      Stefan


    • Greg Reser
      Stefan - Could you share mxml and ActionScript code for this? The file that was uploaded is the complied .swf file for the CS4 panel, which does work
      Message 2 of 17 , Jun 10, 2010
      View Source
      • 0 Attachment
        Stefan - Could you share mxml and ActionScript code for this? The file that was uploaded is the complied .swf file for the CS4 panel, which does work beautifully, but I am having trouble breaking out the code I need to use in my panel.

        Dave - Maybe you and I could talk off list about the Flex coding details.


        Thanks,

        Greg
        greser@...

        --- In iptc4xmp@yahoogroups.com, Dave Kennard <showerheadsuk@...> wrote:
        >
        > Hi Stefan
        >
        > Thanks for posting that workaround, it looks much easier than my
        > workaround. I only wish I'd known about it when I first came up against
        > the problem.
        >
        > Cheers
        >
        > Dave
        >
        > On 08/06/2010 18:38, Stefan wrote:
        > >
        > > Hi Dave and Greg,
        > >
        > > I hope that I can solve some of your problems.
        > >
        > > 1. Array creation in panels.
        > >
        > > In general you are right that
        > > xmpAccess.setProperty("dc:subject", null, IXMPConst.ARRAY);
        > > creates a "bag", while IXMPConst.ARRAY_ORDERED is used for a "seq" and
        > > IXMPConst.ARRAY_ALTERNATE for an "alt" array. This works in CS5.
        > > Unfortunately there is a bug in CS4, which does not allow to hand over
        > > "null" as a parameter, which is required to create an array, because an
        > > array must not have a simple value, not even an empty string.
        > >
        > > But there is a workaround to create the above array:
        > >
        > > event.xmpAccess.separateArrayItems("dc:subject", "", IXMPConst.ARRAY);
        > >
        > > This call is normally used to convert a comma-separated string into an
        > > array (like keywords).
        > >
        > > 2. "LocationShown"-Properties
        > >
        > > The main problem here is that you want to edit only the first item of
        > > the "LocationShown" array. With the xmpPath
        > > "Iptc4xmpExt:LocationCreated[1]/Iptc4xmpExt:Sublocation"
        > > you link the text edit field to a struct field inside an array's first
        > > item. As you have noticed, the top-level array is neither automatically
        > > created nor deleted, once it's empty.
        > > We faced this problem already for the IPTC Extension panel in CS5 and I
        > > am happy to share our solution (I send it via mail - is there a way to
        > > attach files in this webeditor?).
        > > Its obvious that this code is not really straight forward, but at least
        > > it works.
        > >
        > > I hope this helps to create your panel and I would like to hear if it
        > > worked for you.
        > >
        > > Kind Regards,
        > >
        > > Stefan
        > >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.