Package org.opencustomer.framework.webapp.panel

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


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

        EditPanel panel = new EditPanel(Right.CRM_PERSONS_WRITE, person);
        boolean contactSelectable = true;
        boolean deletable = true;
       
        if(person.getId() == null) {
            panel.setTitle(MessageUtil.message(request, "module.crm.person.headLine.create"));
            contactSelectable = false;
        } else {
            String name = new String(person.getFirstName()+" "+person.getLastName());
            if(person.getTitle() != null)
                name = person.getTitle()+" "+name;
            if(person.getNameAffix() != null)
                name = name+" "+person.getNameAffix();
           
            panel.setTitle(MessageUtil.message(request, "module.crm.person.headLine.edit", name));

            panel.setAttribute(DeleteAction.TEXT_TITLE, MessageUtil.message(request, "module.crm.person.delete.headLine", person.getLastName(), person.getFirstName()));
            panel.setAttribute(DeleteAction.TEXT_QUESTION, MessageUtil.message(request, "module.crm.person.delete.question", person.getLastName(), person.getFirstName()));
        }
       
        if(person.getPersonContacts().size() > 0 || person.getJobs().size() > 0)
            deletable = false;
       
        panel.addAction(Action.Type.DELETE, "/crm/person/delete", deletable);
        panel.addAction(Action.Type.SAVE, "/crm/person/save");
       
        if(SystemConfiguration.getInstance().getBooleanValue(SystemConfiguration.Key.SHOW_OVERVIEW)) {
            panel.addPage("OVERVIEW", "/crm/person/pageOverview""module.generic.panel.tab.overview");
        }
        panel.addPage("STANDARD", "/crm/person/pageStandard", "module.crm.person.pageStandard");
        panel.addPage("ADDRESS""/crm/person/pageAddress", "module.crm.person.pageAddress");
        panel.addPage("CONTACT""/crm/person/pageContact", "module.crm.person.pageContact", contactSelectable, true);
        panel.addPage("JOBS",     "/crm/person/pageJob", "module.generic.panel.tab.crm.jobs", contactSelectable, true);
        panel.addPage("SYSTEM",   "/crm/person/pageSystem",   "module.generic.panel.tab.system");
       
        if(person.getId() == null) {
            panel.activatePage(panel.findPage("STANDARD"));
        }
       
        return panel;
    }
View Full Code Here


        if(request.getAttribute(Globals.JUMP_KEY) != null) {
            JumpBean jump = (JumpBean)request.getAttribute(Globals.JUMP_KEY);
           
            PanelStack panelStack = Panel.getPanelStack(request);
            if(panelStack.peek(2).getType().equals(Panel.Type.EDIT)) {
                EditPanel panel = (EditPanel)panelStack.peek(2);
               
                return Panel.getForward(panel.getAction(Action.Type.SAVE).getAction(), request);
            } else if(panelStack.peek(2).getType().equals(Panel.Type.LIST)) {
               
                return jump.getForward();
            }
           
        }

       
        if(request.getAttribute("external_person_id") != null
                || request.getAttribute("external_company_id") != null)
        {
            PanelStack panelStack = Panel.getPanelStack(request);
           
            EditPanel panel = (EditPanel)panelStack.peek(2);
           
            return Panel.getForward(panel.getAction(Action.Type.SAVE).getAction(), request);
        }
        else
            return null;
    }
View Full Code Here

            if(log.isDebugEnabled())
                log.debug("will jump ... got to save parent panel (person:"+request.getAttribute("external_person_id")+"/company:"+request.getAttribute("external_company_id")+")");
           
            PanelStack panelStack = Panel.getPanelStack(request);
           
            EditPanel panel = (EditPanel)panelStack.peek(2);
           
            return Panel.getForward(panel.getAction(Action.Type.SAVE).getAction(), request);
        }
        else
            return null;
    }
View Full Code Here

        String name = "list";
       
        if(log.isDebugEnabled())
            log.debug("listConfiguration (in panel): "+listConfiguration);
       
        EditPanel panel = null;
        if(listConfiguration.getUser() == null) {
            panel = new EditPanel(Right.ADMINISTRATION_LIST_GLOBALLIST, listConfiguration);
        } else {
            panel = new EditPanel(Right.ADMINISTRATION_LIST_WRITE, listConfiguration);
        }
       
        if(listConfiguration.getId() == null)
            panel.setTitle(MessageUtil.message(request, "module.system.list.create.title"));
        else {
            panel.setTitle(MessageUtil.message(request, "module.system.list.edit.title", listConfiguration.getName()));

            panel.setAttribute(DeleteAction.TEXT_TITLE, MessageUtil.message(request, "module.system.list.delete.title", listConfiguration.getName()));
            panel.setAttribute(DeleteAction.TEXT_QUESTION, MessageUtil.message(request, "module.system.list.delete.question", listConfiguration.getName()));
        }
       
        panel.addAction(Action.Type.DELETE, "/system/settings/"+name+"/delete");
        panel.addAction(Action.Type.SAVE, "/system/settings/"+name+"/save");
       
        panel.addPage("STANDARD", "/system/settings/"+name+"/pageStandard", "module.generic.panel.tab.standard");
        panel.addPage("COLUMNS", "/system/settings/"+name+"/pageColumns", "module.system.list.page.columns");
       
        return panel;
    }
