Search in sources :

Example 31 with SimpleWidgetModel

use of org.jaffa.presentation.portlet.widgets.model.SimpleWidgetModel in project jaffa-framework by jaffa-projects.

the class TaskMaintenanceForm method getOftenHoursWM.

/**
 * Getter for property oftenHours. This is invoked by the custom tag, when the jsp is rendered, to get the current value.
 * @return Value of property oftenHours.
 */
public SimpleWidgetModel getOftenHoursWM() {
    SimpleWidgetModel w_oftenHours = (SimpleWidgetModel) getWidgetCache().getModel("oftenHours");
    if (w_oftenHours == null) {
        // Allow positive integers only
        IntegerFieldMetaData fieldMetaData = new IntegerFieldMetaData("OftenHours", "[label.Jaffa.Scheduler.ScheduledTask.Recurrence.OFTEN.Hours]", Boolean.FALSE, null, new Long(0), null, null);
        w_oftenHours = new SimpleWidgetModel(getOftenHours(), fieldMetaData);
        getWidgetCache().addModel("oftenHours", w_oftenHours);
    }
    return w_oftenHours;
}
Also used : IntegerFieldMetaData(org.jaffa.metadata.IntegerFieldMetaData) SimpleWidgetModel(org.jaffa.presentation.portlet.widgets.model.SimpleWidgetModel)

Example 32 with SimpleWidgetModel

use of org.jaffa.presentation.portlet.widgets.model.SimpleWidgetModel in project jaffa-framework by jaffa-projects.

the class TaskMaintenanceForm method getMonthlyWeekDayWM.

/**
 * Getter for property monthlyWeekDay. This is invoked by the custom tag, when the jsp is rendered, to get the current value.
 * @return Value of property monthlyWeekDay.
 */
public SimpleWidgetModel getMonthlyWeekDayWM() {
    SimpleWidgetModel w_monthlyWeekDay = (SimpleWidgetModel) getWidgetCache().getModel("monthlyWeekDay");
    if (w_monthlyWeekDay == null) {
        w_monthlyWeekDay = new SimpleWidgetModel(getMonthlyWeekDay());
        addWeekDayOptions(w_monthlyWeekDay);
        getWidgetCache().addModel("monthlyWeekDay", w_monthlyWeekDay);
    }
    return w_monthlyWeekDay;
}
Also used : SimpleWidgetModel(org.jaffa.presentation.portlet.widgets.model.SimpleWidgetModel)

Example 33 with SimpleWidgetModel

use of org.jaffa.presentation.portlet.widgets.model.SimpleWidgetModel in project jaffa-framework by jaffa-projects.

the class TaskMaintenanceForm method getYearlyFrequencyWM.

/**
 * Getter for property yearlyFrequency. This is invoked by the custom tag, when the jsp is rendered, to get the current value.
 * @return Value of property yearlyFrequency.
 */
public SimpleWidgetModel getYearlyFrequencyWM() {
    SimpleWidgetModel w_yearlyFrequency = (SimpleWidgetModel) getWidgetCache().getModel("yearlyFrequency");
    if (w_yearlyFrequency == null) {
        // Allow positive integers only
        IntegerFieldMetaData fieldMetaData = new IntegerFieldMetaData("YearlyFrequency", "[label.Jaffa.Scheduler.ScheduledTask.Recurrence.YEARLY.Frequency]", Boolean.FALSE, null, new Long(0), null, null);
        w_yearlyFrequency = new SimpleWidgetModel(getYearlyFrequency(), fieldMetaData);
        getWidgetCache().addModel("yearlyFrequency", w_yearlyFrequency);
    }
    return w_yearlyFrequency;
}
Also used : IntegerFieldMetaData(org.jaffa.metadata.IntegerFieldMetaData) SimpleWidgetModel(org.jaffa.presentation.portlet.widgets.model.SimpleWidgetModel)

Example 34 with SimpleWidgetModel

use of org.jaffa.presentation.portlet.widgets.model.SimpleWidgetModel in project jaffa-framework by jaffa-projects.

the class LabelEditorForm method getSourceFragmentNameWM.

/**
 * Getter for property sourceFragmentName. This is invoked by the custom tag, when the jsp is rendered, to get the current value.
 * @return Value of property sourceFragmentName.
 */
