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

#include <IHTTPLinkSubsystemObjectFactory.h>

Inheritance diagram for IHTTPLinkSubsystemObjectFactory:
IPMUnknownCPMUnknown< IHTTPLinkSubsystemObjectFactory >CusHttpLnkLinkResourceFactory

Public Types

enum  { kDefaultIID = IID_IHTTPLINKSUBSYSTEMOBJECTFACTORY }
 

Public Member Functions

virtual void GetSchemes (K2Vector< WideString > &schemes) const =0
 
virtual ILinkResourceHandlerQueryHandler (const URI &uri, IDataBase *db) const =0
 
virtual ILinkResourceStateUpdaterQueryStateUpdater (const URI &uri, IDataBase *db) const =0
 
virtual
IHTTPLinkResourceConnection
QueryHTTPLinkResourceConnection (const URI &uri, IDataBase *db) const =0
 
virtual
IHTTPLinkResourceServerAPIWrapper
QueryHTTPLinkResourceServerAPIWrapper (const URI &uriScheme, IDataBase *db) 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

IHTTPLinkSubsystemObjectFactory is used to implement custom handling of http links through scheme system. For creating a plugin for handling of http links, first define a scheme. Then do following steps:

  1. Include this interface on the http link resource connection provider boss that is registered with the service registry as a kHTTPLinkResourceConnectionProvider. Its GetSchemes should return list of schemes supported by plugin. It will be called when HTTPLinkManager is initialized and schemes will be registered. IHTTPLinkManager will be using query functions defined here for the uri which matches with the schemes provided in GetSchemes.
  2. Implement IHTTPLinkResourceServerAPIWrapper(for details see IHTTPLinkResourceServerAPIWrapper.h). It is mandatory to implement this interface. It deals with high level API interaction with server.
  3. Implement IHTTPLinkResourceConnection(for details see IHTTPLinkResourceConnection.h). It is mandatory to implement this interface. It deals with creating connection with server. It handles responsibilities like login credentials and passing session tokens.

Above mentioned interfaces are mandatory, but there are other interfaces also that can be overriden to extend the functionalities:

  1. IHTTPLinkResourceStateBatchUpdater - If web-api supports batch state updates, this interface can be implemented to alter default implementation
  2. IHTTPLinkResourceServerCache - This should be implemented if want to handle cache by yourself.
  3. IHTTPAssetDownloadManager - Should be implemented if different handling http asset downloads.
See Also
IHTTPLinkResourceServerAPIWrapper
IHTTPLinkResourceConnection
IK2ServiceProvider
IHTTPLinkResourceServerCache
IHTTPLinkResourceStateBatchUpdater

Member Function Documentation

virtual void IHTTPLinkSubsystemObjectFactory::GetSchemes (K2Vector< WideString > & schemes) const
pure virtual

Gets the URI scheme supported by the resource connection.

Parameters
schemes[OUT] all the registered schemes

Implemented in CusHttpLnkLinkResourceFactory.

virtual ILinkResourceHandler* IHTTPLinkSubsystemObjectFactory::QueryHandler (const URIuri,
IDataBasedb 
) const
pure virtual

Returns the link resource handler that will be used by a link resource object to act on an resource whose URI scheme matches one of the supported schemes. Caller assumes responsibility for releasing the returned object.

Parameters
uri[IN] URI of the link resource the handler will be used for.
db[IN] Database that contains the link resource.
Returns
HTTP Link resource handler. \

Implemented in CusHttpLnkLinkResourceFactory.

virtual IHTTPLinkResourceConnection* IHTTPLinkSubsystemObjectFactory::QueryHTTPLinkResourceConnection (const URIuri,
IDataBasedb 
) const
pure virtual

Returns the http link resource connection that will be used by a http links subsystem to interact with the http resource connection whose URI scheme matches one of the supported scheme. Caller assumes responsibility for releasing the returned object.

Parameters
uri[IN] URI of the link resource the handler will be used for.
db[IN] Database that contains the link resource.
Returns
Http Link resource connection. \

Implemented in CusHttpLnkLinkResourceFactory.

virtual IHTTPLinkResourceServerAPIWrapper* IHTTPLinkSubsystemObjectFactory::QueryHTTPLinkResourceServerAPIWrapper (const URIuriScheme,
IDataBasedb 
) const
pure virtual

Returns the http link resource server API wrapper that will be used by a http links subsystem to interact with the http resource server whose URI scheme matches one of the supported scheme. Caller assumes responsibility for releasing the returned object.

Parameters
uri[IN] URI of the link resource the handler will be used for.
db[IN] Database that contains the link resource.
Returns
Http Link resource server API Wrapper. \

Implemented in CusHttpLnkLinkResourceFactory.

virtual ILinkResourceStateUpdater* IHTTPLinkSubsystemObjectFactory::QueryStateUpdater (const URIuri,
IDataBasedb 
) const
pure virtual

Returns the link resource state updater that will be used to obtain and update the state of a link resource whose URI scheme matches one of the supported schemes. Caller assumes responsibility for releasing the returned object.

Parameters
uri[IN] URI of the link resource whose state will be updated.
db[IN] Database that contains the link resource.
Returns
HTTP Link resource state updater. \

Implemented in CusHttpLnkLinkResourceFactory.