RichFaces Photoalbum 4.3.5.Final

org.richfaces.photoalbum.manager
Class Controller

java.lang.Object
  extended by org.richfaces.photoalbum.manager.Controller
All Implemented Interfaces:
Serializable

@Named
@SessionScoped
public class Controller
extends Object
implements Serializable

This class represent 'C' in MVC pattern. It is logic that determine what actions invoked and what next page need to be showed. Typically on almost all user actions, this class populates the model and determine new view to show. Also contain utility logic, such as checking is the given shelf belongs to the specified user etc..

Author:
Andrey Markhel
See Also:
Serialized Form

Constructor Summary
Controller()
           
 
Method Summary
 Boolean adviseNodeSelected(org.richfaces.component.UITree tree)
          This utility method determine if the specified node should be marked as selected.
 void cancelEditAlbum()
          This method invoked after the user want to interrupt edit album process
 void cancelEditImage()
          This method invoked after the user want to interrupt edit image process
 void cancelEditShelf()
          This method invoked after the user want to interrupt edit shelf process
 void cancelEditUser()
          This method invoked after the user want to interrupt edit user process
 void cancelRegistration()
          This method invoked after the user want to interrupt registration process
 void editUser()
          This method invoked after the user want to save just edited user to database.
 Integer getFPage()
           
 Integer getGplusPage()
           
 Integer getPage()
          This utility method used by custom datascroller to determine images to show.
 boolean isEventFacebookAlbum(String id)
           
 boolean isEventGoogleAlbum(String id)
           
 boolean isProfileEditable(User selectedUser)
          This utility method used to determine if the specified user can be edited
 boolean isUserAlbum(Album album)
          This utility method used to determine if the specified album belongs to the logged user
 boolean isUserHaveAlbums()
          This utility method used to determine if the logged user have any albums.
 boolean isUserHaveShelves()
          This utility method used to determine if the logged user have any shelves.
 boolean isUserImage(Image image)
          This utility method used to determine if the specified image belongs to the logged user
 boolean isUserShelf(Shelf shelf)
          This utility method used to determine if the specified shelf belongs to the logged user
 void onAlbumAdded(AlbumEvent ae)
          This method observes Constants.ALBUM_ADDED_EVENT and invoked after the user add new album
 void onAlbumDeleted(AlbumEvent ae)
          This method observes Constants.ALBUM_DELETED_EVENT and invoked after the user delete her album
 void onAlbumEdited(AlbumEvent ae)
          This method observes Constants.ALBUM_EDITED_EVENT and invoked after the user edit her album
 void onAuthenticate(SimpleEvent se)
          This method observes Constants.AUTHENTICATED_EVENT and invoked after the user successfully authenticate to the system
 void onEventAdded(ShelfEvent se)
           
 void onEventDeleted(ShelfEvent se)
           
 void onEventEdited(ShelfEvent se)
           
 void onImageDeleted(ImageEvent ie)
          This method observes Constants.IMAGE_DELETED_EVENT and invoked after the user delete her image
 void onShelfAdded(ShelfEvent se)
          This method observes Constants.SHELF_ADDED_EVENT and invoked after the user add new shelf
 void onShelfDeleted(ShelfEvent se)
          This method observes Constants.SHELF_DELETED_EVENT and invoked after the user delete her shelf
 void onShelfEdited(ShelfEvent se)
          This method observes Constants.SHELF_EDITED_EVENT and invoked after the user edit her shelf
 void resetFileUpload()
          This method invoked in cases, when it is need to clear fileUpload component
 void selectAlbums()
          This method invoked after the user want to see all her albums.
 void selectImages()
          This method invoked after the user want to see all her images.
 void selectPublicShelves()
          This method invoked after the user want to see all predefined shelves, existed in application
 void selectShelves()
          This method invoked after the user want to see all her shelves.
 void setFPage(Integer page)
           
 void setGplusPage(Integer page)
           
 void setPage(Integer page)
           
 void showAlbum(Album album)
          This method invoked after the user want to see specified album independently is it her album or not.
 void showError(String summary, String errorMessage)
          This utility method invoked in case if you want to show to the user specified error in popup
 void showEvent(Event event)
           
 void showFBAlbum(String albumId)
           
 void showFbImage(String imageId)
           
 void showFbShelf()
           
 void showFileUpload()
          This method invoked after the user want to go to the file-upload page
 void showFileUpload(Album album)
          This method invoked after the user want to go to the file-upload page and download images to the specified album
 void showGPlusAlbum()
           
 void showGPlusImage(String imageId)
           
 void showGPlusShelf()
           
 void showImage(Image image)
          This method invoked after the user want to see specified image independently is it her image or not.
 void showNextFbImage()
           
 void showNextGPlusImage()
           
 void showNextImage()
           
 void showPrevFbImage()
           
 void showPrevGPlusImage()
           
 void showPrevImage()
           
 void showSharedAlbums(User user)
          This method invoked after the user want to see all shared albums of the specified user
 void showSharedImages(User user)
          This method invoked after the user want to see all shared images of the specified user
 void showShelf(Shelf shelf)
          This method invoked after the user want to see specified shelf independently is it her shelf or not.
 void showTag(MetaTag metatag)
          This method invoked after the user want to see all images, related to the of specified album
 void showUnvisitedImages(Album album)
          This method invoked after the user want to see all unvisited images, belongs to the of specified album
 void showUnvisitedImages(Shelf shelf)
          This method invoked after the user want to see all unvisited images, belongs to the of specified shelf
 void showUser(User user)
          This method invoked after the user want to see profile of the specified user
 void startEditAlbum(Album album)
          This method invoked after the user want to edit specified album.
 void startEditImage(Image image)
          This method invoked after the user want to edit specified image.
 void startEditShelf(Shelf shelf)
          This method invoked after the user want to edit specified shelf.
 void startRegistration(SimpleEvent se)
          This method observes Constants.START_REGISTER_EVENT and invoked after the user want to start registration process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Controller

