File Export.lua

Functions

Export.endDialog (props, why) Called when dialog box is closing.
Export.processRenderedPhotos (functionContext, exportContext) Called to process render(ing) photos.
Export.propertyChangeHandler (id, props, name, value) Export parameter change handler proper - static function
Export.sectionsForBottomOfDialog (vf, props) Presently, there are no default sections imagined for the export bottom.
Export.sectionsForTopOfDialog (vf, props) Presently, it is imagined to just replicate the manager's top section in the export.
Export.startDialog (props) Called when dialog box is opening - static function as required by Lightroom.
Export:_getExportParams (props) "Protected" method to get export parameters based on properties.
Export:checkBeforeRendering () Remove photos not to be rendered, or whatever.
Export:doExport (params) Do export on current task.
Export:doExportOnCurrentTask (params) function to export photo(s) with specified settings.
Export:endDialogMethod (props, why) Do whatever when dialog box closing.
Export:finale (service, status, message) Perform export service wrap-up.
Export:getDestBaseName (props, photo, cache) Get export destination filename.
Export:getDestDir (props, photo, cache) Get export destination directory
Export:getDestExt (props, photo, cache) Get export destination extension - with correct case.
Export:getDestFilename (props, photo, cache) Get export destination filename.
Export:getDestPath (props, photo, cache) Get export destination path for photo.
Export:getSettingsFromPreset (params) get export settings from an export preset file.
Export:initiate (service) Called when export is initiated.
Export:newClass (t) Constructor for extending class.
Export:newDialog (t) Constructor to create the export object that represents the export dialog box.
Export:newExport (t) Create a new export object.
Export:processExportFilenamingChange (props, name, value) Process change to export-filenaming property - for cases when export filenaming may have some restrictions.
Export:processExportLocationChange (props, name, value) Process change to export-to export param - for cases when export location may have some restrictions.
Export:processRenderedPhoto (rendition, photoPath) Process one rendered photo.
Export:processRenderedPhotosMethod () Method version of like-named static function.
Export:processRenderingFailure (rendition, message) Process one photo rendering failure.
Export:propertyChangeHandlerMethod (props, name, value) Handle change to properties under authority of base export class.
Export:sectionsForBottomOfDialogMethod (vf, props) Standard export sections for bottom of dialog.
Export:sectionsForTopOfDialogMethod (vf, props) Standard export sections for top of dialog.
Export:service (service) Service function of base export - processes renditions.
Export:startDialogMethod (props) Do whatever when dialog box opening.


Functions

Export.endDialog (props, why)
Called when dialog box is closing.

Parameters:

  • props:
  • why:

Usage:

  • Generally no reason to override in derived class - override method instead.
  • Just calls corresponding method of actual (i.e derived class) export object. 
Export.processRenderedPhotos (functionContext, exportContext)
Called to process render(ing) photos.

Photos have not started rendering when this is first called. Once started, they will be rendered in an asynchronous task within Lightroom. Rendering may be started implicitly by invoking the renditions iterator of the export context, or explicitly by calling export-context - start-rendering.

Parameters:

  • functionContext:
  • exportContext:

Usage:

  • Generally no reason to override in derived class - override method instead.
  • 1st: creates derived export object via object factory, 
    then calls corresponding method of actual (i.e derived class) export object.
  • Rendering order is not guaranteed, however experience dictates they are in order. 
Export.propertyChangeHandler (id, props, name, value)
Export parameter change handler proper - static function

Parameters:

  • id:
  • props:
  • name:
  • value:

Usage:

  • Generally no reason to override in derived class - override method instead.
  • Just calls corresponding method of actual (i.e derived class) export object. 
Export.sectionsForBottomOfDialog (vf, props)
Presently, there are no default sections imagined for the export bottom.

Parameters:

  • vf:
  • props:

Usage:

  • Generally no reason to override in derived class - override method instead.
  • Just calls corresponding method of actual (i.e derived class) export dialog object. 
Export.sectionsForTopOfDialog (vf, props)
Presently, it is imagined to just replicate the manager's top section in the export.

Parameters:

  • vf:
  • props:

Usage:

  • Generally no reason to override in derived class - override method instead.
  • Just calls corresponding method of actual (i.e derived class) export dialog object. 
Export.startDialog (props)
Called when dialog box is opening - static function as required by Lightroom.

Parameters:

  • props:

Usage:

  • Generally no reason to override in derived class - override method instead.
  • Just calls corresponding method of actual (i.e derived class) export object. 
Export:_getExportParams (props)
"Protected" method to get export parameters based on properties. This method only makes sense in the context of a publish service that also supports non-publish exporting.

Parameters:

  • props:
Export:checkBeforeRendering ()
Remove photos not to be rendered, or whatever.
Export:doExport (params)
Do export on current task.

Parameters:

  • params:
Export:doExportOnCurrentTask (params)
function to export photo(s) with specified settings.

Parameters:

  • params: (table, required) essential export settings, and also:
    photo or photos (single LrPhoto, or array of).
    explicitSettings (explicit Lr export settings, overrides baseline settings).
    baselineSettings (default Lr export settings, will be assigned if no explicit settig override).