View Full Code Here

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

        EditPanel panel = new EditPanel(Right.CRM_JOBS_WRITE, job);
       
        if(job.getId() == null)
            panel.setTitle(MessageUtil.message(request, "module.crm.job.create.title"));
        else
        {
            panel.setTitle(MessageUtil.message(request, "module.crm.job.edit.title", job.getSubject()));
           
            panel.setAttribute(DeleteAction.TEXT_TITLE, MessageUtil.message(request, "module.crm.job.delete.title", job.getSubject()));
            panel.setAttribute(DeleteAction.TEXT_QUESTION, MessageUtil.message(request, "module.crm.job.delete.question", job.getSubject()));
        }
       
        panel.addAction(Action.Type.SAVE, "/crm/job/save");
        panel.addAction(Action.Type.DELETE, "/crm/job/delete");
       
        panel.addPage("STANDARD", "/crm/job/pageStandard", "module.generic.panel.tab.standard");
        panel.addPage("SYSTEM",   "/crm/job/pageSystem",   "module.generic.panel.tab.system");
       
        return panel;
    }
View Full Code Here

public class LoadAction extends EditLoadAction<LoadForm> {
    private static Logger log = Logger.getLogger(LoadAction.class);

    @Override
    public EditPanel createPanel(ActionMessages errors, LoadForm form, Hashtable<String, Object> attributes, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        EditPanel panel = new EditPanel(Right.ADMINISTRATION_CONFIGURATION_WRITE, null);
       
        panel.setTitle(MessageUtil.message(request, "module.system.configuration.title"));
       
        panel.addAction(Action.Type.SAVE, "/system/settings/configuration/save");
       
        panel.addPage("STANDARD", "/system/settings/configuration/pageStandard", "module.generic.panel.tab.standard");
        panel.addPage("LDAP",     "/system/settings/configuration/pageLdap",     "module.system.configuration.pageLdap");
       
        return panel;
    }
View Full Code Here

        job.setAccessGroup(EntityAccess.Access.NONE);
        job.setOwnerGroup(activeUser.getProfile().getDefaultUsergroup().getId());
        job.setAccessGlobal(EntityAccess.Access.WRITE_SYSTEM);
       
        if(Panel.getPanelStack(request).peek() instanceof EditPanel) {
            EditPanel lastPanel = (EditPanel)Panel.getPanelStack(request).peek();
           
            if(lastPanel.getEntity() instanceof CompanyVO) {
                if (log.isDebugEnabled())
                    log.debug("contact for company");
   
                CompanyVO company = (CompanyVO) lastPanel.getEntity();
                job.setReferencedCompany(company);
            } else if(lastPanel.getEntity() instanceof PersonVO) {
                if (log.isDebugEnabled())
                    log.debug("contact for person");
   
                PersonVO person = (PersonVO)lastPanel.getEntity();
                job.setReferencedPerson(person);
                job.setReferencedCompany(person.getCompany());
            } else {
                log.warn("unknown entity found in panel: "+lastPanel);
            }   
View Full Code Here

            loadEntity(errors, form, attributes, request, response);
        }

        loadEnvironment(errors, form, attributes, request, response);

        EditPanel panel = createPanel(errors, form, attributes, request, response);
        for(String name : attributes.keySet())
            panel.setAttribute(name, attributes.get(name));
        panel.setEditable(isEditable(panel, request));
       
        if(!validateAccess(request, panel))
            errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("default.error.invalidEntity", panel.getEntity().getId()));
       
        PanelStack panelStack = Panel.getPanelStack(request);
        panelStack.push(panel);
       
        if(!errors.isEmpty())
        {
            this.saveErrors(request, errors);
           
            Panel.getPanelStack(request).pop();           
            return Panel.getForward(Panel.getPanelStack(request).peek().getPath(), request);
        }
        else
            return Panel.getForward(panel.getActivePage().getAction(), request);
    }
View Full Code Here

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

        EditPanel panel = new EditPanel(Right.CRM_CONTACTS_WRITE, contact);
       
        if(contact.getId() == null)
            panel.setTitle(MessageUtil.message(request, "module.crm.contact.headLine.create"));
        else
        {
            panel.setTitle(MessageUtil.message(request, "module.crm.contact.headLine.edit", contact.getSubject()));
           
            panel.setAttribute(DeleteAction.TEXT_TITLE, MessageUtil.message(request, "module.crm.contact.delete.headLine", contact.getSubject()));
            panel.setAttribute(DeleteAction.TEXT_QUESTION, MessageUtil.message(request, "module.crm.contact.delete.question", contact.getSubject()));
        }
       
        EditPanel lastPanel = (EditPanel)Panel.getPanelStack(request).peek();
       
        panel.addAction(Action.Type.SAVE, "/crm/contact/save");
        panel.addAction(Action.Type.DELETE, "/crm/contact/delete");
       
        panel.addPage("STANDARD", "/crm/contact/pageStandard", "module.generic.panel.tab.standard");
View Full Code Here

        contact.setOwnerUser(activeUser.getId());
        contact.setAccessGroup(EntityAccess.Access.NONE);
        contact.setOwnerGroup(activeUser.getProfile().getDefaultUsergroup().getId());
        contact.setAccessGlobal(EntityAccess.Access.WRITE_SYSTEM);
       
        EditPanel lastPanel = (EditPanel)Panel.getPanelStack(request).peek();
       
        if(lastPanel.getEntity() instanceof CompanyVO)
        {
            if (log.isDebugEnabled())
                log.debug("contact for company");

            CompanyVO company = (CompanyVO) lastPanel.getEntity();
            contact.setCompany(company);
        }
        else if(lastPanel.getEntity() instanceof PersonVO)
        {
            if (log.isDebugEnabled())
                log.debug("contact for person");

            PersonVO person = (PersonVO)lastPanel.getEntity();
            contact.getPersonContacts().add(new PersonContactVO(person, contact));
        }
        else
        {
            log.error("unknown entity foundin panel: "+lastPanel);
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.