Interface RepresentationGeneratorService
-
public interface RepresentationGeneratorService
This is the OSGi service interface of a registry ofRepresentationGenerator
instances. Clients can register their ownRepresentationGenerator
by making it available through the OSGi service registry. The single implementation of this module does not implement service ranking. I.e., if there are two services registered for a given type, then it is not specified which of the two services is used to represent the content item.The search order for a given type
T
is defined as follows:- If
T
is mapped to a set of generators then return an arbitrary generator from that set. - For all interfaces
I
ofT
do: IfI
is mapped to a set of generators then return an arbitrary generator from that set. - Let
S
be the super type ofT
. Start from (1) withS
.
On startup, the service registers a number of default representation generators for the following types:
Object
Page
PageMetaData
Redirect
RelatedLink
WorkflowModelInstance
WorkflowActivityInstance
PageVersion
Element
- All legacy elements
MediaItemArticleVersion
- If
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ContentRepresentation
represent(Object contentItem)
Represents the given content item.
-
-
-
Method Detail
-
represent
ContentRepresentation represent(Object contentItem) throws ContentRepresentationException
Represents the given content item. It finds appropriateRepresentationGenerator
instances in its registry and uses them to generate the representation. The look-up is done using the run-time class of the given content item instance and theRepresentationGenerator.getSupportedType()
method. If no suitableRepresentationGenerator
service has registered then an exception is thrown.- Parameters:
contentItem
- the content item to represent- Returns:
- a
ContentRepresentation
for the given content item instance - Throws:
ContentRepresentationException
- on error (such as a cycle in the content item object structure)
-
-