Package org.richfaces.photoalbum.util

Examples of org.richfaces.photoalbum.util.PhotoAlbumException


                } else if (searchInShared) {
                    strategy = new SearchSharedShelvesStrategy();
                } else if (searchInMy) {
                    strategy = new SearchMyShelvesStrategy();
                } else {
                    throw new PhotoAlbumException(Constants.WRONG_SEARCH_PARAMETERS_ERROR);
                }
                break;
            }
            case ALBUM: {
                if (searchInShared && searchInMy) {
                    strategy = new SearchBothAlbumsStrategy();
                } else if (searchInShared) {
                    strategy = new SearchSharedAlbumsStrategy();
                } else if (searchInMy) {
                    strategy = new SearchMyAlbumsStrategy();
                } else {
                    throw new PhotoAlbumException(Constants.WRONG_SEARCH_PARAMETERS_ERROR);
                }
                break;
            }
            case IMAGE: {
                if (searchInShared && searchInMy) {
                    strategy = new SearchBothImagesStrategy();
                } else if (searchInShared) {
                    strategy = new SearchSharedImagesStrategy();
                } else if (searchInMy) {
                    strategy = new SearchMyImagesStrategy();
                } else {
                    throw new PhotoAlbumException(Constants.WRONG_SEARCH_PARAMETERS_ERROR);
                }
                break;
            }
            case METATAG: {
                strategy = new SearchMetatagsStrategy();
                break;
            }
            default:
                throw new PhotoAlbumException(Constants.WRONG_SEARCH_PARAMETERS_ERROR);
        }
        return strategy.getQuery(em, parameters, queryString);
    }
View Full Code Here


     */
    public List<Album> searchByAlbum(String searchQuery, boolean searchInMyAlbums, boolean searchInShared)
        throws PhotoAlbumException {
        Query query = searchQueryFactory.getQuery(SearchEntityEnum.ALBUM, user, searchInShared, searchInMyAlbums, searchQuery);
        if (null == query) {
            throw new PhotoAlbumException(Constants.WRONG_SEARCH_PARAMETERS_ERROR);
        }
        return (List<Album>) query.getResultList();
    }
View Full Code Here

     */
    public List<Image> searchByImage(String searchQuery, boolean searchInMyAlbums, boolean searchInShared)
        throws PhotoAlbumException {
        Query query = searchQueryFactory.getQuery(SearchEntityEnum.IMAGE, user, searchInShared, searchInMyAlbums, searchQuery);
        if (null == query) {
            throw new PhotoAlbumException(Constants.WRONG_SEARCH_PARAMETERS_ERROR);
        }
        return (List<Image>) query.getResultList();
    }
View Full Code Here

     */
    public List<User> searchByUsers(String searchQuery, boolean searchInMyAlbums, boolean searchInShared)
        throws PhotoAlbumException {
        Query query = searchQueryFactory.getQuery(SearchEntityEnum.USER, user, searchInShared, searchInMyAlbums, searchQuery);
        if (null == query) {
            throw new PhotoAlbumException(Constants.WRONG_SEARCH_PARAMETERS_ERROR);
        }
        return (List<User>) query.getResultList();
    }
View Full Code Here

    public List<MetaTag> searchByTags(String searchQuery, boolean searchInMyAlbums, boolean searchInShared)
        throws PhotoAlbumException {
        Query query = searchQueryFactory
            .getQuery(SearchEntityEnum.METATAG, user, searchInShared, searchInMyAlbums, searchQuery);
        if (null == query) {
            throw new PhotoAlbumException(Constants.WRONG_SEARCH_PARAMETERS_ERROR);
        }
        return (List<MetaTag>) query.getResultList();
    }
View Full Code Here

     */
    public List<Shelf> searchByShelves(String searchQuery, boolean searchInMyAlbums, boolean searchInShared)
        throws PhotoAlbumException {
        Query query = searchQueryFactory.getQuery(SearchEntityEnum.SHELF, user, searchInShared, searchInMyAlbums, searchQuery);
        if (null == query) {
            throw new PhotoAlbumException(Constants.WRONG_SEARCH_PARAMETERS_ERROR);
        }
        return (List<Shelf>) query.getResultList();
    }
View Full Code Here

            // the image will be sent in an event
            image.setAlbum(parentAlbum);
        } catch (Exception e) {
            parentAlbum.addImage(image);
            throw new PhotoAlbumException(e.getMessage());
        }
    }
View Full Code Here

            }
            em.merge(image);
            em.flush();
        } catch (Exception e) {
            throw new PhotoAlbumException(e.getMessage());
        }
    }
View Full Code Here

        try {
            em.persist(image);
            image.getAlbum().addImage(image);
            em.flush();
        } catch (Exception e) {
            throw new PhotoAlbumException(e.getMessage());
        }
    }
View Full Code Here

            Image image = comment.getImage();
            image.removeComment(comment);
            em.remove(em.merge(comment));
            em.flush();
        } catch (Exception e) {
            throw new PhotoAlbumException(e.getMessage());
        }
    }
View Full Code Here

TOP

Related Classes of org.richfaces.photoalbum.util.PhotoAlbumException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.