loading table of contents...

8.1.8. External Library

[Note]Note

Feature is only supported in e-Commerce Blueprint.

The external library previews data that is not located in the content repository. By using a separate REST extension, any data can be displayed by writing a provider class for it. Currently the external library supports RSS feeds and access to the video platform 'Kaltura'. The user can create new content using the external library by using the New Content action. Depending on the data type, a new document is created and initialized with data of the selected library item.

External library showing RSS feed items

Figure 8.12. External library showing RSS feed items


How to configure the existing RSS source

The external sources that are available in the external library are configured via properties for each site in a settings document and in a global configuration settings document. The path information is configured for the class ExternalLibraryResource in the file component-external-library-common-rest-extension.xml. The name of the settings document that is located in these settings folders is ExternalLibrary.

To configure different source entries for a specific site, open the ExternalLibrary settings document using CoreMedia Studio and use the Struct editor to edit the configuration. Additional RSS sources can be added by cloning the corresponding <Struct> element and adept the URL of the feed. It is import that each configuration entry has a unique index value.

<Struct xmlns="http://www.coremedia.com/2008/struct" xmlns:xlink="http://www.w3.org/1999/xlink">
  <StructListProperty Name="externalLibraries">
    <Struct>
      <IntProperty Name="index">1</IntProperty>
        <StringProperty Name="name">RSS Feed - CNN.com - Top Stories</StringProperty>
        <StringProperty Name="dataUrl">http://rss.cnn.com/rss/edition.rss</StringProperty>
        <StringProperty Name="providerId">rssProvider</StringProperty>
        <StringProperty Name="previewType">html</StringProperty>
        <StringProperty Name="contentType">CMArticle</StringProperty>
        <BooleanProperty Name="markAsRead">true</BooleanProperty>
      </Struct>
    </StructListProperty>
  </Struct>

For a detailed description about the elements and attributes see table below.

PropertyDescription
indexThe unique id entity of the entry as a numeric value.
nameThe display name of the source, this name will be shown in the source combo box of the external library.
dataUrlThe data URL of the external source. It can be a HTTP URL or a database URL. It's up to the corresponding provider implementation to interpret this value.
providerIdThe provider ID must match the Spring bean ID value
previewTypeDescribes the type of content to displayed, possible values are 'html' and 'video'. If required, the preview panel of the external library can be extended with additional view types.
contentTypeThe type of document that should be created when the "New document" button of the external library preview toolbar is pressed.
markAsReadIf true, the external library will remember if the user has read the entry.

Table 8.2. Database Settings


How to implement an additional external data source

Additional data providers for the external library can be implemented using the development workspace extensions mechanism or using the existing workspace structure located in the module external-library-rest-extension. The following steps describe how to create and configure a new extension as a submodule of external-library-rest-extension.

  • Open the pom.xml of the external-library-rest-extension

  • In the module section, create a new module element with the name of the new extension, such as sample-extension

  • Create the corresponding Maven submodule, ensure that the pom.xml file of the sample extension is configured the same way like the RSS or video extension's pom.xml.

  • In the sample module create a new class that implements the interface ExternalLibraryProvider. Have a look on the existing provider implementation for help.

  • Create the Spring configuration file component-sample-extension.xml

  • Configure the provider in the XML file, for example like this:

    <bean id="sampleProvider" class=" com.coremedia.blueprint.studio.externallibraryproviders.SampleProvider" />
  • Add the new module as a dependency to the Studio web application module.

  • Open the (site specific) settings content type ExternalLibrary in Studio and add the configuration entry for your library data provider. Ensure that the providerId value matches the bean ID of your provider class, in this case 'sampleProvider'. Use the preview type html and content type CMArticle for the configuration. It will fit most of your needs.

  • Rebuild and restart the Studio web application and it's dependencies.