Class AbstractPictureAdapter
- java.lang.Object
-
- org.nuxeo.ecm.platform.picture.api.adapters.AbstractPictureAdapter
-
- All Implemented Interfaces:
PictureResourceAdapter
- Direct Known Subclasses:
DefaultPictureAdapter,NoPictureAdapter
public abstract class AbstractPictureAdapter extends Object implements PictureResourceAdapter
-
-
Field Summary
Fields Modifier and Type Field Description static StringCONTENT_XPATHprotected Integerdepthprotected Stringdescriptionprotected DocumentModeldocstatic StringFIELD_BYLINEstatic StringFIELD_CAPTIONstatic StringFIELD_CREDITstatic StringFIELD_DATELINEstatic StringFIELD_GENREstatic StringFIELD_HEADLINEstatic StringFIELD_LANGUAGEstatic StringFIELD_ORIGINstatic StringFIELD_SLUGLINEstatic StringFIELD_SOURCEstatic StringFIELD_SUBHEADLINEstatic StringFIELD_TYPAGEprotected BlobfileContentprotected Integerheightprotected ImageInfoimageInfostatic intMEDIUM_SIZEstatic StringSCHEMA_NAMEstatic intSMALL_SIZEstatic intTHUMB_SIZEprotected Stringtypestatic StringVIEWS_PROPERTYprotected Integerwidth
-
Constructor Summary
Constructors Constructor Description AbstractPictureAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddPictureView(PictureView view)Add a pictureView to the existing picture views attached with the documentprotected voidaddPictureViews(List<PictureView> pictureViews, boolean clearPictureViews)Attach new picture views with the documentprotected voidaddViews(List<Map<String,Object>> pictureConversions, String filename, String title, boolean outsideTx)voidclearInfo()Clear the picture info.protected voidclearViews()voidcreatePictureimpl(String description, String tag, String title, Integer maxsize, String filename, Integer width, Integer height, Integer depth, Blob fileContent)protected Blobcrop(Blob blob, Map<String,Serializable> coords)booleanfillPictureViews(Blob blob, String filename, String title)This method just delegate the job toPictureResourceAdapter.fillPictureViews(Blob, String, String, List)by passing null instead of statics picture templates.protected BlobgetContentFromViews(Integer i)protected ConversionServicegetConversionService()protected ImageInfogetImageInfo()Returns theImageInfofor the main Blob (fileContent).protected ImagingServicegetImagingService()protected List<Map<String,Serializable>>getPictureViews()Returns the picture views attached to the document if present, an empty list otherwise.protected CoreSessiongetSession()voidsetDocumentModel(DocumentModel doc)protected voidsetMetadata()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.ecm.platform.picture.api.adapters.PictureResourceAdapter
doCrop, doRotate, fillPictureViews, fillPictureViews, getFirstViewXPath, getPictureFromTitle, getViewXPath, preFillPictureViews
-
-
-
-
Field Detail
-
VIEWS_PROPERTY
public static final String VIEWS_PROPERTY
- See Also:
- Constant Field Values
-
CONTENT_XPATH
public static final String CONTENT_XPATH
- See Also:
- Constant Field Values
-
FIELD_HEADLINE
public static final String FIELD_HEADLINE
- See Also:
- Constant Field Values
-
FIELD_SUBHEADLINE
public static final String FIELD_SUBHEADLINE
- See Also:
- Constant Field Values
-
FIELD_BYLINE
public static final String FIELD_BYLINE
- See Also:
- Constant Field Values
-
FIELD_DATELINE
public static final String FIELD_DATELINE
- See Also:
- Constant Field Values
-
FIELD_SLUGLINE
public static final String FIELD_SLUGLINE
- See Also:
- Constant Field Values
-
FIELD_CREDIT
public static final String FIELD_CREDIT
- See Also:
- Constant Field Values
-
FIELD_LANGUAGE
public static final String FIELD_LANGUAGE
- See Also:
- Constant Field Values
-
FIELD_SOURCE
public static final String FIELD_SOURCE
- See Also:
- Constant Field Values
-
FIELD_ORIGIN
public static final String FIELD_ORIGIN
- See Also:
- Constant Field Values
-
FIELD_GENRE
public static final String FIELD_GENRE
- See Also:
- Constant Field Values
-
FIELD_CAPTION
public static final String FIELD_CAPTION
- See Also:
- Constant Field Values
-
FIELD_TYPAGE
public static final String FIELD_TYPAGE
- See Also:
- Constant Field Values
-
SCHEMA_NAME
public static final String SCHEMA_NAME
- See Also:
- Constant Field Values
-
MEDIUM_SIZE
public static final int MEDIUM_SIZE
- See Also:
- Constant Field Values
-
SMALL_SIZE
public static final int SMALL_SIZE
- See Also:
- Constant Field Values
-
THUMB_SIZE
public static final int THUMB_SIZE
- See Also:
- Constant Field Values
-
doc
protected DocumentModel doc
-
width
protected Integer width
-
height
protected Integer height
-
depth
protected Integer depth
-
description
protected String description
-
type
protected String type
-
fileContent
protected Blob fileContent
-
imageInfo
protected ImageInfo imageInfo
- Since:
- 5.9.5
-
-
Method Detail
-
setDocumentModel
public void setDocumentModel(DocumentModel doc)
- Specified by:
setDocumentModelin interfacePictureResourceAdapter
-
getImagingService
protected ImagingService getImagingService()
-
getConversionService
protected ConversionService getConversionService()
-
getSession
protected CoreSession getSession()
-
setMetadata
protected void setMetadata() throws IOException- Throws:
IOException
-
clearInfo
public void clearInfo()
Description copied from interface:PictureResourceAdapterClear the picture info.- Specified by:
clearInfoin interfacePictureResourceAdapter
-
clearViews
protected void clearViews()
-
addViews
protected void addViews(List<Map<String,Object>> pictureConversions, String filename, String title, boolean outsideTx) throws IOException
- Throws:
IOException
-
createPictureimpl
public void createPictureimpl(String description, String tag, String title, Integer maxsize, String filename, Integer width, Integer height, Integer depth, Blob fileContent) throws IOException
- Throws:
IOException
-
addPictureViews
protected void addPictureViews(List<PictureView> pictureViews, boolean clearPictureViews)
Attach new picture views with the document- Since:
- 7.1
-
fillPictureViews
public boolean fillPictureViews(Blob blob, String filename, String title) throws IOException
Description copied from interface:PictureResourceAdapterThis method just delegate the job toPictureResourceAdapter.fillPictureViews(Blob, String, String, List)by passing null instead of statics picture templates.This will fill the picture views by using the registered picture templates.
- Specified by:
fillPictureViewsin interfacePictureResourceAdapter- Throws:
IOException- See Also:
PictureResourceAdapter.fillPictureViews(Blob, String, String, List)
-
getPictureViews
protected List<Map<String,Serializable>> getPictureViews()
Returns the picture views attached to the document if present, an empty list otherwise.- Since:
- 7.1
-
addPictureView
protected void addPictureView(PictureView view)
Add a pictureView to the existing picture views attached with the document- Since:
- 7.1
-
getImageInfo
protected ImageInfo getImageInfo()
Returns theImageInfofor the main Blob (fileContent).- Since:
- 5.9.5.
-
crop
protected Blob crop(Blob blob, Map<String,Serializable> coords)
-
-