@Service @Transactional public class PictureServiceImpl extends Object implements PictureService
PictureService
implementation.Constructor and Description |
---|
PictureServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addPicture(GallerySection section,
Picture picture,
DataSource source)
Adds a
Picture to the gallery. |
Picture |
createNew()
Creates a new, empty
Picture object to be used in a gallery. |
ResourceDataSource |
getImage(Picture picture,
ImageProcessing process)
Gets a picture of a gallery.
|
void |
removePicture(Picture picture)
Removes a picture.
|
void |
renumberPictures(GallerySection gallery)
Renumbers all pictures of a gallery.
|
void |
updatePicture(Picture picture,
DataSource source)
Updates a picture.
|
public PictureServiceImpl()
public Picture createNew()
PictureService
Picture
object to be used in a gallery.createNew
in interface PictureService
public void addPicture(GallerySection section, Picture picture, DataSource source) throws CillaServiceException
PictureService
Picture
to the gallery.
The image passed in is analyzed and it's EXIF data, geolocation data, creation date, dimensions and type are written into the Picture entity.
Picture's sequence numbers needs to be set separately.
addPicture
in interface PictureService
section
- GallerySection
to add the picture to. The picture will be the
last on the list.picture
- Picture
to add.source
- DataSource
containing a stream to the picture.CillaServiceException
@CacheEvict(value="processedImages", allEntries=true) public void updatePicture(Picture picture, DataSource source) throws CillaServiceException
PictureService
The image passed in is analyzed and it's EXIF data, geolocation data, creation date, dimensions and type are written into the Picture entity.
Picture's sequence numbers needs to be set separately.
updatePicture
in interface PictureService
picture
- Picture
to be updatedsource
- DataSource
containing a stream to the picture, or null
to keep the current pictureCillaServiceException
@CacheEvict(value="processedImages", allEntries=true) public void removePicture(Picture picture) throws CillaServiceException
PictureService
GallerySection
.
Picture's sequence numbers needs to be set separately.
removePicture
in interface PictureService
picture
- Picture
to removeCillaServiceException
public ResourceDataSource getImage(Picture picture, ImageProcessing process) throws CillaServiceException
PictureService
getImage
in interface PictureService
picture
- Picture
to streamprocess
- ImageProcessing
for processing images, null
for originalResourceDataSource
of that pictureCillaServiceException
public void renumberPictures(GallerySection gallery) throws CillaServiceException
PictureService
renumberPictures
in interface PictureService
gallery
- GallerySection
to renumber pictures ofCillaServiceException
Copyright © 2009–2016. All rights reserved.