|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MediaBiz
API for media item actions.
Method Summary | |
---|---|
int |
addMediaItemsToAlbum(Album album,
java.lang.Long[] mediaItemIds,
BizContext context)
Add a set of media items to an album. |
Album |
deleteAlbum(java.lang.Long albumId,
BizContext context)
Delete an album, and any nested albums. |
java.util.List<MediaItem> |
deleteCollectionAndItems(java.lang.Long collectionId,
BizContext context)
Delete a Collection and physically delete the media items in the collection. |
int |
deleteMediaItems(java.lang.Long[] itemIds,
BizContext context)
Physically delete media items. |
Album |
getAlbum(java.lang.Long albumId,
BizContext context)
Get an Album. |
Album |
getAlbumParent(java.lang.Long childAlbumId,
BizContext context)
Get the parent of an album, if one exists. |
java.util.List<KeyNameType> |
getAlbumSortTypes(BizContext context)
Get the list of support album sort types. |
Album |
getAlbumWithItems(java.lang.Long albumId,
BizContext context)
Get an Album along with the MediaItems of that album. |
Collection |
getCollectionWithItems(java.lang.Long collectionId,
BizContext context)
Get a Collection along with the MediaItems of that collection. |
Geometry |
getGeometry(MediaSize size)
Get a geometry for a given size. |
MediaHandler |
getMediaHandler(java.io.File file)
Get a MediaHandler instance for a given file. |
MediaHandler |
getMediaHandler(java.lang.String mime)
Get a MediaHandler instance for a given MIME type. |
Collection |
getMediaItemCollection(MediaItem item)
Get the Collection for a given MediaItem. |
org.springframework.core.io.Resource |
getMediaItemResource(MediaItem item)
Get a Resource for a given MediaItem. |
java.util.List<MediaItem> |
getMediaItemsForAlbum(Album album,
BizContext context)
Get all MediaItems that belong to a given Album. |
java.util.List<MediaItem> |
getMediaItemsForCollection(Collection collection,
BizContext context)
Get all MediaItems that belong to a given Collection. |
MediaItem |
getMediaItemWithInfo(java.lang.Long itemId,
BizContext context)
Get a MediaItem along with the meta data and other info populated. |
float |
getQualityValue(MediaQuality quality)
Get a quality value, where the value ranges from 0.0 to |
Geometry |
getScaledGeometry(MediaItem item,
MediaRequest request)
Creates a Geometry scaled to the desired MediaSize
set on the request. |
Album |
getSharedAlbum(java.lang.String key,
BizContext context)
Get a shared album. |
int |
incrementMediaItemHits(java.lang.Long itemId)
Increment the hits value for a particular MediaItem object and return the incremented value. |
boolean |
isFileSupported(java.io.File file)
Return true if a file is supported by some configured MediaHandler . |
void |
moveMediaItems(MoveItemsCommand command,
BizContext context)
Move a set of media items from the collection they currently are in to a different collection. |
int |
removeMediaItemsFromAlbum(java.lang.Long albumId,
java.lang.Long[] itemIds,
BizContext context)
Remove a list of item IDs from an Album. |
java.lang.String |
shareAlbum(ShareAlbumCommand command,
BizContext context)
Share an album. |
void |
sortAlbumItems(Album album)
Sort the media items within an album based on the Albums' sort mode. |
java.lang.Long |
storeAlbum(Album album,
BizContext context)
Store an Album. |
void |
storeAlbumOrdering(SortAlbumsCommand command,
BizContext context)
Set the ording for the child albums of an album. |
void |
storeAlbumParent(java.lang.Long childAlbumId,
java.lang.Long parentAlbumId,
BizContext context)
Make an album a child of another album. |
void |
storeMediaItemInfo(MediaInfoCommand command,
BizContext context)
Store info for media items. |
void |
storeMediaItemOrdering(SortMediaItemsCommand command,
BizContext context)
Set the ording for the media items of an album. |
void |
storeMediaItemPoster(java.lang.Long itemId,
java.lang.Long albumId,
BizContext context)
Store the poster item for an album. |
void |
storeMediaItemRating(java.lang.Long[] itemIds,
short rating,
BizContext context)
Set the rating for a media item. |
void |
storeMediaItemUserComment(UserCommentCommand command,
BizContext context)
Add a new UserComment to a MediaItem. |
void |
unShareAlbum(java.lang.Long albumId,
BizContext context)
Unshare an album. |
Method Detail |
---|
boolean isFileSupported(java.io.File file)
MediaHandler
.
file
- the file
MediaHandler getMediaHandler(java.io.File file)
file
- the file
java.lang.IllegalArgumentException
- if the file is not supportedMediaHandler getMediaHandler(java.lang.String mime)
mime
- the MIME type
java.lang.IllegalArgumentException
- if the file is not supportedCollection getMediaItemCollection(MediaItem item)
item
- the item
java.util.List<MediaItem> getMediaItemsForCollection(Collection collection, BizContext context)
collection
- the Collectioncontext
- the current context
Collection getCollectionWithItems(java.lang.Long collectionId, BizContext context)
collectionId
- the ID of the Collection to getcontext
- the current context
Album getAlbumWithItems(java.lang.Long albumId, BizContext context)
albumId
- the ID of the Album to getcontext
- the current context
MediaItem getMediaItemWithInfo(java.lang.Long itemId, BizContext context)
itemId
- the ID of the item to getcontext
- the current context
void storeMediaItemRating(java.lang.Long[] itemIds, short rating, BizContext context)
itemIds
- the IDs of the items to set the rating forrating
- the rating to setcontext
- the current contextvoid storeMediaItemInfo(MediaInfoCommand command, BizContext context)
command
- the command datacontext
- the current contextvoid storeMediaItemPoster(java.lang.Long itemId, java.lang.Long albumId, BizContext context)
itemId
- the ID of the item to use as the posteralbumId
- the ID of the album to set the poster forcontext
- the current contextjava.util.List<MediaItem> deleteCollectionAndItems(java.lang.Long collectionId, BizContext context)
collectionId
- the ID of the collection to deletecontext
- the current context
void moveMediaItems(MoveItemsCommand command, BizContext context)
command
- the command objectcontext
- the current contextAlbum deleteAlbum(java.lang.Long albumId, BizContext context)
albumId
- the ID of the album to deletecontext
- the current context
int removeMediaItemsFromAlbum(java.lang.Long albumId, java.lang.Long[] itemIds, BizContext context)
albumId
- the ID of the album to remove the items fromitemIds
- the IDs of the items to removecontext
- the current context
int deleteMediaItems(java.lang.Long[] itemIds, BizContext context)
itemIds
- the media item IDs to deletecontext
- the current context
java.util.List<MediaItem> getMediaItemsForAlbum(Album album, BizContext context)
album
- the Albumcontext
- the current context
org.springframework.core.io.Resource getMediaItemResource(MediaItem item)
item
- the item
Geometry getGeometry(MediaSize size)
size
- the size
float getQualityValue(MediaQuality quality)
quality
- the quality
Geometry getScaledGeometry(MediaItem item, MediaRequest request)
MediaSize
set on the request.
item
- the media item for the current requestrequest
- the current request
int addMediaItemsToAlbum(Album album, java.lang.Long[] mediaItemIds, BizContext context)
album
- the albummediaItemIds
- the IDs of the media items to addcontext
- the context
void sortAlbumItems(Album album)
album
- the album to sortjava.lang.String shareAlbum(ShareAlbumCommand command, BizContext context)
command
- the share album commandcontext
- the context
void unShareAlbum(java.lang.Long albumId, BizContext context)
albumId
- the ID of the album to unsharecontext
- the contextAlbum getSharedAlbum(java.lang.String key, BizContext context)
key
- the anonymous key of the albumcontext
- the context
Album getAlbum(java.lang.Long albumId, BizContext context)
The Album may not have any MediaItem instances populated
in it. Use the getAlbumWithItems(Long, BizContext)
method to get an Album with its items at the same time.
albumId
- the ID of the Album to getcontext
- the context
Album getAlbumParent(java.lang.Long childAlbumId, BizContext context)
childAlbumId
- the ID of the child album to get the parent ofcontext
- the context
java.lang.Long storeAlbum(Album album, BizContext context)
This method will accept new albums as well as updates to existing albums.
album
- the Album to storecontext
- the context
void storeAlbumParent(java.lang.Long childAlbumId, java.lang.Long parentAlbumId, BizContext context)
If parentAlbumId
is null then the album
for childAlbumId
should be made a top-level album.
childAlbumId
- the ID of the child albumparentAlbumId
- the ID of the parent albumcontext
- the contextvoid storeAlbumOrdering(SortAlbumsCommand command, BizContext context)
command
- the sort commandcontext
- the contextvoid storeMediaItemOrdering(SortMediaItemsCommand command, BizContext context)
command
- the sort commandcontext
- the contextvoid storeMediaItemUserComment(UserCommentCommand command, BizContext context)
UserComment
to a MediaItem.
command
- user comment commandcontext
- the contextint incrementMediaItemHits(java.lang.Long itemId)
itemId
- the ID of the item to increment
java.util.List<KeyNameType> getAlbumSortTypes(BizContext context)
This is to allow the available sort types to be displayed on the front-end.
context
- the context
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |