close

Filter

loading table of contents...

Studio Developer Manual / Version 2101

Table Of Contents

7.24.2.1 Basic Setup

The following part explains which interfaces have to be implemented in your studio-lib extension. The Error handling and its localization for the client is explained in Section 7.24.2.3, “Error handling”. How to configure your Adapter bindings is explained in Section 7.24.2.4, “Keywords Adapter Configuration”.

<YOUR_ADAPTER_NAME>Settings

First it is necessary to provide a Settings interface, which has getters for the configurable data of your Adapter. Settings interfaces are used to map Adapter specific connection parameters (like credentials) to Java code. You only have to declare the Settings interface according to the data your Adapter needs. Implementations are generated automatically, backed with the data of your configuration. The getter methods of these interfaces must match the corresponding fields of the settings struct as described in Section 7.24.2.4, “Keywords Adapter Configuration”. The name of the interface is arbitrary, the Settings suffix is just a convention.

com.coremedia.feedbackhub.adapter.FeedbackHubAdapterFactory

An implementation of a FeedbackHubAdapterFactory delivers instances of a FeedbackHubAdapter, that is used for the actual connection to an external system. The id that is returned within the getId method, has to match the factoryId value from your Section 7.24.2.4, “Keywords Adapter Configuration”. In the create method you must return an instance of the specific FeedbackHubAdapter. The method receives the adapter specific settings as parameter. Any errors that occur during the creation of a FeedbackHubAdapter can be thrown as FeedbackHubException (described in Section 7.24.2.3, “Error handling”) if they should result into a specific error message at the client. Any other exceptions result in a general error message at the client.

The factory needs to be available as a Spring bean within the Spring context of the studio-server. Therefore, you also must provide a Spring configuration file that instantiates the FeedbackHubAdapterFactory as Spring Bean (@Bean), so that it can be collected by the Feedback Hub framework.

com.coremedia.feedbackhub.adapter.BlobKeywordsFeedbackHubAdapter

A BlobKeywordsFeedbackHubAdapter delivers a list of KeyWords for a given blob and a locale. The result type of the getKeywords method is java.util.concurrent.CompletionStage. This enables you to implement long running operations, like round trips to external systems, with the stage's asynchronous execution facilities so that no threads are blocked. getKeywords is called, when a user requests keywords for CoreMedia content. It will receive a blob from the content (which is configured in the Section 7.24.2.4, “Keywords Adapter Configuration”) and the locale from the content. Any errors that occur during the calculation of keywords can be thrown as FeedbackHubException (described in Section 7.24.2.3, “Error handling”) if they should result into a specific error message at the client. Any other exceptions will result in a general error message at the client.

com.coremedia.feedbackhub.adapter.FeedbackHubErrorCode

The FeedbackHubErrorCode is part of the error handling, described in Section 7.24.2.3, “Error handling” and needs to be implemented by an enum. The enum stores all error codes for errors that can occur within the specific adapter implementation or its factory. In case of an error the code is transferred to the client where it is shown as an error message in Feedback Hub's window Nagbar.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.