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

#include <IAMSPManager.h>

Inheritance diagram for IAMSPManager:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IAMSPMANAGER }
 
typedef std::vector
< IAssetMonitor * > 
AssetMonitorPtrList
 
typedef std::vector< UIDRefUIDRefList
 

Public Member Functions

virtual ErrorCode BindAsset (IManageableAsset *pAsset, IManageableAsset::AssetType assetType, const IDFile &file=IDFile())=0
 
virtual ErrorCode UnbindAsset (IManageableAsset *pAsset)=0
 
virtual int32 GetNumberOfAMSystemProviders ()=0
 
virtual IAMSystemProviderGetNthSystemProvider (int32 n)=0
 
virtual IAMSystemProviderGetSystemProvider (ClassID amspClassID)=0
 
virtual ClassID GetSystemProviderClassID (ClassID amServiceProviderClassID)=0
 
virtual IAMServiceProviderGetServiceProvider (ClassID amServiceProviderClassID)=0
 
virtual int32 GetAllAssetMonitors (IAMSPManager::AssetMonitorPtrList &outList)=0
 
virtual IAMUIServiceProviderGetUIServiceProvider (IManageableAsset *asset=nil)=0
 
virtual IAMUIServiceProviderGetUIServiceProvider (IManageableAsset *asset, int32 serviceID)=0
 
virtual IAMUIServiceProviderGetUIServiceProvider (const IDFile &file, int32 serviceID)=0
 
virtual IAMUIServiceProviderGetUIServiceProvider (const IAMSPManager::UIDRefList &assetList, int32 serviceID)=0
 
virtual IAMServiceProviderQueryServiceProvider (const IDFile &file)=0
 
virtual void ShowAllWarningDialogs ()=0
 
virtual IAMUIEnablementRulesGetUIEnablementRules (IManageableAsset *asset)=0
 
virtual bool16 IsAuthenticationUIEnabled () const =0
 
virtual bool16 EnableAuthenticationUI (bool16 enable=kTrue) const =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

The IAMSPManager interface accesses the AMSP (asset management system provider) manager. The AMSP manager maintains knowledge of IAMSystemProviders and their service, UI, and monitoring components. This interface is the starting point for obtaining access to an asset management system. IAMSPManager is obtained from the session as follows:

InterfacePtr<IAMSPManager> iAMSPManager( GetExecutionContextSession(), UseDefaultIID() );

In order to be recognized by the AMSP manager, an asset management system provider's boss must subclass the kAMSPBoss (see workgroupid.h).

Example:

This is a simple asset management system provider that has an asset management service provider (IAMServiceProvider) for providing IAMServices.

Class

{

    kMyAMSPBoss,

    kAMSPBoss,

    {   

        IID_IAMSYSTEMPROVIDER,      kMyAMSPImpl,    

        IID_IAMSERVICEPROVIDER,     kMyAMServiceProviderImpl,

    }

},

See Also
IAMSystemProvider.
IAMServiceProvider.
IAMService.

Member Function Documentation

virtual ErrorCode IAMSPManager::BindAsset (IManageableAssetpAsset,
IManageableAsset::AssetType assetType,
const IDFilefile = IDFile() 
)
pure virtual

The BindAsset method attaches (binds) asset management components to any boss (model object) that aggregates the IManageableAsset interface. Binding must be done before monitoring or performing any asset management services on the IManageableAsset. Any IManageableAsset instance that is bound using this method must also be unbound using IAMSPManager::UnbindAsset(). An IManageableAsset instance may be bound any number of times. It is not necessary to call UnbindAsset() before calling BindAsset(). A model object must be rebound whenever its association with an asset changes. For example, when a kDocBoss is written as part of the Save As command, it does not get recreated, but its location changes, so it must be bound to the new location.

Parameters
pAssetis a valid pointer to an IManageableAsset interface on a model object boss.
assetTypeis one of the predefined IManageableAsset::AssetTypes. Attempting to bind an IManageableAsset of type IManageableAsset::enLinked will fail if the link's IDataBase is not associated with an IDocument in the app's IDocumentList.
fileis an IDFile with a valid path or an empty path. This argument is ignored unless the assetType is IManageableAsset::enDocument. Specify this argument when binding a document boss associated with an existing file. Omit this argument (or specify an IDFile with an empty path) when binding a new document that has not yet been saved.
Returns
kSuccess if the asset was bound successfully; otherwise returns a failure ErrorCode if binding could not be done.
See Also
UnbindAsset.
IManageableAsset.
virtual bool16 IAMSPManager::EnableAuthenticationUI (bool16 enable = kTrue) const
pure virtual

INTERNAL USE ONLY. This method enables or disables authentication UI.

Parameters
enablekTrue enables authentication UI; kFalse disables it.
Returns
kTrue if authentication UI is enabled; kFalse otherwise.
virtual int32 IAMSPManager::GetAllAssetMonitors (IAMSPManager::AssetMonitorPtrList & outList)
pure virtual

This method retrieves a list of all of the IAssetMonitors.

Parameters
outListis populated with valid pointers to all of the IAssetMonitors registered with the AMSP manager. The pointers are guaranteed to be valid for the duration of the session.
Returns
the number of IAssetMonitors in the list.
See Also
IAssetMonitor.
virtual IAMSystemProvider* IAMSPManager::GetNthSystemProvider (int32 n)
pure virtual

This method retrieves the IAMSystemProvider for a specified index.

Example usage:

InterfacePtr<IAMSystemProvider> amsp( iAMSPManager->GetNthSystemProvider( i ), UseDefaultIID() );

