Package org.opencustomer.db.vo.crm

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


            return mapping.findForward("addCompany");
        } else if(form.getDoRemoveReference().isSelected()) {
            if (log.isDebugEnabled())
                log.debug("remove reference");
           
            JobVO job = (JobVO)getPanel().getEntity();
            job.setReferencedCompany(null);
            job.setReferencedPerson(null);
           
            return Panel.getForward(getPanel().getActivePage().getAction(), request);
        } else if(form.getDoAddUser().isSelected()) {
            if (log.isDebugEnabled())
                log.debug("add user");
           
            return mapping.findForward("addUser");
        } else if(form.getDoJumpReference().isSelected()) {
            if (log.isDebugEnabled())
                log.debug("jump reference");

            JobVO job = (JobVO)getPanel().getEntity();
            JumpBean jump = null;
           
            if(job.getReferencedPerson() != null) {
                jump = new JumpBean(job.getReferencedPerson(), new ActionForward(Panel.getForward("/crm/person/edit", request)));
            } else if(job.getReferencedCompany() != null) {
                jump = new JumpBean(job.getReferencedCompany(), new ActionForward(Panel.getForward("/crm/company/edit", request)));
            }

            if(jump != null) {
                request.setAttribute(Globals.JUMP_KEY, jump);
                return Panel.getForward(getPanel().getAction(Action.Type.SAVE).getAction(), request);
View Full Code Here


                    log.info("event ignored: " + event);
            }
        }
        else  if(saveOrUpdateEvent.getEntity() instanceof JobVO)
        {
            JobVO job = (JobVO)saveOrUpdateEvent.getEntity();
            SchedulingManager manager = SchedulingManager.getInstance();
            JobReminderMail reminderMail;
            try
            {
                reminderMail = new JobReminderMail();
                reminderMail.setUser(job.getAssignedUser());
            }
            catch (NoValidSenderException e1)
            {
                log.warn("no person for user: " + job.getAssignedUser());
                return;
            }
            catch (AddressException e1)
            {
                log.warn("cannot create reminder mail, incorrect sender address");
                return;
            }
           
            reminderMail.setJob(job);
            MailJob mailJob = new MailJob(reminderMail);
           
            for(Object obj :  manager.getAlarmManager().getAllAlarms())
            {
                AlarmEntry alarmEntry = (AlarmEntry) obj;
                String name;
                if(alarmEntry.getName().equals("JOB" + job.getId())){
                    if(log.isDebugEnabled())
                        log.debug("removing mail job for [job]: " + job);
                    manager.getAlarmManager().removeAlarm(alarmEntry);
                }
            }
            try
            {
                if(log.isInfoEnabled())
                    log.info("adding mailJob for [job]: " + job);
                String name;
                Calendar reminderDate = GregorianCalendar.getInstance();
                reminderDate.setTime(job.getDueDate());
                reminderDate.add(Calendar.MINUTE, -1 * Settings.getInstance().getAlarmBeforeJob());
                AlarmEntry alarmEntry = new AlarmEntry("JOB" + job.getId(),reminderDate.getTime(),mailJob);
                alarmEntry.setRingInNewThead();
                manager.getAlarmManager().addAlarm(alarmEntry);
            }
            catch (PastDateException e)
            {
View Full Code Here

                }
            }
        }
        else if(event.getObject() instanceof JobVO)
        {
            JobVO job = (JobVO) event.getObject();
            SchedulingManager manager = SchedulingManager.getInstance();
           
            for(Object obj :  manager.getAlarmManager().getAllAlarms())
            {
                AlarmEntry alarmEntry = (AlarmEntry) obj;
                if(alarmEntry.getName().contains("JOB" + job.getId())){
                    if(log.isDebugEnabled())
                        log.debug("removing mail job for: " + job);
                    manager.getAlarmManager().removeAlarm(alarmEntry);
                }
            }
View Full Code Here

        if(uservo != null && errors.isEmpty())
        {
            Authenticator auth = new Authenticator(uservo);
            if(auth.isValid(Right.EXTERN_WEBSERVICE_WRITE))
            {
                JobVO job = new JobDAO().getById(id);
                if(status.equals(JobVO.Status.COMPLETED.toString()))
                    job.setStatus(JobVO.Status.COMPLETED);
                else if(status.equals(JobVO.Status.IN_PROGRESS.toString()))
                    job.setStatus(JobVO.Status.IN_PROGRESS);
                else if(status.equals(JobVO.Status.PLANNED.toString()))
                    job.setStatus(JobVO.Status.PLANNED);
                new JobDAO().insertOrUpdate(job);
            }
            else
            {
            if(log.isInfoEnabled())
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.