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.DefaultWebResourceLoaderService
    The com.example.service.rest.ResourceLoaderService class in asset-integration-starter project is a quick starter implementation for the resource-loader service and extends from the following class:
    com.hcl.unica.cms.integration.service.resourceloader
    .DefaultWebResourceLoaderService

    DefaultWebResourceLoaderService class is the default implementation of resource-loader service provided by the Asset Picker SDK. If the plugin does not implement its own resource-loader service, Asset Picker falls back on this default implementation. Default implementation of resource-loader provided 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-loader implementation which slightly modifies the standard HTTP GET, we recommend extending from the DefaultWebResourceLoaderService class.

  • com.hcl.unica.cms.integration.service.resourceloader.HttpWebResourceLoaderService

    The DefaultWebResourceLoaderService class discussed earlier extends from the HttpWebResourceLoaderService abstract class. This class defines the input type and the type of HTTP response received from target URL for resource-loader service as com.hcl.unica.cms.model.request.resourceloader.ResourceRequest and byte[] respectively. ResourceRequest class encapsulates the relative resource URL and instance identifier (Instance identifier is exactly same as the systemId used everywhere in Asset Picker). Similarly, resource-loader works with a byte array when the content from remote HTTP URL is successfully read.

    If the plugin does not extend its resource-loader implementation from the DefaultWebResourceLoaderService class, it must at least extend from HttpWebResourceLoaderService class in order to be recognized as a resource-loader service by Asset Picker. (Functional counterpart is also a valid choice to extend from.)

  • com.hcl.unica.cms.integration.service.resourceloader.AbstractWebResourceLoaderService
    The HttpWebResourceLoaderService class discussed in previous point extends from AbstractWebResourceLoaderService abstract class. This class defines the following service gateway interface for the resource-loader service:
    com.hcl.unica.cms.integration.service.gateway
    .ResourceLoaderServiceGateway

    To know the role of service gateways in service invocation, please see Service invocation. ResourceLoaderServiceGateway interface defines ResourceRequest and WebResource<?> as input and output types for resource-loader service. The com.hcl.unica.cms.model.response.resourceloader.WebResource class is just a wrapper for HTTP response headers, body & cookies received from remote URL.