1 Reply Latest reply on Apr 27, 2012 9:23 PM by areohbee

    Publish Plugin Development


      Hey All!


      Thanks for the great answers to the questions I've posed. I've just come back from what seems like the deepest dive into the bowls of lua and lightroom and I'm now pretty confused. Here are some of my questions.


      1. I need the user to authenticate to the service. Once authenticated I'll always use the stored credentials. Currently, I'm storing these in a property table because I've bound the property table passed to

      sectionsForTopOfDialog. (Or do you say the propertyTable is the bound_to_object??). Is there any way to disable saving the publish dialog until the credentials have been validated?


      2. I need to get access to the credentials in the property table when a new collection is created. How do I access that table from within updateCollectionSettings?


      I think those are my biggest two questions.



        • 1. Re: Publish Plugin Development
          areohbee Level 6

          Put this in the export/publish module:


          local exportParams = {}

          exportParams[#exportParams + 1] = { key = 'username', default = 'Enter a better username...' }

          exportParams[#exportParams + 1] = { key = 'password', default = nil }

          ExportSlashPublish.exportPresetFields = exportParams




          return ExportSlashPublish

          -- the end


          "exportParams" will be members of the "publishSettings" passed to updateCollectionSettings.


          Then all you have to do is define the UI for it in ExportSlashPublish.sectionsFor...


          Note: the property table passed to sectionsFor... is automagically linked to the export params.


          If you don't want an export param to be recorded until you are ready, then either:

          * create a custom binding (advanced) which does the authentication, or

          * create an independent property table and bind to that instead. - once the entered values are validated, they can be assigned to the property table passed to sectionsFor..., which is the export-params.


          Note: set propertyTable.cantExportBecause = "Validating - please standby..." and the export / publish button will be disabled until validation is complete.