Package org.opencustomer.framework.db.util

Examples of org.opencustomer.framework.db.util.Page


        if (form.getSort() == null)
            sort = new Sort(ContactDAO.SORT_CONTACTTIMESTAMP, false);
        else
            sort = Sort.parseParam(form.getSort());

        Page page = new Page(conf.getIntValue(UserConfiguration.Key.LIST_NUMBER_ROWS), form.getPage());

        String paramSubject = form.getSubject();
        String paramBoundType = form.getBoundType();
        String paramContactType = form.getContactType();
        String paramName = form.getName();

        Date paramContactTimestampStart = null;
        Date paramContactTimestampEnd = null;
        String format = MessageUtil.message(request, "default.format.input.date");
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        try
        {
            if (form.getContactTimestampStart() != null)
                paramContactTimestampStart = sdf.parse(form.getContactTimestampStart());
            if (form.getContactTimestampEnd() != null)
                paramContactTimestampEnd = DateUtility.getEndOfDay(sdf.parse(form.getContactTimestampEnd()));
        }
        catch (ParseException e)
        {
            log.error("bad form validation", e);
        }

        ContactDAO dao = new ContactDAO();

        count = dao.countListForPerson(person.getId(), paramSubject, paramBoundType, paramContactType, paramContactTimestampStart, paramContactTimestampEnd, paramName, user);
        if (count < page.getFirstEntry())
            page.setPage(1);

        if (count > 0)
            list = dao.getListForPerson(person.getId(), paramSubject, paramBoundType, paramContactType, paramContactTimestampStart, paramContactTimestampEnd, paramName, sort, page, user);
        else
            list = new ArrayList();
