Class DefaultPictureAdapter
- java.lang.Object
-
- org.nuxeo.ecm.platform.picture.api.adapters.AbstractPictureAdapter
-
- org.nuxeo.ecm.platform.picture.api.adapters.DefaultPictureAdapter
-
- All Implemented Interfaces:
PictureResourceAdapter
public class DefaultPictureAdapter extends AbstractPictureAdapter
-
-
Field Summary
-
Fields inherited from class org.nuxeo.ecm.platform.picture.api.adapters.AbstractPictureAdapter
CONTENT_XPATH, depth, description, doc, FIELD_BYLINE, FIELD_CAPTION, FIELD_CREDIT, FIELD_DATELINE, FIELD_GENRE, FIELD_HEADLINE, FIELD_LANGUAGE, FIELD_ORIGIN, FIELD_SLUGLINE, FIELD_SOURCE, FIELD_SUBHEADLINE, FIELD_TYPAGE, fileContent, height, imageInfo, MEDIUM_SIZE, SCHEMA_NAME, SMALL_SIZE, THUMB_SIZE, type, VIEWS_PROPERTY, width
-
-
Constructor Summary
Constructors Constructor Description DefaultPictureAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoCrop(String coords)voiddoRotate(int angle)booleanfillPictureViews(Blob blob, String filename, String title, List<Map<String,Object>> pictureConversions)Fill this Picture views using the givenpictureConversionsandblobto compute the picture views.booleanfillPictureViews(Blob blob, String filename, String title, List<Map<String,Object>> pictureConversions, boolean outsideTx)Fill this Picture views using the givenpictureConversionsandblobto compute the picture views.StringgetFirstViewXPath()Convenience method to get the XPath of the first view of the Picture.BlobgetPictureFromTitle(String title)StringgetViewXPath(String viewName)Returns the XPath of the given view name, ornullif the view is not found on the Picture.protected StringgetViewXPathFor(int index)voidpreFillPictureViews(Blob blob, List<Map<String,Object>> pictureConversions, ImageInfo imageInfo)Pre-fill this Picture views using the givenpictureConversionsandblob.-
Methods inherited from class org.nuxeo.ecm.platform.picture.api.adapters.AbstractPictureAdapter
addPictureView, addPictureViews, addViews, clearInfo, clearViews, createPictureimpl, crop, fillPictureViews, getContentFromViews, getConversionService, getImageInfo, getImagingService, getPictureViews, getSession, setDocumentModel, setMetadata
-
-
-
-
Method Detail
-
fillPictureViews
public boolean fillPictureViews(Blob blob, String filename, String title, List<Map<String,Object>> pictureConversions) throws IOException
Description copied from interface:PictureResourceAdapterFill this Picture views using the givenpictureConversionsandblobto compute the picture views.The
blobis converted to fit the definedpictureConversions.- Throws:
IOException
-
fillPictureViews
public boolean fillPictureViews(Blob blob, String filename, String title, List<Map<String,Object>> pictureConversions, boolean outsideTx) throws IOException
Description copied from interface:PictureResourceAdapterFill this Picture views using the givenpictureConversionsandblobto compute the picture views.The
blobis converted to fit the definedpictureConversions.outsideTx- should potential conversions be done outside a transaction- Throws:
IOException
-
preFillPictureViews
public void preFillPictureViews(Blob blob, List<Map<String,Object>> pictureConversions, ImageInfo imageInfo) throws IOException
Description copied from interface:PictureResourceAdapterPre-fill this Picture views using the givenpictureConversionsandblob.The
blobis not converted and just stored as the Blob of the picture views.- Throws:
IOException
-
doRotate
public void doRotate(int angle)
-
doCrop
public void doCrop(String coords)
-
getPictureFromTitle
public Blob getPictureFromTitle(String title) throws PropertyException
- Throws:
PropertyException
-
getFirstViewXPath
public String getFirstViewXPath()
Description copied from interface:PictureResourceAdapterConvenience method to get the XPath of the first view of the Picture.- Returns:
- the XPath of the first view
-
getViewXPath
public String getViewXPath(String viewName)
Description copied from interface:PictureResourceAdapterReturns the XPath of the given view name, ornullif the view is not found on the Picture.- Parameters:
viewName- the view name
-
getViewXPathFor
protected String getViewXPathFor(int index)
-
-