Derivatives of HttpService
Only resource-loader standard service is implemented as an
HttpService as it relates to the standard HTTP GET operation. You can
also use RestService without losing any capability.
Resource loader (resource-loader)
The following are the specialized interfaces and classes available for resource-loader service:
com.hcl.unica.cms.integration.service.resourceloader.DefaultWebResourceLoaderServiceThecom.example.service.rest.ResourceLoaderServiceclass inasset-integration-starterproject is a quick starter implementation for theresource-loaderservice and extends from the following class:com.hcl.unica.cms.integration.service.resourceloader .DefaultWebResourceLoaderServiceDefaultWebResourceLoaderServiceclass is the default implementation ofresource-loaderservice provided by the Asset Picker SDK. If the plugin does not implement its ownresource-loaderservice, Asset Picker falls back on this default implementation. Default implementation ofresource-loaderprovided by Asset Picker SDK simply follows the given resource URL and retrieves the web resource from target system. It encapsulates the standard HTTP GET operation.If the plugin needs to have its own
resource-loaderimplementation which slightly modifies the standard HTTP GET, we recommend extending from theDefaultWebResourceLoaderServiceclass.com.hcl.unica.cms.integration.service.resourceloader.HttpWebResourceLoaderServiceThe
DefaultWebResourceLoaderServiceclass discussed earlier extends from theHttpWebResourceLoaderServiceabstract class. This class defines the input type and the type of HTTP response received from target URL forresource-loaderservice ascom.hcl.unica.cms.model.request.resourceloader.ResourceRequestand byte[] respectively.ResourceRequestclass encapsulates the relative resource URL and instance identifier (Instance identifier is exactly same as thesystemIdused everywhere in Asset Picker). Similarly,resource-loaderworks with a byte array when the content from remote HTTP URL is successfully read.If the plugin does not extend its
resource-loaderimplementation from theDefaultWebResourceLoaderServiceclass, it must at least extend fromHttpWebResourceLoaderServiceclass in order to be recognized as aresource-loaderservice by Asset Picker. (Functional counterpart is also a valid choice to extend from.)com.hcl.unica.cms.integration.service.resourceloader.AbstractWebResourceLoaderServiceTheHttpWebResourceLoaderServiceclass discussed in previous point extends fromAbstractWebResourceLoaderServiceabstract class. This class defines the following service gateway interface for theresource-loaderservice:com.hcl.unica.cms.integration.service.gateway .ResourceLoaderServiceGatewayTo know the role of service gateways in service invocation, please see Service invocation.
ResourceLoaderServiceGateway interface definesResourceRequestandWebResource<?>as input and output types for resource-loader service. Thecom.hcl.unica.cms.model.response.resourceloader.WebResourceclass is just a wrapper for HTTP response headers, body & cookies received from remote URL.