public Controller()
Method Detail

selectPublicShelves

public void selectPublicShelves()
This method invoked after the user want to see all predefined shelves, existed in application


selectShelves

public void selectShelves()
This method invoked after the user want to see all her shelves.


selectAlbums

public void selectAlbums()
This method invoked after the user want to see all her albums.


selectImages

public void selectImages()
This method invoked after the user want to see all her images.


startEditShelf

public void startEditShelf(Shelf shelf)
This method invoked after the user want to edit specified shelf.

Parameters:
shelf - - shelf to edit

cancelEditShelf

public void cancelEditShelf()
This method invoked after the user want to interrupt edit shelf process


showAlbum

public void showAlbum(Album album)
This method invoked after the user want to see specified album independently is it her album or not.

Parameters:
album - - album to show

showFBAlbum

public void showFBAlbum(String albumId)

showFbImage

public void showFbImage(String imageId)

showFbShelf

public void showFbShelf()

showGPlusShelf

public void showGPlusShelf()

showGPlusAlbum

public void showGPlusAlbum()

showGPlusImage

public void showGPlusImage(String imageId)

resetFileUpload

public void resetFileUpload()
This method invoked in cases, when it is need to clear fileUpload component


showImage

public void showImage(Image image)
This method invoked after the user want to see specified image independently is it her image or not.

Parameters:
album - - album to show

showNextImage

public void showNextImage()

showPrevImage

public void showPrevImage()

showNextFbImage

public void showNextFbImage()

showPrevFbImage

public void showPrevFbImage()

showNextGPlusImage

public void showNextGPlusImage()

showPrevGPlusImage

public void showPrevGPlusImage()

startEditImage

public void startEditImage(Image image)
This method invoked after the user want to edit specified image.

Parameters:
image - - image to edit

editUser

public void editUser()
This method invoked after the user want to save just edited user to database.


cancelEditUser

public void cancelEditUser()
This method invoked after the user want to interrupt edit user process


cancelEditImage

public void cancelEditImage()
This method invoked after the user want to interrupt edit image process


showShelf

public void showShelf(Shelf shelf)
This method invoked after the user want to see specified shelf independently is it her shelf or not.

Parameters:
album - - album to show

showEvent

public void showEvent(Event event)

startEditAlbum

public void startEditAlbum(Album album)
This method invoked after the user want to edit specified album.

Parameters:
album - - album to edit

cancelEditAlbum

public void cancelEditAlbum()
This method invoked after the user want to interrupt edit album process


onAlbumAdded

public void onAlbumAdded(@Observes
                         AlbumEvent ae)
This method observes Constants.ALBUM_ADDED_EVENT and invoked after the user add new album

Parameters:
album - - added album

onAlbumEdited

public void onAlbumEdited(@Observes
                          AlbumEvent ae)
This method observes Constants.ALBUM_EDITED_EVENT and invoked after the user edit her album

Parameters:
album - - edited album

onAlbumDeleted

public void onAlbumDeleted(@Observes
                           AlbumEvent ae)
This method observes Constants.ALBUM_DELETED_EVENT and invoked after the user delete her album

Parameters:
album - - deleted album
path - - relative path of the album directory