public SimpleWidgetModel getSourceFragmentNameWM() {
    SimpleWidgetModel sourceFragmentNameModel = (SimpleWidgetModel) getWidgetCache().getModel("sourceFragmentName");
    if (sourceFragmentNameModel == null) {
        sourceFragmentNameModel = new SimpleWidgetModel(getSourceFragmentName());
        getWidgetCache().addModel("sourceFragmentName", sourceFragmentNameModel);
    }
    return sourceFragmentNameModel;
}
Also used : SimpleWidgetModel(org.jaffa.presentation.portlet.widgets.model.SimpleWidgetModel)

Example 35 with SimpleWidgetModel

use of org.jaffa.presentation.portlet.widgets.model.SimpleWidgetModel in project jaffa-framework by jaffa-projects.

the class LabelEditorForm method doValidate.

/**
 * This method should be invoked to copy the fields from the FormBean to the component.
 * @return true of the values are copied successfully
 */
public boolean doValidate() {
    String value = null;
    value = getLabelFilterWM().getStringValue();
    if (value != null && value.trim().length() == 0)
        value = null;
    setLabelFilter(value);
    setDisplayOverridesOnly(getDisplayOverridesOnlyWM().getBooleanValue());
    value = getSearchPathForSourceFragmentsWM().getStringValue();
    if (value != null && value.trim().length() == 0)
        value = null;
    setSearchPathForSourceFragments(value);
    value = getSourceFragmentNameWM().getStringValue();
    if (value != null && value.trim().length() == 0)
        value = null;
    setSourceFragmentName(value);
    Map labels = ((LabelEditorComponent) getComponent()).getLabels();
    GridModel rows = getRowsWM();
    for (Iterator itr = rows.getRows().iterator(); itr.hasNext(); ) {
        GridModelRow row = (GridModelRow) itr.next();
        String label = (String) row.get(LabelEditorComponent.LABEL);
        String override = ((SimpleWidgetModel) row.get(LabelEditorComponent.OVERRIDE)).getStringValue();
        if (override != null && override.length() == 0)
            override = null;
        Map map = (Map) labels.get(label);
        map.put(LabelEditorComponent.OVERRIDE, override);
    }
    return true;
}
Also used : GridModel(org.jaffa.presentation.portlet.widgets.model.GridModel) GridModelRow(org.jaffa.presentation.portlet.widgets.model.GridModelRow) SimpleWidgetModel(org.jaffa.presentation.portlet.widgets.model.SimpleWidgetModel)

Aggregations

SimpleWidgetModel (org.jaffa.presentation.portlet.widgets.model.SimpleWidgetModel)40 GridModelRow (org.jaffa.presentation.portlet.widgets.model.GridModelRow)5 JspWriteRuntimeException (org.jaffa.presentation.portlet.widgets.taglib.exceptions.JspWriteRuntimeException)5 IOException (java.io.IOException)4 JspException (javax.servlet.jsp.JspException)4 JspWriter (javax.servlet.jsp.JspWriter)4 MissingParametersRuntimeException (org.jaffa.presentation.portlet.widgets.taglib.exceptions.MissingParametersRuntimeException)4 OuterFormTagMissingRuntimeException (org.jaffa.presentation.portlet.widgets.taglib.exceptions.OuterFormTagMissingRuntimeException)4 IPropertyRuleIntrospector (org.jaffa.rules.IPropertyRuleIntrospector)4 Iterator (java.util.Iterator)2 IntegerFieldMetaData (org.jaffa.metadata.IntegerFieldMetaData)2 Recurrence (org.jaffa.modules.scheduler.services.Recurrence)2 FormBase (org.jaffa.presentation.portlet.FormBase)2 File (java.io.File)1 TreeSet (java.util.TreeSet)1 FrameworkException (org.jaffa.exceptions.FrameworkException)1 TaskMaintenanceDto (org.jaffa.modules.scheduler.components.taskmaintenance.dto.TaskMaintenanceDto)1 GridModel (org.jaffa.presentation.portlet.widgets.model.GridModel)1 WidgetModelAccessMethodNotFoundRuntimeException (org.jaffa.presentation.portlet.widgets.taglib.exceptions.WidgetModelAccessMethodNotFoundRuntimeException)1