RichFaces Photoalbum 4.3.5.Final

org.richfaces.photoalbum.model.actions
Class ImageAction

java.lang.Object
  extended by org.richfaces.photoalbum.model.actions.ImageAction
All Implemented Interfaces:
IImageAction

public class ImageAction
extends Object
implements IImageAction

Class for manipulating with image entity. Analogous to DAO pattern. EJB3 Bean

Author:
Andrey Markhel

Constructor Summary
ImageAction()
           
 
Method Summary
 void addComment(Comment comment)
          Add comment from image
 void addImage(Image image)
          Persist image entity to database
 void addMetaTag(Image image, MetaTag metaTag)
          Add MetaTag to image
 void deleteComment(Comment comment)
          Remove comment from image
 void deleteImage(Image image)
          Remove image entity from database
 void editImage(Image image, boolean metatagsChanged)
          Synchronize state of image entity with database
 List<Comment> findAllUserComments(User user)
          Retrieve all cooments posted by given user.
 Long getCountIdenticalImages(Album album, String path)
          Return count of images with path, that started from specified path already exist in specified album
 List<MetaTag> getPopularTags()
          Find most-popular metatags
 MetaTag getTagByName(String tag)
          Find metatag object by its string representation
 List<MetaTag> getTagsLikeString(String suggest)
          Find List of metatags, similar to specified string.
 boolean isImageWithThisPathExist(Album album, String path)
          Check if image with specified path already exist in specified album
 void removeMetaTag(Image image, MetaTag metaTag)
          Remove MetaTag to image
 void resetImage(Image image)
          Refresh state of given image
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageAction

public ImageAction()
Method Detail

deleteImage

public void deleteImage(Image image)
                 throws PhotoAlbumException
Remove image entity from database

Specified by:
deleteImage in interface IImageAction
Parameters:
image - - image to delete
Throws:
PhotoAlbumException

editImage

public void editImage(Image image,
                      boolean metatagsChanged)
               throws PhotoAlbumException
Synchronize state of image entity with database

Specified by:
editImage in interface IImageAction
Parameters:
image - - image to Synchronize
metatagsChanged - - boolean value, that indicates is metatags of this image were changed(add new or delete older)
Throws:
PhotoAlbumException

addImage

public void addImage(Image image)
              throws PhotoAlbumException
Persist image entity to database

Specified by:
addImage in interface IImageAction
Parameters:
image - - image to add
Throws:
PhotoAlbumException

deleteComment

public void deleteComment(Comment comment)
                   throws PhotoAlbumException
Remove comment from image

Specified by:
deleteComment in interface IImageAction
Parameters:
comment - - comment to remove
Throws:
PhotoAlbumException

addComment

public void addComment(Comment comment)
                throws PhotoAlbumException
Add comment from image

Specified by:
addComment in interface IImageAction
Parameters:
comment - - comment to add
Throws:
PhotoAlbumException

addMetaTag

public void addMetaTag(Image image,
                       MetaTag metaTag)
                throws PhotoAlbumException
Add MetaTag to image

Parameters:
image - - image to which the tag is added
metaTage - - metaTag to be added
Throws:
PhotoAlbumException

removeMetaTag

public void removeMetaTag(Image image,
                          MetaTag metaTag)
                   throws PhotoAlbumException
Remove MetaTag to image

Parameters:
image - - image to which the tag is added
metaTage - - metaTag to be added
Throws:
PhotoAlbumException

getTagByName

public MetaTag getTagByName(String tag)
Find metatag object by its string representation

Specified by:
getTagByName in interface IImageAction
Parameters:
tag - - string representation of metatag
Returns:
metatag object or null

getPopularTags

public List<MetaTag> getPopularTags()
Find most-popular metatags

Specified by:
getPopularTags in interface IImageAction
Returns:
list of most-popular metatags

getTagsLikeString

public List<MetaTag> getTagsLikeString(String suggest)
Find List of metatags, similar to specified string. Used in autosuggect

Specified by:
getTagsLikeString in interface IImageAction
Parameters:
suggest - - string to search; has to be set to lowerCase since this cannot be done inside a query
Returns:
list of most-popular metatags

isImageWithThisPathExist

public boolean isImageWithThisPathExist(Album album,
                                        String path)
Check if image with specified path already exist in specified album

Specified by:
isImageWithThisPathExist in interface IImageAction
Parameters:
album - - album to check
path - - path to check
Returns:
is image with specified path already exist

getCountIdenticalImages

public Long getCountIdenticalImages(Album album,
                                    String path)
Return count of images with path, that started from specified path already exist in specified album

Specified by:
getCountIdenticalImages in interface IImageAction
Parameters:
album - - album to check
path - - path to check
Returns:
count of images

findAllUserComments

public List<Comment> findAllUserComments(User user)
Retrieve all cooments posted by given user.

Specified by:
findAllUserComments in interface IImageAction
Returns:
list of comments

resetImage

public void resetImage(Image image)
Refresh state of given image

Specified by:
resetImage in interface IImageAction
Parameters:
image - - image to Synchronize

RichFaces Photoalbum 4.3.5.Final

Copyright © 2014 JBoss by Red Hat. All Rights Reserved.