Java 类ims.core.vo.lookups.JobRunningFrequency 实例源码

项目:AvoinApotti    文件:Logic.java   
private void initialize() throws PresentationLogicException 
{   
    form.getGlobalContext().Admin.setSystemJobNotification(null);

    form.lyrConfiguration().showtabScheduling();
    form.getLocalContext().setCurrentSelectedTab(SCHEDULER_TAB);
    form.lyrConfiguration().tabScheduling().cmbFrequency().setValue(JobRunningFrequency.RUNONCE);
    form.lyrConfiguration().tabScheduling().dtimStartDate().setValue(new DateTime());
    onCmbCronValueChanged();

    showLyrConfigurationTabs(true, false, false);           
}
项目:AvoinApotti    文件:Logic.java   
private void clearSchedulerTab() 
{   
    if (form.lyrConfiguration().tabScheduling().cmbFrequency().getValue() != null)
    {
        if (form.lyrConfiguration().tabScheduling().cmbFrequency().getValue().equals(JobRunningFrequency.DAILY))
        {
            form.lyrConfiguration().tabScheduling().lyrCron().tabDaily().intDays().setValue(null);
            form.lyrConfiguration().tabScheduling().lyrCron().tabDaily().intHours().setValue(null);
            form.lyrConfiguration().tabScheduling().lyrCron().tabDaily().intMinutes().setValue(null);
        }
        else if (form.lyrConfiguration().tabScheduling().cmbFrequency().getValue().equals(JobRunningFrequency.WEEKLY))
        {
            form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkMon().setValue(true);
            form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkTue().setValue(true);
            form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkWed().setValue(true);
            form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkThu().setValue(true);
            form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkFri().setValue(true);
            form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkSat().setValue(true);
            form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkSun().setValue(true);
        }
        else if (form.lyrConfiguration().tabScheduling().cmbFrequency().getValue().equals(JobRunningFrequency.MONTHLY))
        {
            form.lyrConfiguration().tabScheduling().lyrCron().tabMonthly().intDayOfMonth().setValue(null);
            form.lyrConfiguration().tabScheduling().lyrCron().tabMonthly().timMonthlyTime().setValue(null);
        }
    }
}
项目:openMAXIMS    文件:Logic.java   
private void initialize() throws PresentationLogicException 
{   
    form.getGlobalContext().Admin.setSystemJobNotification(null);

    form.lyrConfiguration().showtabScheduling();
    form.getLocalContext().setCurrentSelectedTab(SCHEDULER_TAB);
    form.lyrConfiguration().tabScheduling().cmbFrequency().setValue(JobRunningFrequency.RUNONCE);
    form.lyrConfiguration().tabScheduling().dtimStartDate().setValue(PATIENT_CLINICAL_NOTES_FOR_EVOLVE_INGESTION_IMSID.equals(form.getGlobalContext().Admin.getSystemJob().getImsId()) ? new DateTime(new Date().addDay(1), new Time(2, 0, 0)): new DateTime()); //WDEV-19128
    onCmbCronValueChanged();

    showLyrConfigurationTabs(true, false, false);           
}
项目:openMAXIMS    文件:Logic.java   
private void clearSchedulerTab() 
{   
    if (form.lyrConfiguration().tabScheduling().cmbFrequency().getValue() != null)
    {
        if (form.lyrConfiguration().tabScheduling().cmbFrequency().getValue().equals(JobRunningFrequency.DAILY))
        {
            form.lyrConfiguration().tabScheduling().lyrCron().tabDaily().intDays().setValue(null);
            form.lyrConfiguration().tabScheduling().lyrCron().tabDaily().intHours().setValue(null);
            form.lyrConfiguration().tabScheduling().lyrCron().tabDaily().intMinutes().setValue(null);
        }
        else if (form.lyrConfiguration().tabScheduling().cmbFrequency().getValue().equals(JobRunningFrequency.WEEKLY))
        {
            form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkMon().setValue(true);
            form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkTue().setValue(true);
            form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkWed().setValue(true);
            form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkThu().setValue(true);
            form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkFri().setValue(true);
            form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkSat().setValue(true);
            form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkSun().setValue(true);
        }
        else if (form.lyrConfiguration().tabScheduling().cmbFrequency().getValue().equals(JobRunningFrequency.MONTHLY))
        {
            form.lyrConfiguration().tabScheduling().lyrCron().tabMonthly().intDayOfMonth().setValue(null);
            form.lyrConfiguration().tabScheduling().lyrCron().tabMonthly().timMonthlyTime().setValue(null);
        }
    }
}
项目:openMAXIMS    文件:Logic.java   
private void initialize() throws PresentationLogicException 
{   
    form.getGlobalContext().Admin.setSystemJobNotification(null);

    form.lyrConfiguration().showtabScheduling();
    form.getLocalContext().setCurrentSelectedTab(SCHEDULER_TAB);
    form.lyrConfiguration().tabScheduling().cmbFrequency().setValue(JobRunningFrequency.RUNONCE);
    form.lyrConfiguration().tabScheduling().dtimStartDate().setValue(new DateTime());
    onCmbCronValueChanged();

    showLyrConfigurationTabs(true, false, false);           
}
项目:openMAXIMS    文件:Logic.java   
private void clearSchedulerTab() 
{   
    if (form.lyrConfiguration().tabScheduling().cmbFrequency().getValue() != null)
    {
        if (form.lyrConfiguration().tabScheduling().cmbFrequency().getValue().equals(JobRunningFrequency.DAILY))
        {
            form.lyrConfiguration().tabScheduling().lyrCron().tabDaily().intDays().setValue(null);
            form.lyrConfiguration().tabScheduling().lyrCron().tabDaily().intHours().setValue(null);
            form.lyrConfiguration().tabScheduling().lyrCron().tabDaily().intMinutes().setValue(null);
        }
        else if (form.lyrConfiguration().tabScheduling().cmbFrequency().getValue().equals(JobRunningFrequency.WEEKLY))
        {
            form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkMon().setValue(true);
            form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkTue().setValue(true);
            form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkWed().setValue(true);
            form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkThu().setValue(true);
            form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkFri().setValue(true);
            form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkSat().setValue(true);
            form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkSun().setValue(true);
        }
        else if (form.lyrConfiguration().tabScheduling().cmbFrequency().getValue().equals(JobRunningFrequency.MONTHLY))
        {
            form.lyrConfiguration().tabScheduling().lyrCron().tabMonthly().intDayOfMonth().setValue(null);
            form.lyrConfiguration().tabScheduling().lyrCron().tabMonthly().timMonthlyTime().setValue(null);
        }
    }
}
项目:openmaxims-linux    文件:Logic.java   
private void initialize() throws PresentationLogicException 
{   
    form.getGlobalContext().Admin.setSystemJobNotification(null);

    form.lyrConfiguration().showtabScheduling();
    form.getLocalContext().setCurrentSelectedTab(SCHEDULER_TAB);
    form.lyrConfiguration().tabScheduling().cmbFrequency().setValue(JobRunningFrequency.RUNONCE);
    form.lyrConfiguration().tabScheduling().dtimStartDate().setValue(new DateTime());
    onCmbCronValueChanged();

    showLyrConfigurationTabs(true, false, false);           
}
项目:openmaxims-linux    文件:Logic.java   
private void clearSchedulerTab() 
{   
    if (form.lyrConfiguration().tabScheduling().cmbFrequency().getValue() != null)
    {
        if (form.lyrConfiguration().tabScheduling().cmbFrequency().getValue().equals(JobRunningFrequency.DAILY))
        {
            form.lyrConfiguration().tabScheduling().lyrCron().tabDaily().intDays().setValue(null);
            form.lyrConfiguration().tabScheduling().lyrCron().tabDaily().intHours().setValue(null);
            form.lyrConfiguration().tabScheduling().lyrCron().tabDaily().intMinutes().setValue(null);
        }
        else if (form.lyrConfiguration().tabScheduling().cmbFrequency().getValue().equals(JobRunningFrequency.WEEKLY))
        {
            form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkMon().setValue(true);
            form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkTue().setValue(true);
            form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkWed().setValue(true);
            form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkThu().setValue(true);
            form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkFri().setValue(true);
            form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkSat().setValue(true);
            form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkSun().setValue(true);
        }
        else if (form.lyrConfiguration().tabScheduling().cmbFrequency().getValue().equals(JobRunningFrequency.MONTHLY))
        {
            form.lyrConfiguration().tabScheduling().lyrCron().tabMonthly().intDayOfMonth().setValue(null);
            form.lyrConfiguration().tabScheduling().lyrCron().tabMonthly().timMonthlyTime().setValue(null);
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
@Override
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{   
    form.lyrConfiguration().tabScheduling().cmbFrequency().removeRow(JobRunningFrequency.CUSTOM);

    form.getLocalContext().setSystemJob(form.getGlobalContext().Admin.getSystemJob());

    if (args != null && args.length > 0)
    {
        if (args[0] != null && args[0] instanceof ConfiguredJobVo)
        {
            form.getLocalContext().setConfiguredJob((ConfiguredJobVo)args[0]);                              
            form.getLocalContext().setNotificationOnSuccess(((ConfiguredJobVo)args[0]).getNotificationsOnSuccess()); 
            form.getLocalContext().setNotificationOnFailure(((ConfiguredJobVo)args[0]).getNotificationsOnFailure());                
            form.getGlobalContext().Admin.setSystemJobNotification(null);

            if(form.getLocalContext().getConfiguredJob() != null &&
                    form.getLocalContext().getConfiguredJob().getScheduledJob() != null &&
                        form.getLocalContext().getConfiguredJob().getScheduledJob().getConfigFormId() != null &&
                            form.getLocalContext().getConfiguredJob().getScheduledJob().getConfigFormId() > 0)
            {
                showLyrConfigurationTabs(true, true, true);
            }
            else
            {
                showLyrConfigurationTabs(true, false, true);
            }               

            form.lyrConfiguration().showtabScheduling();                
            form.getLocalContext().setCurrentSelectedTab(SCHEDULER_TAB);

            populateSchedulingTab((ConfiguredJobVo)args[0]);
            manageButtons(false, false, true, true);

            return;
        }
    }

    initialize();
    open();
}
项目:AvoinApotti    文件:Logic.java   
private boolean validateUI()
{
    int currentSelectedTab = form.getLocalContext().getCurrentSelectedTab();
    ArrayList<String> errors = new ArrayList<String>();

    switch (currentSelectedTab) 
    {
        case SCHEDULER_TAB:     if (form.lyrConfiguration().tabScheduling().dtimStartDate().getValue() == null)
                                {
                                    errors.add("Job start date is mandatory");
                                }
                                if (form.lyrConfiguration().tabScheduling().cmbFrequency().getValue() == null)
                                {
                                    errors.add("Job frequency is mandatory");//WDEV-17279
                                }
                                if(JobRunningFrequency.DAILY.equals(form.lyrConfiguration().tabScheduling().cmbFrequency().getValue()))
                                {
                                    if(form.lyrConfiguration().tabScheduling().lyrCron().tabDaily().intDays().getValue() == null)
                                    {
                                        errors.add("Day(s) is mandatory");
                                    }
                                    if(form.lyrConfiguration().tabScheduling().lyrCron().tabDaily().intHours().getValue() == null)
                                    {
                                        errors.add("Hour(s) is mandatory");
                                    }
                                    if(form.lyrConfiguration().tabScheduling().lyrCron().tabDaily().intMinutes().getValue() == null)
                                    {
                                        errors.add("Minute(s) is mandatory");
                                    }
                                }
                                if(JobRunningFrequency.WEEKLY.equals(form.lyrConfiguration().tabScheduling().cmbFrequency().getValue()))
                                {
                                    if(!form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkMon().getValue()
                                            && !form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkTue().getValue()
                                            && !form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkWed().getValue()
                                            && !form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkThu().getValue()
                                            && !form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkFri().getValue()
                                            && !form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkSat().getValue()
                                            && !form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkSun().getValue())
                                    {
                                        errors.add("Please select at least one day of the week");
                                    }
                                }
                                if(JobRunningFrequency.MONTHLY.equals(form.lyrConfiguration().tabScheduling().cmbFrequency().getValue()))
                                {
                                    if(form.lyrConfiguration().tabScheduling().lyrCron().tabMonthly().intDayOfMonth().getValue() == null)
                                    {
                                        errors.add("Day is mandatory");
                                    }
                                    if(form.lyrConfiguration().tabScheduling().lyrCron().tabMonthly().timMonthlyTime().getValue() == null)
                                    {
                                        errors.add("Time is mandatory");
                                    }
                                    if(form.lyrConfiguration().tabScheduling().lyrCron().tabMonthly().intDayOfMonth().getValue() != null)
                                    {
                                        if(form.lyrConfiguration().tabScheduling().lyrCron().tabMonthly().intDayOfMonth().getValue() > 31 || form.lyrConfiguration().tabScheduling().lyrCron().tabMonthly().intDayOfMonth().getValue() < 1)
                                        {
                                            errors.add("Day of month values must be between 1 and 31");
                                        }
                                    }
                                }
                                break;
        case CONFIGURATION_TAB: showLyrConfigurationTabs(false, false, true);
                                manageButtons(true, false, true, true);                                             
                                form.getLocalContext().setCurrentSelectedTab(NOTIFICATIONS_TAB);
                                break;
        default:
                                break;
    }

    if (errors.size() > 0) 
    {
        String[] allErrors = new String[errors.size()];
        errors.toArray(allErrors);
        engine.showErrors("Invalid Scheduler Job", allErrors);

        return true;
    }

    return false;
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{   
    form.lyrConfiguration().tabScheduling().cmbFrequency().removeRow(JobRunningFrequency.CUSTOM);

    form.getLocalContext().setSystemJob(form.getGlobalContext().Admin.getSystemJob());

    if (args != null && args.length > 0)
    {
        if (args[0] != null && args[0] instanceof ConfiguredJobVo)
        {
            form.getLocalContext().setConfiguredJob((ConfiguredJobVo)args[0]);                              
            form.getLocalContext().setNotificationOnSuccess(((ConfiguredJobVo)args[0]).getNotificationsOnSuccess()); 
            form.getLocalContext().setNotificationOnFailure(((ConfiguredJobVo)args[0]).getNotificationsOnFailure());                
            form.getGlobalContext().Admin.setSystemJobNotification(null);

            if(form.getLocalContext().getConfiguredJob() != null &&
                    form.getLocalContext().getConfiguredJob().getScheduledJob() != null &&
                        form.getLocalContext().getConfiguredJob().getScheduledJob().getConfigFormId() != null &&
                            form.getLocalContext().getConfiguredJob().getScheduledJob().getConfigFormId() > 0)
            {
                showLyrConfigurationTabs(true, true, true);
            }
            else
            {
                showLyrConfigurationTabs(true, false, true);
            }               

            form.lyrConfiguration().showtabScheduling();                
            form.getLocalContext().setCurrentSelectedTab(SCHEDULER_TAB);

            populateSchedulingTab((ConfiguredJobVo)args[0]);
            manageButtons(false, false, true, true);

            return;
        }
    }

    initialize();
    open();
}
项目:openMAXIMS    文件:Logic.java   
private boolean validateUI()
{
    int currentSelectedTab = form.getLocalContext().getCurrentSelectedTab();
    ArrayList<String> errors = new ArrayList<String>();

    switch (currentSelectedTab) 
    {
        case SCHEDULER_TAB:     if (form.lyrConfiguration().tabScheduling().dtimStartDate().getValue() == null)
                                {
                                    errors.add("Job start date is mandatory");
                                }
                                if (form.lyrConfiguration().tabScheduling().cmbFrequency().getValue() == null)
                                {
                                    errors.add("Job frequency is mandatory");//WDEV-17279
                                }
                                if(JobRunningFrequency.DAILY.equals(form.lyrConfiguration().tabScheduling().cmbFrequency().getValue()))
                                {
                                    if(form.lyrConfiguration().tabScheduling().lyrCron().tabDaily().intDays().getValue() == null)
                                    {
                                        errors.add("Day(s) is mandatory");
                                    }
                                    if(form.lyrConfiguration().tabScheduling().lyrCron().tabDaily().intHours().getValue() == null)
                                    {
                                        errors.add("Hour(s) is mandatory");
                                    }
                                    if(form.lyrConfiguration().tabScheduling().lyrCron().tabDaily().intMinutes().getValue() == null)
                                    {
                                        errors.add("Minute(s) is mandatory");
                                    }
                                }
                                if(JobRunningFrequency.WEEKLY.equals(form.lyrConfiguration().tabScheduling().cmbFrequency().getValue()))
                                {
                                    if(!form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkMon().getValue()
                                            && !form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkTue().getValue()
                                            && !form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkWed().getValue()
                                            && !form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkThu().getValue()
                                            && !form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkFri().getValue()
                                            && !form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkSat().getValue()
                                            && !form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkSun().getValue())
                                    {
                                        errors.add("Please select at least one day of the week");
                                    }
                                }
                                if(JobRunningFrequency.MONTHLY.equals(form.lyrConfiguration().tabScheduling().cmbFrequency().getValue()))
                                {
                                    if(form.lyrConfiguration().tabScheduling().lyrCron().tabMonthly().intDayOfMonth().getValue() == null)
                                    {
                                        errors.add("Day is mandatory");
                                    }
                                    if(form.lyrConfiguration().tabScheduling().lyrCron().tabMonthly().timMonthlyTime().getValue() == null)
                                    {
                                        errors.add("Time is mandatory");
                                    }
                                    if(form.lyrConfiguration().tabScheduling().lyrCron().tabMonthly().intDayOfMonth().getValue() != null)
                                    {
                                        if(form.lyrConfiguration().tabScheduling().lyrCron().tabMonthly().intDayOfMonth().getValue() > 31 || form.lyrConfiguration().tabScheduling().lyrCron().tabMonthly().intDayOfMonth().getValue() < 1)
                                        {
                                            errors.add("Day of month values must be between 1 and 31");
                                        }
                                    }
                                }
                                break;
        case CONFIGURATION_TAB: showLyrConfigurationTabs(false, false, true);
                                manageButtons(true, false, true, true);                                             
                                form.getLocalContext().setCurrentSelectedTab(NOTIFICATIONS_TAB);
                                break;
        default:
                                break;
    }

    if (errors.size() > 0) 
    {
        String[] allErrors = new String[errors.size()];
        errors.toArray(allErrors);
        engine.showErrors("Invalid Scheduler Job", allErrors);

        return true;
    }

    return false;
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{   
    form.lyrConfiguration().tabScheduling().cmbFrequency().removeRow(JobRunningFrequency.CUSTOM);

    form.getLocalContext().setSystemJob(form.getGlobalContext().Admin.getSystemJob());

    if (args != null && args.length > 0)
    {
        if (args[0] != null && args[0] instanceof ConfiguredJobVo)
        {
            form.getLocalContext().setConfiguredJob((ConfiguredJobVo)args[0]);                              
            form.getLocalContext().setNotificationOnSuccess(((ConfiguredJobVo)args[0]).getNotificationsOnSuccess()); 
            form.getLocalContext().setNotificationOnFailure(((ConfiguredJobVo)args[0]).getNotificationsOnFailure());                
            form.getGlobalContext().Admin.setSystemJobNotification(null);

            if(form.getLocalContext().getConfiguredJob() != null &&
                    form.getLocalContext().getConfiguredJob().getScheduledJob() != null &&
                        form.getLocalContext().getConfiguredJob().getScheduledJob().getConfigFormId() != null &&
                            form.getLocalContext().getConfiguredJob().getScheduledJob().getConfigFormId() > 0)
            {
                showLyrConfigurationTabs(true, true, true);
            }
            else
            {
                showLyrConfigurationTabs(true, false, true);
            }               

            form.lyrConfiguration().showtabScheduling();                
            form.getLocalContext().setCurrentSelectedTab(SCHEDULER_TAB);

            populateSchedulingTab((ConfiguredJobVo)args[0]);
            manageButtons(false, false, true, true);

            return;
        }
    }

    initialize();
    open();
}
项目:openMAXIMS    文件:Logic.java   
private boolean validateUI()
{
    int currentSelectedTab = form.getLocalContext().getCurrentSelectedTab();
    ArrayList<String> errors = new ArrayList<String>();

    switch (currentSelectedTab) 
    {
        case SCHEDULER_TAB:     if (form.lyrConfiguration().tabScheduling().dtimStartDate().getValue() == null)
                                {
                                    errors.add("Job start date is mandatory");
                                }
                                if (form.lyrConfiguration().tabScheduling().cmbFrequency().getValue() == null)
                                {
                                    errors.add("Job frequency is mandatory");//WDEV-17279
                                }
                                if(JobRunningFrequency.DAILY.equals(form.lyrConfiguration().tabScheduling().cmbFrequency().getValue()))
                                {
                                    if(form.lyrConfiguration().tabScheduling().lyrCron().tabDaily().intDays().getValue() == null)
                                    {
                                        errors.add("Day(s) is mandatory");
                                    }
                                    if(form.lyrConfiguration().tabScheduling().lyrCron().tabDaily().intHours().getValue() == null)
                                    {
                                        errors.add("Hour(s) is mandatory");
                                    }
                                    if(form.lyrConfiguration().tabScheduling().lyrCron().tabDaily().intMinutes().getValue() == null)
                                    {
                                        errors.add("Minute(s) is mandatory");
                                    }
                                }
                                if(JobRunningFrequency.WEEKLY.equals(form.lyrConfiguration().tabScheduling().cmbFrequency().getValue()))
                                {
                                    if(!form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkMon().getValue()
                                            && !form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkTue().getValue()
                                            && !form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkWed().getValue()
                                            && !form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkThu().getValue()
                                            && !form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkFri().getValue()
                                            && !form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkSat().getValue()
                                            && !form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkSun().getValue())
                                    {
                                        errors.add("Please select at least one day of the week");
                                    }
                                }
                                if(JobRunningFrequency.MONTHLY.equals(form.lyrConfiguration().tabScheduling().cmbFrequency().getValue()))
                                {
                                    if(form.lyrConfiguration().tabScheduling().lyrCron().tabMonthly().intDayOfMonth().getValue() == null)
                                    {
                                        errors.add("Day is mandatory");
                                    }
                                    if(form.lyrConfiguration().tabScheduling().lyrCron().tabMonthly().timMonthlyTime().getValue() == null)
                                    {
                                        errors.add("Time is mandatory");
                                    }
                                    if(form.lyrConfiguration().tabScheduling().lyrCron().tabMonthly().intDayOfMonth().getValue() != null)
                                    {
                                        if(form.lyrConfiguration().tabScheduling().lyrCron().tabMonthly().intDayOfMonth().getValue() > 31 || form.lyrConfiguration().tabScheduling().lyrCron().tabMonthly().intDayOfMonth().getValue() < 1)
                                        {
                                            errors.add("Day of month values must be between 1 and 31");
                                        }
                                    }
                                }
                                break;
        case CONFIGURATION_TAB: showLyrConfigurationTabs(false, false, true);
                                manageButtons(true, false, true, true);                                             
                                form.getLocalContext().setCurrentSelectedTab(NOTIFICATIONS_TAB);
                                break;
        default:
                                break;
    }

    if (errors.size() > 0) 
    {
        String[] allErrors = new String[errors.size()];
        errors.toArray(allErrors);
        engine.showErrors("Invalid Scheduler Job", allErrors);

        return true;
    }

    return false;
}
项目:openmaxims-linux    文件:Logic.java   
@Override
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{   
    form.lyrConfiguration().tabScheduling().cmbFrequency().removeRow(JobRunningFrequency.CUSTOM);

    form.getLocalContext().setSystemJob(form.getGlobalContext().Admin.getSystemJob());

    if (args != null && args.length > 0)
    {
        if (args[0] != null && args[0] instanceof ConfiguredJobVo)
        {
            form.getLocalContext().setConfiguredJob((ConfiguredJobVo)args[0]);                              
            form.getLocalContext().setNotificationOnSuccess(((ConfiguredJobVo)args[0]).getNotificationsOnSuccess()); 
            form.getLocalContext().setNotificationOnFailure(((ConfiguredJobVo)args[0]).getNotificationsOnFailure());                
            form.getGlobalContext().Admin.setSystemJobNotification(null);

            if(form.getLocalContext().getConfiguredJob() != null &&
                    form.getLocalContext().getConfiguredJob().getScheduledJob() != null &&
                        form.getLocalContext().getConfiguredJob().getScheduledJob().getConfigFormId() != null &&
                            form.getLocalContext().getConfiguredJob().getScheduledJob().getConfigFormId() > 0)
            {
                showLyrConfigurationTabs(true, true, true);
            }
            else
            {
                showLyrConfigurationTabs(true, false, true);
            }               

            form.lyrConfiguration().showtabScheduling();                
            form.getLocalContext().setCurrentSelectedTab(SCHEDULER_TAB);

            populateSchedulingTab((ConfiguredJobVo)args[0]);
            manageButtons(false, false, true, true);

            return;
        }
    }

    initialize();
    open();
}
项目:openmaxims-linux    文件:Logic.java   
private boolean validateUI()
{
    int currentSelectedTab = form.getLocalContext().getCurrentSelectedTab();
    ArrayList<String> errors = new ArrayList<String>();

    switch (currentSelectedTab) 
    {
        case SCHEDULER_TAB:     if (form.lyrConfiguration().tabScheduling().dtimStartDate().getValue() == null)
                                {
                                    errors.add("Job start date is mandatory");
                                }
                                if (form.lyrConfiguration().tabScheduling().cmbFrequency().getValue() == null)
                                {
                                    errors.add("Job frequency is mandatory");//WDEV-17279
                                }
                                if(JobRunningFrequency.DAILY.equals(form.lyrConfiguration().tabScheduling().cmbFrequency().getValue()))
                                {
                                    if(form.lyrConfiguration().tabScheduling().lyrCron().tabDaily().intDays().getValue() == null)
                                    {
                                        errors.add("Day(s) is mandatory");
                                    }
                                    if(form.lyrConfiguration().tabScheduling().lyrCron().tabDaily().intHours().getValue() == null)
                                    {
                                        errors.add("Hour(s) is mandatory");
                                    }
                                    if(form.lyrConfiguration().tabScheduling().lyrCron().tabDaily().intMinutes().getValue() == null)
                                    {
                                        errors.add("Minute(s) is mandatory");
                                    }
                                }
                                if(JobRunningFrequency.WEEKLY.equals(form.lyrConfiguration().tabScheduling().cmbFrequency().getValue()))
                                {
                                    if(!form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkMon().getValue()
                                            && !form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkTue().getValue()
                                            && !form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkWed().getValue()
                                            && !form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkThu().getValue()
                                            && !form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkFri().getValue()
                                            && !form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkSat().getValue()
                                            && !form.lyrConfiguration().tabScheduling().lyrCron().tabWeekly().chkSun().getValue())
                                    {
                                        errors.add("Please select at least one day of the week");
                                    }
                                }
                                if(JobRunningFrequency.MONTHLY.equals(form.lyrConfiguration().tabScheduling().cmbFrequency().getValue()))
                                {
                                    if(form.lyrConfiguration().tabScheduling().lyrCron().tabMonthly().intDayOfMonth().getValue() == null)
                                    {
                                        errors.add("Day is mandatory");
                                    }
                                    if(form.lyrConfiguration().tabScheduling().lyrCron().tabMonthly().timMonthlyTime().getValue() == null)
                                    {
                                        errors.add("Time is mandatory");
                                    }
                                    if(form.lyrConfiguration().tabScheduling().lyrCron().tabMonthly().intDayOfMonth().getValue() != null)
                                    {
                                        if(form.lyrConfiguration().tabScheduling().lyrCron().tabMonthly().intDayOfMonth().getValue() > 31 || form.lyrConfiguration().tabScheduling().lyrCron().tabMonthly().intDayOfMonth().getValue() < 1)
                                        {
                                            errors.add("Day of month values must be between 1 and 31");
                                        }
                                    }
                                }
                                break;
        case CONFIGURATION_TAB: showLyrConfigurationTabs(false, false, true);
                                manageButtons(true, false, true, true);                                             
                                form.getLocalContext().setCurrentSelectedTab(NOTIFICATIONS_TAB);
                                break;
        default:
                                break;
    }

    if (errors.size() > 0) 
    {
        String[] allErrors = new String[errors.size()];
        errors.toArray(allErrors);
        engine.showErrors("Invalid Scheduler Job", allErrors);

        return true;
    }

    return false;
}