public class CatalogBuilderPlugin extends Object implements MediaPackageElementBuilderPlugin
MediaPackageElementBuilderPlugin recognizes metadata catalogs and provides the
functionality of reading it on behalf of the media package.| Modifier and Type | Field and Description |
|---|---|
protected XPath |
xpath
The xpath facility
|
| Constructor and Description |
|---|
CatalogBuilderPlugin() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(MediaPackageElement.Type type,
MediaPackageElementFlavor flavor)
This method is called if the media package builder tries to create a new media package element of type
elementType. |
boolean |
accept(Node elementNode)
This method is called while the media package builder parses a media package manifest.
|
boolean |
accept(URI uri,
MediaPackageElement.Type type,
MediaPackageElementFlavor flavor)
This method is called on every registered media package builder plugin until one of these plugins returns
true. |
protected Catalog |
catalogFromManifest(String id,
URI uri) |
void |
destroy()
This method is called before the plugin is abandoned by the element builder.
|
MediaPackageElement |
elementFromManifest(Node elementNode,
MediaPackageSerializer serializer)
Creates a media package element from the DOM element.
|
MediaPackageElement |
elementFromURI(URI uri)
Creates a media package element from the given url that was previously accepted.
|
void |
init()
This method is called once in a plugin's life cycle.
|
MediaPackageElement |
newElement(MediaPackageElement.Type type,
MediaPackageElementFlavor flavor)
Creates a new media package element of the specified type.
|
String |
toString() |
protected XPath xpath
public boolean accept(MediaPackageElement.Type type, MediaPackageElementFlavor flavor)
MediaPackageElementBuilderPluginelementType.
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).
accept in interface MediaPackageElementBuilderPlugintype - the typeflavor - the element flavortrue if the plugin is able to create such an elementMediaPackageElementBuilderPlugin.accept(org.opencastproject.mediapackage.MediaPackageElement.Type,
org.opencastproject.mediapackage.MediaPackageElementFlavor)public boolean accept(Node elementNode)
MediaPackageElementBuilderPluginEvery 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).
accept in interface MediaPackageElementBuilderPluginelementNode - the nodetrue if the plugin is able to create such an elementMediaPackageElementBuilderPlugin.accept(org.w3c.dom.Node)public boolean accept(URI uri, MediaPackageElement.Type type, MediaPackageElementFlavor flavor)
MediaPackageElementBuilderPlugintrue. If no plugin recognises the file, it is rejected.
The parameters type and flavor may be taken as strong hints and may both be
null.
Implementers schould return the correct mime type for the given file if they are absolutely sure about the file.
Otherwise, null should be returned.
accept in interface MediaPackageElementBuilderPluginuri - the element locationtype - the element typeflavor - the element flavortrue if the plugin can handle the elementMediaPackageElementBuilderPlugin.accept(URI,
org.opencastproject.mediapackage.MediaPackageElement.Type,
org.opencastproject.mediapackage.MediaPackageElementFlavor)public MediaPackageElement elementFromURI(URI uri) throws UnsupportedElementException
MediaPackageElementBuilderPluginelementFromURI in interface MediaPackageElementBuilderPluginuri - the element locationUnsupportedElementException - if creating the media package element failsMediaPackageElementBuilderPlugin.elementFromURI(URI)public void destroy()
destroy in interface MediaPackageElementBuilderPluginMediaPackageElementBuilderPlugin.destroy()public MediaPackageElement elementFromManifest(Node elementNode, MediaPackageSerializer serializer) throws UnsupportedElementException
elementFromManifest in interface MediaPackageElementBuilderPluginelementNode - the DOM nodeserializer - the media package serializerUnsupportedElementExceptionMediaPackageElementBuilderPlugin.elementFromManifest(org.w3c.dom.Node,
org.opencastproject.mediapackage.MediaPackageSerializer)public MediaPackageElement newElement(MediaPackageElement.Type type, MediaPackageElementFlavor flavor)
newElement in interface MediaPackageElementBuilderPlugintype - the element typeflavor - the element flavorMediaPackageElementBuilderPlugin.newElement(org.opencastproject.mediapackage.MediaPackageElement.Type,
org.opencastproject.mediapackage.MediaPackageElementFlavor)public void init()
throws Exception
init in interface MediaPackageElementBuilderPluginException - if some unrecoverable state is reachedMediaPackageElementBuilderPlugin.init()Copyright © 2009–2020 Opencast Project. All rights reserved.