onShelfDeleted

public void onShelfDeleted(@Observes
                           ShelfEvent se)
This method observes Constants.SHELF_DELETED_EVENT and invoked after the user delete her shelf

Parameters:
shelf - - deleted shelf
path - - relative path of the shelf directory

onShelfAdded

public void onShelfAdded(@Observes
                         ShelfEvent se)
This method observes Constants.SHELF_ADDED_EVENT and invoked after the user add new shelf

Parameters:
shelf - - added shelf

onShelfEdited

public void onShelfEdited(@Observes
                          ShelfEvent se)
This method observes Constants.SHELF_EDITED_EVENT and invoked after the user edit her shelf

Parameters:
shelf - - edited shelf

onEventDeleted

public void onEventDeleted(@Observes
                           ShelfEvent se)

onEventAdded

public void onEventAdded(@Observes
                         ShelfEvent se)

onEventEdited

public void onEventEdited(@Observes
                          ShelfEvent se)

onImageDeleted

public void onImageDeleted(@Observes
                           ImageEvent ie)
This method observes Constants.IMAGE_DELETED_EVENT and invoked after the user delete her image

Parameters:
image - - deleted image
path - - relative path of the image file

onAuthenticate

public void onAuthenticate(@Observes
                           SimpleEvent se)
This method observes Constants.AUTHENTICATED_EVENT and invoked after the user successfully authenticate to the system

Parameters:
u - - authenticated user

showFileUpload

public void showFileUpload()
This method invoked after the user want to go to the file-upload page


showFileUpload

public void showFileUpload(Album album)
This method invoked after the user want to go to the file-upload page and download images to the specified album

Parameters:
album - - selected album

showSharedAlbums

public void showSharedAlbums(User user)
This method invoked after the user want to see all shared albums of the specified user

Parameters:
user - - user to see

showSharedImages

public void showSharedImages(User user)
This method invoked after the user want to see all shared images of the specified user

Parameters:
user - - user to see

showUser

public void showUser(User user)
This method invoked after the user want to see profile of the specified user

Parameters:
user - - user to see

showUnvisitedImages

public void showUnvisitedImages(Shelf shelf)
This method invoked after the user want to see all unvisited images, belongs to the of specified shelf

Parameters:
shelf - - shelf to see

showUnvisitedImages

public void showUnvisitedImages(Album album)
This method invoked after the user want to see all unvisited images, belongs to the of specified album

Parameters:
album - - album to see

showTag

public void showTag(MetaTag metatag)
This method invoked after the user want to see all images, related to the of specified album

Parameters:
metatag - - tag to see

startRegistration

public void startRegistration(@Observes
                              SimpleEvent se)
This method observes Constants.START_REGISTER_EVENT and invoked after the user want to start registration process.


cancelRegistration

public void cancelRegistration()
This method invoked after the user want to interrupt registration process


adviseNodeSelected

public Boolean adviseNodeSelected(org.richfaces.component.UITree tree)
This utility method determine if the specified node should be marked as selected. Used in internal rich:tree mechanism


getPage

public Integer getPage()
This utility method used by custom datascroller to determine images to show. Used in internal rich:tree mechanism


setPage

public void setPage(Integer page)

getFPage

public Integer getFPage()

setFPage

public void setFPage(Integer page)

getGplusPage

public Integer getGplusPage()

setGplusPage

public void setGplusPage(Integer page)

isUserImage

public boolean isUserImage(Image image)
This utility method used to determine if the specified image belongs to the logged user

Parameters:
image - - image to check

isUserHaveShelves

public boolean isUserHaveShelves()
This utility method used to determine if the logged user have any shelves.


isUserHaveAlbums

public boolean isUserHaveAlbums()
This utility method used to determine if the logged user have any albums.


isUserShelf

public boolean isUserShelf(Shelf shelf)
This utility method used to determine if the specified shelf belongs to the logged user

Parameters:
shelf - - shelf to check

isUserAlbum

public boolean isUserAlbum(Album album)
This utility method used to determine if the specified album belongs to the logged user

Parameters:
album - - album to check

isProfileEditable

public boolean isProfileEditable(User selectedUser)
This utility method used to determine if the specified user can be edited

Parameters:
user - - user to check

showError

public void showError(String summary,
                      String errorMessage)
This utility method invoked in case if you want to show to the user specified error in popup

Parameters:
error - - error to show

isEventFacebookAlbum

public boolean isEventFacebookAlbum(String id)

isEventGoogleAlbum

public boolean isEventGoogleAlbum(String id)

RichFaces Photoalbum 4.3.5.Final

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