Package org.opencustomer.framework.webapp.panel

Examples of org.opencustomer.framework.webapp.panel.EditPanel


        }

        ActionMessages errors = new ActionMessages();
        ActionForward forward = null;
       
        EditPanel panel = (EditPanel)getPanel(request);
       
        if(!panel.isEditable())
        {
            if(log.isDebugEnabled())
                log.debug("no validation / panel is not editable");
           
            forward = executeForward(panel, errors, mapping, request, response);
        }
        else if (validateData(panel, errors, request))
        {
            if(log.isDebugEnabled())
                log.debug("entity validated: true");
           
            saveEntity(panel, errors, request);
           
            if (errors.isEmpty())
                forward = executeForward(panel, errors, mapping, request, response);
            else
                forward = Panel.getForward(panel.getActivePage().getAction(), request);
        }
        else
        {
            if(log.isDebugEnabled())
                log.debug("entity validated: false");
           
            forward = Panel.getForward(panel.getActivePage().getAction(), request);
        }
       
        if (!errors.isEmpty())
            saveErrors(request, errors);
View Full Code Here


    @Override
    protected Panel getPanel(HttpServletRequest request) {
        if(request.getAttribute("external_company_id") != null
                || request.getAttribute("external_person_id") != null
                || request.getAttribute(Globals.JUMP_KEY) != null) {
            EditPanel panel = (EditPanel)Panel.getPanelStack(request).peek();
            if(panel.getEntity() instanceof PersonVO)
                return panel;
            else
                return Panel.getPanelStack(request).peek(2);
        } else {
            return super.getPanel(request);
View Full Code Here

        DeletePanel panel = null;
       
        if(Panel.getPanelStack(request).isTypeOnTop(Panel.Type.DELETE)) {
            panel = (DeletePanel)Panel.getPanelStack(request).peek();
        } else if(Panel.getPanelStack(request).isTypeOnTop(Panel.Type.EDIT)) {
            EditPanel editPanel = (EditPanel)Panel.getPanelStack(request).peek();
           
            panel = new DeletePanel();
            panel.setTitle((String)editPanel.getAttribute(TEXT_TITLE));
            panel.setQuestion((String)editPanel.getAttribute(TEXT_QUESTION));
            panel.setEntity(editPanel.getEntity());
           
            panel.setPath(editPanel.getAction(org.opencustomer.framework.webapp.panel.Action.Type.DELETE).getAction());
           
            preparePanel(editPanel, panel);
           
            Panel.getPanelStack(request).push(panel);
        } else {
View Full Code Here

        boolean deletable = false;
        if(users.isEmpty())
            deletable = true;

        EditPanel panel = new EditPanel(Right.ADMINISTRATION_ROLE_WRITE, role);
       
        if(role.getId() == null)
            panel.setTitle(MessageUtil.message(request, "module.system.role.headLine.create"));
        else
        {
            panel.setTitle(MessageUtil.message(request, "module.system.role.headLine.edit", role.getName()));

            panel.setAttribute(DeleteAction.TEXT_TITLE, MessageUtil.message(request, "module.system.role.delete.headLine", role.getName()));
            panel.setAttribute(DeleteAction.TEXT_QUESTION, MessageUtil.message(request, "module.system.role.delete.question", role.getName()));

        }
       
        panel.addAction(Action.Type.DELETE, "/system/management/role/delete", deletable);
        panel.addAction(Action.Type.SAVE, "/system/management/role/save");
       
        panel.addPage("STANDARD", "/system/management/role/pageStandard", "module.generic.panel.tab.standard");
        panel.addPage("RIGHT", "/system/management/role/pageRights", "module.system.role.pageRights");
        panel.addPage("SYSTEM", "/system/management/role/pageSystem", "module.generic.panel.tab.system");
       
        return panel;
    }
View Full Code Here

        boolean deletable = false;
        if(users.isEmpty() && roles.isEmpty())
            deletable = true;

        EditPanel panel = new EditPanel(Right.ADMINISTRATION_USERGROUP_WRITE, usergroup);
       
        if(usergroup.getId() == null)
            panel.setTitle(MessageUtil.message(request, "module.system.usergroup.headLine.create"));
        else
        {
            panel.setTitle(MessageUtil.message(request, "module.system.usergroup.headLine.edit", usergroup.getName()));

            panel.setAttribute(DeleteAction.TEXT_TITLE, MessageUtil.message(request, "module.system.usergroup.delete.headLine", usergroup.getName()));
            panel.setAttribute(DeleteAction.TEXT_QUESTION, MessageUtil.message(request, "module.system.usergroup.delete.question", usergroup.getName()));
        }
       
        panel.addAction(Action.Type.DELETE, "/system/management/usergroup/delete", deletable);
        panel.addAction(Action.Type.SAVE, "/system/management/usergroup/save");
       
        panel.addPage("STANDARD", "/system/management/usergroup/pageStandard", "module.generic.panel.tab.standard");
        panel.addPage("SYSTEM", "/system/management/usergroup/pageSystem", "module.generic.panel.tab.system");
       
        return panel;
    }
View Full Code Here

        if(user.equals(activeUser))
            isActiveUser = true;  
        boolean isLdapUser =  user.getProfile().getLdapGroup() != null;
      
       
        EditPanel panel = new EditPanel(Right.ADMINISTRATION_USERMANAGEMENT_WRITE, user);
       
        if(user.getId() == null)
            panel.setTitle(MessageUtil.message(request, "module.system.user.manage.headLine.create"));
        else
        {
            panel.setTitle(MessageUtil.message(request, "module.system.user.manage.headLine.edit", user.getUserName()));

            panel.setAttribute(DeleteAction.TEXT_TITLE, MessageUtil.message(request, "module.system.user.manage.deleteUser.headLine", user.getUserName()));
            panel.setAttribute(DeleteAction.TEXT_QUESTION, MessageUtil.message(request, "module.system.user.manage.deleteUser.question", user.getUserName()));
        }
       
        panel.addAction(Action.Type.DELETE, "/system/management/user/delete", !isActiveUser&&!isLdapUser);
        panel.addAction(Action.Type.SAVE, "/system/management/user/save");
       
        panel.addPage("STANDARD", "/system/management/user/pageStandard", "module.generic.panel.tab.standard");
        panel.addPage("SYSTEM", "/system/management/user/pageSystem", "module.generic.panel.tab.system");
       
        panel.setAttribute("isActiveUser", isActiveUser);
        panel.setAttribute("isLdapUser", isLdapUser);
       
        return panel;
    }
