Configuring the Default Link Header Plug-in
You can use the default link header plug-in to create as many
different link header components as you wish, you just create a
separate .properties
file for each component. You
can call the components whatever you like and place them anywhere in
your chosen configuration layer. It is probably a good idea to place
them in your own subtree. You might, for example, create two
properties files called:
configuration-root/com/myCompany/linkHeaderPlugins/MyFirstLinkHeaderPlugin.properties
configuration-root/com/myCompany/linkHeaderPlugins/MySecondLinkHeaderPlugin.properties
These properties files must contain the following settings:
$class=com.escenic.webservice.spi.DefaultLinkHeaderPlugin vendor=vendor-name version=version-number description=description relation=relation mimeType=mime-type title=plug-in-title uriTemplate=uri-template objectLoader=/io/api/ObjectLoader
where:
- vendor-name
-
Should in most cases be the name (ideally the domain name) of your organisation: for example,
mycompany.com
. - version-number
-
A version number. You can use this to keep track of changes to the plug-in configuration.
- description
-
A description of the plug-in configuration, for information only.
- relation
-
A name defining the relation of the content provided by the plug-in to the content displayed in Content Studio. This property is used to determine where the content displayed by the plug-in will be displayed as follows:
http://www.vizrt.com/types/relation/more-info
-
If you specify this value then the plug-in content is displayed in the attributes panel of the content item editor to which it is related. If you define several plug-ins with this relation then a separate section is created for each plug-in. Since attributes panel sections are collapsible this is not a problem.
- Any other value
-
If you specify any other value then the plug-in content is displayed in a research panel.
- mime-type
-
The MIME type of the content that will be displayed in the browser panel, typically
text/html
for HTML content. - title
-
The title of the content provided by the plug-in. It is used as the title of the attribute panel section or research panel to which output is directed.
- uri-template
-
A URI template for the resource to be displayed. For example:
{scheme}://{host}:{port}/{web-service-name}/escenic/content/{articleid}
The items enclosed in braces (
{
and}
) are placeholders, and are replaced at run-time by values that depend on the content editor currently displayed in Content Studio. The URI template may contain any of the following placeholders:{publication}
-
Gets replaced by the name of the currently displayed content item's home publication.
{content-type}
-
Gets replaced by the name of the currently displayed content item's content type.
{source}
-
Gets replaced by the currently displayed content item's
source
property. {sourceid}
-
Gets replaced by the currently displayed content item's
sourceid
property. {articleid}
-
Gets replaced by the currently displayed content item's database ID.
{host}
-
Gets replaced by the host name of the web service.
{scheme}
-
Gets replaced by the scheme of the web service. This will normally be either
http
orhttps
. {port}
-
Gets replaced by the port of the web service.
{context-path}
-
Gets replaced by the context path of the Content Engine web service. By default, the web service's context path is
webservice
, but this name may be replaced by the web server or application server. Using this placeholder ensures that the constructed URI always references the web service correctly.
You can use the placeholders in any way you like to construct URIs that will access the content you want to display in the research panel.
The property file may also contain the following optional settings:
includeContentTypes
-
A comma separated list of content types the plug-in will support. If the property for instance is defined like this
includeContentTypes=news,poll
the plug-in will only add the link header if the content type is either
news
orpoll
excludeContentTypes
-
A comma separated list of content types the plug-in will not support. If the property for instance is defined like this
excludeContentTypes=news,poll
the plug-in will not add a link header if the content type is either
news
orpoll
. A link header will be added for all other content types. includeObjectTypes
-
A comma separated list of object types the plug-in will support. If the property for instance is defined like this
includeObjectTypes=article
the plug-in will only add the link header if the object type is
article
. Other possible values could besection
andperson
.