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 String
CONTENT_XPATH
protected Integer
depth
protected String
description
protected DocumentModel
doc
static String
FIELD_BYLINE
static String
FIELD_CAPTION
static String
FIELD_CREDIT
static String
FIELD_DATELINE
static String
FIELD_GENRE
static String
FIELD_HEADLINE
static String
FIELD_LANGUAGE
static String
FIELD_ORIGIN
static String
FIELD_SLUGLINE
static String
FIELD_SOURCE
static String
FIELD_SUBHEADLINE
static String
FIELD_TYPAGE
protected Blob
fileContent
protected Integer
height
protected ImageInfo
imageInfo
static int
MEDIUM_SIZE
static String
SCHEMA_NAME
static int
SMALL_SIZE
static int
THUMB_SIZE
protected String
type
static String
VIEWS_PROPERTY
protected Integer
width
-
Constructor Summary
Constructors Constructor Description AbstractPictureAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addPictureView(PictureView view)
Add a pictureView to the existing picture views attached with the documentprotected void
addPictureViews(List<PictureView> pictureViews, boolean clearPictureViews)
Attach new picture views with the documentprotected void
addViews(List<Map<String,Object>> pictureConversions, String filename, String title, boolean outsideTx)
void
clearInfo()
Clear the picture info.protected void
clearViews()
void
createPictureimpl(String description, String tag, String title, Integer maxsize, String filename, Integer width, Integer height, Integer depth, Blob fileContent)
protected Blob
crop(Blob blob, Map<String,Serializable> coords)
boolean
fillPictureViews(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 Blob
getContentFromViews(Integer i)
protected ConversionService
getConversionService()
protected ImageInfo
getImageInfo()
Returns theImageInfo
for the main Blob (fileContent
).protected ImagingService
getImagingService()
protected List<Map<String,Serializable>>
getPictureViews()
Returns the picture views attached to the document if present, an empty list otherwise.protected CoreSession
getSession()
void
setDocumentModel(DocumentModel doc)
protected void
setMetadata()
-
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:
setDocumentModel
in 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:PictureResourceAdapter
Clear the picture info.- Specified by:
clearInfo
in 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:PictureResourceAdapter
This 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:
fillPictureViews
in 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 theImageInfo
for the main Blob (fileContent
).- Since:
- 5.9.5.
-
crop
protected Blob crop(Blob blob, Map<String,Serializable> coords)
-
-