Package org.opencustomer.db.vo.crm

Examples of org.opencustomer.db.vo.crm.CompanyVO


           
            return Panel.getForward(getPanel().getAction(Action.Type.SAVE).getAction(), request);
        }
        else if(form.getDoJumpCompany().isSelected())
        {
            CompanyVO company = ((ContactVO)getPanel().getAttribute("contact")).getCompany();
           
            if (log.isDebugEnabled())
                log.debug("jump to company with id: "+company.getId());
           
            request.setAttribute("external_company_id", company.getId());
           
            return Panel.getForward(getPanel().getAction(Action.Type.SAVE).getAction(), request);
        }
        else
        {
View Full Code Here


    protected void chooseEntity(EntityPanel panel, AddCompanyForm form, ActionMessages errors, HttpServletRequest request, HttpServletResponse response)
    {
        if (log.isDebugEnabled())
            log.debug("add company with ID: " + form.getId());

        CompanyVO company = new CompanyDAO().getById(form.getId());

        if (company == null)
        {
            errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("default.error.invalidEntity", new Integer(form.getId())));
View Full Code Here

           
            return mapping.findForward("addCompany");
        }
        else if (form.getDoJumpCompany().isSelected())
        {
            CompanyVO company = ((PersonVO) getPanel().getEntity()).getCompany();

            if(log.isDebugEnabled())
                log.debug("jump to company with id: "+company.getId());
           
            request.setAttribute("external_company_id", company.getId());
           
            return Panel.getForward(getPanel().getAction(Action.Type.SAVE).getAction(), request);
        }
        else if (form.getDoRemoveCompany().isSelected())
        {
View Full Code Here

   

    @Override
    public ActionForward handleCustomAction(ActionMapping mapping, PageOverviewForm form, ActionMessages errors, HttpServletRequest request) {
        if (form.getDoJumpCompany().isSelected()) {
            CompanyVO company = ((PersonVO) getPanel().getEntity()).getCompany();

            if(log.isDebugEnabled())
                log.debug("jump to company with id: "+company.getId());
           
            request.setAttribute("external_company_id", company.getId());
           
            return Panel.getForward(getPanel().getAction(Action.Type.SAVE).getAction(), request);
        }
       
        return null;
View Full Code Here

        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())
View Full Code Here

           
            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");
   
View Full Code Here

    public CompanyVO getByName(String companyName)
    {
        String _companyName = toLower(companyName);

        CompanyVO vo = null;

        try
        {
            StringBuilder hql = new StringBuilder();
            hql.append(" FROM ").append(getEntityClass().getName()).append(" e ");
View Full Code Here

    }
   
    @Override
    protected void chooseEntity(EntityPanel panel, AddCompanyForm form, ActionMessages errors, HttpServletRequest request, HttpServletResponse response)
    {
        CompanyVO company = new CompanyDAO().getById(form.getId());
        if (company != null)
        {
            PersonVO person = (PersonVO)panel.getEntity();
            person.setCompany(company);
        }
View Full Code Here

    @Override
    protected void search(PageContactForm form, ActionMessages errors, HttpServletRequest request)
    {
        UserVO user       = (UserVO)request.getSession().getAttribute(Globals.USER_KEY);
        CompanyVO company = (CompanyVO) getPanel().getEntity();
        UserConfiguration conf = (UserConfiguration)request.getSession().getAttribute(Globals.CONFIGURATION_KEY);

        List list = null;
        long count = 0;

        Sort sort = null;
        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();

        ScrollBean scroll = new ScrollBean();
        scroll.setCount(count);
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 {
        CompanyVO company = (CompanyVO)attributes.get("company");

        EditPanel panel = new EditPanel(Right.CRM_COMPANIES_WRITE, company);
       
        boolean deletable = true;
       
        if(company.getId() == null)
            panel.setTitle(MessageUtil.message(request, "module.crm.company.headLine.create"));
        else {
            panel.setTitle(MessageUtil.message(request, "module.crm.company.headLine.edit", company.getCompanyName()));
           
            panel.setAttribute(DeleteAction.TEXT_TITLE, MessageUtil.message(request, "module.crm.company.delete.headLine", company.getCompanyName()));
            panel.setAttribute(DeleteAction.TEXT_QUESTION, MessageUtil.message(request, "module.crm.company.delete.question", company.getCompanyName()));
        }
       
        if(company.getPersons().size() > 0 || company.getPersonContacts().size() > 0 || company.getJobs().size() > 0)
            deletable = false;
       
        panel.addAction(Action.Type.DELETE, "/crm/company/delete", deletable);
        panel.addAction(Action.Type.SAVE, "/crm/company/save");
       
        if(SystemConfiguration.getInstance().getBooleanValue(SystemConfiguration.Key.SHOW_OVERVIEW)) {
            panel.addPage("OVERVIEW", "/crm/company/pageOverview""module.generic.panel.tab.overview");
        }
        panel.addPage("STANDARD", "/crm/company/pageStandard""module.generic.panel.tab.standard");
        panel.addPage("INFO",     "/crm/company/pageInfo",      "module.crm.company.page2");
        panel.addPage("ADDRESS""/crm/company/pageAddress",   "module.crm.company.pageAddress");
        panel.addPage("PERSON",   "/crm/company/pagePerson",    "module.crm.company.page3", company.getId() != null);
        panel.addPage("CONTACT""/crm/company/pageContact",   "module.crm.company.page4", company.getId() != null, true);
        panel.addPage("JOB",      "/crm/company/pageJob",       "module.generic.panel.tab.crm.jobs", company.getId() != null, true);
        panel.addPage("SYSTEM",   "/crm/company/pageSystem",    "module.generic.panel.tab.system");
       
        if(company.getId() == null) {
            panel.activatePage(panel.findPage("STANDARD"));
        }
       
        return panel;
    }
View Full Code Here

TOP

Related Classes of org.opencustomer.db.vo.crm.CompanyVO

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.