svn commit: r900024 - in /ofbiz/trunk: applications/workeffort/src/org/ofbiz/workeffort/workeffort/ framework/common/config/ framework/common/servicedef/ framework/common/webcommon/includes/ framework/service/data/ framework/service/src/org/ofbiz/servi...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r900024 - in /ofbiz/trunk: applications/workeffort/src/org/ofbiz/workeffort/workeffort/ framework/common/config/ framework/common/servicedef/ framework/common/webcommon/includes/ framework/service/data/ framework/service/src/org/ofbiz/servi...

adrianc
Author: adrianc
Date: Sat Jan 16 20:59:37 2010
New Revision: 900024

URL: http://svn.apache.org/viewvc?rev=900024&view=rev
Log:
Temporal Expression bug fixes.

Internationalization note: this commit contains new UI labels.

Deprecated the time of day expression - it was a bad design. Replaced it with separate hour and minute expressions.

Fixed the createTemporalExpression service. It wouldn't allow user-specified expression IDs.

Modified:
    ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalRecurConverter.java
    ofbiz/trunk/framework/common/config/TemporalExpressionUiLabels.xml
    ofbiz/trunk/framework/common/servicedef/services.xml
    ofbiz/trunk/framework/common/webcommon/includes/commonMacros.ftl
    ofbiz/trunk/framework/service/data/ServiceDemoData.xml
    ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/TemporalExpressionVisitor.java
    ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/TemporalExpressionWorker.java
    ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/TemporalExpressions.java
    ofbiz/trunk/framework/webtools/webapp/webtools/tempexpr/tempExprMacros.ftl
    ofbiz/trunk/framework/webtools/webapp/webtools/tempexpr/tempExprMaint.ftl

Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalRecurConverter.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalRecurConverter.java?rev=900024&r1=900023&r2=900024&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalRecurConverter.java (original)
+++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalRecurConverter.java Sat Jan 16 20:59:37 2010
@@ -44,15 +44,6 @@
  */
 public class ICalRecurConverter implements TemporalExpressionVisitor {
     protected static final WeekDay dayOfWeekArray[] = {WeekDay.SU, WeekDay.MO, WeekDay.TU, WeekDay.WE, WeekDay.TH, WeekDay.FR, WeekDay.SA};
-    protected DtStart dateStart = null;
-    protected List<DateListProperty> incDateList = FastList.newInstance();
-    protected List<DateListProperty> exDateList = FastList.newInstance();
-    protected List<RRule> incRuleList = FastList.newInstance();
-    protected List<ExRule> exRuleList = FastList.newInstance();
-    protected VisitorState state = new VisitorState();
-    protected Stack<VisitorState> stateStack = new Stack<VisitorState>();
-
-    protected ICalRecurConverter() {}
 
     @SuppressWarnings("unchecked")
     public static void convert(TemporalExpression expr, PropertyList eventProps) {
@@ -78,16 +69,85 @@
         eventProps.addAll(converter.exRuleList);
     }
 
-    // ----- TemporalExpressionVisitor Implementation ----- //
+    protected DtStart dateStart = null;
+    protected List<DateListProperty> incDateList = FastList.newInstance();
+    protected List<DateListProperty> exDateList = FastList.newInstance();
+    protected List<RRule> incRuleList = FastList.newInstance();
+    protected List<ExRule> exRuleList = FastList.newInstance();
+    protected VisitorState state = new VisitorState();
+    protected Stack<VisitorState> stateStack = new Stack<VisitorState>();
 
-    public void visit(Null expr) {}
+    protected ICalRecurConverter() {}
 
-    public void visit(Union expr) {
-        for (TemporalExpression childExpr : expr.getExpressionSet()) {
-            childExpr.accept(this);
+    @SuppressWarnings("unchecked")
+    protected Recur consolidateRecurs(List<Recur> recurList) {
+        // Try to consolidate a list of Recur instances into one instance
+        Set<Integer> monthList = FastSet.newInstance();
+        Set<Integer> monthDayList = FastSet.newInstance();
+        Set<WeekDay> weekDayList = FastSet.newInstance();
+        Set<Integer> hourList = FastSet.newInstance();
+        String freq = null;
+        int freqCount = 0;
+        for (Recur recur : recurList) {
+            monthList.addAll(recur.getMonthList());
+            monthDayList.addAll(recur.getMonthDayList());
+            weekDayList.addAll(recur.getDayList());
+            hourList.addAll(recur.getHourList());
+            if (recur.getInterval() != 0 && freq == null) {
+                freq = recur.getFrequency();
+                freqCount = recur.getInterval();
+            }
+        }
+        if (freq == null && monthList.size() > 0) {
+            freq = Recur.MONTHLY;
+        } else if (freq == null && (monthDayList.size() > 0 || weekDayList.size() > 0)) {
+            freq = Recur.DAILY;
+        } else if (freq == null && hourList.size() > 0) {
+            freq = Recur.HOURLY;
+        }
+        if (freq == null) {
+            throw new IllegalStateException("Unable to convert intersection");
+        }
+        Recur newRecur = new Recur(freq, 0);
+        if (freqCount != 0) {
+            newRecur.setInterval(freqCount);
+        }
+        newRecur.getMonthList().addAll(monthList);
+        newRecur.getMonthDayList().addAll(monthDayList);
+        newRecur.getDayList().addAll(weekDayList);
+        newRecur.getHourList().addAll(hourList);
+        return newRecur;
+    }
+
+    // ----- TemporalExpressionVisitor Implementation ----- //
+
+    @Override
+    public void visit(Difference expr) {
+        VisitorState newState = new VisitorState();
+        newState.isIntersection = this.state.isIntersection;
+        this.stateStack.push(this.state);
+        this.state = newState;
+        expr.getIncluded().accept(this);
+        newState.isExcluded = true;
+        expr.getExcluded().accept(this);
+        this.state = this.stateStack.pop();
+        if (this.state.isIntersection) {
+            this.state.inclRecurList.addAll(newState.inclRecurList);
+            this.state.exRecurList.addAll(newState.exRecurList);
         }
     }
 
+    @SuppressWarnings("unchecked")
+    @Override
+    public void visit(HourRange expr) {
+        NumberList hourList = new NumberList();
+        hourList.addAll(expr.getHourRangeAsSet());
+        Recur recur = new Recur(Recur.HOURLY, 0);
+        recur.getHourList().addAll(hourList);
+        this.state.addRecur(recur);
+    }
+
+    @Override
     public void visit(Intersection expr) {
         this.stateStack.push(this.state);
         VisitorState newState = new VisitorState();
@@ -106,21 +166,20 @@
         }
     }
 
-    public void visit(Difference expr) {
-        VisitorState newState = new VisitorState();
-        newState.isIntersection = this.state.isIntersection;
-        this.stateStack.push(this.state);
-        this.state = newState;
-        expr.getIncluded().accept(this);
-        newState.isExcluded = true;
-        expr.getExcluded().accept(this);
-        this.state = this.stateStack.pop();
-        if (this.state.isIntersection) {
-            this.state.inclRecurList.addAll(newState.inclRecurList);
-            this.state.exRecurList.addAll(newState.exRecurList);
-        }
+    @SuppressWarnings("unchecked")
+    @Override
+    public void visit(MinuteRange expr) {
+        NumberList minuteList = new NumberList();
+        minuteList.addAll(expr.getMinuteRangeAsSet());
+        Recur recur = new Recur(Recur.MINUTELY, 0);
+        recur.getMinuteList().addAll(minuteList);
+        this.state.addRecur(recur);
     }
 
+    @Override
+    public void visit(Null expr) {}
+
+    @Override
     public void visit(TemporalExpressions.DateRange expr) {
         if (this.state.isExcluded) {
             throw new IllegalStateException("iCalendar does not support excluded date ranges");
@@ -131,84 +190,49 @@
         this.incDateList.add(new RDate(periodList));
     }
 
-    @SuppressWarnings("unchecked")
-    public void visit(TimeOfDayRange expr) {
-        // TODO: this needs a better conversion
-        int startHr = expr.getStartHours();
-        int endHr = expr.getEndHours();
-        NumberList hourList = new NumberList();
-        hourList.add(startHr);
-        while (startHr != endHr) {
-            startHr++;
-            if (startHr == 24) {
-                startHr = 0;
-            }
-            hourList.add(startHr);
-        }
-        Recur recur = new Recur(Recur.HOURLY, 0);
-        recur.getHourList().addAll(hourList);
+    @Override
+    public void visit(TemporalExpressions.DayInMonth expr) {
+        Recur recur = new Recur(Recur.MONTHLY, 0);
+        recur.getDayList().add(new WeekDay(dayOfWeekArray[expr.getDayOfWeek() - 1], expr.getOccurrence()));
         this.state.addRecur(recur);
     }
 
     @SuppressWarnings("unchecked")
-    public void visit(TemporalExpressions.DayOfWeekRange expr) {
+    @Override
+    public void visit(TemporalExpressions.DayOfMonthRange expr) {
         int startDay = expr.getStartDay();
         int endDay = expr.getEndDay();
-        WeekDayList dayList = new WeekDayList();
-        dayList.add(dayOfWeekArray[startDay - 1]);
+        NumberList dayList = new NumberList();
+        dayList.add(startDay);
         while (startDay != endDay) {
             startDay++;
-            if (startDay > Calendar.SATURDAY) {
-                startDay = Calendar.SUNDAY;
-            }
-            dayList.add(dayOfWeekArray[startDay - 1]);
+            dayList.add(startDay);
         }
         Recur recur = new Recur(Recur.DAILY, 0);
-        recur.getDayList().addAll(dayList);
-        this.state.addRecur(recur);
-    }
-
-    @SuppressWarnings("unchecked")
-    public void visit(TemporalExpressions.MonthRange expr) {
-        int startMonth = expr.getStartMonth();
-        int endMonth = expr.getEndMonth();
-        Calendar cal = Calendar.getInstance();
-        int maxMonth = cal.getActualMaximum(Calendar.MONTH);
-        NumberList monthList = new NumberList();
-        monthList.add(startMonth + 1);
-        while (startMonth != endMonth) {
-            startMonth++;
-            if (startMonth > maxMonth) {
-                startMonth = Calendar.JANUARY;
-            }
-            monthList.add(startMonth + 1);
-        }
-        Recur recur = new Recur(Recur.MONTHLY, 0);
-        recur.getMonthList().addAll(monthList);
+        recur.getMonthDayList().addAll(dayList);
         this.state.addRecur(recur);
     }
 
     @SuppressWarnings("unchecked")
-    public void visit(TemporalExpressions.DayOfMonthRange expr) {
+    @Override
+    public void visit(TemporalExpressions.DayOfWeekRange expr) {
         int startDay = expr.getStartDay();
         int endDay = expr.getEndDay();
-        NumberList dayList = new NumberList();
-        dayList.add(startDay);
+        WeekDayList dayList = new WeekDayList();
+        dayList.add(dayOfWeekArray[startDay - 1]);
         while (startDay != endDay) {
             startDay++;
-            dayList.add(startDay);
+            if (startDay > Calendar.SATURDAY) {
+                startDay = Calendar.SUNDAY;
+            }
+            dayList.add(dayOfWeekArray[startDay - 1]);
         }
         Recur recur = new Recur(Recur.DAILY, 0);
-        recur.getMonthDayList().addAll(dayList);
-        this.state.addRecur(recur);
-    }
-
-    public void visit(TemporalExpressions.DayInMonth expr) {
-        Recur recur = new Recur(Recur.MONTHLY, 0);
-        recur.getDayList().add(new WeekDay(dayOfWeekArray[expr.getDayOfWeek() - 1], expr.getOccurrence()));
+        recur.getDayList().addAll(dayList);
         this.state.addRecur(recur);
     }
 
+    @Override
     public void visit(TemporalExpressions.Frequency expr) {
         if (this.dateStart == null) {
             this.dateStart = new DtStart(new net.fortuna.ical4j.model.Date(expr.getStartDate()));
@@ -232,43 +256,50 @@
     }
 
     @SuppressWarnings("unchecked")
-    protected Recur consolidateRecurs(List<Recur> recurList) {
-        // Try to consolidate a list of Recur instances into one instance
-        Set<Integer> monthList = FastSet.newInstance();
-        Set<Integer> monthDayList = FastSet.newInstance();
-        Set<WeekDay> weekDayList = FastSet.newInstance();
-        Set<Integer> hourList = FastSet.newInstance();
-        String freq = null;
-        int freqCount = 0;
-        for (Recur recur : recurList) {
-            monthList.addAll(recur.getMonthList());
-            monthDayList.addAll(recur.getMonthDayList());
-            weekDayList.addAll(recur.getDayList());
-            hourList.addAll(recur.getHourList());
-            if (recur.getInterval() != 0 && freq == null) {
-                freq = recur.getFrequency();
-                freqCount = recur.getInterval();
+    @Override
+    public void visit(TemporalExpressions.MonthRange expr) {
+        int startMonth = expr.getStartMonth();
+        int endMonth = expr.getEndMonth();
+        Calendar cal = Calendar.getInstance();
+        int maxMonth = cal.getActualMaximum(Calendar.MONTH);
+        NumberList monthList = new NumberList();
+        monthList.add(startMonth + 1);
+        while (startMonth != endMonth) {
+            startMonth++;
+            if (startMonth > maxMonth) {
+                startMonth = Calendar.JANUARY;
             }
+            monthList.add(startMonth + 1);
         }
-        if (freq == null && monthList.size() > 0) {
-            freq = Recur.MONTHLY;
-        } else if (freq == null && (monthDayList.size() > 0 || weekDayList.size() > 0)) {
-            freq = Recur.DAILY;
-        } else if (freq == null && hourList.size() > 0) {
-            freq = Recur.HOURLY;
-        }
-        if (freq == null) {
-            throw new IllegalStateException("Unable to convert intersection");
+        Recur recur = new Recur(Recur.MONTHLY, 0);
+        recur.getMonthList().addAll(monthList);
+        this.state.addRecur(recur);
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public void visit(TimeOfDayRange expr) {
+        int startHr = expr.getStartHours();
+        int endHr = expr.getEndHours();
+        NumberList hourList = new NumberList();
+        hourList.add(startHr);
+        while (startHr != endHr) {
+            startHr++;
+            if (startHr == 24) {
+                startHr = 0;
+            }
+            hourList.add(startHr);
         }
-        Recur newRecur = new Recur(freq, 0);
-        if (freqCount != 0) {
-            newRecur.setInterval(freqCount);
+        Recur recur = new Recur(Recur.HOURLY, 0);
+        recur.getHourList().addAll(hourList);
+        this.state.addRecur(recur);
+    }
+
+    @Override
+    public void visit(Union expr) {
+        for (TemporalExpression childExpr : expr.getExpressionSet()) {
+            childExpr.accept(this);
         }
-        newRecur.getMonthList().addAll(monthList);
-        newRecur.getMonthDayList().addAll(monthDayList);
-        newRecur.getDayList().addAll(weekDayList);
-        newRecur.getHourList().addAll(hourList);
-        return newRecur;
     }
 
     protected class VisitorState {

Modified: ofbiz/trunk/framework/common/config/TemporalExpressionUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/config/TemporalExpressionUiLabels.xml?rev=900024&r1=900023&r2=900024&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/config/TemporalExpressionUiLabels.xml (original)
+++ ofbiz/trunk/framework/common/config/TemporalExpressionUiLabels.xml Sat Jan 16 20:59:37 2010
@@ -126,12 +126,18 @@
         <value xml:lang="it">Frequenza</value>
         <value xml:lang="zh">频率</value>
     </property>
+    <property key="TemporalExpression_HOUR_RANGE">
+        <value xml:lang="en">Hour Range</value>
+    </property>
     <property key="TemporalExpression_INTERSECTION">
         <value xml:lang="en">Intersection</value>
         <value xml:lang="fr">Intersection</value>
         <value xml:lang="it">Intersezione</value>
         <value xml:lang="zh">交叉点</value>
     </property>
+    <property key="TemporalExpression_MINUTE_RANGE">
+        <value xml:lang="en">Minute Range</value>
+    </property>
     <property key="TemporalExpression_MONTH_RANGE">
         <value xml:lang="en">Month Range</value>
         <value xml:lang="fr">Intervalle entre 2 mois</value>
@@ -139,7 +145,7 @@
         <value xml:lang="zh">月的范围</value>
     </property>
     <property key="TemporalExpression_TIME_OF_DAY_RANGE">
-        <value xml:lang="en">Time Of Day Range</value>
+        <value xml:lang="en">Time Of Day Range (deprecated)</value>
         <value xml:lang="fr">Intervalle entre 2 heures d'un jour</value>
         <value xml:lang="it">Ora nel giorno dell'intervallo</value>
         <value xml:lang="zh">日中时间的范围</value>

Modified: ofbiz/trunk/framework/common/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/servicedef/services.xml?rev=900024&r1=900023&r2=900024&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/servicedef/services.xml (original)
+++ ofbiz/trunk/framework/common/servicedef/services.xml Sat Jan 16 20:59:37 2010
@@ -537,7 +537,7 @@
     <service name="createTemporalExpression" default-entity-name="TemporalExpression" engine="entity-auto" invoke="create" auth="true">
         <description>Create a Temporal Expression</description>
         <permission-service service-name="tempExprPermissionCheck" main-action="CREATE"/>
-        <auto-attributes include="pk" mode="OUT" optional="false"/>
+        <auto-attributes include="pk" mode="INOUT" optional="true"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
     <service name="updateTemporalExpression" default-entity-name="TemporalExpression" engine="entity-auto" invoke="update" auth="true">

Modified: ofbiz/trunk/framework/common/webcommon/includes/commonMacros.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/commonMacros.ftl?rev=900024&r1=900023&r2=900024&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/includes/commonMacros.ftl (original)
+++ ofbiz/trunk/framework/common/webcommon/includes/commonMacros.ftl Sat Jan 16 20:59:37 2010
@@ -53,6 +53,28 @@
   </#if>
 </#macro>
 
+<#macro HourOfDayField fieldName="" fieldValue=-1 fieldClass="">
+  <select name="${fieldName}"<#if fieldClass?has_content> class="${fieldClass}"</#if>>
+    <#list 0..23 as i>
+      <option value="${i}"<#if i == fieldValue> selected="selected"</#if>>${i}</option>
+    </#list>
+  </select>
+  <#if fieldClass == "required">
+    <span class="tooltip">${uiLabelMap.CommonRequired}</span>
+  </#if>
+</#macro>
+
+<#macro MinuteField fieldName="" fieldValue=-1 fieldClass="">
+  <select name="${fieldName}"<#if fieldClass?has_content> class="${fieldClass}"</#if>>
+    <#list 0..59 as i>
+      <option value="${i}"<#if i == fieldValue> selected="selected"</#if>>${i}</option>
+    </#list>
+  </select>
+  <#if fieldClass == "required">
+    <span class="tooltip">${uiLabelMap.CommonRequired}</span>
+  </#if>
+</#macro>
+
 <#macro DayOfWeekField fieldName="" fieldValue=-1 fieldClass="">
   <select name="${fieldName}"<#if fieldClass?has_content> class="${fieldClass}"</#if>>
     <#list dayValueList as dayValue>

Modified: ofbiz/trunk/framework/service/data/ServiceDemoData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/data/ServiceDemoData.xml?rev=900024&r1=900023&r2=900024&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/data/ServiceDemoData.xml (original)
+++ ofbiz/trunk/framework/service/data/ServiceDemoData.xml Sat Jan 16 20:59:37 2010
@@ -21,6 +21,94 @@
 <entity-engine-xml>
     <!-- Temporal Expression demo data -->
 
+    <!-- Pre-define all 60 minutes -->
+    <TemporalExpression tempExprId="MINUTE_00" tempExprTypeId="MINUTE_RANGE" integer1="0" integer2="0"/>
+    <TemporalExpression tempExprId="MINUTE_01" tempExprTypeId="MINUTE_RANGE" integer1="1" integer2="1"/>
+    <TemporalExpression tempExprId="MINUTE_02" tempExprTypeId="MINUTE_RANGE" integer1="2" integer2="2"/>
+    <TemporalExpression tempExprId="MINUTE_03" tempExprTypeId="MINUTE_RANGE" integer1="3" integer2="3"/>
+    <TemporalExpression tempExprId="MINUTE_04" tempExprTypeId="MINUTE_RANGE" integer1="4" integer2="4"/>
+    <TemporalExpression tempExprId="MINUTE_05" tempExprTypeId="MINUTE_RANGE" integer1="5" integer2="5"/>
+    <TemporalExpression tempExprId="MINUTE_06" tempExprTypeId="MINUTE_RANGE" integer1="6" integer2="6"/>
+    <TemporalExpression tempExprId="MINUTE_07" tempExprTypeId="MINUTE_RANGE" integer1="7" integer2="7"/>
+    <TemporalExpression tempExprId="MINUTE_08" tempExprTypeId="MINUTE_RANGE" integer1="8" integer2="8"/>
+    <TemporalExpression tempExprId="MINUTE_09" tempExprTypeId="MINUTE_RANGE" integer1="9" integer2="9"/>
+    <TemporalExpression tempExprId="MINUTE_10" tempExprTypeId="MINUTE_RANGE" integer1="10" integer2="10"/>
+    <TemporalExpression tempExprId="MINUTE_11" tempExprTypeId="MINUTE_RANGE" integer1="11" integer2="11"/>
+    <TemporalExpression tempExprId="MINUTE_12" tempExprTypeId="MINUTE_RANGE" integer1="12" integer2="12"/>
+    <TemporalExpression tempExprId="MINUTE_13" tempExprTypeId="MINUTE_RANGE" integer1="13" integer2="13"/>
+    <TemporalExpression tempExprId="MINUTE_14" tempExprTypeId="MINUTE_RANGE" integer1="14" integer2="14"/>
+    <TemporalExpression tempExprId="MINUTE_15" tempExprTypeId="MINUTE_RANGE" integer1="15" integer2="15"/>
+    <TemporalExpression tempExprId="MINUTE_16" tempExprTypeId="MINUTE_RANGE" integer1="16" integer2="16"/>
+    <TemporalExpression tempExprId="MINUTE_17" tempExprTypeId="MINUTE_RANGE" integer1="17" integer2="17"/>
+    <TemporalExpression tempExprId="MINUTE_18" tempExprTypeId="MINUTE_RANGE" integer1="18" integer2="18"/>
+    <TemporalExpression tempExprId="MINUTE_19" tempExprTypeId="MINUTE_RANGE" integer1="19" integer2="19"/>
+    <TemporalExpression tempExprId="MINUTE_20" tempExprTypeId="MINUTE_RANGE" integer1="20" integer2="20"/>
+    <TemporalExpression tempExprId="MINUTE_21" tempExprTypeId="MINUTE_RANGE" integer1="21" integer2="21"/>
+    <TemporalExpression tempExprId="MINUTE_22" tempExprTypeId="MINUTE_RANGE" integer1="22" integer2="22"/>
+    <TemporalExpression tempExprId="MINUTE_23" tempExprTypeId="MINUTE_RANGE" integer1="23" integer2="23"/>
+    <TemporalExpression tempExprId="MINUTE_24" tempExprTypeId="MINUTE_RANGE" integer1="24" integer2="24"/>
+    <TemporalExpression tempExprId="MINUTE_25" tempExprTypeId="MINUTE_RANGE" integer1="25" integer2="25"/>
+    <TemporalExpression tempExprId="MINUTE_26" tempExprTypeId="MINUTE_RANGE" integer1="26" integer2="26"/>
+    <TemporalExpression tempExprId="MINUTE_27" tempExprTypeId="MINUTE_RANGE" integer1="27" integer2="27"/>
+    <TemporalExpression tempExprId="MINUTE_28" tempExprTypeId="MINUTE_RANGE" integer1="28" integer2="28"/>
+    <TemporalExpression tempExprId="MINUTE_29" tempExprTypeId="MINUTE_RANGE" integer1="29" integer2="29"/>
+    <TemporalExpression tempExprId="MINUTE_30" tempExprTypeId="MINUTE_RANGE" integer1="30" integer2="30"/>
+    <TemporalExpression tempExprId="MINUTE_31" tempExprTypeId="MINUTE_RANGE" integer1="31" integer2="31"/>
+    <TemporalExpression tempExprId="MINUTE_32" tempExprTypeId="MINUTE_RANGE" integer1="32" integer2="32"/>
+    <TemporalExpression tempExprId="MINUTE_33" tempExprTypeId="MINUTE_RANGE" integer1="33" integer2="33"/>
+    <TemporalExpression tempExprId="MINUTE_34" tempExprTypeId="MINUTE_RANGE" integer1="34" integer2="34"/>
+    <TemporalExpression tempExprId="MINUTE_35" tempExprTypeId="MINUTE_RANGE" integer1="35" integer2="35"/>
+    <TemporalExpression tempExprId="MINUTE_36" tempExprTypeId="MINUTE_RANGE" integer1="36" integer2="36"/>
+    <TemporalExpression tempExprId="MINUTE_37" tempExprTypeId="MINUTE_RANGE" integer1="37" integer2="37"/>
+    <TemporalExpression tempExprId="MINUTE_38" tempExprTypeId="MINUTE_RANGE" integer1="38" integer2="38"/>
+    <TemporalExpression tempExprId="MINUTE_39" tempExprTypeId="MINUTE_RANGE" integer1="39" integer2="39"/>
+    <TemporalExpression tempExprId="MINUTE_40" tempExprTypeId="MINUTE_RANGE" integer1="40" integer2="40"/>
+    <TemporalExpression tempExprId="MINUTE_41" tempExprTypeId="MINUTE_RANGE" integer1="41" integer2="41"/>
+    <TemporalExpression tempExprId="MINUTE_42" tempExprTypeId="MINUTE_RANGE" integer1="42" integer2="42"/>
+    <TemporalExpression tempExprId="MINUTE_43" tempExprTypeId="MINUTE_RANGE" integer1="43" integer2="43"/>
+    <TemporalExpression tempExprId="MINUTE_44" tempExprTypeId="MINUTE_RANGE" integer1="44" integer2="44"/>
+    <TemporalExpression tempExprId="MINUTE_45" tempExprTypeId="MINUTE_RANGE" integer1="45" integer2="45"/>
+    <TemporalExpression tempExprId="MINUTE_46" tempExprTypeId="MINUTE_RANGE" integer1="46" integer2="46"/>
+    <TemporalExpression tempExprId="MINUTE_47" tempExprTypeId="MINUTE_RANGE" integer1="47" integer2="47"/>
+    <TemporalExpression tempExprId="MINUTE_48" tempExprTypeId="MINUTE_RANGE" integer1="48" integer2="48"/>
+    <TemporalExpression tempExprId="MINUTE_49" tempExprTypeId="MINUTE_RANGE" integer1="49" integer2="49"/>
+    <TemporalExpression tempExprId="MINUTE_50" tempExprTypeId="MINUTE_RANGE" integer1="50" integer2="50"/>
+    <TemporalExpression tempExprId="MINUTE_51" tempExprTypeId="MINUTE_RANGE" integer1="51" integer2="51"/>
+    <TemporalExpression tempExprId="MINUTE_52" tempExprTypeId="MINUTE_RANGE" integer1="52" integer2="52"/>
+    <TemporalExpression tempExprId="MINUTE_53" tempExprTypeId="MINUTE_RANGE" integer1="53" integer2="53"/>
+    <TemporalExpression tempExprId="MINUTE_54" tempExprTypeId="MINUTE_RANGE" integer1="54" integer2="54"/>
+    <TemporalExpression tempExprId="MINUTE_55" tempExprTypeId="MINUTE_RANGE" integer1="55" integer2="55"/>
+    <TemporalExpression tempExprId="MINUTE_56" tempExprTypeId="MINUTE_RANGE" integer1="56" integer2="56"/>
+    <TemporalExpression tempExprId="MINUTE_57" tempExprTypeId="MINUTE_RANGE" integer1="57" integer2="57"/>
+    <TemporalExpression tempExprId="MINUTE_58" tempExprTypeId="MINUTE_RANGE" integer1="58" integer2="58"/>
+    <TemporalExpression tempExprId="MINUTE_59" tempExprTypeId="MINUTE_RANGE" integer1="59" integer2="59"/>
+
+    <!-- Pre-define all 24 hours of the day -->
+    <TemporalExpression tempExprId="HOUR_00" tempExprTypeId="HOUR_RANGE" integer1="0" integer2="0"/>
+    <TemporalExpression tempExprId="HOUR_01" tempExprTypeId="HOUR_RANGE" integer1="1" integer2="1"/>
+    <TemporalExpression tempExprId="HOUR_02" tempExprTypeId="HOUR_RANGE" integer1="2" integer2="2"/>
+    <TemporalExpression tempExprId="HOUR_03" tempExprTypeId="HOUR_RANGE" integer1="3" integer2="3"/>
+    <TemporalExpression tempExprId="HOUR_04" tempExprTypeId="HOUR_RANGE" integer1="4" integer2="4"/>
+    <TemporalExpression tempExprId="HOUR_05" tempExprTypeId="HOUR_RANGE" integer1="5" integer2="5"/>
+    <TemporalExpression tempExprId="HOUR_06" tempExprTypeId="HOUR_RANGE" integer1="6" integer2="6"/>
+    <TemporalExpression tempExprId="HOUR_07" tempExprTypeId="HOUR_RANGE" integer1="7" integer2="7"/>
+    <TemporalExpression tempExprId="HOUR_08" tempExprTypeId="HOUR_RANGE" integer1="8" integer2="8"/>
+    <TemporalExpression tempExprId="HOUR_09" tempExprTypeId="HOUR_RANGE" integer1="9" integer2="9"/>
+    <TemporalExpression tempExprId="HOUR_10" tempExprTypeId="HOUR_RANGE" integer1="10" integer2="10"/>
+    <TemporalExpression tempExprId="HOUR_11" tempExprTypeId="HOUR_RANGE" integer1="11" integer2="11"/>
+    <TemporalExpression tempExprId="HOUR_12" tempExprTypeId="HOUR_RANGE" integer1="12" integer2="12"/>
+    <TemporalExpression tempExprId="HOUR_13" tempExprTypeId="HOUR_RANGE" integer1="13" integer2="13"/>
+    <TemporalExpression tempExprId="HOUR_14" tempExprTypeId="HOUR_RANGE" integer1="14" integer2="14"/>
+    <TemporalExpression tempExprId="HOUR_15" tempExprTypeId="HOUR_RANGE" integer1="15" integer2="15"/>
+    <TemporalExpression tempExprId="HOUR_16" tempExprTypeId="HOUR_RANGE" integer1="16" integer2="16"/>
+    <TemporalExpression tempExprId="HOUR_17" tempExprTypeId="HOUR_RANGE" integer1="17" integer2="17"/>
+    <TemporalExpression tempExprId="HOUR_18" tempExprTypeId="HOUR_RANGE" integer1="18" integer2="18"/>
+    <TemporalExpression tempExprId="HOUR_19" tempExprTypeId="HOUR_RANGE" integer1="19" integer2="19"/>
+    <TemporalExpression tempExprId="HOUR_20" tempExprTypeId="HOUR_RANGE" integer1="20" integer2="20"/>
+    <TemporalExpression tempExprId="HOUR_21" tempExprTypeId="HOUR_RANGE" integer1="21" integer2="21"/>
+    <TemporalExpression tempExprId="HOUR_22" tempExprTypeId="HOUR_RANGE" integer1="22" integer2="22"/>
+    <TemporalExpression tempExprId="HOUR_23" tempExprTypeId="HOUR_RANGE" integer1="23" integer2="23"/>
+
     <!-- Pre-define all days of the week (Sunday -> Saturday) -->
     <TemporalExpression tempExprId="DAYOFWEEK_01" tempExprTypeId="DAY_OF_WEEK_RANGE" integer1="1" integer2="1"/>
     <TemporalExpression tempExprId="DAYOFWEEK_02" tempExprTypeId="DAY_OF_WEEK_RANGE" integer1="2" integer2="2"/>
@@ -155,8 +243,7 @@
 
     <!-- An 8am Mon-Fri expression that excludes US federal holidays -->
     <TemporalExpression tempExprId="DAILY_GRIND" tempExprTypeId="INTERSECTION"/>
-    <TemporalExpression tempExprId="8AM" tempExprTypeId="TIME_OF_DAY_RANGE" string1="08:00" string2="08:00"/>
-    <TemporalExpressionAssoc fromTempExprId="DAILY_GRIND" toTempExprId="8AM"/>
+    <TemporalExpressionAssoc fromTempExprId="DAILY_GRIND" toTempExprId="HOUR_08"/>
     <TemporalExpressionAssoc fromTempExprId="DAILY_GRIND" toTempExprId="GOVT_WORK_SCHED"/>
 
     <!-- An every-other-Monday at 5pm expression -->
@@ -168,15 +255,17 @@
         values are typically obtained from the java.util.Calendar field constants. For more
         information, see the org.ofbiz.service.calendar.TemporalExpressions.java file.
 
-        tempExprTypeId       integer1       integer2        date1  date2  string1    string2
-        ==================== ============== =============== ====== ====== ========== ========
-        DATE_RANGE                                          start  end
-        TIME_OF_DAY_RANGE    interval [9]   count [7]                     start [1]  end [1]
-        DAY_OF_WEEK_RANGE    start [2]      end [2]
-        MONTH_RANGE          start [3]      end [3]
-        DAY_OF_MONTH_RANGE   start [4]      end [4]
-        DAY_IN_MONTH         day [2]        occurrence [5]
-        FREQUENCY            freq type [6]  freq count [7]  start[8]
+        tempExprTypeId        integer1       integer2        date1  date2  string1    string2
+        ====================  ============== =============== ====== ====== ========== ========
+        HOUR_RANGE            start[11]      end[11]
+        DATE_RANGE                                           start  end
+        TIME_OF_DAY_RANGE[10] interval [9]   count [7]                     start [1]  end [1]
+        DAY_OF_WEEK_RANGE     start [2]      end [2]
+        MINUTE_RANGE          start [12]     end [12]
+        MONTH_RANGE           start [3]      end [3]
+        DAY_OF_MONTH_RANGE    start [4]      end [4]
+        DAY_IN_MONTH          day [2]        occurrence [5]
+        FREQUENCY             freq type [6]  freq count [7]  start[8]
 
         [1] hh:mm:ss
         [2] Day of week: 1 = Sunday, 7 = Saturday
@@ -187,6 +276,9 @@
         [7] Positive integer, zero excluded
         [8] If null, defaults to system date when the expression was retrieved from storage.
         [9] Second = 13, Minute = 12, Hour = 11 (default)
+        [10] Deprecated - do not use
+        [11] Integer: 0 to 23, midnight = 0
+        [12] Integer: 0 to 59
     -->
 
 </entity-engine-xml>

Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/TemporalExpressionVisitor.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/TemporalExpressionVisitor.java?rev=900024&r1=900023&r2=900024&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/TemporalExpressionVisitor.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/TemporalExpressionVisitor.java Sat Jan 16 20:59:37 2010
@@ -20,15 +20,17 @@
 
 /** Temporal expression visitor interface. */
 public interface TemporalExpressionVisitor {
-    void visit(TemporalExpressions.Null expr);
-    void visit(TemporalExpressions.Union expr);
-    void visit(TemporalExpressions.Intersection expr);
-    void visit(TemporalExpressions.Difference expr);
     void visit(TemporalExpressions.DateRange expr);
-    void visit(TemporalExpressions.TimeOfDayRange expr);
-    void visit(TemporalExpressions.DayOfWeekRange expr);
-    void visit(TemporalExpressions.MonthRange expr);
-    void visit(TemporalExpressions.DayOfMonthRange expr);
     void visit(TemporalExpressions.DayInMonth expr);
+    void visit(TemporalExpressions.DayOfMonthRange expr);
+    void visit(TemporalExpressions.DayOfWeekRange expr);
+    void visit(TemporalExpressions.Difference expr);
     void visit(TemporalExpressions.Frequency expr);
+    void visit(TemporalExpressions.HourRange expr);
+    void visit(TemporalExpressions.Intersection expr);
+    void visit(TemporalExpressions.MinuteRange expr);
+    void visit(TemporalExpressions.MonthRange expr);
+    void visit(TemporalExpressions.Null expr);
+    void visit(TemporalExpressions.TimeOfDayRange expr);
+    void visit(TemporalExpressions.Union expr);
 }

Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/TemporalExpressionWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/TemporalExpressionWorker.java?rev=900024&r1=900023&r2=900024&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/TemporalExpressionWorker.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/TemporalExpressionWorker.java Sat Jan 16 20:59:37 2010
@@ -23,6 +23,7 @@
 import java.util.Set;
 import java.util.TreeSet;
 
+import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.UtilMisc;
 import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.entity.Delegator;
@@ -34,6 +35,8 @@
 /** TemporalExpression persistence worker. */
 public class TemporalExpressionWorker {
 
+    public final static String module = TemporalExpressionWorker.class.getName();
+
     // Temporal expression constants
     public final static String DateRange = "DATE_RANGE";
     public final static String DayInMonth = "DAY_IN_MONTH";
@@ -41,7 +44,9 @@
     public final static String DayOfWeekRange = "DAY_OF_WEEK_RANGE";
     public final static String Difference = "DIFFERENCE";
     public final static String Frequency = "FREQUENCY";
+    public final static String HourRange = "HOUR_RANGE";
     public final static String Intersection = "INTERSECTION";
+    public final static String MinuteRange = "MINUTE_RANGE";
     public final static String MonthRange = "MONTH_RANGE";
     public final static String TimeOfDayRange = "TIME_OF_DAY_RANGE";
     public final static String Union = "UNION";
@@ -92,11 +97,16 @@
             }
         } else if (Frequency.equals(tempExprTypeId)) {
             return new TemporalExpressions.Frequency(exprValue.getTimestamp("date1"), exprValue.getLong("integer1").intValue(), exprValue.getLong("integer2").intValue());
+        } else if (HourRange.equals(tempExprTypeId)) {
+            return new TemporalExpressions.HourRange(exprValue.getLong("integer1").intValue(), exprValue.getLong("integer2").intValue());
+        } else if (MinuteRange.equals(tempExprTypeId)) {
+            return new TemporalExpressions.MinuteRange(exprValue.getLong("integer1").intValue(), exprValue.getLong("integer2").intValue());
         } else if (Intersection.equals(tempExprTypeId)) {
             return new TemporalExpressions.Intersection(getChildExpressions(delegator, tempExprId));
         } else if (MonthRange.equals(tempExprTypeId)) {
             return new TemporalExpressions.MonthRange(exprValue.getLong("integer1").intValue(), exprValue.getLong("integer2").intValue());
         } else if (TimeOfDayRange.equals(tempExprTypeId)) {
+            Debug.logWarning(TimeOfDayRange + " has been deprecated. Use " + HourRange + " and/or " + MinuteRange, module);
             int interval = Calendar.HOUR_OF_DAY;
             int count = 1;
             Long longObj = exprValue.getLong("integer1");

Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/TemporalExpressions.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/TemporalExpressions.java?rev=900024&r1=900023&r2=900024&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/TemporalExpressions.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/TemporalExpressions.java Sat Jan 16 20:59:37 2010
@@ -24,6 +24,7 @@
 import java.util.Date;
 import java.util.Set;
 import java.util.TreeSet;
+
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.UtilValidate;
 
@@ -467,6 +468,246 @@
         }
     }
 
+    /** A temporal expression that represents an hour range. */
+    public static class HourRange extends TemporalExpression {
+        protected final int start;
+        protected final int end;
+
+        /**
+         * @param hour An integer in the range of 0 to 23.
+         */
+        public HourRange(int hour) {
+            this(hour, hour);
+        }
+
+        /**
+         * @param start An integer in the range of 0 to 23.
+         * @param end An integer in the range of 0 to 23.
+         */
+        public HourRange(int start, int end) {
+            if (start < 0 || start > 23) {
+                throw new IllegalArgumentException("Invalid start argument");
+            }
+            if (end < 0 || end > 23) {
+                throw new IllegalArgumentException("Invalid end argument");
+            }
+            this.start = start;
+            this.end = end;
+            this.sequence = 600;
+            this.subSequence = start * 4000;
+            if (Debug.verboseOn()) {
+                Debug.logVerbose("Created " + this, module);
+            }
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (obj == this) {
+                return true;
+            }
+            try {
+                HourRange that = (HourRange) obj;
+                return this.start == that.start && this.end == that.end;
+            } catch (ClassCastException e) {}
+            return false;
+        }
+
+        @Override
+        public String toString() {
+            return super.toString() + ", start = " + this.start + ", end = " + this.end;
+        }
+
+        @Override
+        public boolean includesDate(Calendar cal) {
+            int hour = cal.get(Calendar.HOUR_OF_DAY);
+            if (hour == this.start || hour == this.end) {
+                return true;
+            }
+            Calendar compareCal = (Calendar) cal.clone();
+            compareCal.set(Calendar.HOUR_OF_DAY, this.start);
+            while (compareCal.get(Calendar.HOUR_OF_DAY) != this.end) {
+                if (compareCal.get(Calendar.HOUR_OF_DAY) == hour) {
+                    return true;
+                }
+                compareCal.add(Calendar.HOUR_OF_DAY, 1);
+            }
+            return false;
+        }
+
+        @Override
+        public Calendar first(Calendar cal) {
+            Calendar first = (Calendar) cal.clone();
+            while (!includesDate(first)) {
+                first.add(Calendar.HOUR_OF_DAY, 1);
+            }
+            return first;
+        }
+
+        @Override
+        public Calendar next(Calendar cal) {
+            Calendar next = (Calendar) cal.clone();
+            next.add(Calendar.HOUR_OF_DAY, 1);
+            while (!includesDate(next)) {
+                next.add(Calendar.HOUR_OF_DAY, 1);
+            }
+            return next;
+        }
+
+        @Override
+        public void accept(TemporalExpressionVisitor visitor) {
+            visitor.visit(this);
+        }
+
+        /** Returns the starting hour of this range.
+         * @return The starting hour of this range
+         */
+        public int getStartHour() {
+            return this.start;
+        }
+
+        /** Returns the ending hour of this range.
+         * @return The ending hour of this range
+         */
+        public int getEndHour() {
+            return this.end;
+        }
+
+        public Set<Integer> getHourRangeAsSet() {
+            Set<Integer> rangeSet = new TreeSet<Integer>();
+            if (this.start == this.end) {
+                rangeSet.add(this.start);
+            } else {
+                Calendar cal = Calendar.getInstance();
+                cal.set(Calendar.HOUR_OF_DAY, this.start);
+                while (cal.get(Calendar.HOUR_OF_DAY) != this.end) {
+                    rangeSet.add(cal.get(Calendar.HOUR_OF_DAY));
+                    cal.add(Calendar.HOUR_OF_DAY, 1);
+                }
+            }
+            return rangeSet;
+        }
+    }
+
+
+    /** A temporal expression that represents a minute range. */
+    public static class MinuteRange extends TemporalExpression {
+        protected final int start;
+        protected final int end;
+
+        /**
+         * @param hour An integer in the range of 0 to 59.
+         */
+        public MinuteRange(int minute) {
+            this(minute, minute);
+        }
+
+        /**
+         * @param start An integer in the range of 0 to 59.
+         * @param end An integer in the range of 0 to 59.
+         */
+        public MinuteRange(int start, int end) {
+            if (start < 0 || start > 23) {
+                throw new IllegalArgumentException("Invalid start argument");
+            }
+            if (end < 0 || end > 23) {
+                throw new IllegalArgumentException("Invalid end argument");
+            }
+            this.start = start;
+            this.end = end;
+            this.sequence = 600;
+            this.subSequence = start;
+            if (Debug.verboseOn()) {
+                Debug.logVerbose("Created " + this, module);
+            }
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (obj == this) {
+                return true;
+            }
+            try {
+                MinuteRange that = (MinuteRange) obj;
+                return this.start == that.start && this.end == that.end;
+            } catch (ClassCastException e) {}
+            return false;
+        }
+
+        @Override
+        public String toString() {
+            return super.toString() + ", start = " + this.start + ", end = " + this.end;
+        }
+
+        @Override
+        public boolean includesDate(Calendar cal) {
+            int minute = cal.get(Calendar.MINUTE);
+            if (minute == this.start || minute == this.end) {
+                return true;
+            }
+            Calendar compareCal = (Calendar) cal.clone();
+            compareCal.set(Calendar.MINUTE, this.start);
+            while (compareCal.get(Calendar.MINUTE) != this.end) {
+                if (compareCal.get(Calendar.MINUTE) == minute) {
+                    return true;
+                }
+                compareCal.add(Calendar.MINUTE, 1);
+            }
+            return false;
+        }
+
+        @Override
+        public Calendar first(Calendar cal) {
+            Calendar first = (Calendar) cal.clone();
+            while (!includesDate(first)) {
+                first.add(Calendar.MINUTE, 1);
+            }
+            return first;
+        }
+
+        @Override
+        public Calendar next(Calendar cal) {
+            Calendar next = (Calendar) cal.clone();
+            next.add(Calendar.MINUTE, 1);
+            while (!includesDate(next)) {
+                next.add(Calendar.MINUTE, 1);
+            }
+            return next;
+        }
+
+        @Override
+        public void accept(TemporalExpressionVisitor visitor) {
+            visitor.visit(this);
+        }
+
+        /** Returns the starting minute of this range.
+         * @return The starting minute of this range
+         */
+        public int getStartMinute() {
+            return this.start;
+        }
+
+        /** Returns the ending minute of this range.
+         * @return The ending minute of this range
+         */
+        public int getEndMinute() {
+            return this.end;
+        }
+
+        public Set<Integer> getMinuteRangeAsSet() {
+            Set<Integer> rangeSet = new TreeSet<Integer>();
+            if (this.start == this.end) {
+                rangeSet.add(this.start);
+            } else {
+                Calendar cal = Calendar.getInstance();
+                cal.set(Calendar.HOUR_OF_DAY, this.start);
+                while (cal.get(Calendar.HOUR_OF_DAY) != this.end) {
+                    rangeSet.add(cal.get(Calendar.HOUR_OF_DAY));
+                    cal.add(Calendar.HOUR_OF_DAY, 1);
+                }
+            }
+            return rangeSet;
+        }
+    }
     /** A temporal expression that represents a time of day range. */
     public static class TimeOfDayRange extends TemporalExpression {
         protected final String startStr;

Modified: ofbiz/trunk/framework/webtools/webapp/webtools/tempexpr/tempExprMacros.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/tempexpr/tempExprMacros.ftl?rev=900024&r1=900023&r2=900024&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/tempexpr/tempExprMacros.ftl (original)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/tempexpr/tempExprMacros.ftl Sat Jan 16 20:59:37 2010
@@ -78,6 +78,17 @@
   </tr>
 </#macro>
 
+<#macro HourOfDayRange fromHour=1 toHour=31>
+  <tr>
+    <td class="label">${uiLabelMap.CommonFrom}</td>
+    <td><@HourOfDayField fieldName="integer1" fieldValue=fromHour/></td>
+  </tr>
+  <tr>
+    <td class="label">${uiLabelMap.CommonTo}</td>
+    <td><@HourOfDayField fieldName="integer2" fieldValue=toHour/></td>
+  </tr>
+</#macro>
+
 <#macro DayOfWeekRange fromDay=firstDayOfWeek toDay=lastDayOfWeek>
   <tr>
     <td class="label">${uiLabelMap.CommonFrom}</td>
@@ -118,6 +129,17 @@
   </tr>
 </#macro>
 
+<#macro MinuteRange fromMinute=1 toMinute=31>
+  <tr>
+    <td class="label">${uiLabelMap.CommonFrom}</td>
+    <td><@MinuteField fieldName="integer1" fieldValue=fromMinute/></td>
+  </tr>
+  <tr>
+    <td class="label">${uiLabelMap.CommonTo}</td>
+    <td><@MinuteField fieldName="integer2" fieldValue=toMinute/></td>
+  </tr>
+</#macro>
+
 <#macro MonthRange fromMonth=0 toMonth=11>
   <tr>
     <td class="label">${uiLabelMap.CommonFrom}</td>

Modified: ofbiz/trunk/framework/webtools/webapp/webtools/tempexpr/tempExprMaint.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/tempexpr/tempExprMaint.ftl?rev=900024&r1=900023&r2=900024&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/tempexpr/tempExprMaint.ftl (original)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/tempexpr/tempExprMaint.ftl Sat Jan 16 20:59:37 2010
@@ -44,8 +44,12 @@
       <@DayOfWeekRange fromDay=temporalExpression.integer1 toDay=temporalExpression.integer2/>
     <#elseif temporalExpression.tempExprTypeId == "FREQUENCY">
       <@Frequency formName="updateExpression" fromDate=temporalExpression.date1 freqType=temporalExpression.integer1 freqValue=temporalExpression.integer2/>
-    <#elseif temporalExpression.tempExprTypeId == "MONTH_RANGE">
-      <@MonthRange fromMonth=temporalExpression.integer1 toMonth=temporalExpression.integer2/>
+    <#elseif temporalExpression.tempExprTypeId == "DAY_OF_WEEK_RANGE">
+      <@DayOfWeekRange fromDay=temporalExpression.integer1 toDay=temporalExpression.integer2/>
+    <#elseif temporalExpression.tempExprTypeId == "HOUR_RANGE">
+      <@HourOfDayRange fromHour=temporalExpression.integer1 toHour=temporalExpression.integer2/>
+    <#elseif temporalExpression.tempExprTypeId == "MINUTE_RANGE">
+      <@MinuteRange fromMinute=temporalExpression.integer1 toMinute=temporalExpression.integer2/>
     <#elseif temporalExpression.tempExprTypeId == "TIME_OF_DAY_RANGE">
       <@TimeOfDayRange fromTime=temporalExpression.string1 toTime=temporalExpression.string2 freqType=temporalExpression.integer1 freqValue=temporalExpression.integer2/>
     <#elseif "INTERSECTION.UNION.DIFFERENCE"?contains(temporalExpression.tempExprTypeId)>
@@ -100,6 +104,10 @@
   <hr/>
   <@CreateForm "FREQUENCY" Frequency/>
   <hr/>
+  <@CreateForm "HOUR_RANGE" HourOfDayRange/>
+  <hr/>
+  <@CreateForm "MINUTE_RANGE" MinuteRange/>
+  <hr/>
   <@CreateForm "MONTH_RANGE" MonthRange/>
   <hr/>
   <@CreateForm "TIME_OF_DAY_RANGE" TimeOfDayRange/>