Usage:

  • LR export settings must be specified without the LR prefix.
  • only the first char is required of string settings when unambiguous.
  • alternate specifiers: 
    watermark (boolean) true = simple-copyright; false = none.
  • does NOT assure target dir is created, so calling context must do so, if appropriate. 
Export:endDialogMethod (props, why)
Do whatever when dialog box closing.

Nuthin yet...

Parameters:

  • props:
  • why:

Usage:

    Call from derived class to ensure dialog is ended properly according to base class. 
Export:finale (service, status, message)
Perform export service wrap-up.

Parameters:

  • service:
  • status:
  • message:

Usage:

  • Override this method in derived class to log stats...
  • *** IMPORTANT: This method is critical to export integrity. Derived export class must remember to call it at end of special export finale method. 
Export:getDestBaseName (props, photo, cache)
Get export destination filename.

Parameters:

  • props:
  • photo:
  • cache:
Export:getDestDir (props, photo, cache)
Get export destination directory

Parameters:

  • props:
  • photo:
  • cache:

Usage:

    consider disallowing "Choose Later" option if you are planning to use this function as is - it will prompt for the folder, but so will Lightroom making for an obnoxious double-prompt: probably not what you want. 
Export:getDestExt (props, photo, cache)
Get export destination extension - with correct case.

Parameters:

  • props:
  • photo:
  • cache:

Usage:

    consider disallowing "Choose Later" option if you are planning to use this function as is - it will prompt for the folder, but so will Lightroom making for an obnoxious double-prompt: probably not what you want. 
Export:getDestFilename (props, photo, cache)
Get export destination filename.

Parameters:

  • props:
  • photo:
  • cache:
Export:getDestPath (props, photo, cache)
Get export destination path for photo.

Parameters:

  • props:
  • photo:
  • cache:
Export:getSettingsFromPreset (params)
get export settings from an export preset file. ###2 note: does not yet support automatic detection of export preset folder.

Parameters:

  • params: (table) members:
    file

Return value:

    export settings, or throws error trying.
Export:initiate (service)
Called when export is initiated.

Parameters:

  • service:

Usage:

    This method helps export manager track managed exports (all exports based on this class are managed). 
Export:newClass (t)
Constructor for extending class.

Parameters:

  • t:
Export:newDialog (t)
Constructor to create the export object that represents the export dialog box.

One of these objects is created when the export dialog box is presented, if it has not already been.

Parameters:

  • t:
Export:newExport (t)
Create a new export object.

One of these objects is created EACH time a new export is initiated, then killed at export completion - supports multiple concurrent exports, without interference (assuming a different set of photos is selected, otherwise all kinds of interference...)

Parameters:

  • t: Parameter table
    • exportContext
    • functionContext

Return value:

    Export object
Export:processExportFilenamingChange (props, name, value)
Process change to export-filenaming property - for cases when export filenaming may have some restrictions.

Parameters:

  • props:
  • name:
  • value:
Export:processExportLocationChange (props, name, value)
Process change to export-to export param - for cases when export location may have some restrictions.

Parameters:

  • props:
  • name:
  • value:
Export:processRenderedPhoto (rendition, photoPath)
Process one rendered photo.

Parameters:

  • rendition:
  • photoPath:
Export:processRenderedPhotosMethod ()
Method version of like-named static function.

Usage:

  • Base class implementation simply calls the export service method wrapped in an app call.
  • Derived export class can certainly override this method, but consider overriding the service & finale methods instead.
  • Called immediately after process-rendered-photos static "boot-strap" function. 
Export:processRenderingFailure (rendition, message)
Process one photo rendering failure.

Parameters:

  • rendition:
  • message: error message generated by Lightroom.
Export:propertyChangeHandlerMethod (props, name, value)
Handle change to properties under authority of base export class.

Presently there are none - but that could change

Parameters:

  • props:
  • name:
  • value:

Usage:

    Call from derived class to ensure base property changes are handled. 
Export:sectionsForBottomOfDialogMethod (vf, props)
Standard export sections for bottom of dialog.

Reminder: Lightroom supports named export presets.

Parameters:

  • vf:
  • props:

Usage:

    These sections can be combined with derived class's in their entirety, or strategically - presently there are none. 
Export:sectionsForTopOfDialogMethod (vf, props)
Standard export sections for top of dialog.

Presently seems like a good idea to replicate the plugin manager sections.

Parameters:

  • vf:
  • props:

Usage:

    These sections can be combined with derived class's in their entirety, or strategically... 
Export:service (service)
Service function of base export - processes renditions.

You can override this method in its entirety, OR just:

  • checkBeforeRendering
  • processRenderedPhoto
  • processRenderingFailure
  • (and finale maybe)

Parameters:

  • service:
Export:startDialogMethod (props)
Do whatever when dialog box opening.

Nuthin to do so far - but that could change.

Parameters:

  • props:

Usage:

    Call from derived class to ensure dialog is initialized according to base class. 

Valid XHTML 1.0!