View Full Code Here

    @Override
    public EditPanel createPanel(ActionMessages errors, EditLoadForm form, Hashtable<String, Object> attributes, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
    {
        UserVO user = (UserVO)attributes.get("user");

        EditPanel panel = new EditPanel(Right.ADMINISTRATION_USERPROFILE_WRITE, user);
       
        panel.setTitle(MessageUtil.message(request, "module.system.user.profile.default.title"));
       
        panel.addAction(Action.Type.SAVE, "/system/profile/save");
       
        panel.addPage("STANDARD", "/system/profile/pageStandard", "module.generic.panel.tab.standard");
       
        return panel;
    }
View Full Code Here

    private boolean pageEditable = false;
   
    @Override
    public int doStartTag() throws JspException
    {
        EditPanel panel = (EditPanel)Panel.getPanelStack((HttpServletRequest)pageContext.getRequest()).peek();

        panelEditable = panel.isEditable();
        pageEditable = panelEditable;
        if(panel.getActivePage().getEditable() != null) {
            pageEditable = panel.getActivePage().getEditable();
        }
        if(log.isDebugEnabled())
            log.debug("panelEditable="+panelEditable+", pageEditable="+pageEditable);
       
        pageContext.setAttribute("i_panel_editable", panelEditable);
        pageContext.setAttribute("i_page_editable", pageEditable);
       
        action = panel.getActivePage().getAction();
        styleClass = getProperty("form");
        setDisabled(!pageEditable);
       
        int process = super.doStartTag();
       
        StringBuilder html = new StringBuilder();
       
        if(panel.getPages().size() > 1)
        {
            html.append("<div class=\"").append(getProperty("slider")).append("\">");
            for(Page tab : panel.getPages())
            {
                if(isTabRightsValid(tab))
                {
                    if(tab.equals(panel.getActivePage()))
                        renderButton(html, "doPage_"+tab.getName(), tab.getMessageKey(), null, getProperty("slider.active"), null, true);
                    else
                    {
                        if(tab.isSelectable())
                            renderButton(html, "doPage_"+tab.getName(), tab.getMessageKey(), null, null, null, false);
View Full Code Here

    }
   
    @Override
    public int doEndTag() throws JspException
    {       
        EditPanel panel = (EditPanel)Panel.getPanelStack((HttpServletRequest)pageContext.getRequest()).peek();

        StringBuilder html = new StringBuilder();
       
        html.append("<fieldset class=\"").append(getProperty("block.action")).append("\">");
       
        if(panelEditable)
        {
            Action deleteAction = panel.getAction(Action.Type.DELETE);
            if(deleteAction != null)
            {
                if(panel.getEntity().getId() == null || !deleteAction.isSelectable())
                    renderButton(html,  "doDelete", "button.delete", "button.delete.title.inactive", getProperty("block.action.leftButton"), null, true);
                else
                    renderButton(html, "doDelete", "button.delete", "button.delete.title.active", getProperty("block.action.leftButton"), 'd', false);
            }
           
            renderButton(html, "doCancel", "button.cancel", "button.cancel.title", null, 'c', false);
           
            if(panel.getAction(Action.Type.SAVE) != null)
                renderButton(html, "doSave", "button.save", "button.save.title", null, 's', false);
        }
        else
            renderButton(html, "doCancel", "button.back", "button.cancel.title", null, 'c', false);
       
View Full Code Here

    {
        UserVO activeUser = (UserVO)request.getSession().getAttribute(Globals.USER_KEY);
       
        CalendarVO calendar = (CalendarVO)attributes.get("calendar");

        EditPanel panel = new EditPanel(Right.CALENDAR_CALENDAR_WRITE, calendar);
       
        String calendarName = MessageUtil.message(request, "module.calendar.personalCalendar");
        if(calendar.getUser() == null) {
            calendarName = calendar.getName();
        } else if(!calendar.getUser().equals(activeUser)) {
            calendarName = calendar.getUser().getUserName();
        }
       
        panel.setTitle(MessageUtil.message(request, "module.calendar.edit.headline", calendarName));
       
        panel.addAction(Action.Type.SAVE, "/calendar/edit/save");
       
        panel.addPage("STANDARD", "/calendar/edit/pageStandard", "module.generic.panel.tab.standard");
       
        return panel;
    }
View Full Code Here

TOP

Related Classes of org.opencustomer.framework.webapp.panel.EditPanel

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.