Class AbstractCoverImageService
java.lang.Object
org.opencastproject.job.api.AbstractJobProducer
org.opencastproject.coverimage.impl.AbstractCoverImageService
- All Implemented Interfaces:
CoverImageService,JobProducer
- Direct Known Subclasses:
CoverImageServiceOsgiImpl
public abstract class AbstractCoverImageService
extends AbstractJobProducer
implements CoverImageService
Service for creating cover images
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static enumList of available operations on jobs -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected OrganizationDirectoryServiceThe organization directory serviceprotected SecurityServiceThe security serviceprotected ServiceRegistryThe service registry serviceprotected UserDirectoryServiceThe user directory serviceprotected WorkspaceThe workspace serviceFields inherited from class org.opencastproject.job.api.AbstractJobProducer
ACCEPT_JOB_LOADS_EXCEEDING_PROPERTY, acceptJobLoadsExeedingMaxLoad, DEFAULT_ACCEPT_JOB_LOADS_EXCEEDING, executor, jobTypeFields inherited from interface org.opencastproject.coverimage.CoverImageService
JOB_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected FilecreateTempFile(Job job, String suffix) generateCoverImage(String xml, String xsl, String width, String height, String posterImageUri, String targetFlavor) Creates a job for creating a cover image for movie/media package.protected AttachmentgenerateCoverImageInternal(Job job, String xml, String xsl, int width, int height, String posterImage, String targetFlavor) protected static Documentprotected StringAsks the overriding class to process the arguments using the given operation.protected static voidrasterizeSvg(File svgSource, File pngResult) protected static voidtransformSvg(Result svg, InputSource xmlSource, Document xslDoc, int width, int height, String posterImage) Methods inherited from class org.opencastproject.job.api.AbstractJobProducer
acceptJob, activate, countJobs, finallyUpdateJob, getJobType, getOrganizationDirectoryService, getSecurityService, getServiceRegistry, getUserDirectoryService, incident, isReadyToAccept, isReadyToAcceptJobs
-
Field Details
-
COVERIMAGE_WORKSPACE_COLLECTION
- See Also:
-
workspace
The workspace service -
serviceRegistry
The service registry service -
securityService
The security service -
userDirectoryService
The user directory service -
organizationDirectoryService
The organization directory service
-
-
Constructor Details
-
AbstractCoverImageService
public AbstractCoverImageService()Creates a new composer service instance.
-
-
Method Details
-
process
Description copied from class:AbstractJobProducerAsks the overriding class to process the arguments using the given operation. The result will be added to the associated job as the payload.- Specified by:
processin classAbstractJobProducer- Parameters:
job- the job to process- Returns:
- the operation result
- Throws:
Exception
-
generateCoverImage
public Job generateCoverImage(String xml, String xsl, String width, String height, String posterImageUri, String targetFlavor) throws CoverImageException Description copied from interface:CoverImageServiceCreates a job for creating a cover image for movie/media package.- Specified by:
generateCoverImagein interfaceCoverImageService- Parameters:
xml- metadata as XML. Will be handed over to the XSL transformation. Optional, if not given, there should be a fallbackxsl- the XSL stylesheet used to create the SVG version of the cover imagewidth- the width of the resulting imageheight- the height of the resulting imageposterImageUri- file URI to an additional poster image (optional)targetFlavor- target flavor- Returns:
- a job instance
- Throws:
CoverImageException- if there is an error while creating the job
-
generateCoverImageInternal
protected Attachment generateCoverImageInternal(Job job, String xml, String xsl, int width, int height, String posterImage, String targetFlavor) throws CoverImageException - Throws:
CoverImageException
-
parseXsl
- Throws:
CoverImageException
-
transformSvg
protected static void transformSvg(Result svg, InputSource xmlSource, Document xslDoc, int width, int height, String posterImage) throws TransformerFactoryConfigurationError, CoverImageException -
createTempFile
- Throws:
CoverImageException
-
rasterizeSvg
- Throws:
CoverImageException
-