Examples of ErrorEvent


Examples of org.richfaces.photoalbum.model.event.ErrorEvent

     *
     * @param keyword - keyword to search
     */
    public void searchKeyword(String keyword) {
        if (!isSearchOptionSelected()) {
            error.fire(new ErrorEvent(Constants.SEARCH_NO_OPTIONS_ERROR));
            return;
        }
        Iterator<ISearchOption> it = searchOptionsHolder.getOptions().iterator();
        selectedKeyword = keyword.trim();
        while (it.hasNext()) {
            ISearchOption option = it.next();
            try {
                if (option.getSelected()) {
                    option.search(searchAction, selectedKeyword, searchOptionsHolder.isSeachInMyAlbums(),
                        searchOptionsHolder.isSearchInShared());
                }
            } catch (PhotoAlbumException e) {
                error.fire(new ErrorEvent(option.getName() + ":" + e.getMessage()));
            }
        }
    }
View Full Code Here

Examples of org.richfaces.photoalbum.model.event.ErrorEvent

                setLoginFailed(false);
                return true;
            }
        } catch (Exception nre) {
            loginFailed();
            error.fire(new ErrorEvent("Error:" + nre.getMessage()));
            return false;
        }
        return false;
    }
View Full Code Here

Examples of org.richfaces.photoalbum.model.event.ErrorEvent

            }

            return true;
        } catch (Exception nre) {
            loginFailed();
            error.fire(new ErrorEvent("Error:" + nre.getMessage()));
            return false;
        }
    }
View Full Code Here

Examples of org.richfaces.photoalbum.model.event.ErrorEvent

            }

            return true;
        } catch (Exception nre) {
            loginFailed();
            error.fire(new ErrorEvent("Error:" + nre.getMessage()));
            return false;
        }
    }
View Full Code Here

Examples of org.richfaces.photoalbum.model.event.ErrorEvent

            return;
        }
        try {
            userAction.register(user);
        } catch (Exception e) {
            error.fire(new ErrorEvent(Constants.REGISTRATION_ERROR + ": " + e.getMessage()));
            return;
        }
        // Registration was successful, so we can login this user.
        try {
            this.user = userBean.logIn(user.getLogin(), HashUtils.hash(user.getPassword()));
        } catch (Exception e) {
            error.fire(new ErrorEvent(Constants.LOGIN_ERROR + "\n" + e.getMessage()));
            return;
        }
        if (this.user == null) {
            error.fire(new ErrorEvent(Constants.LOGIN_ERROR));
        }
        navEvent.fire(new NavEvent(NavigationEnum.USER_PREFS));

        UIComponent root = FacesContext.getCurrentInstance().getViewRoot();
        UIComponent component = root.findComponent("overForm");
View Full Code Here

Examples of org.richfaces.photoalbum.model.event.ErrorEvent

    public void editUser(@Observes @EventType(Events.EDIT_USER_EVENT) SimpleEvent se) {
        avatarData = uph.getAvatarData();
        // If new avatar was uploaded
        if (avatarData != null) {
            if (!fileManager.saveAvatar(avatarData, user)) {
                error.fire(new ErrorEvent(Constants.FILE_IO_ERROR));
                return;
            }
            avatarData.delete();
            avatarData = null;
            uph.setAvatarData(null);
            user.setHasAvatar(true);
        }
        try {
            // This check is actual only on livedemo server to prevent hacks.
            // Prevent hackers to mark user as pre-defined
            //user.setPreDefined(false);
            userAction.updateUser(user);
        } catch (Exception e) {
            error.fire(new ErrorEvent("Error", Constants.UPDATE_USER_ERROR + " <br/>" + e.getMessage()));
            return;
        }
    }
View Full Code Here

Examples of org.richfaces.photoalbum.model.event.ErrorEvent

    private boolean handleAvatar(User user) {
        avatarData = uph.getAvatarData();
        if (avatarData != null) {
            user.setHasAvatar(true);
            if (fileManager == null || !fileManager.saveAvatar(avatarData, user)) {
                error.fire(new ErrorEvent(Constants.AVATAR_SAVING_ERROR));
                return false;
            }
        }
        return true;
    }
View Full Code Here

Examples of org.richfaces.photoalbum.model.event.ErrorEvent

            newEvent.setShelf(newShelf);

            eventAction.addEvent(newEvent);
            shelfAction.addShelf(newShelf);
        } catch (Exception e) {
            error.fire(new ErrorEvent("Error", Constants.EVENT_SAVING_ERROR + " <br /> " + e.getMessage()));
            logger.log(Level.SEVERE, "exception occured", e);
            return;
        }
        shelfEvent.select(new EventTypeQualifier(Events.EVENT_ADDED_EVENT)).fire(new ShelfEvent(newEvent));
    }
View Full Code Here

Examples of org.richfaces.photoalbum.model.event.ErrorEvent

            return;
        }
        try {
            eventAction.editEvent(event);
        } catch (Exception e) {
            error.fire(new ErrorEvent("Error", Constants.EVENT_SAVING_ERROR + " <br /> " + e.getMessage()));
            eventAction.resetEvent(event);
            return;
        }
        shelfEvent.select(new EventTypeQualifier(Events.EVENT_EDITED_EVENT)).fire(new ShelfEvent(event));
    }
View Full Code Here

Examples of org.richfaces.photoalbum.model.event.ErrorEvent

            return;
        }
        try {
            eventAction.deleteEvent(event);
        } catch (Exception e) {
            error.fire(new ErrorEvent("Error", Constants.EVENT_DELETING_ERROR + " <br /> " + e.getMessage()));
            return;
        }
        shelfEvent.select(new EventTypeQualifier(Events.EVENT_DELETED_EVENT)).fire(new ShelfEvent(event));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.