Package org.nuxeo.ecm.platform.picture
Class ImagingComponent
java.lang.Object
org.nuxeo.runtime.model.DefaultComponent
org.nuxeo.ecm.platform.picture.ImagingComponent
- All Implemented Interfaces:
ImagingService,Adaptable,Component,Extensible,TimestampedService
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringprotected Map<String, PictureConversion> Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected BlobcallPictureConversionChain(DocumentModel doc, Blob blob, PictureConversion pictureConversion, ImageInfo imageInfo, Point size, String conversionFormat) protected booleancanApplyPictureConversion(PictureConversion pictureConversion, DocumentModel doc) protected PictureViewcomputeView(Blob blob, PictureConversion pictureConversion, ImageInfo imageInfo, boolean convert) protected PictureViewcomputeView(DocumentModel doc, Blob blob, PictureConversion pictureConversion, ImageInfo imageInfo) protected PictureViewcomputeView(DocumentModel doc, Blob blob, PictureConversion pictureConversion, ImageInfo imageInfo, boolean convert) computeViewFor(Blob blob, PictureConversion pictureConversion, boolean convert) computeViewFor(Blob blob, PictureConversion pictureConversion, ImageInfo imageInfo, boolean convert) computeViewsFor(List<Blob> blobs, List<PictureConversion> pictureConversions, boolean convert) computeViewsFor(List<Blob> blobs, List<PictureConversion> pictureConversions, ImageInfo imageInfo, boolean convert) computeViewsFor(Blob blob, List<PictureConversion> pictureConversions, boolean convert) computeViewsFor(Blob blob, List<PictureConversion> pictureConversions, ImageInfo imageInfo, boolean convert) computeViewsFor(DocumentModel doc, Blob blob, ImageInfo imageInfo, boolean convert) Compute all the registeredPictureConversionFor each picture template theImagingService.computeViewFor(Blob, PictureConversion, ImageInfo, boolean)method is callprotected PictureViewcomputeViewWithoutConversion(Blob blob, PictureConversion pictureConversion, ImageInfo imageInfo) convertToPDF(Blob blob) Converts an image to PDF.protected ActionContextCrops an image.getConfigurationValue(String configurationName) Returns the value a configuration which name is received as parameter.getConfigurationValue(String configurationName, String defaultValue) Returns the value a configuration which name is received as parameter.getImageInfo(Blob blob) getImageMimeType(File file) Returns the mime-type for the given file.getImageMimeType(Blob blob) Returns the mime-type for the given BlobReturns aPictureConversiongiven itsid.Returns the registered picture conversions.protected static PointDeprecated.Resizes image.Rotates an image.voidsetConfigurationValue(String configurationName, String configurationValue) Sets the value of a configuration which could be used by the ImagingService.voidstart(ComponentContext context) Start the component.voidstop(ComponentContext context) Stop the component.protected BlobMethods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, registerExtension, setLastModified, setModifiedNow, setName, unregister, unregisterContribution, unregisterExtensionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuxeo.runtime.model.Component
getApplicationStartedOrder
-
Field Details
-
CONFIGURATION_PARAMETERS_EP
- See Also:
-
PICTURE_CONVERSIONS_EP
- See Also:
-
configurationParameters
-
pictureConversions
-
-
Constructor Details
-
ImagingComponent
public ImagingComponent()
-
-
Method Details
-
start
Description copied from interface:ComponentStart the component. This method is called after all the components were resolved and activated- Specified by:
startin interfaceComponent- Overrides:
startin classDefaultComponent
-
stop
Description copied from interface:ComponentStop the component.- Specified by:
stopin interfaceComponent- Overrides:
stopin classDefaultComponent
-
getPictureConversions
Description copied from interface:ImagingServiceReturns the registered picture conversions.- Specified by:
getPictureConversionsin interfaceImagingService
-
getPictureConversion
Description copied from interface:ImagingServiceReturns aPictureConversiongiven itsid.- Specified by:
getPictureConversionin interfaceImagingService
-
crop
Description copied from interface:ImagingServiceCrops an image.- Specified by:
cropin interfaceImagingService
-
resize
Description copied from interface:ImagingServiceResizes image.- Specified by:
resizein interfaceImagingService
-
rotate
Description copied from interface:ImagingServiceRotates an image.- Specified by:
rotatein interfaceImagingService- Parameters:
blob- a Blob containing the imageangle- the angle of the rotation- Returns:
- a Blob holding the rotated image
-
convertToPDF
Description copied from interface:ImagingServiceConverts an image to PDF.- Specified by:
convertToPDFin interfaceImagingService- Parameters:
blob- a Blob containing the image- Returns:
- a Blob holding the resulting PDF
-
getImageMimeType
Description copied from interface:ImagingServiceReturns the mime-type for the given file.- Specified by:
getImageMimeTypein interfaceImagingService
-
getImageMimeType
Description copied from interface:ImagingServiceReturns the mime-type for the given Blob- Specified by:
getImageMimeTypein interfaceImagingService
-
getImageInfo
Description copied from interface:ImagingServiceRetrieves theImageInfoof theBlobthat is received as parameter.The information provided by the ImageInfo, like width, height or format, is obtained using ImageMagick (see http://www.imagemagick.org/script/index.php for more details on ImageMagick).
- Specified by:
getImageInfoin interfaceImagingService- Parameters:
blob- the blob of a picture- Returns:
- the
ImageInfoof a blob
-
getConfigurationValue
Description copied from interface:ImagingServiceReturns the value a configuration which name is received as parameter.- Specified by:
getConfigurationValuein interfaceImagingService- Parameters:
configurationName- the name of the configuration- Returns:
- the value of the configuration, which can be null in case no configuration with the specified name was registered
-
getConfigurationValue
Description copied from interface:ImagingServiceReturns the value a configuration which name is received as parameter. In case no configuration with the specified name was registered, the received defaultValue parameter will be returned.- Specified by:
getConfigurationValuein interfaceImagingService- Parameters:
configurationName- the name of the configurationdefaultValue- the value of the configuration
-
setConfigurationValue
Description copied from interface:ImagingServiceSets the value of a configuration which could be used by the ImagingService.- Specified by:
setConfigurationValuein interfaceImagingService- Parameters:
configurationName- the name of the configurationconfigurationValue- the value of the configuration
-
computeViewFor
Description copied from interface:ImagingService- Specified by:
computeViewForin interfaceImagingService- Parameters:
convert- true if theblobis converted to fit thepictureConversion, false if theblobis put as it in the PictureView (without any conversion)- Returns:
- the computed picture view
-
computeViewFor
public PictureView computeViewFor(Blob blob, PictureConversion pictureConversion, ImageInfo imageInfo, boolean convert) Description copied from interface:ImagingService- Specified by:
computeViewForin interfaceImagingService- Parameters:
imageInfo- theImageInfoto use when computing the viewconvert- true if theblobis converted to fit thepictureConversion, false if theblobis put as it in the PictureView (without any conversion)- Returns:
- the computed picture view
-
computeViewsFor
public List<PictureView> computeViewsFor(Blob blob, List<PictureConversion> pictureConversions, boolean convert) Description copied from interface:ImagingService- Specified by:
computeViewsForin interfaceImagingService- Parameters:
convert- true if theblobis converted to fit eachPictureConversion, false if theblobis put as it in the PictureView (without any conversion)- Returns:
- the computed picture views as a List of
PictureViews
-
computeViewsFor
public List<PictureView> computeViewsFor(Blob blob, List<PictureConversion> pictureConversions, ImageInfo imageInfo, boolean convert) Description copied from interface:ImagingService- Specified by:
computeViewsForin interfaceImagingService- Parameters:
imageInfo- theImageInfoto use when computing the viewconvert- true if theblobis converted to fit eachPictureConversion, false if theblobis put as it in the PictureView (without any conversion)- Returns:
- the computed picture views as a List of
PictureViews
-
computeView
protected PictureView computeView(Blob blob, PictureConversion pictureConversion, ImageInfo imageInfo, boolean convert) -
computeView
protected PictureView computeView(DocumentModel doc, Blob blob, PictureConversion pictureConversion, ImageInfo imageInfo, boolean convert) -
wrapBlob
-
computeView
protected PictureView computeView(DocumentModel doc, Blob blob, PictureConversion pictureConversion, ImageInfo imageInfo) -
callPictureConversionChain
protected Blob callPictureConversionChain(DocumentModel doc, Blob blob, PictureConversion pictureConversion, ImageInfo imageInfo, Point size, String conversionFormat) -
computeViewsFor
public List<PictureView> computeViewsFor(DocumentModel doc, Blob blob, ImageInfo imageInfo, boolean convert) Description copied from interface:ImagingServiceCompute all the registeredPictureConversionFor each picture template theImagingService.computeViewFor(Blob, PictureConversion, ImageInfo, boolean)method is call- Specified by:
computeViewsForin interfaceImagingService
-
canApplyPictureConversion
-
createActionContext
-
computeViewWithoutConversion
protected PictureView computeViewWithoutConversion(Blob blob, PictureConversion pictureConversion, ImageInfo imageInfo) -
getSize
Deprecated.since 11.1 useImageResizer.scaleToMax(int, int, int)instead. -
computeViewsFor
public List<List<PictureView>> computeViewsFor(List<Blob> blobs, List<PictureConversion> pictureConversions, boolean convert) Description copied from interface:ImagingService- Specified by:
computeViewsForin interfaceImagingService- Parameters:
convert- true if theblobis converted to fit eachPictureConversion, false if theblobis put as it in the PictureView (without any conversion)
-
computeViewsFor
public List<List<PictureView>> computeViewsFor(List<Blob> blobs, List<PictureConversion> pictureConversions, ImageInfo imageInfo, boolean convert) Description copied from interface:ImagingService- Specified by:
computeViewsForin interfaceImagingService- Parameters:
imageInfo- theImageInfoto use when computing the viewconvert- true if theblobis converted to fit eachPictureConversion, false if theblobis put as it in the PictureView (without any conversion)
-
ImageResizer.scaleToMax(int, int, int)instead.