View Full Code Here


        List list = null;
        long count = 0;

        Sort sort = ListAction.extractSort(getPanel(), "job_sort", form.getSort(), new Sort(JobListDAO.SORT_DUEDATE, true));
        Page page = new Page(conf.getIntValue(UserConfiguration.Key.LIST_NUMBER_ROWS), form.getPage());

        String paramSubject = form.getSubject();
        JobVO.Status[] paramStatus = null;
        if(form.getStatus() != null)
            paramStatus = new JobVO.Status[]{EnumUtility.valueOf(JobVO.Status.class, form.getStatus())};

        Date paramDateStart = null;
        Date paramDateEnd = null;
        SimpleDateFormat sdf = new SimpleDateFormat(MessageUtil.message(request, "default.format.input.date"));
        try
        {
            if (form.getDateStart() != null)
                paramDateStart = sdf.parse(form.getDateStart());
            if (form.getDateEnd() != null)
                paramDateEnd = DateUtility.getEndOfDay(sdf.parse(form.getDateEnd()));
        }
        catch (ParseException e)
        {
            log.error("bad form validation", e);
        }

        JobListDAO dao = new JobListDAO();

        count = dao.countList(null, person, null, paramSubject, paramStatus, null, paramDateStart, paramDateEnd, true, null, user);
        if (count < page.getFirstEntry())
            page.setPage(1);

        if (count > 0) {
            list = dao.getList(null, person, null, paramSubject, paramStatus, null, paramDateStart, paramDateEnd, true, null, sort, page, user);
        } else {
            list = new ArrayList();
View Full Code Here

        List<RoleVO> list = null;
        long count = 0;

        Sort sort = extractSort(panel, form, new Sort(RoleDAO.SORT_NAME, true));

        Page page = new Page(conf.getIntValue(UserConfiguration.Key.LIST_NUMBER_ROWS), form.getPage());

        String paramName = form.getName();
        RoleDAO.AdminSelect paramAdmin = EnumUtility.valueOf(RoleDAO.AdminSelect.class, form.getAdmin(), RoleDAO.AdminSelect.ALL);
       
        RoleDAO dao = new RoleDAO();

        count = dao.countList(paramName, paramAdmin, user);
        if (count < page.getFirstEntry())
            page.setPage(1);

        if (count > 0)
            list = dao.getList(paramName, paramAdmin, sort, page, user);
        else
            list = new ArrayList<RoleVO>();
View Full Code Here

        List<RoleVO> list = null;
        long count = 0;

        Sort sort = extractSort(panel, form, UsergroupDAO.SORT_NAME);

        Page page = new Page(conf.getIntValue(UserConfiguration.Key.LIST_NUMBER_ROWS), form.getPage());

        String paramName = form.getName();

        RoleDAO.AdminSelect adminSelect = RoleDAO.AdminSelect.NOT_ADMIN;
        if(activeUser.getProfile().getRole().isAdmin())
            adminSelect = RoleDAO.AdminSelect.ALL;
       
        RoleDAO dao = new RoleDAO();
        count = dao.countList(paramName, adminSelect, activeUser);
        if (count < page.getFirstEntry())
            page.setPage(1);

        if (count > 0)
            list = dao.getList(paramName, adminSelect, sort, page, activeUser);
        else
            list = new ArrayList<RoleVO>();
View Full Code Here

        List list = null;
        long count = 0;

        Sort sort = extractSort(panel, form, new Sort(JobListDAO.SORT_DUEDATE, true));
        Page page = new Page(conf.getIntValue(UserConfiguration.Key.LIST_NUMBER_ROWS), form.getPage());

        String paramSubject = form.getSubject();
        boolean paramAssignedUser = form.isAssignedUser();
        JobVO.Status[] paramStatus = new JobVO.Status[] {JobVO.Status.IN_PROGRESS, JobVO.Status.PLANNED};
        if(form.getStatus() != null) {
            paramStatus = new JobVO.Status[]{EnumUtility.valueOf(JobVO.Status.class, form.getStatus())};
        }
        JobVO.Priority paramPriority = EnumUtility.valueOf(JobVO.Priority.class, form.getPriority());

        Date paramDateStart = null;
        Date paramDateEnd = null;
        SimpleDateFormat sdf = new SimpleDateFormat(MessageUtil.message(request, "default.format.input.date"));
        try
        {
            if (form.getDateStart() != null)
                paramDateStart = sdf.parse(form.getDateStart());
            if (form.getDateEnd() != null)
                paramDateEnd = DateUtility.getEndOfDay(sdf.parse(form.getDateEnd()));
        }
        catch (ParseException e)
        {
            log.error("bad form validation", e);
        }
       
        JobListDAO dao = new JobListDAO();

        count = dao.countList(null, null, null, paramSubject, paramStatus, paramPriority, paramDateStart, paramDateEnd, paramAssignedUser, user, null);
        if (count < page.getFirstEntry())
            page.setPage(1);

        if (count > 0) {
            list = dao.getList(null, null, null, paramSubject, paramStatus, paramPriority, paramDateStart, paramDateEnd, paramAssignedUser, user, sort, page, null);
        } else {
            list = new ArrayList();
View Full Code Here

        List<UsergroupVO> list = null;
        long count = 0;

        Sort sort = extractSort(panel, form, new Sort(UsergroupDAO.SORT_NAME, true));
        Page page = new Page(conf.getIntValue(UserConfiguration.Key.LIST_NUMBER_ROWS), form.getPage());

        String paramName = form.getName();
        UsergroupDAO.AdminSelect paramAdmin = EnumUtility.valueOf(UsergroupDAO.AdminSelect.class, form.getAdmin(), UsergroupDAO.AdminSelect.ALL);
               
        UsergroupDAO dao = new UsergroupDAO();

        count = dao.countList(paramName, paramAdmin, user);
        if (count < page.getFirstEntry())
            page.setPage(1);

        if (count > 0)
            list = dao.getList(paramName, paramAdmin, sort, page, user);
        else
            list = new ArrayList<UsergroupVO>();
View Full Code Here

        List<UserVO> list = null;
        long count = 0;

        Sort sort = extractSort(panel, form, new Sort(UserDAO.SORT_USERNAME, true));
        Page page = new Page(conf.getIntValue(UserConfiguration.Key.LIST_NUMBER_ROWS), form.getPage());

        String paramUserName = form.getUserName();
        Boolean paramLocked = null;
        if (form.getLocked() != null)
            paramLocked = Boolean.parseBoolean(form.getLocked());

        Date paramLastLoginStart = null;
        Date paramLastLoginEnd = null;
        String format = MessageUtil.message(request, "default.format.input.date");
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        try
        {
            if (form.getLastLoginStart() != null)
                paramLastLoginStart = sdf.parse(form.getLastLoginStart());
            if (form.getLastLoginEnd() != null)
            {
                paramLastLoginEnd = sdf.parse(form.getLastLoginEnd());
                Calendar cal = GregorianCalendar.getInstance();
                cal.setTime(paramLastLoginEnd);
                cal.add(Calendar.DAY_OF_MONTH, 1);
                cal.add(Calendar.SECOND, -1);
                paramLastLoginEnd = cal.getTime();
            }
        }
        catch (ParseException e)
        {
            log.error("bad form validation", e);
        }

        UserDAO dao = new UserDAO();

        count = dao.countList(paramUserName, paramLocked, user);
        if (count < page.getFirstEntry())
            page.setPage(1);

        if (count > 0)
            list = dao.getList(paramUserName, paramLocked, sort, page, user);
        else
            list = new ArrayList<UserVO>();
View Full Code Here

        if (form.getSort() == null)
            sort = new Sort(UserDAO.SORT_USERNAME, true);
        else
            sort = Sort.parseParam(form.getSort());

        Page page = new Page(conf.getIntValue(UserConfiguration.Key.LIST_NUMBER_ROWS), form.getPage());

        String paramUserName = form.getUserName();
        String paramFirstName = form.getFirstName();
        String paramLastName = form.getLastName();
        String paramName = form.getName();

        CalendarListDAO dao = new CalendarListDAO();

        count = dao.countList(paramName, paramUserName, paramFirstName, paramLastName, null, user);
        if (count < page.getFirstEntry())
            page.setPage(1);

        if (count > 0)
            list = dao.getList(paramName, paramUserName, paramFirstName, paramLastName, null, sort, page, user);
        else
            list = new ArrayList<CalendarListVO>();
View Full Code Here

        if (form.getSort() == null)
            sort = new Sort(UserDAO.SORT_USERNAME, true);
        else
            sort = Sort.parseParam(form.getSort());

        Page page = new Page(conf.getIntValue(UserConfiguration.Key.LIST_NUMBER_ROWS), form.getPage());

        String paramUserName = form.getUserName();
        String paramName = form.getName();

        List<CalendarVO> excludedCalendars = new ArrayList<CalendarVO>();
        excludedCalendars.add(user.getCalendar());
       
        CalendarListDAO dao = new CalendarListDAO();
       
        count = dao.countList(paramName, paramUserName, null, null, excludedCalendars, user);
        if (count < page.getFirstEntry())
            page.setPage(1);

        if (count > 0)
            list = dao.getList(paramName, paramUserName, null, null, excludedCalendars, sort, page, user);
        else
            list = new ArrayList<CalendarListVO>();
View Full Code Here

        if (form.getSort() == null)
            sort = new Sort(ContactDAO.SORT_CONTACTTIMESTAMP, false);
        else
            sort = Sort.parseParam(form.getSort());

        Page page = new Page(conf.getIntValue(UserConfiguration.Key.LIST_NUMBER_ROWS), form.getPage());

        String paramSubject = form.getSubject();
        String paramBoundType = form.getBoundType();
        String paramContactType = form.getContactType();
        String paramName = form.getName();

        Date paramContactTimestampStart = null;
        Date paramContactTimestampEnd = null;
        String format = MessageUtil.message(request, "default.format.input.date");
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        try {
            if (form.getContactTimestampStart() != null)
                paramContactTimestampStart = sdf.parse(form.getContactTimestampStart());
            if (form.getContactTimestampEnd() != null)
                paramContactTimestampEnd = DateUtility.getEndOfDay(sdf.parse(form.getContactTimestampEnd()));
        } catch (ParseException e) {
            log.error("bad form validation", e);
        }

        ContactDAO dao = new ContactDAO();

        count = dao.countListForCompany(company.getId(), paramSubject, paramBoundType, paramContactType, paramContactTimestampStart, paramContactTimestampEnd, paramName, user);
        if (count < page.getFirstEntry())
            page.setPage(1);

        if (count > 0)
            list = dao.getListForCompany(company.getId(), paramSubject, paramBoundType, paramContactType, paramContactTimestampStart, paramContactTimestampEnd, paramName, sort, page, user);
        else
            list = new ArrayList();
View Full Code Here

TOP

Related Classes of org.opencustomer.framework.db.util.Page

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.