4 Replies Latest reply on May 27, 2013 5:03 PM by Sham HC

    Customizing metadata properties in DAM

    Bayani Portier Level 1

      Hi all,


      I have been looking into leveraging the DAM to allow for content providers to attach specific global meta data to particular assets. Perhaps I am thinking incorrectly on a strategic level, so any alternate approaches are appreciated as well.


      The problem is, we have a set of affiliates which are listed out in the dam, containing a prescribed set of images/assets/links. These providers can be viewed via pages in CQ5, but also within a set of mobile apps for droid and iPhone.


      The iPhone and droid crews are currently accessing a set of JSON files to get the required metadata, which is placed within the DAM. I think is a very nasty solution, as this data will not be filled in by developers, but rather an affiliate on ramp team. (Essentially a team of Sales staff).


      What I am looking into now, is to store the additional metadata on an affiliate folder as JCR metadata, which I have successfully done, but only by generically customizing the properties for folders/images. Ie, for folders, right click -> properties.


      You can add additional items to the basic properties tab by adding the relevant component nodes to /libs/foundation/components/primary/sling/OrderedFolder/tab_basic/items, even add entirely new tabs by creating a new node at the /libs/foundation/components/primary/sling/OrderedFolder level (i.e. myTab) and then specifying it in the dialog /libs/foundation/components/primary/sling/OrderedFolder/dialog/items/tabs/items


      The problem is that the tab/extra question fields will be universally displayed, and are not folder dependant, so they appear in every folder context.


      What I would love to do, is to have it so that if you access http://localhost:4502/damadmin#/content/dam/affiliate/affiliateA you get your newly customized options/panels etc, but if you were to view properties on http://localhost:4502/damadmin#/content/dam/affiliate you would not get any additional questions being asked.


      Any help would be greatly appreciated.

        • 1. Re: Customizing metadata properties in DAM
          Sham HC Level 7

          Recently there was a similar discussion internally & suggestion came from group was


          1.    Create & confiure an acl.


          2.    using Listener on the particular field you want to hide and then hide the field based on the path. To do this, create a listeners node of type nt:unstructured under the field  (e.g. /apps/dam/content/asseteditors/image/jpeg/formitems/person/listeners) and set the beforeloadcontent property to [1]. This will hide this field for assets under /content/dam/geometrixx. You could adjust this to meet other requirements.


          Verify 2 & let us know how it goes.


          [1]  function(f, r, p) { if (p.indexOf("/content/dam/geometrixx/") == 0) { f.hide(); } return true; }

          • 2. Re: Customizing metadata properties in DAM
            Bayani Portier Level 1

            Thanks for responding so quickly.



            I am not quite sure how an acl would be appropriate in my case here, as it has nothing to do with users, but should there be difference in rights, I can definitely see where it is applicable.



            Your function(f, r, p) { if (p.indexOf("/content/dam/dpost/providers") == 0) { f.hide(); } return true; } function is almost right.


            function(f, r, p) { if (p.indexOf("/content/dam/dpost/providers") != 0) { f.hide(); } return true; } Works a treat, and gives me exactly what we wanted.


            Thanks again for your help.

            • 3. Re: Customizing metadata properties in DAM
              maruthid Level 1

              Hi Sham,


              I want to add some more functionality to it. Want to change the label of the metadata field instead of hiding it.

              Can we change the label of the field itself.

              something like this I tried

              f.fieldLabel = 'newfieldlabel'


              But it failed. Am I doing some thing wrong in setting field label?


              And one more thing in that method we are comparing path. Instead I want to compare matedata of that asset. Can you tell me how can I access assets metadata through record parameter (r).




              • 4. Re: Customizing metadata properties in DAM
                Sham HC Level 7

                Hi Maruthi,


                You might need to extend field to define setFieldLabel & then set the value to get effective.


                http://www.sencha.com/forum/showthread.php?42916-Changing-fieldLabel-dynamically-in-TextFi eld