InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ISaveAssetContent Class Referenceabstract

#include <ISaveAssetContent.h>

Inheritance diagram for ISaveAssetContent:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ISAVEASSETCONTENT }
 

Public Member Functions

virtual ErrorCode Do (UIDRef assetRef, const IDFile &destination)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

This is a call-back interface that is responsible for saving (writing) asset content. It may be used by IAMServiceProvider::enCheckIn services to assure that an asset's model changes are applied as part of the check in. For example, an ISaveAssetContent implementation for stories would export a story page item. Similarly, an implementation for InDesign documents would write the document to an indd file. The ISaveAssetContent hook is useful for complicated checkin rules that involve displaying UI with a Cancel option. Thus, should the user cancel the operation, the checkin can be aborted without the unwanted side-effect writing the content.

To enable this callback during the enCheckIn service, add this interface to the service boss.

Example:

The following boss checks in an InDesign document to Version Cue:

Class

{

    kVCCheckInServiceBoss,

    kInvalidClass,

    {

        IID_IAMSERVICE,         kVCCheckInServiceImpl,

        IID_IAMSERVICEDATA,     kAMServiceDataImpl,

        IID_ISAVEASSETCONTENT,  kSaveDocumentContentImpl, // Saves an indd document

    }

},

Example:

The following boss checks in a LiveEdit story (does not use Version Cue):

Class

{

    kICCheckInServiceBoss,

    kInvalidClass,

    {

        IID_IAMSERVICE,         kICCheckInServiceImpl,

        IID_IAMSERVICEDATA,     kAMServiceDataImpl,

        IID_ISAVEASSETCONTENT,  kSaveStoryContentImpl,  // Exports a story

    }

},

Member Function Documentation

virtual ErrorCode ISaveAssetContent::Do (UIDRef assetRef,
const IDFiledestination 
)
pure virtual

Writes asset content to secure storage.

Parameters
assetRefis the UIDRef of a boss that aggregates the IManageableAsset interface.
destinationis the IDFile to write the content data to. The file need not exist beforehand. For an asset that is not file-based, the file path may be empty. In this case, an implementation of this method must be able to determine the destination from the UIDRef alone.
Returns
kSuccess if the content was written without error, or did not require writing. An appropriate ErrorCode is returned if the operation fails.