Package org.richfaces.photoalbum.model

Examples of org.richfaces.photoalbum.model.Album


     *
     * @param image - image to delete
     * @throws PhotoAlbumException
     */
    public void deleteImage(Image image) throws PhotoAlbumException {
        Album parentAlbum = em.find(Album.class, image.getAlbum().getId());
        try {
            parentAlbum.removeImage(image);
            em.merge(parentAlbum);
            em.flush();

            // 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


     * @param album - dragged album
     * @param pathOld - old path of album directory
     */
    public void renameAlbumDirectory(@Observes @EventType(Events.ALBUM_DRAGGED_EVENT) AlbumEvent ae) {
        String pathOld = ae.getPath();
        Album album = ae.getAlbum();
        File file = getFileByPath(pathOld);
        File file2 = getFileByPath(album.getPath());
        if (file2.exists()) {
            if (file2.isDirectory()) {
                FileManipulation.deleteDirectory(file2, false);
            } else {
                FileManipulation.deleteFile(file2);
View Full Code Here

     * Refresh state of given album
     *
     * @param album - album to Synchronize
     */
    public Album resetAlbum(Album album) {
        Album a = em.merge(album);
        em.refresh(a);
        return a;
    }
View Full Code Here

     */
    public void createAlbum(Shelf shelf, boolean isShowAlbumAfterCreate) {
        if (user == null) {
            return;
        }
        album = new Album();
        if (shelf == null) {
            if (model.getSelectedShelf() != null) {
                shelf = model.getSelectedShelf();
            } else if (user.getShelves().size() > 0) {
                shelf = user.getShelves().get(0);
View Full Code Here

        Object dragValue = dropEvent.getDragValue();
        Event event = (Event) dropEvent.getDropValue();

        if (dragValue instanceof Album) {
            Album album = (Album) dragValue;

            String pathOld = album.getPath();

            event.getShelf().addAlbum(album);

            try {
                albumAction.editAlbum(album);
View Full Code Here

            }
        }
    }

    private void createAlbum(String name, Event event) {
        album = new Album();
        album.setName(name);
        album.setShelf(event.getShelf());

        albumManager.addAlbum(album);
    }
View Full Code Here

TOP

Related Classes of org.richfaces.photoalbum.model.Album

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.