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

#include <ILinkResourceStateUpdater.h>

Inheritance diagram for ILinkResourceStateUpdater:
IPMUnknownCPMUnknown< ILinkResourceStateUpdater >CusDtLnkLinkResourceStateUpdaterHTTPAssetLinkResourceStateUpdaterCusHttpLnkLinkResourceStateUpdater

Public Types

enum  { kDefaultIID = IID_ILINKRESOURCESTATEUPDATER }
 

Public Member Functions

virtual ErrorCode UpdateResourceStateSync (const UIDRef &resourceRef, bool bNotify)=0
 
virtual ErrorCode UpdateResourceStateAsync (const UIDRef &resourceRef)=0
 
virtual void CancelUpdateResourceState (const UIDRef &resourceRef)=0
 
virtual void WaitForUpdateResourceStateCompletion (const UIDRef &resourceRef)=0
 
virtual ErrorCode ResolveResource (const UIDRef &resourceRef, const URI &relativeURI, bool bIgnoreStamp)=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

ILinkResourceStateUpdater is used to update the state of an ILinkResource and is specific to the type of a resource as identified by the scheme of the link resource's URI. The state updater is also responsible for resolving the location of a resource that cannot be located utilizing the information in the resource's URI (a missing resource). How both of the above tasks are performed is left completely up to the provider.

To associate a state updater for a specific type of resource, a factory for the type of resource is registered via a link resource provider for the kLinkResourceService. For example, a file based link resource will require a different provider and state updater than a database link resource.

When ILinkManager is called to update the state of an ILinkResource or to resolve the location of a missing resource, the state updater is obtained using the scheme of the resource's URI as a key to find the appropriate provider. If no state updater is found, due to a missing plug-in for instance, the link resource is set to a state of unknown by the manager. Therefore, all resources that have a custom URI must provide a state updater.

See Also
ILinkManager
ILinkResource

Member Function Documentation

virtual void ILinkResourceStateUpdater::CancelUpdateResourceState (const UIDRefresourceRef)
pure virtual

Cancels an asynchronous link resource state update.

Parameters
resourceRef[IN] UIDRef of the link resource to cancel the asynchronous state update for.

Implemented in CusDtLnkLinkResourceStateUpdater, and HTTPAssetLinkResourceStateUpdater.

virtual ErrorCode ILinkResourceStateUpdater::ResolveResource (const UIDRefresourceRef,
const URIrelativeURI,
bool bIgnoreStamp 
)
pure virtual

Synchronous API to automatically find the resource (without user interaction) at new location if it is missing. of the link resource if it is missing.

Parameters
resourceRef[IN] UIDRef of the link resource to resolve.
relativeURI[IN] Relative location of where to start the search. \ For example, this is often the location of the document, and depending upon the protocol of the link may not be utilized.
bIgnoreStamp[IN] Denotes whether to ignore the resource's stamp when looking for potential matches.
Returns
kSuccess if the link resource is successfully resolved, else an error code.

Implemented in CusDtLnkLinkResourceStateUpdater, and HTTPAssetLinkResourceStateUpdater.

virtual ErrorCode ILinkResourceStateUpdater::UpdateResourceStateAsync (const UIDRefresourceRef)
pure virtual

Called to update the state of a link resource synchronously.

Parameters
resourceRef[IN] UIDRef of the link resource to update.
Returns
kSuccess if the state update request was successfully queued, else an error code.

Implemented in CusDtLnkLinkResourceStateUpdater, and HTTPAssetLinkResourceStateUpdater.

virtual ErrorCode ILinkResourceStateUpdater::UpdateResourceStateSync (const UIDRefresourceRef,
bool bNotify 
)
pure virtual

Called to update the state of a link resource synchronously.

Parameters
resourceRef[IN] UIDRef of the link resource to update.
bNotify[IN] Denotes whether to notify when the resource's state is updated.
Returns
kSuccess if the link resource's state is successfully updated, else an error code.

Implemented in CusDtLnkLinkResourceStateUpdater, and HTTPAssetLinkResourceStateUpdater.

virtual void ILinkResourceStateUpdater::WaitForUpdateResourceStateCompletion (const UIDRefresourceRef)
pure virtual

Wait for the asynchronous link resource state update request to get completed.

Parameters
resourceRef[IN] UIDRef of the link resource whose asynchronous request needs to be completed.

Implemented in CusDtLnkLinkResourceStateUpdater, and HTTPAssetLinkResourceStateUpdater.