Derivatives of RestService
Derivatives of RestService interface facilitates creation of RESTful implementation of standard services.
Simple search (simple-search
)
simple-search
service:com.hcl.unica.system.integration.service.search.RestSearchService
The
com.example.service.rest.SimpleSearchService
class in asset-integration-starter project is a quick starter implementation for RESTfulsimple-search
service. Its parent iscom.hcl.unica.system.integration.service.search.RestSearchService
class.The
RestSearchService
class has a type parameter RS, which represents the type of response (post deserialization) received from the remote REST API. In this case it isSimpleSearchResponse
class defined inside theasset-integration-starter
project.RestSearchService
class implementsRestService
interface and defines theSearchRequest
class as the type argument RQ forRestService
. Thus, the object ofSearchRequest
becomes input to all thesimple-search
services (same input is used for Functional counterpart of simple-search as well).SearchRequest
class is part of the Content Integration SDK.In addition to defining the input type for the
simple-search
service,RestSearchService
class also overrides thetransformResponse
method and defines return value of this method to be ofContentPage
type.ContentPage
is also part of the Content Integration SDK and encapsulates the search result and associated pagination details.The plugin must extend its
simple-search
implementation from the servicecom.hcl.unica.system.integration.service.search.RestSearchService
to be recognized as asimple-search
service by the Content Integration Framework (Functional counterpart, discussed later, is also a valid choice to extend from, for thesimple-search
services implemented using the Functional approach).RestSearchService
extends fromcom.hcl.unica.system.integration.service.search .AbstractSearchService
abstract class.We recommend looking at
com.aem.service.AemSimpleSearchService
class from theaem-integration
project to know more about how theSearchRequest
class and theContentPage
class are used during service implementation.Adhering to the contract of
Presentable
interface while populating list of contents inContentPage
is a crucial part of this service implementation.Presentable
interface is covered in more detail in subsequent section.com.hcl.unica.system.integration.service.search.AbstractSearchService
This is a common base class for RESTful as well as Functional
simple-search
implementations. So, the details of this class also apply to the Functional implementation ofsimple-search
.This class defines the
com.hcl.unica.system.integration.service.gateway.SimpleSearchServiceGateway
interface as the service gateway for thesimple-search
service. A closer look at this interface tells us that thesimple-search
takes theSearchRequest
object and returns theContentPage
object.In addition to defining the service interface forsimple-search
, it introduces one more method for thesimple-search
service, namedgetSupportedContentTypes
. Everysimple-search
implementation can optionally override and implement this method. Please note that this method is verysimple-search
specific and has nothing to do with other standard and custom services. The signature of this method is as follows:public Map<String, String> getSupportedContentTypes();
Implementation of this method returns a
Map<String, String>
representing the supported categories of contents that can be searched in the target system. There is no specific semantic associated with the entries in this Map. It can be any meaningful key-value pair. It acts as a filter for client application during the search operation. As of current implementation of Unica Content Integration, this Map is used to populate entries in a drop down, wherein keys of the Map become values of the options, and values of the Map become display labels for the options. Thus, keys can carry internal names, or identifiers, and values should be readable and meaningful texts. If the user needs to search any specific type of content, he can choose one or more options from the supported types. In such case,simple-search
service receives a set of keys corresponding to the values chosen by the user. Set of keys received from the client application can be obtained fromExecutionContext
object by navigating through thegetRequest
method and then callinggetTypes()
on it. Thesimple-search
implementation deals with these set of keys, as per the target system’s programming interface, and filters the search items accordingly.Standard service parameter - supportedContentTypes
Overriding
getSupportedContentTypes
method is recommended only if the Map needs to be generated dynamically. Content Integration Framework provides an alternate approach to statically define this Map using a standard service parameter calledsupportedContentTypes
, configured underparams
element in the service declaration file. For example, refer thesimple-search
service declaration for AEM and WCM inside <ASSET_PICKER_HOME>/conf/plugin-services.yml file.
List content categories (list-content-categories
)
The following are the specialized interfaces and classes available for the
list-content-categories
service:
-
com.hcl.unica.system.integration.service.content.categories.list. RestContentCategoriesListService
The
com.example.service.rest
. ExampleContentCategoryListingService class in asset-integration-starter project is a quick starter for RESTful list-content-categories service. ExampleContentCategoryListingService class extends from RestContentCategoriesListService class.The
RestContentCategoriesListService
class has a type parameter RS, which represents the type of response (post deserialization) received from the remote REST API. In this case it is specified asList<ContentCategoryDetails>
for the sake of example.RestContentCategoriesListService
class implementsRestService
interface and defines thecom.hcl.unica.system.model.request.content.categories
.ContentCategoryListRequest class as the type argument RQ for RestService. Thus, the object of ContentCategoryListRequest becomes input to all thelist-content-categories
services (same input is used for Functional counterpart of list-content-categories as well).ContentCategoryListRequest
object should be consulted for parent category ID as well as for parent folder ID if categories are hierarchical and/or maintained in folder hierarchy.In addition to defining the input type for the list-content-categories service, RestContentCategoriesListService class also overrides the transformResponse method and mandates the return value of this method to be an object of
List<ContentCategory>
type.ContentCategory
class is part of Content Integration SDK.The plugin must extend the implementation of list-content-categories service from com.hcl.unica.system.integration.service.content.categories.list. RestContentCategoriesListService class to be recognized as a valid list-content-categories service by the Content Integration Framework (Functional counterpart, discussed later, is also a valid choice to extend from).
RestContentCategoriesListService
extends from
.com.hcl.unica.system.integration.service.content.categories.list.AbstractContentCategoriesListService class
-
com.hcl.unica.system.integration.service.content.categories.list.AbstractContentCategoriesListService
This is a common base class for
RESTful
as well as Functional implementations oflist-content-categories
service. So, the details covered herein applies to Functional version oflist-content-categories
as well.This class defines the
com.hcl.unica.system.integration.service.gateway.ContentCategoriesListServiceGateway
interface as the service gateway for thelist-content-categories
service. This interface extends fromcom.hcl.unica.system.integration.service.gateway
.ServiceGateway
interface and mandates theContentCategoryListRequest & List<ContentCategory>
objects to be the input and output types for thelist-content-categories
service.
List folders (list-folders
)
The following are the specialized interfaces and classes available for the
list-folders
service:
com.hcl.unica.system.integration.service.folder.list.RestFolderListService
The
com.aem.service.AemFolderListService
class inaem-integration
project is a reference implementation for RESTful list-folders service.AemFolderListService
class extends fromRestFolderListService
class.The
RestFolderListService
class has a type parameter RS, which represents the type of response (post deserialization) received from the remote REST API. In this case it isSimpleSearchResponse
class defined inside theaem-integration
project.RestFolderListService
class implementsRestService
interface and defines thecom.hcl.unica.system.model.request.folder.list.FolderListRequest
class as the type argument RQ forRestService
. Thus, the object ofFolderListRequest
becomes input to all thelist-folders
services (same input is used for Functional counterpart oflist-folders
as well).In addition to defining the input type for the
list-folders
service,RestFolderListService
class also overrides thetransformResponse
method and mandates the return value of this method to be an object ofList<Folder>
type. Folder is a standard type defined in Content Integration SDK.The plugin must extend the implementation of
list-folders
service fromcom.hcl.unica.system.integration.service.folder.list.RestFolderListService
class to be recognized as a valid list-folders service by the Content Integration Framework (Functional counterpart, discussed later, is also a valid choice to extend from).RestFolderListService
extends fromcom.hcl.unica.system.integration.service.folder.list.AbstractFolderListService
class.com.hcl.unica.system.integration.service.folder.list. AbstractFolderListService
This is a common base class for RESTful as well as Functional implementations of
list-folders
service. So, the details covered herein applies to Functional version oflist-folders
as well.This class defines the
com.hcl.unica.system.integration.service.gateway.FolderListServiceGateway
interface as the service gateway for thelist-folders
service. This interface extends fromcom.hcl.unica.system.integration.service.gateway.ServiceGateway
interface and mandates theFolderListRequest
andList<Folder>
objects to be the input and output types for thelist-folders
service.
List category folders (list-category-folders
)
The specialized types used for implementing list-category-folders are exactly same as the ones used for list-folders.
List contents (list-contents
)
The following are the specialized interfaces and classes available for the list-contents service:
com.hcl.unica.system.integration.service.content.list.RestContentListService
The
com.aem.service.AemContentListServiceclass
inaem-integration
project is a reference implementation for RESTfullist-contents
service.AemContentListServiceclass
class extends fromRestContentListService
class.The
RestContentListService
class has a type parameter RS, which represents the type of response (post deserialization) received from the remote REST API. In this case it isSimpleSearchResponse
class defined inside theaem-integration
project.RestContentListService
class implementsRestService
interface and defines thecom.hcl.unica.system.model.request.content.list.ContentListRequest
class as the type argument RQ forRestService
. Thus, the object ofContentListRequest
becomes input to all thelist-contents
services (same input is used for Functional counterpart oflist-contents
as well).In addition to defining the input type for the
list-contents
service,RestContentListService
class also overrides thetransformResponse
method and mandates the return value of this method to be an object ofContentPage
type. This return type is same as the one used forsimple-search
service.ContentPage
is a standard type defined in Content Integration SDK.The plugin must extend the implementation of
list-contents
service fromcom.hcl.unica.system.integration.service.content.list.RestContentListService
class to be recognized as a validlist-contents
service by the Content Integration Framework (Functional counterpart, discussed later, is also a valid choice to extend from).RestContentListService
extends fromcom.hcl.unica.system.integration.service.content.list.AbstractContentListService
class.com.hcl.unica.system.integration.service.content.list.AbstractContentListService
This is a common base class for RESTful as well as Functional implementations of
list-contents
service. So, the details covered herein applies to Functional version oflist-contents
as well.This class defines the
com.hcl.unica.system.integration.service.gateway.ContentListServiceGateway
interface as the service gateway for thelist-contents
service. This interface extends fromcom.hcl.unica.system.integration.service.gateway.ServiceGateway
interface and mandates theContentListRequest
andContentPage
objects to be the input and output types for thelist-contents
service.
Get content details (get-content-details
)
The following are the specialized interfaces and classes available for the get-content-details service:
com.hcl.unica.system.integration.service.content.details.RestContentDetailsService
The
com.aem.service.AemObjectDetailsService
class inaem-integration
project is a reference implementation for RESTfulget-content-details
service.AemObjectDetailsService
class extends fromRestContentDetailsService
class.The
RestContentDetailsService
class has a type parameter RS, which represents the type of response (post deserialization) received from the remote REST API. In this case it isSimpleSearchResponse
class defined inside theaem-integration
project.RestContentDetailsService
class implementsRestService
interface and defines thecom.hcl.unica.system.model.request.content.details.ContentDetailsRequest
class as the type argument RQ forRestService
. Thus, the object ofContentDetailsRequest
becomes input to all theget-content-details
services (same input is used for Functional counterpart ofget-content-details
as well).In addition to defining the input type for the
get-content-details
service,RestContentDetailsService
class also overrides thetransformResponse
method and mandates the return value of this method to be an object of Presentable type.The plugin must extend the implementation of
get-content-details
service fromcom.hcl.unica.system.integration.service.content.details.RestContentDetailsService
class to be recognized as a validget-content-details
service by the Content Integration Framework (Functional counterpart, discussed later, is also a valid choice to extend from).RestContentDetailsService
extends from thecom.hcl.unica.system.integration.service.content.details.AbstractContentDetailsService
class.com.hcl.unica.system.integration.service.content.details.AbstractContentDetailsService
This is a common base class for RESTful as well as Functional implementations of
get-content-details
service. So, the details covered herein applies to Functional version ofget-content-details
as well.This class defines the
com.hcl.unica.system.integration.service.gateway.ContentDetailsServiceGateway
interface as the service gateway for theget-content-details
service.ServiceGateways
are the means to programmatically define input and output types of the service and facilitate invocation of the services. A closer look at this interface tells us that theget-content-details
service accepts theContentDetailsRequest
object and returns a Presentable object.
Get cognitive analysis (get-cognitive-analysis)
The following are the specialized interfaces and classes available for the get-cognitive-analysis service:
com.hcl.unica.system.integration.service.cognitive.analysis.RestCognitiveAnalysisService
The
com.example.service.rest.ExampleCognitiveAnalysisService
inasset-integration-starter
project is a quick starter implementation for RESTfulget-cognitive-analysis
service.ExampleCognitiveAnalysisService
in class extends fromRestCognitiveAnalysisService
class.The
RestCognitiveAnalysisService
class has a type parameter RS, which represents the type of response (post deserialization) received from the remote REST API. In this case it isCognitiveDetails
class defined inside theasset-integration-starter
project.RestCognitiveAnalysisService
class implementsRestService
interface and defines thecom.hcl.unica.system.model.request.cognitive.analysis.CognitiveAnalysisRequest
class as the type argument RQ forRestService
. Thus, the object ofCognitiveAnalysisRequest
becomes input to all theget-cognitive-analysis
services (same input is used for Functional counterpart as well).In addition to defining the input type for the
get-cognitive-analysis
service,RestCognitiveAnalysisService
class also overrides thetransformResponse
method and mandates the return value of this method to be an object ofcom.hcl.unica.system.model.response.cognitive.analysis.CognitiveAnalysis
type.CognitiveAnalysis
is a standard type defined in Content Integration SDK.The plugin must extend the implementation of
get-cognitive-analysis
service fromcom.hcl.unica.system.integration.service.cognitive.analysis.RestCognitiveAnalysisService
class to be recognized as a validget-cognitive-analysis
service by the Content Integration Framework (Functional counterpart, discussed later, is also a valid choice to extend from).RestCognitiveAnalysisService
extends fromcom.hcl.unica.system.integration.service.cognitive.analysis.AbstractCognitiveAnalysisService
class.com.hcl.unica.system.integration.service.cognitive.analysis.AbstractCognitiveAnalysisService
This is a common base class for RESTful as well as Functional implementations of
get-cognitive-analysis
service. So, the details covered herein applies to Functional version ofget-cognitive-analysis
as well.This class defines the
com.hcl.unica.system.integration.service.gateway.CognitiveAnalysisServiceGateway
interface as the service gateway for theget-cognitive-analysis
service. This interface extends fromcom.hcl.unica.system.integration.service.gateway.ServiceGateway
interface and mandates theCognitiveAnalysisRequest
andCognitiveAnalysis
objects to be the input and output types for theget-cognitive-analysis
service.
Object extension service
com.hcl.unica.system.integration.service.object.extension.RestObjectExtensionService
The
com.example.service.rest.ExampleObjectExtensionService
in asset-integration-starter project is a quick starter implementation for RESTful object extension service.ExampleObjectExtensionService
class extends fromRestObjectExtensionService
class.The
RestObjectExtensionService
class has a type parameter RS, which represents the type of response (post deserialization) received from the remote REST API. In this case, it is CognitiveDetails class defined inside theasset-integration-starter
project.RestObjectExtensionService
class implementsRestService
interface and defines thecom.hcl.unica.system.model.request.object.extension.ObjectExtensionRequest
class as the type argument RQ forRestService
. Thus, the object ofObjectExtensionRequest
becomes input to object extension services (same input is used for Functional counterpart as well).ObjectExtensionRequest
is discussed in subsequent section.In addition to defining the input type for object extension service,
RestObjectExtensionService
class also overrides thetransformResponse
method and allows returning any type of object.The plugin must extend the implementation of object extension service from
com. hcl.unica.system.integration.service.object.extension.RestObjectExtensionService
class to be recognized as a valid object extension service by the Content Integration Framework (Functional counterpart, discussed later, is also a valid choice to extend from).RestObjectExtensionService
extends fromcom.hcl.unica.system.integration.service.object.extension.AbstractObjectExtensionService
class.com.hcl.unica.system.model.request.object.extension.ObjectExtensionRequest
The
ObjectExtensionRequest
provides and API to retrieve values of request attributes. The core principle of object extension service is to accept desired request attributes, perform designated operation and optionally return with a response object. Request attribute values are obtained from the object whose capabilities need to be extended by using the object extension service being implemented. Implementation of object extension service must be request object agnostic. It is the responsibility of Content Integration Framework to extract request attributes from the object to be extended and supply it to the object extension service by means ofObjectExtensionRequest
. Thus, object extension service must be able to extend the capability of any object if the object being extended contains the required request attributes for the object extension service.ObjectExtensionRequest
provides following methods for obtaining request attribute values –Collection<AttributeValue> getAttributeValues()
– This method returns a collection of all request attribute values.Attribute values are wrapped inside
AttributeValue
object, which provides API for reading the value of attribute. It provides a convenience method, as(Class<T> type), for obtaining type cast value of the attribute. Likewise,getValue()
method can be used to read the uncast value.Furthermore,
AttributeValue
class providesgetAttributeSchema()
method to obtain the meta information about respective attribute.getAttributeSchema()
returns an object ofAttributeSchema
containing the required meta information about attribute. The most important methods inAttributeSchema
aregetType()
&getFormat()
. These methods can be consulted to check if the attribute is of desired type. As of 12.1.1 release of Content Integration Framework, object extension service may receive values for the attributes which are not of required type. Hence, extension service must consult the type & format of the attribute before using its value. Service implementation must filter the required attribute values by itself. Refer to thebuildRequest
method implementation incom.example.service.rest.ExampleObjectExtensionService
to learn how this can be achieved. This example implementation tries to extract first URL & first Text attribute from the request.Map<String, AttributeValue> getAttributes()
- From release 12.1.2 onward, request attributes of object extension service can also be mapped to source object’s attributes. get-object-schema service must be enhanced in such case to generate schema for request object. Following standard service parameter must be set to true if request attribute mapping is desired for the given object extension service. If this parameter is missing, it is assumed to be false by default. Likewise, requirement of response attribute mapping can also be indicated using attributeMappingSupport | response parameter. By default, Content Integration Framework assumes value for response to be true.params: attributeMappingSupport: request: true response: true
getAttributes()
method returns map of attribute values, wherein values are organized by respective attribute identifiers. The Map object returned by this method is useful for retrieving attribute value using its identifier (as used in object schema).Object extension service can override void
validateRequest(ExecutionContext<ObjectExtensionRequest> executionContext
) method to probe request attributes before performing core operation.InvalidServiceRequestException
can be raised If desired attributes are not found in theObjectExtensionRequest
. Refer to the Validation supportboolean isStronglyBound()
– Object extension services written prior to 12.1.2 may still receive unmapped requests if user hasn’t changed the request mapping for such services. This method can be consulted to check if request object attribute mapping exists for the given execution request. This method returns true if object extension service does have request object attribute mapping, false otherwise. If this method returns true, service can look for its request object attributes by their identifiers in the Map returned bygetAttributes()
method. Else, it must find out required type of attributes the wayExampleObjectExtensionService
does inasset-integration-starter
project.
com.hcl.unica.system.integration.service.object.extension.AbstractObjectExtensionService
This is a common base class for RESTful as well as Functional implementations of object extension service. So, the details covered herein applies to Functional version as well.
This class defines the
com.hcl.unica.system.integration.service.gateway.ObjectExtensionServiceGateway
interface as the service gateway for object extension service. This interface extends fromcom.hcl.unica.system.integration.service.gateway.ServiceGateway
interface and mandates theObjectExtensionRequest
to be the input type for object extension service. Object extension service can return any type of object.Service title & summary
Object extension services are listed as Custom actions in Centralized Offer Management. The title/label for object extension service is derived from I18n resource bundles using the key same as service name declared for respective object extension service. Likewise, a brief summary is also shown for the service to help users working with it. Summary is maintained in I18n resource bundles using
{service-name}.summary
key. For example, checkexample-object-extension-service
&example-object-extension-service.summary
keys inasset-integration-starter\src\main\resources\i18n\Foo_Messages.properties
file.
Collaboration services
- Channel creation service
(
collaboration.create-channel
)- The following are the specialized interfaces and classes available for the collaboration.create-channel service:-
com.hcl.unica.system.integration.service.collab.channel.create.RestChannelCreationService
–The
com.example.service.rest.collaboration
.ExampleChannelCreationService
inasset-integration-starter
project is a quick starter implementation for RESTfulcollaboration.create-channel
service.ExampleChannelCreationService
class extends fromRestChannelCreationService
class.The
RestChannelCreationService
class has a type parameter RS, which represents the type of response (post deserialization) received from the remote REST API. In this case it is JsonNode class defined inside theExampleChannelCreationService
class.RestChannelCreationService
class implementsRestService
interface and defines thecom.hcl.unica.system.model.request.collab.channel.CollaborationChannelCreationRequest
class as the type argument RQ forRestService
. Thus, the object ofCollaborationChannelCreationRequest
becomes input to all thecollaboration.create-channel
services (same input is used for Functional counterpart as well).CollaborationChannelCreationRequest
carries the name of channel to be created.In addition to defining the input type for the
collaboration.create-channel
service,RestChannelCreationService
class also overrides thetransformResponse
method and mandates the return value of this method to be an object ofcom.hcl.unica.system.model.response.collab.channel.CollaborationChannelDetails
type.CollaborationChannelDetails
must carry the identifier of the newly created channel in addition to its name.Plugin must extend the implementation of
collaboration.create-channel
service fromRestChannelCreationService
class to be recognized as a valid collaboration.create-channel service by the Content Integration Framework (Functional counterpart, discussed later, is also a valid choice to extend from).
-
- Channel modification service
(
collaboration.update-channel
)The following are the specialized interfaces and classes available for thecollaboration.update-channel
service:-
com.hcl.unica.system.integration.service.collab.channel.update.RestChannelModificationService
–The
com.example.service.rest.collaboration
.ExampleChannelModificationService
inasset-integration-starter
project is a quick starter implementation for RESTfulcollaboration.update-channel
service.ExampleChannelModificationService
class extends fromRestChannelModificationService
class.The
RestChannelModificationService
class has a type parameter RS, which represents the type of response (post deserialization) received from the remote REST API. In this case it is JsonNode class defined inside theExampleChannelModificationService
class.RestChannelModificationService
class implements RestService interface and defines thecom.hcl.unica.system.model.request.collab.channel.CollaborationChannelModificationRequest
class as the type argument RQ for RestService. Thus, the object ofCollaborationChannelModificationRequest
becomes input to all the collaboration.update-channel services (same input is used for Functional counterpart as well).CollaborationChannelModificationRequest
carries the identifier of the channel to be updated along with the new channel name.In addition to defining the input type for the
collaboration.update-channel
service,RestChannelModificationService
class also overrides thetransformResponse
method and mandates the return value of this method to be an object ofcom.hcl.unica.system.model.response.collab.channel.CollaborationChannelDetails
type.CollaborationChannelDetails
must carry the identifier & name of the updated channel.Plugin must extend the implementation of
collaboration.update-channel
service fromRestChannelModificationService
class to be recognized as a validcollaboration.update-channel
service by the Content Integration Framework (Functional counterpart, discussed later, is also a valid choice to extend from).
-
- Channel details service
(
collaboration.get-channel-details
)The following are the specialized interfaces and classes available for the collaboration.get-channel-details service:-
com.hcl.unica.system.integration.service.collab.channel.details.RestChannelDetailsService
–The
com.example.service.rest.collaboration.ExampleChannelDetailsService
inasset-integration-starter
project is a quick starter implementation for RESTfulcollaboration.get-channel-details
service.ExampleChannelDetailsService
class extends fromRestChannelDetailsService
class.The
RestChannelDetailsService
class has a type parameter RS, which represents the type of response (post deserialization) received from the remote REST API. In this case it is JsonNode class defined inside theExampleChannelDetailsService
class.RestChannelDetailsService
class implementsRestService
interface and defines thecom.hcl.unica.system.model.request.collab.channel.CollaborationChannelDetailsRequest
class as the type argument RQ forRestService
. Thus, the object ofCollaborationChannelDetailsRequest
becomes input to all thecollaboration.get-channel-details
services (same input is used for Functional counterpart as well).CollaborationChannelDetailsRequest
carries the identifier of the channel to be retrieved.In addition to defining the input type for the
collaboration.get-channel-details
service,RestChannelDetailsService
class also overrides thetransformResponse
method and mandates the return value of this method to be an object ofjava.util.Optional
ofcom.hcl.unica.system.model.response.collab.channel.CollaborationChannelDetails
type.CollaborationChannelDetails
must carry the identifier & name of the requested channel. If requested channel is not found, this method can returnOptional.empty()
.Plugin must extend the implementation of
collaboration.get-channel-details
service fromRestChannelDetailsService
class to be recognized as a validcollaboration.get-channel-details
service by the Content Integration Framework (Functional counterpart, discussed later, is also a valid choice to extend from).
-
- Member addition service
(
collaboration.add-members-to-channel
)The following are the specialized interfaces and classes available for thecollaboration.add-members-to-channel
service:-
com.hcl.unica.system.integration.service.collab.channel.member.RestChannelMemberAdditionService
–The
com.example.service.rest.collaboration.ExampleMemberAdditionService
inasset-integration-starter
project is a quick starter implementation for RESTfulcollaboration.add-members-to-channel
service.ExampleMemberAdditionService
class extends fromRestChannelMemberAdditionService
class.The
RestChannelMemberAdditionService
class has a type parameter RS, which represents the type of response (post deserialization) received from the remote REST API. In this case it is JsonNode class defined inside theExampleMemberAdditionService
class.RestChannelMemberAdditionService
class implementsRestService
interface and defines thecom.hcl.unica.system.model.request.collab.channel.CollaborationChannelMembers
class as the type argument RQ for RestService. Thus, the object ofCollaborationChannelMembers
becomes input to all thecollaboration.add-members-to-channel
services (same input is used for Functional counterpart as well).CollaborationChannelMembers
carries the channel identifier & list ofcom.hcl.unica.system.model.request.collab.channel.CollaborationChannelMember
objects. EachCollaborationChannelMember
object carries identifier of the user/member to be added to the channel corresponding to the supplied channel identifier.In addition to defining the input type for the
collaboration.add-members-to-channel
service,RestChannelMemberAdditionService
class also overrides thetransformResponse
method and mandates the return value of this method to be an object ofcom.hcl.unica.system.model.response.collab.channel.ChannelMembersAdditionStatus
type.ChannelMembersAdditionStatus
must carry the list ofcom.hcl.unica.system.model.response.collab.channel.ChannelMemberAdditionStatus
objects containing addition status for each supplied member. ThememberId
property inChannelMemberAdditionStatus
object should carry the identifier of member/user the status is being reported for. The error property can be used to convey error message associated with specified member’s addition operation. Plugin can choose to send localized error using an API provided byExecutionContext
. The ok property must be set to true if member is successfully added to the channel, or to false otherwise. Reason property should be used to convey appropriate failure reason. The entire list of member addition status should be set on the status property ofChannelMembersAdditionStatus
object to be returned fromtransformResponse
method.Plugin must extend the implementation of
collaboration.add-members-to-channel
service fromRestChannelMemberAdditionService
class to be recognized as a validcollaboration.add-members-to-channel
service by the Content Integration Framework (Functional counterpart, discussed later, is also a valid choice to extend from).
-
- Member removal service
(
collaboration.remove-members-from-channel
)The following are the specialized interfaces and classes available for thecollaboration.remove-members-from-channel
service:-
com.hcl.unica.system.integration.service.collab.channel.member.RestChannelMemberRemovalService
–The
com.example.service.rest.collaboration.ExampleMemberRemovalService
inasset-integration-starter
project is a quick starter implementation for RESTfulcollaboration.remove-members-from-channel
service.ExampleMemberRemovalService
class extends fromRestChannelMemberRemovalService
class.The
RestChannelMemberRemovalService
class has a type parameter RS, which represents the type of response (post deserialization) received from the remote REST API. In this case it isJsonNode
class defined inside theExampleMemberRemovalService
class.RestChannelMemberRemovalService
class implementsRestService
interface and defines thecom.hcl.unica.system.model.request.collab.channel.CollaborationChannelMembers
class as the type argument RQ forRestService
. Thus, the object ofCollaborationChannelMembers
becomes input to all thecollaboration.remove-members-from-channel
services (same input is used for Functional counterpart as well).CollaborationChannelMembers
carries the channel identifier & list ofcom.hcl.unica.system.model.request.collab.channel.CollaborationChannelMember
objects. EachCollaborationChannelMember
object carries identifier of the user/member to be removed from the channel corresponding to the supplied channel identifier.In addition to defining the input type for the
collaboration.remove-members-from-channel
service,RestChannelMemberRemovalService
class also overrides thetransformResponse
method and mandates the return value of this method to be an object ofcom.hcl.unica.system.model.response.collab.channel.ChannelMembersRemovalStatus
type.ChannelMembersRemovalStatus
must carry the list ofcom.hcl.unica.system.model.response.collab.channel.ChannelMemberRemovalStatus
objects containing removal status for each supplied member. The memberId property inChannelMemberRemovalStatus
object should carry the identifier of member/user the status is being reported for. The error property can be used to convey error message associated with specified member’s removal operation. Plugin can choose to send localized error using an API provided byExecutionContext
. The ok property must be set to true if member is successfully removed from the channel, or to false otherwise. reason property should be used to convey appropriate failure reason. The entire list of member addition status should be set on the status property ofChannelMembersRemovalStatus
object to be returned fromtransformResponse
method.Plugin must extend the implementation of
collaboration.remove-members-from-channel
service fromRestChannelMemberRemovalService
class to be recognized as a validcollaboration.remove-members-from-channel
service by the Content Integration Framework (Functional counterpart, discussed later, is also a valid choice to extend from).
-
- Message posting service
(
collaboration.post-message-to-channel
)The following are the specialized interfaces and classes available for thecollaboration.post-message-to-channel
service:-
com.hcl.unica.system.integration.service.collab.channel.message.RestMessagePostingService
–The
com.example.service.rest.collaboration.ExampleMessagePostingService
inasset-integration-starter
project is a quick starter implementation for RESTfulcollaboration.post-message-to-channel
service.ExampleMessagePostingService
class extends fromRestMessagePostingService
class.The
RestMessagePostingService
class has a type parameter RS, which represents the type of response (post deserialization) received from the remote REST API. In this case it isJsonNode
class defined inside theExampleMessagePostingService
class.RestMessagePostingService
class implementsRestService
interface and defines thecom.hcl.unica.system.model.request.collab.channel.GroupMessage
class as the type argument RQ forRestService
. Thus, the object ofGroupMessage
becomes input to all thecollaboration.post-message-to-channel
services (same input is used for Functional counterpart as well).GroupMessage
carries the identifier of target channel & the message itself.In addition to defining the input type for the
collaboration.post-message-to-channel
service,RestMessagePostingService
class also overrides thetransformResponse
method and mandates the return value of this method to be an object of sameGroupMessage
type. The responseGroupMessage
object should carry the identifier of newly posted message.Plugin must extend the implementation of
collaboration.post-message-to-channel
service fromRestMessagePostingService
class to be recognized as a validcollaboration.post-message-to-channel
service by the Content Integration Framework (Functional counterpart, discussed later, is also a valid choice to extend from).
-