Package org.encuestame.persistence.exception

Examples of org.encuestame.persistence.exception.EnMeExpcetion


            geoPoint.setLocationDescription(locationBean.getName());
            geoPoint.setLocationLatitude(locationBean.getLat());
            geoPoint.setLocationLongitude(locationBean.getLng());
            getGeoPointDao().saveOrUpdate(geoPoint);
        }else{
            throw new EnMeExpcetion("geoPoint not found");
        }
   }
View Full Code Here


                }
                getGeoPointDao().saveOrUpdate(geoPointDomain);
                location.setId(geoPointDomain.getLocateId());
                createNotification(NotificationEnum.LOCATION_NEW, location.getName() +" is created.", geoPointDomain.getAccount());
            } catch (Exception e) {
                throw new EnMeExpcetion(e);
            }
            return location;
        } else {
            throw new EnMeExpcetion("location info not found");
        }
    }
View Full Code Here

     */
    public void updateLocationMap(final UnitLocationBean locationBean, final Long locationId, final String username) throws EnMeExpcetion, EnMeNoResultsFoundException{
        final GeoPoint location = getLocation(locationId, username);
        log.info("location map location "+location);
        if(location == null){
            throw new EnMeExpcetion("location not found");
        }
        else{
            location.setLocationAccuracy(locationBean.getAccuracy());
            location.setLocationLatitude(locationBean.getLat());
            location.setLocationAddress(locationBean.getAddress());
View Full Code Here

            final Integer maxResults,
            final Integer start) throws EnMeExpcetion{
             List<Gadget> gadgets  = new ArrayList<Gadget>();
            List<GadgetBean> gadgetBean = new ArrayList<GadgetBean>();
            if (keyword == null) {
               throw new EnMeExpcetion("keyword is missing");
            } else {
                gadgets = getDashboardDao().getGadgetbyKeyword(keyword, maxResults, start);
                gadgetBean.addAll(ConvertDomainBean.convertListGadgetToBean(gadgets));
            }
            log.info("search keyword Gadgets size "+gadgets.size());
View Full Code Here

    public List<Dashboard> getDashboardsbyKeyword(final String keyword,
            final Integer maxResults,
            final Integer start) throws EnMeExpcetion{
        List<Dashboard> dashboardList = new ArrayList<Dashboard>();
        if(keyword!= null){
            throw new EnMeExpcetion("keyword is missing");
        }
        else {
          dashboardList = getDashboardDao().retrieveDashboardbyKeyword(keyword, getUserAccount(getUserPrincipalUsername()), maxResults, start);
        }
        return dashboardList;
View Full Code Here

            arrayAsIng[i] = Integer.valueOf(versionArray[i]);
        }
        if (arrayAsIng.length == 3) {
            return arrayAsIng;
        } else {
            throw new EnMeExpcetion("version not valid  or not compatible");
        }
    }
View Full Code Here

            //saving user.
            getAccountDao().saveOrUpdate(userDomain);
        }
        else {
            //if we have a problem with user, we retrieve null value
           throw new EnMeExpcetion("error on renew password");
        }
        return newPassword;
    }
View Full Code Here

            getGroupDao().saveOrUpdate(group);
            log.info("group new name "+group.getGroupName());
            log.info("group new description "+group.getGroupDescriptionInfo());
            groupBean = ConvertDomainBean.convertGroupDomainToBean(group);
        } else {
            throw new EnMeExpcetion("group not found");
        }
        return groupBean;
    }
View Full Code Here

        if (userBean.getEmail() != null && userBean.getUsername() != null) {
            userAccount.setUserEmail(userBean.getEmail());
            userAccount.setUsername(userBean.getUsername());
            userAccount.setAccount(account);
        } else {
            throw new EnMeExpcetion("needed email and username to create user");
        }
        String password = null;
        if (userBean.getPassword() != null) {
             password = userBean.getPassword();
             userAccount.setPassword(EnMePasswordUtils.encryptPassworD(password));
        }
        else{
            password = generatePassword();
            userAccount.setPassword(EnMePasswordUtils.encryptPassworD(password));
        }
        //TODO: maybe we need create a table for editor permissions
        userAccount.setCompleteName(userBean.getName() == null ? "" : userBean.getUsername());
        userAccount.setUserStatus(Boolean.TRUE);
        userAccount.setEnjoyDate(Calendar.getInstance().getTime());
            // send to user the password to her emails
            final SignUpBean singUpBean = new SignUpBean();
            singUpBean.setEmail(userBean.getEmail());
            singUpBean.setFullName(userAccount.getCompleteName());
            singUpBean.setUsername(userBean.getUsername());
            singUpBean.setPassword(password);
            final String inviteCode =  UUID.randomUUID().toString();
            userAccount.setInviteCode(inviteCode);
            try {
                getMailService().sendConfirmYourAccountEmail(singUpBean, inviteCode);
            } catch (Exception e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
            }
            try {
                getMailService().sendPasswordConfirmationEmail(singUpBean);
            } catch (Exception e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
            }
            // save user
            getAccountDao().saveOrUpdate(userAccount);
            // assing first default group to user
            final UserAccount retrievedUser = getAccountDao().getUserAccountById(userAccount.getUid());
            final Permission permission = getPermissionByName(SecurityService.DEFAULT);
            if (permission != null) {
                final List<Permission> all = getPermissionDao().findAllPermissions();
                log.info("all permission "+all.size());
                log.info("default permission "+permission);
                retrievedUser.getSecUserPermissions().add(permission);
            }
            else{
                log.warn("error assing default permissions");
            }
            log.info("saving user");
            try{
                getAccountDao().saveOrUpdate(retrievedUser);
            } catch (Exception e) {
                log.debug(e);
                throw new EnMeExpcetion(e.getMessage());
            }
    }
View Full Code Here

           log.info("user selected "+userDomain.getUid());
           userDomain.getSecUserPermissions().add(permissionDomain);
           getAccountDao().saveOrUpdate(userDomain);
           log.info("saved permission "+userDomain.getSecUserPermissions().size());
        } else {
            throw new EnMeExpcetion("error adding permission");
        }
    }
View Full Code Here

TOP

Related Classes of org.encuestame.persistence.exception.EnMeExpcetion

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.