Class CatalogBuilderPlugin
- All Implemented Interfaces:
MediaPackageElementBuilderPlugin
MediaPackageElementBuilderPlugin recognizes metadata catalogs and provides the
functionality of reading it on behalf of the media package.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccept(URI uri, MediaPackageElement.Type type, MediaPackageElementFlavor flavor) This method is called on every registered media package builder plugin until one of these plugins returnstrue.booleanaccept(MediaPackageElement.Type type, MediaPackageElementFlavor flavor) This method is called if the media package builder tries to create a new media package element of typeelementType.booleanThis method is called while the media package builder parses a media package manifest.voiddestroy()This method is called before the plugin is abandoned by the element builder.elementFromManifest(Node elementNode, MediaPackageSerializer serializer) Creates a media package element from the DOM element.elementFromURI(URI uri) Creates a media package element from the given url that was previously accepted.voidinit()This method is called once in a plugin's life cycle.newElement(MediaPackageElement.Type type, MediaPackageElementFlavor flavor) Creates a new media package element of the specified type.toString()
-
Field Details
-
xpath
The xpath facility
-
-
Constructor Details
-
CatalogBuilderPlugin
public CatalogBuilderPlugin()
-
-
Method Details
-
accept
Description copied from interface:MediaPackageElementBuilderPluginThis method is called if the media package builder tries to create a new media package element of typeelementType.Every registered builder plugin will then be asked whether it is able to create a media package element from the given element type. If this is the case for a plugin, it will then be asked to create such an element by a call to
MediaPackageElementBuilderPlugin.newElement(org.opencastproject.mediapackage.MediaPackageElement.Type,MediaPackageElementFlavor).- Specified by:
acceptin interfaceMediaPackageElementBuilderPlugin- Parameters:
type- the typeflavor- the element flavor- Returns:
trueif the plugin is able to create such an element- See Also:
-
accept
Description copied from interface:MediaPackageElementBuilderPluginThis method is called while the media package builder parses a media package manifest.Every registered builder plugin will then be asked, whether it is able to create a media package element from the given element definition.
The element must then be constructed and returned in the call to
MediaPackageElementBuilderPlugin.elementFromManifest(Node, MediaPackageSerializer).- Specified by:
acceptin interfaceMediaPackageElementBuilderPlugin- Parameters:
elementNode- the node- Returns:
trueif the plugin is able to create such an element- See Also:
-
accept
Description copied from interface:MediaPackageElementBuilderPluginThis method is called on every registered media package builder plugin until one of these plugins returnstrue. If no plugin recognises the file, it is rejected.The parameters
typeandflavormay be taken as strong hints and may both benull.Implementers schould return the correct mime type for the given file if they are absolutely sure about the file. Otherwise,
nullshould be returned.- Specified by:
acceptin interfaceMediaPackageElementBuilderPlugin- Parameters:
uri- the element locationtype- the element typeflavor- the element flavor- Returns:
trueif the plugin can handle the element- See Also:
-
elementFromURI
Description copied from interface:MediaPackageElementBuilderPluginCreates a media package element from the given url that was previously accepted.- Specified by:
elementFromURIin interfaceMediaPackageElementBuilderPlugin- Parameters:
uri- the element location- Returns:
- the new media package element
- Throws:
UnsupportedElementException- if creating the media package element fails- See Also:
-
toString
-
destroy
public void destroy()This method is called before the plugin is abandoned by the element builder.- Specified by:
destroyin interfaceMediaPackageElementBuilderPlugin- See Also:
-
elementFromManifest
public MediaPackageElement elementFromManifest(Node elementNode, MediaPackageSerializer serializer) throws UnsupportedElementException Creates a media package element from the DOM element.- Specified by:
elementFromManifestin interfaceMediaPackageElementBuilderPlugin- Parameters:
elementNode- the DOM nodeserializer- the media package serializer- Returns:
- the media package element
- Throws:
UnsupportedElementException- See Also:
-
newElement
public MediaPackageElement newElement(MediaPackageElement.Type type, MediaPackageElementFlavor flavor) Creates a new media package element of the specified type.- Specified by:
newElementin interfaceMediaPackageElementBuilderPlugin- Parameters:
type- the element typeflavor- the element flavor- Returns:
- the new media package element
- See Also:
-
init
This method is called once in a plugin's life cycle. When this method is called, the plugin can make sure that everything is in place for it to work properly. If this isn't the case, it should throw an exception so it will no longer be bothered by the element builder.- Specified by:
initin interfaceMediaPackageElementBuilderPlugin- Throws:
Exception- if some unrecoverable state is reached- See Also:
-