Parameters
nis an integer >= 0.
Returns
pointer to an IAMSystemProvider or nil if n is out of bounds.
See Also
IAMSystemProvider.
virtual int32 IAMSPManager::GetNumberOfAMSystemProviders ()
pure virtual

This method retrieves the number of IAMSystemProvider instances that are currently registered with the AMSP manager.

Returns
int32 greater than or equal to zero.
virtual IAMServiceProvider* IAMSPManager::GetServiceProvider (ClassID amServiceProviderClassID)
pure virtual

This method retrieves the IAMServiceProvider interface for a specific asset management system provider (AMSP) implementation.

Parameters
amServiceProviderClassIDis the ClassID of an existing AMSP.
Returns
a pointer to an IAMServiceProvider, or nil if the specified ClassID is invalid or the AMSP is disabled.
See Also
IAMServiceProvider.
virtual IAMSystemProvider* IAMSPManager::GetSystemProvider (ClassID amspClassID)
pure virtual

This method retrieves a pointer to the IAMSystemProvider instance for an AMSP boss.

Parameters
amspClassIDis the ClassID of a boss that subclasses kAMSPBoss.
Returns
pointer to an IAMSystemProvider or nil if amspClassID is invalid orthe boss does not have an IAMSystemProvider interface.
See Also
IAMSystemProvider.
virtual ClassID IAMSPManager::GetSystemProviderClassID (ClassID amServiceProviderClassID)
pure virtual

This method retrieves the ClassID of the asset management system provider for an asset management service provider (IAMServiceProvider).

Parameters
amServiceProviderClassIDis the ClassID of a boss that aggregates IID_IAMSERVICEPROVIDER.
Returns
the ClassID of a boss that aggregates IID_IAMSYSTEMPROVIDER.
See Also
IAMSystemProvider.
IAMServiceProvider.
virtual IAMUIEnablementRules* IAMSPManager::GetUIEnablementRules (IManageableAssetasset)
pure virtual

This method retrieves the IAMUIEnablementRules for a specific IManageableAsset. The enablement rules are used to enable or disable UI widgets for an asset.

Parameters
assetis a valid pointer to a bound IManageableAsset.
Returns
a valid pointer to the asset's IAMUIEnablementRules or nil if not found.
See Also
IAMUIEnablementRules.
virtual IAMUIServiceProvider* IAMSPManager::GetUIServiceProvider (IManageableAssetasset = nil)
pure virtual

This method retrieves the IAMUIServiceProvider for an asset.

Parameters
assetis a valid pointer to a bound IManageableAsset or nil. If nil, this method returns the first enabled IAMUIServiceProvider available.
Returns
a valid pointer to an IAMUIServiceProvider if found; otherwise returns nil.
See Also
IAMUIServiceProvider.
virtual IAMUIServiceProvider* IAMSPManager::GetUIServiceProvider (IManageableAssetasset,
int32 serviceID 
)
pure virtual

This method retrieves the IAMUIServiceProvider that offers a particular UI service.

Parameters
assetis a valid pointer to a bound IManageableAsset.
serviceIDspecifies the IAMUIService service identifier.
Returns
a valid pointer to an IAMUIServiceProvider or nil if no UI service provider can be found that offers the service.
virtual IAMUIServiceProvider* IAMSPManager::GetUIServiceProvider (const IDFilefile,
int32 serviceID 
)
pure virtual

This method retrieves the IAMUIServiceProvider that offers a particular UI service that is compatible with an asset file.

Parameters
fileis an IDFile with a valid path to an existing asset.
serviceIDspecifies the IAMUIService service identifier.
Returns
a valid pointer to the first IAMUIServiceProvider found that can handle the file. Returns nil if no UI service provider can be found that offers the service.
virtual IAMUIServiceProvider* IAMSPManager::GetUIServiceProvider (const IAMSPManager::UIDRefList & assetList,
int32 serviceID 
)
pure virtual

This method retrieves the IAMUIServiceProvider that offers a particular UI service that is compatible with a list of assets. This method is used primarily to display UI for batch checkin comments.

Parameters
assetListis a list of UIDRefs for bound IManageableAssets.
serviceIDspecifies the IAMUIService service identifier.
Returns
a valid pointer to the first IAMUIServiceProvider found that can handle the list. Returns nil if no UI service provider can be found that offers the service.
virtual bool16 IAMSPManager::IsAuthenticationUIEnabled () const
pure virtual

INTERNAL USE ONLY. This method tests if authentication UI is enabled.

Returns
kTrue if authentication UI is enable; kFalse otherwise.
virtual IAMServiceProvider* IAMSPManager::QueryServiceProvider (const IDFilefile)
pure virtual

This method retrieves the IAMServiceProvider for a file.

Parameters
fileis an IDFile with a valid path to an existing asset.
Returns
a pointer to the IAMServiceProvider that recognizes the file.
virtual void IAMSPManager::ShowAllWarningDialogs ()
pure virtual

This method notifies the underlying asset management systems that warning dialogs are allowed.

virtual ErrorCode IAMSPManager::UnbindAsset (IManageableAssetpAsset)
pure virtual

The UnbindAsset method removes asset management components that are bound to an asset. Before destroying any IManageableAsset instance, call this method if the instance was previously bound using BindAsset(). Failure to call UnbindAsset() for a bound IManageableAsset may result in unreleased resources when a document is closed.

Parameters
pAssetis a valid pointer to an IManageableAsset interface on a model object boss.
Returns
kSuccess if the asset was unbound successfully; otherwise returns a failure ErrorCode.
See Also
BindAsset.
IManageableAsset.