Package org.opencustomer.db.dao.system

Examples of org.opencustomer.db.dao.system.ListConfigurationDAO


        if (log.isDebugEnabled())
            log.debug("delete list configuration (ID:" + listConfiguration.getId() + ")");

        try {
            new ListConfigurationDAO().delete(listConfiguration);
           
            PanelStack stack = Panel.getPanelStack(request);
            if(stack.getSize() > 2) {
                Panel lastPanel = stack.peek(3);
                lastPanel.removeAttribute("listConfigurations");
View Full Code Here


    @Override
    protected void saveEntity(EditPanel panel, ActionMessages errors, HttpServletRequest request) {
        ListConfigurationVO listConfiguration = (ListConfigurationVO) panel.getEntity();

        try {
            ListConfigurationDAO dao = new ListConfigurationDAO();
            HibernateContext.beginTransaction();
           
            if(listConfiguration.isDefault())
                dao.resetDefaultValue(listConfiguration.getType(), (listConfiguration.getUser() == null));
           
            if (listConfiguration.getId() == null) {
                if (log.isDebugEnabled())
                    log.debug("create list configuration");
                dao.insert(listConfiguration);
            } else {
                if (log.isDebugEnabled())
                    log.debug("save list configuration (ID:" + listConfiguration.getId() + ")");
                dao.update(listConfiguration);
            }
           
            HibernateContext.commitTransaction();
           
            PanelStack stack = Panel.getPanelStack(request);
View Full Code Here

        UserVO user                           = (UserVO)request.getSession().getAttribute(Globals.USER_KEY);
        ListConfigurationVO listConfiguration = (ListConfigurationVO) panel.getEntity();
       
        if (listConfiguration.getName() != null) {
            try {
                ListConfigurationDAO dao = new ListConfigurationDAO();

                ListConfigurationVO editListConfiguration = null;
                if(listConfiguration.getUser() == null)
                    editListConfiguration = dao.getForSystemByTypeAndName(listConfiguration.getType(), listConfiguration.getName());
                else
                    editListConfiguration = dao.getForUserByTypeAndName(listConfiguration.getType(), listConfiguration.getName(), user);
               
                if (editListConfiguration != null && !editListConfiguration.getId().equals(listConfiguration.getId())) {
                    errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("module.system.list.error.nameExists"));
                }
View Full Code Here

    public void loadEntity(ActionMessages errors, LoadForm form, Hashtable<String, Object> attributes, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        if (log.isDebugEnabled())
            log.debug("load list configuration (ID:" + form.getId() + ")");

        try {
            ListConfigurationVO listConfiguration = new ListConfigurationDAO().getById(form.getId());
            attributes.put("listConfiguration", listConfiguration);
        } catch (HibernateException e) {
            errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("default.error.invalidEntity", new Integer(form.getId())));

            log.debug("problems loading list configuration (ID:" + form.getId() + ")");
View Full Code Here

        UserConfiguration conf = (UserConfiguration)request.getSession().getAttribute(Globals.CONFIGURATION_KEY);
       
        ListConfigurationVO choosenList = (ListConfigurationVO)panel.getAttribute("choosenList");
       
        if(panel.getAttribute("listConfigurations") == null) {
            List<ListConfigurationVO> listConfigurations = new ListConfigurationDAO().getByTypeAndUser(type, user);
            if(!listConfigurations.isEmpty()) {
                ListBean bean = new ListBean();
                for(ListConfigurationVO vo : listConfigurations) {
                    List<ListConfigurationVO> group = bean.getGroups().get(vo.getUser() == null);
                    group.add(vo);
                }
               
                if(!listConfigurations.contains(choosenList)) {
                    if(log.isDebugEnabled())
                        log.debug("list is not yet available: "+choosenList);
                    panel.removeAttribute("choosenList");
                }
               
                panel.setAttribute("listConfigurations", bean);
            }
        }
       
        if(form.getDoChooseList() != null) {
            if(log.isDebugEnabled())
                log.debug("load new list configuration: "+form.getListId());
           
            panel.removeAttribute(TABLE_KEY);
           
            choosenList = new ListConfigurationDAO().getById(form.getListId());

            form.setDoChooseList(null);
        } else if(panel.getAttribute(TABLE_KEY) == null) {
            if(log.isDebugEnabled())
                log.debug("load default configuration: ");
           
            if(choosenList == null)
                choosenList = new ListConfigurationDAO().getDefaultListConfiguration(type, user);
            else
                choosenList = new ListConfigurationDAO().getById(choosenList.getId());
           
            if(choosenList != null)
                form.setListId(choosenList.getId());
        }
       
View Full Code Here

TOP

Related Classes of org.opencustomer.db.dao.system.ListConfigurationDAO

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.