Package org.opencustomer.db.vo.crm

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


            log.error("problems loading user (ID:" + form.getId() + ")");
        }
        else
        {
            JobVO job = (JobVO) panel.getEntity();

            if(!EntityAccessUtility.isAccessGranted(user, job, EntityAccess.Access.WRITE))
                errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("module.generic.pageSystem.error.missingWriteAccessForAssignedUser", user.getUserName()));
            else
                job.setAssignedUser(user);
        }
    }
View Full Code Here


            log.error("problems loading person (ID:" + form.getId() + ")");
        }
        else
        {
            JobVO job = (JobVO) panel.getEntity();
            job.setReferencedPerson(person);
            job.setReferencedCompany(person.getCompany());
        }
    }
View Full Code Here

            log.error("problems loading company (ID:" + form.getId() + ")");
        }
        else
        {
            JobVO job = (JobVO) panel.getEntity();
            job.setReferencedCompany(company);
            job.setReferencedPerson(null);
        }
    }
View Full Code Here

public final class DeleteAction extends org.opencustomer.framework.webapp.action.DeleteAction {
    private static Logger log = Logger.getLogger(DeleteAction.class);

    @Override
    protected void deleteEntity(DeletePanel panel, HttpServletRequest request, HttpServletResponse response, ActionMessages errors) {
        JobVO job = (JobVO) panel.getEntity();

        if (log.isDebugEnabled())
            log.debug("delete job (ID:" + job.getId() + ")");

        if (job.getId() != null) {
            try {
                new JobDAO().delete(job);
            } catch (HibernateException e) {
                errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("default.error.couldNotDeleteEntity", panel.getEntity().getId()));

                log.debug("problems deleting job (ID:" + job.getId() + ")");
            }
        }       
    }
View Full Code Here

    @Override
    protected void saveEntity(EditPanel panel, ActionMessages errors, HttpServletRequest request)
    {
        try
        {
            JobVO job = (JobVO) panel.getEntity();

            if (job.getId() == null)
            {
                if (log.isDebugEnabled())
                    log.debug("create job " + job);
                new JobDAO().insert(job);
            }
View Full Code Here

{
    private static Logger log = Logger.getLogger(LoadAction.class);

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

    @Override
    public void createEntity(ActionMessages errors, EditLoadForm form, Hashtable<String, Object> attributes, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
    {
        UserVO activeUser = (UserVO) request.getSession().getAttribute(Globals.USER_KEY);
       
        JobVO job = new JobVO();
        job.setStatus(JobVO.Status.PLANNED);
        job.setPriority(JobVO.Priority.MEDIUM);
       
        job.setAccessUser(EntityAccess.Access.WRITE_SYSTEM);
        job.setOwnerUser(activeUser.getId());
        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);
            }   
        }
       
        job.setAssignedUser(activeUser);
               
        attributes.put("job", job);
    }
View Full Code Here

    @Override
    public void loadEntity(ActionMessages errors, EditLoadForm form, Hashtable<String, Object> attributes, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
    {
        try
        {
            JobVO job = new JobDAO().getById(form.getId());
            Hibernate.initialize(job.getReferencedCompany());
            Hibernate.initialize(job.getReferencedPerson());
           
            attributes.put("job", job);
        }
        catch (HibernateException e)
        {
View Full Code Here

    public void readForm(PageStandardForm form, ActionMessages errors, HttpServletRequest request)
    {
        if (log.isDebugEnabled())
            log.debug("read form");

        JobVO job = (JobVO) getPanel().getEntity();

        job.setSubject(form.getSubject());
        job.setInfo(form.getInfo());
        job.setPriority(EnumUtility.valueOf(JobVO.Priority.class, form.getPriority()));
        job.setStatus(EnumUtility.valueOf(JobVO.Status.class, form.getStatus()));

        if(form.getDueDate() != null) {
            SimpleDateFormat sdf = new SimpleDateFormat(MessageUtil.message(request, "default.format.input.dateTime"));
            try {
                job.setDueDate(sdf.parse(form.getDueDate()));
            } catch (ParseException e) {
                log.error("problems parsing contact timestamp", e);
            }
        } else {
            job.setDueDate(null);
        }
    }
View Full Code Here

    public void writeForm(PageStandardForm form, ActionMessages errors, HttpServletRequest request)
    {
        if (log.isDebugEnabled())
            log.debug("write form");
       
        JobVO job = (JobVO)getPanel().getEntity();

        form.setSubject(job.getSubject());
        form.setInfo(job.getInfo());
        if (job.getPriority() != null)
            form.setPriority(job.getPriority().toString());
        if (job.getStatus() != null)
            form.setStatus(job.getStatus().toString());

        if (job.getDueDate() != null) {
            SimpleDateFormat sdf = new SimpleDateFormat(MessageUtil.message(request, "default.format.input.dateTime"));
            form.setDueDate(sdf.format(job.getDueDate()));
        } else {
            form.setDueDate(null);
        }
    }
View Full Code Here

TOP

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

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.