svn commit: r700310 - in /ofbiz/trunk/framework: common/config/ common/data/ common/servicedef/ common/webcommon/WEB-INF/ common/webcommon/includes/ service/entitydef/ service/src/org/ofbiz/service/calendar/ webtools/webapp/webtools/WEB-INF/ webtools/w...

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

svn commit: r700310 - in /ofbiz/trunk/framework: common/config/ common/data/ common/servicedef/ common/webcommon/WEB-INF/ common/webcommon/includes/ service/entitydef/ service/src/org/ofbiz/service/calendar/ webtools/webapp/webtools/WEB-INF/ webtools/w...

adrianc
Author: adrianc
Date: Mon Sep 29 16:58:59 2008
New Revision: 700310

URL: http://svn.apache.org/viewvc?rev=700310&view=rev
Log:
Temporal Expression UI artifacts. There is a Temporal Expression Maintenance screen in the Webtools component.

I tried my best to break this up into re-usable pieces and put them where I thought they made sense. Feel free to move things around if you have a better idea.

Internationalization note: this commit contains new UI labels.

Added:
    ofbiz/trunk/framework/common/config/TemporalExpressionUiLabels.xml   (with props)
    ofbiz/trunk/framework/common/webcommon/WEB-INF/tempexpr-controller.xml   (with props)
    ofbiz/trunk/framework/common/webcommon/includes/commonMacros.ftl   (with props)
    ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/ExpressionUiHelper.java   (with props)
    ofbiz/trunk/framework/webtools/webapp/webtools/tempexpr/
    ofbiz/trunk/framework/webtools/webapp/webtools/tempexpr/tempExprForms.xml   (with props)
    ofbiz/trunk/framework/webtools/webapp/webtools/tempexpr/tempExprMacros.ftl   (with props)
    ofbiz/trunk/framework/webtools/webapp/webtools/tempexpr/tempExprMaint.ftl   (with props)
    ofbiz/trunk/framework/webtools/widget/TempExprScreens.xml   (with props)
Modified:
    ofbiz/trunk/framework/common/config/CommonUiLabels.xml
    ofbiz/trunk/framework/common/data/CommonSecurityData.xml
    ofbiz/trunk/framework/common/servicedef/services.xml
    ofbiz/trunk/framework/service/entitydef/entitymodel.xml
    ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml
    ofbiz/trunk/framework/webtools/webapp/webtools/includes/appheader.ftl
    ofbiz/trunk/framework/webtools/widget/CommonScreens.xml
    ofbiz/trunk/framework/webtools/widget/WebToolsMenus.xml

Modified: ofbiz/trunk/framework/common/config/CommonUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/config/CommonUiLabels.xml?rev=700310&r1=700309&r2=700310&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/config/CommonUiLabels.xml (original)
+++ ofbiz/trunk/framework/common/config/CommonUiLabels.xml Mon Sep 29 16:58:59 2008
@@ -676,6 +676,9 @@
         <value xml:lang="zh_CN">八月</value>
         <value xml:lang="zh">八月</value>
     </property>
+    <property key="CommonAutoAssignedId">
+        <value xml:lang="en">Unique ID - auto-assigned if blank</value>
+    </property>
     <property key="CommonAvailable">
         <value xml:lang="ar">متوفر</value>
         <value xml:lang="cs">k dispozici</value>
@@ -3387,6 +3390,18 @@
         <value xml:lang="zh_CN">方法</value>
         <value xml:lang="zh">方法</value>
     </property>
+    <property key="CommonMinute">
+        <value xml:lang="ar">بدقة</value>
+        <value xml:lang="de">Jede Minute</value>
+        <value xml:lang="en">Minute</value>
+        <value xml:lang="fr">Chaque minute</value>
+        <value xml:lang="it">Minuto</value>
+        <value xml:lang="pt">Minuto a Minuto</value>
+        <value xml:lang="ro">Minut</value>
+        <value xml:lang="ru">Ежеминутно</value>
+        <value xml:lang="th">ทุกนาที</value>
+        <value xml:lang="zh">每分钟</value>
+    </property>
     <property key="CommonMinutely">
         <value xml:lang="ar">بدقة</value>
         <value xml:lang="de">Jede Minute</value>
@@ -5042,6 +5057,19 @@
         <value xml:lang="zh_CN">搜索结果</value>
         <value xml:lang="zh">搜索</value>
     </property>
+    <property key="CommonSecond">
+        <!-- The time measurement, not the ordinal -->
+        <value xml:lang="ar">ثانيا</value>
+        <value xml:lang="de">Zweiter</value>
+        <value xml:lang="en">Second</value>
+        <value xml:lang="fr">Deuxièmement</value>
+        <value xml:lang="it">Secondo</value>
+        <value xml:lang="pt">Secundariamente</value>
+        <value xml:lang="ro">Al doilea</value>
+        <value xml:lang="ru">Во-вторых</value>
+        <value xml:lang="th">ในลำดับที่สอง</value>
+        <value xml:lang="zh">每秒</value>
+    </property>
     <property key="CommonSecondly">
         <value xml:lang="ar">ثانيا</value>
         <value xml:lang="de">Zweiter</value>

Added: ofbiz/trunk/framework/common/config/TemporalExpressionUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/config/TemporalExpressionUiLabels.xml?rev=700310&view=auto
==============================================================================
--- ofbiz/trunk/framework/common/config/TemporalExpressionUiLabels.xml (added)
+++ ofbiz/trunk/framework/common/config/TemporalExpressionUiLabels.xml Mon Sep 29 16:58:59 2008
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <property key="TemporalExpression">
+        <value xml:lang="en">Temporal Expression</value>
+    </property>
+    <property key="TemporalExpressionFind">
+        <value xml:lang="en">Find Temporal Expression</value>
+    </property>
+    <property key="TemporalExpressionId">
+        <value xml:lang="en">Expression Id</value>
+    </property>
+    <property key="TemporalExpressionType">
+        <value xml:lang="en">Expression Type</value>
+    </property>
+    <property key="TemporalExpressionFreqCount">
+        <value xml:lang="en">Frequency Count</value>
+    </property>
+    <property key="TemporalExpressionFreqType">
+        <value xml:lang="en">Frequency Type</value>
+    </property>
+    <property key="TemporalExpressionTimeFormat">
+        <value xml:lang="en">hh:mm:ss</value>
+    </property>
+    <property key="TemporalExpressionOccurrence">
+        <value xml:lang="en">Occurrence</value>
+    </property>
+    <property key="TemporalExpressionMaintenance">
+        <value xml:lang="en">Temporal Expression Maintenance</value>
+    </property>
+    <property key="TemporalExpressionCollections">
+        <value xml:lang="en">Expression Collections</value>
+    </property>
+    <property key="TemporalExpression_DATE_RANGE">
+        <value xml:lang="en">Date Range</value>
+    </property>
+    <property key="TemporalExpression_DAY_IN_MONTH">
+        <value xml:lang="en">Day In Month</value>
+    </property>
+    <property key="TemporalExpression_DAY_OF_MONTH_RANGE">
+        <value xml:lang="en">Day Of Month Range</value>
+    </property>
+    <property key="TemporalExpression_DAY_OF_WEEK_RANGE">
+        <value xml:lang="en">Day Of Week Range</value>
+    </property>
+    <property key="TemporalExpression_DIFFERENCE">
+        <value xml:lang="en">Difference</value>
+    </property>
+    <property key="TemporalExpression_FREQUENCY">
+        <value xml:lang="en">Frequency</value>
+    </property>
+    <property key="TemporalExpression_INTERSECTION">
+        <value xml:lang="en">Intersection</value>
+    </property>
+    <property key="TemporalExpression_MONTH_RANGE">
+        <value xml:lang="en">Month Range</value>
+    </property>
+    <property key="TemporalExpression_TIME_OF_DAY_RANGE">
+        <value xml:lang="en">Time Of Day Range</value>
+    </property>
+    <property key="TemporalExpression_UNION">
+        <value xml:lang="en">Union</value>
+    </property>
+    <property key="TemporalExpressionInclude">
+        <value xml:lang="en">Include</value>
+    </property>
+    <property key="TemporalExpressionExclude">
+        <value xml:lang="en">Exclude</value>
+    </property>
+</resource>

Propchange: ofbiz/trunk/framework/common/config/TemporalExpressionUiLabels.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: ofbiz/trunk/framework/common/data/CommonSecurityData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/data/CommonSecurityData.xml?rev=700310&r1=700309&r2=700310&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/data/CommonSecurityData.xml (original)
+++ ofbiz/trunk/framework/common/data/CommonSecurityData.xml Mon Sep 29 16:58:59 2008
@@ -44,4 +44,8 @@
     <!-- User preferences security -->
     <SecurityPermission description="User preferences admin" permissionId="USERPREF_ADMIN"/>
     <SecurityGroupPermission groupId="FULLADMIN" permissionId="USERPREF_ADMIN"/>
+
+    <!-- Temporal expression security -->
+    <SecurityPermission description="Temporal expression admin" permissionId="TEMPEXPR_ADMIN"/>
+    <SecurityGroupPermission groupId="FULLADMIN" permissionId="TEMPEXPR_ADMIN"/>
 </entity-engine-xml>

Modified: ofbiz/trunk/framework/common/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/servicedef/services.xml?rev=700310&r1=700309&r2=700310&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/servicedef/services.xml (original)
+++ ofbiz/trunk/framework/common/servicedef/services.xml Mon Sep 29 16:58:59 2008
@@ -542,4 +542,40 @@
         <implements service="permissionInterface"/>
     </service>
 
+
+    <!-- Temporal expression services -->    
+    <service name="tempExprPermissionCheck" engine="simple"
+             location="org/ofbiz/common/permission/CommonPermissionServices.xml" invoke="genericBasePermissionCheck">
+        <implements service="permissionInterface"/>
+        <attribute name="primaryPermission" type="String" mode="IN" optional="false" default-value="TEMPEXPR"/>
+        <attribute name="altPermission" type="String" mode="IN" optional="true"/>
+    </service>
+
+    <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="nonpk" mode="IN" optional="true"/>
+    </service>
+
+    <service name="updateTemporalExpression" default-entity-name="TemporalExpression" engine="entity-auto" invoke="update" auth="true">
+        <description>Update a Temporal Expression</description>
+        <permission-service service-name="tempExprPermissionCheck" main-action="UPDATE"/>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+    </service>
+
+    <service name="createTemporalExpressionAssoc" default-entity-name="TemporalExpressionAssoc" engine="entity-auto" invoke="create" auth="true">
+        <description>Create a Temporal Expression Association</description>
+        <permission-service service-name="tempExprPermissionCheck" main-action="CREATE"/>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+    </service>
+
+    <service name="deleteTemporalExpressionAssoc" default-entity-name="TemporalExpressionAssoc" engine="entity-auto" invoke="delete" auth="true">
+        <description>Delete a Temporal Expression Association</description>
+        <permission-service service-name="exampleGenericPermission" main-action="DELETE"/>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+    </service>
+
 </services>

Added: ofbiz/trunk/framework/common/webcommon/WEB-INF/tempexpr-controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/WEB-INF/tempexpr-controller.xml?rev=700310&view=auto
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/WEB-INF/tempexpr-controller.xml (added)
+++ ofbiz/trunk/framework/common/webcommon/WEB-INF/tempexpr-controller.xml Mon Sep 29 16:58:59 2008
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<site-conf xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/site-conf.xsd">
+    <description>Temporal Expression Events Configuration File</description>
+    <owner>Copyright 2001-2008 The Apache Software Foundation</owner>
+
+    <handler name="service" type="request" class="org.ofbiz.webapp.event.ServiceEventHandler"/>
+    
+    <!-- Temporal expression event mapping -->
+    <request-map uri="createTemporalExpression">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="createTemporalExpression"/>
+        <response name="success" type="request" value="editTemporalExpression"/>
+    </request-map>
+    <request-map uri="updateTemporalExpression">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="updateTemporalExpression"/>
+        <response name="success" type="request" value="editTemporalExpression"/>
+    </request-map>
+    <request-map uri="createTemporalExpressionAssoc">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="createTemporalExpressionAssoc"/>
+        <response name="success" type="request" value="editTemporalExpression"/>
+    </request-map>
+    <request-map uri="deleteTemporalExpressionAssoc">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="deleteTemporalExpressionAssoc"/>
+        <response name="success" type="request" value="editTemporalExpression"/>
+    </request-map>
+
+</site-conf>

Propchange: ofbiz/trunk/framework/common/webcommon/WEB-INF/tempexpr-controller.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: ofbiz/trunk/framework/common/webcommon/includes/commonMacros.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/commonMacros.ftl?rev=700310&view=auto
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/includes/commonMacros.ftl (added)
+++ ofbiz/trunk/framework/common/webcommon/includes/commonMacros.ftl Mon Sep 29 16:58:59 2008
@@ -0,0 +1,76 @@
+<#--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<#--
+To use these macros in your template, insert the following line in
+your template file:
+<#include "component://common/webcommon/includes/commonMacros.ftl"/>
+-->
+
+<#assign
+  dayValueList = Static["org.ofbiz.service.calendar.ExpressionUiHelper"].getDayValueList(locale)
+  monthValueList = Static["org.ofbiz.service.calendar.ExpressionUiHelper"].getMonthValueList(locale)
+/>
+
+<#macro NullMacro></#macro>
+
+<#macro DateField formName="" fieldName="" fieldValue="" fieldClass="">
+  <input type="text" name="${fieldName}"<#if fieldValue?has_content> value="${fieldValue}"</#if><#if fieldClass?has_content> class="${fieldClass}"</#if> maxlength="25" size="25"/>
+  <#if javaScriptEnabled>
+    <a href="javascript:call_cal(document.${formName}.${fieldName},'${fieldValue}');">
+    <img src="/images/cal.gif" width="16" height="16" border="0" alt="${uiLabelMap.CommonViewCalendar}" title="${uiLabelMap.CommonViewCalendar}"/></a>
+  </#if>
+  <span class="tooltip">${uiLabelMap.CommonFormatDateTime}</span>
+  <#if fieldClass == "required">
+    <span class="tooltip">${uiLabelMap.CommonRequired}</span>
+  </#if>
+</#macro>
+
+<#macro MonthField fieldName="" fieldValue=-1 fieldClass="">
+  <select name="${fieldName}"<#if fieldClass?has_content> class="${fieldClass}"</#if>>
+    <#list monthValueList as monthValue>
+      <option value="${monthValue.value}"<#if monthValue.value == fieldValue> selected="selected"</#if>>${monthValue.description}</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>
+      <option value="${dayValue.value}"<#if dayValue.value == fieldValue> selected="selected"</#if>>${dayValue.description}</option>
+    </#list>
+  </select>
+  <#if fieldClass == "required">
+    <span class="tooltip">${uiLabelMap.CommonRequired}</span>
+  </#if>
+</#macro>
+
+<#macro DayOfMonthField fieldName="" fieldValue=-1 fieldClass="">
+  <select name="${fieldName}"<#if fieldClass?has_content> class="${fieldClass}"</#if>>
+    <#list 1..31 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>

Propchange: ofbiz/trunk/framework/common/webcommon/includes/commonMacros.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: ofbiz/trunk/framework/service/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/entitydef/entitymodel.xml?rev=700310&r1=700309&r2=700310&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/framework/service/entitydef/entitymodel.xml Mon Sep 29 16:58:59 2008
@@ -156,7 +156,7 @@
             title="Temporal Expression Association">
       <field name="fromTempExprId" type="id-ne"><description>The "parent" expression</description></field>
       <field name="toTempExprId" type="id-ne"><description>The "child" expression</description></field>
-      <field name="exprAssocType" type="id"><description>Expression association type, applies to DIFFERENCE expression types only. Valid values are INCLUDED or EXCLUDED.</description></field>
+      <field name="exprAssocType" type="id"><description>Expression association type. Applies to DIFFERENCE expression types only. Valid values are INCLUDED or EXCLUDED.</description></field>
       <prim-key field="fromTempExprId"/>
       <prim-key field="toTempExprId"/>
       <relation type="one" fk-name="TEMP_EXPR_FROM" rel-entity-name="TemporalExpression" title="From">
@@ -167,6 +167,20 @@
       </relation>
     </entity>
 
+    <view-entity entity-name="TemporalExpressionChild"
+            package-name="org.ofbiz.service.schedule"
+            title="Temporal Expression Children View Entity">
+      <member-entity entity-alias="TEA" entity-name="TemporalExpressionAssoc"/>
+      <member-entity entity-alias="TE" entity-name="TemporalExpression"/>
+      <alias-all entity-alias="TEA">
+          <exclude field="toTempExprId"/>
+      </alias-all>
+      <alias-all entity-alias="TE"/>
+      <view-link entity-alias="TEA" rel-entity-alias="TE">
+        <key-map field-name="toTempExprId" rel-field-name="tempExprId"/>
+      </view-link>
+    </view-entity>
+
   <!-- ========================================================= -->
   <!-- org.ofbiz.service.semaphore -->
   <!-- ========================================================= -->

Added: ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/ExpressionUiHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/ExpressionUiHelper.java?rev=700310&view=auto
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/ExpressionUiHelper.java (added)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/ExpressionUiHelper.java Mon Sep 29 16:58:59 2008
@@ -0,0 +1,142 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.service.calendar;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+
+import javolution.util.FastList;
+import javolution.util.FastSet;
+
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.entity.GenericDelegator;
+import org.ofbiz.entity.GenericEntityException;
+import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.condition.EntityCondition;
+import org.ofbiz.entity.condition.EntityExpr;
+import org.ofbiz.entity.condition.EntityOperator;
+import org.ofbiz.entity.util.EntityUtil;
+
+/** TemporalExpression UI artifacts worker. */
+public class ExpressionUiHelper {
+
+    /** An array of valid DayInMonth occurrence values. */
+    public static final int Occurrence[] = {1, 2, 3, 4, 5, -1, -2, -3, -4 -5};
+    
+    /** Returns a List of valid DayInMonth occurrence int values.
+     * @return
+     */
+    public static List getOccurrenceList() {
+        return Arrays.asList(Occurrence);
+    }
+
+    /** Returns a List of Maps containing day of the week values.
+     * @param locale
+     * @return List of Maps. Each Map has a
+     * <code>description</code> entry and a <code>value</code> entry.
+     */
+    public static List<Map> getDayValueList(Locale locale) {
+        Calendar tempCal = Calendar.getInstance(locale);
+        tempCal.set(Calendar.DAY_OF_WEEK, tempCal.getFirstDayOfWeek());
+        SimpleDateFormat dateFormat = new SimpleDateFormat("EEEE", locale);
+        List<Map> result = new ArrayList<Map>(7);
+        for (int i = Calendar.SUNDAY; i <= Calendar.SATURDAY; i++) {
+            result.add(UtilMisc.toMap("description", dateFormat.format(tempCal.getTime()), "value", new Integer(i)));
+            tempCal.roll(Calendar.DAY_OF_WEEK, 1);
+        }
+        return result;
+    }
+
+    /** Returns a List of Maps containing month values.
+     * @param locale
+     * @return List of Maps. Each Map has a
+     * <code>description</code> entry and a <code>value</code> entry.
+     */
+    public static List<Map> getMonthValueList(Locale locale) {
+        Calendar tempCal = Calendar.getInstance(locale);
+        tempCal.set(Calendar.MONTH, Calendar.JANUARY);
+        SimpleDateFormat dateFormat = new SimpleDateFormat("MMMM", locale);
+        List<Map> result = new ArrayList<Map>(13);
+        for (int i = Calendar.JANUARY; i <= tempCal.getActualMaximum(Calendar.MONTH); i++) {
+            result.add(UtilMisc.toMap("description", dateFormat.format(tempCal.getTime()), "value", new Integer(i)));
+            tempCal.roll(Calendar.MONTH, 1);
+        }
+        return result;
+    }
+    
+    /** Returns a List of Maps containing valid Frequency values.
+     * @param uiLabelMap CommonUiLabels label Map
+     * @return List of Maps. Each Map has a
+     * <code>description</code> entry and a <code>value</code> entry.
+     */
+    public static List<Map> getFrequencyValueList(Map<String, Object> uiLabelMap) {
+        List<Map> result = new ArrayList<Map>(6);
+        result.add(UtilMisc.toMap("description", uiLabelMap.get("CommonSecond"), "value", new Integer(Calendar.SECOND)));
+        result.add(UtilMisc.toMap("description", uiLabelMap.get("CommonMinute"), "value", new Integer(Calendar.MINUTE)));
+        result.add(UtilMisc.toMap("description", uiLabelMap.get("CommonHour"), "value", new Integer(Calendar.HOUR_OF_DAY)));
+        result.add(UtilMisc.toMap("description", uiLabelMap.get("CommonDay"), "value", new Integer(Calendar.DAY_OF_MONTH)));
+        result.add(UtilMisc.toMap("description", uiLabelMap.get("CommonMonth"), "value", new Integer(Calendar.MONTH)));
+        result.add(UtilMisc.toMap("description", uiLabelMap.get("CommonYear"), "value", new Integer(Calendar.YEAR)));
+        return result;
+    }
+    
+    /** Returns a List of Maps containing valid temporal expression types.
+     * @param uiLabelMap TemporalExpressionUiLabels label Map
+     * @return List of Maps. Each Map has a
+     * <code>description</code> entry and a <code>value</code> entry.
+     */
+    public static List<Map> getExpressionTypeList(Map<String, Object> uiLabelMap) {
+        int listSize = TemporalExpressionWorker.ExpressionTypeList.length;
+        List<Map> result = new ArrayList<Map>(listSize);
+        for (int i = 0; i < listSize; i++) {
+            String exprType = TemporalExpressionWorker.ExpressionTypeList[i];
+            result.add(UtilMisc.toMap("description", uiLabelMap.get("TemporalExpression_" + exprType), "value", exprType));
+        }
+        return result;
+    }
+
+    /** Returns a List of candidate inclusion tempExprId Strings.
+     * @param delegator
+     * @param tempExprId The ID of the temporal expression needing candidates
+     * for inclusion
+     * @return Set of candidate tempExprId Strings
+     */
+    public static Set<String> getCandidateIncludeIds(GenericDelegator delegator, String tempExprId) throws GenericEntityException {
+        List<GenericValue> findList = delegator.findList("TemporalExpressionAssoc", EntityCondition.makeCondition("fromTempExprId", tempExprId), null, null, null, true);
+        Set<String> excludedIds = FastSet.newInstance();
+        for (GenericValue value : findList) {
+            excludedIds.add(value.getString("toTempExprId"));
+        }
+        excludedIds.add(tempExprId);
+        findList = delegator.findList("TemporalExpression", null, null, null, null, true);
+        Set<String> candidateIds = FastSet.newInstance();
+        for (GenericValue value : findList) {
+            candidateIds.add(value.getString("tempExprId"));
+        }
+        candidateIds.removeAll(excludedIds);
+        return candidateIds;
+    }
+
+}

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/ExpressionUiHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml?rev=700310&r1=700309&r2=700310&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml Mon Sep 29 16:58:59 2008
@@ -21,6 +21,7 @@
 <site-conf xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/site-conf.xsd">
     <include location="component://common/webcommon/WEB-INF/common-controller.xml"/>    
+    <include location="component://common/webcommon/WEB-INF/tempexpr-controller.xml"/>    
     <description>WebTools Site Configuration File</description>
     <owner>Copyright 2001-2008 The Apache Software Foundation</owner>
 
@@ -514,6 +515,17 @@
         <response name="success" type="none"/>
         <response name="error" type="none"/>
     </request-map>
+
+    <!-- Temporal expression view mapping -->
+    <request-map uri="editTemporalExpression">
+        <security https="true" auth="true" />
+        <response name="success" type="view" value="editTemporalExpression"/>
+    </request-map>
+    <request-map uri="findTemporalExpression">
+        <security https="true" auth="true" />
+        <response name="success" type="view" value="findTemporalExpression"/>
+    </request-map>
+
     <!-- end of request mappings -->
 
     <!-- View Mappings -->
@@ -595,5 +607,10 @@
     
     <!-- Artifact Info Views -->
     <view-map name="ArtifactInfo" type="screen" page="component://webtools/widget/ArtifactInfoScreens.xml#ArtifactInfo"/>
+
+    <!-- Temporal expression views -->
+    <view-map name="editTemporalExpression" type="screen" page="component://webtools/widget/TempExprScreens.xml#EditTemporalExpression"/>
+    <view-map name="findTemporalExpression" type="screen" page="component://webtools/widget/TempExprScreens.xml#FindTemporalExpression"/>
+
     <!-- end of view mappings -->
 </site-conf>

Modified: ofbiz/trunk/framework/webtools/webapp/webtools/includes/appheader.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/includes/appheader.ftl?rev=700310&r1=700309&r2=700310&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/includes/appheader.ftl (original)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/includes/appheader.ftl Mon Sep 29 16:58:59 2008
@@ -34,6 +34,9 @@
       <#if security.hasPermission("ARTIFACT_INFO_VIEW", session)>
         <li<#if selected == "ArtifactInfo"> class="selected"</#if>><a href="<@ofbizUrl>ArtifactInfo</@ofbizUrl>">Artifact Info</a></li>
       </#if>
+      <#if security.hasPermission("TEMPEXPR_ADMIN", session)>
+        <li<#if selected == "tempexpr"> class="selected"</#if>><a href="<@ofbizUrl>findTemporalExpression</@ofbizUrl>">${uiLabelMap.TemporalExpression}</a></li>
+      </#if>
       <li class="opposed"><a href="<@ofbizUrl>logout</@ofbizUrl>">${uiLabelMap.CommonLogout}</a></li>
     <#else>
       <li class="opposed"><a href="<@ofbizUrl>${checkLoginUrl?if_exists}</@ofbizUrl>">${uiLabelMap.CommonLogin}</a></li>

Added: ofbiz/trunk/framework/webtools/webapp/webtools/tempexpr/tempExprForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/tempexpr/tempExprForms.xml?rev=700310&view=auto
==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/tempexpr/tempExprForms.xml (added)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/tempexpr/tempExprForms.xml Mon Sep 29 16:58:59 2008
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd">
+
+    <!-- Temporal Expression forms -->
+    <form name="FindTemporalExpression" target="findTemporalExpression" type="single">
+        <actions>
+            <set field="expressionTypeList" value="${bsh:org.ofbiz.service.calendar.ExpressionUiHelper.getExpressionTypeList(uiLabelMap);}" type="List"/>
+        </actions>
+        <field name="tempExprId" title="${uiLabelMap.TemporalExpressionId}"><text-find/></field>
+<!--        <field name="tempExprTypeId" title="${uiLabelMap.TemporalExpressionType}">
+            <drop-down allow-empty="true">
+                <list-options list-name="expressionTypeList" key-name="value" description="description"/>
+            </drop-down>
+        </field> -->
+        <field name="noConditionFind"><hidden value="Y"/></field>
+        <field name="submitButton" title="${uiLabelMap.CommonFind}"><submit button-type="button"/></field>
+    </form>
+
+    <form name="BasicExpressionList" type="list"
+         default-table-style="basic-table hover-bar" odd-row-style="alternate-row" header-row-style="header-row-2">
+        <field name="tempExprId" title="${uiLabelMap.TemporalExpressionId}">
+            <hyperlink also-hidden="false" target-type="plain" description="${tempExprId}" target="editTemporalExpression?tempExprId=${tempExprId}"/>
+        </field>
+        <field name="tempExprTypeId" title="${uiLabelMap.TemporalExpressionType}"><display/></field>
+        <field name="date1"><display/></field>
+        <field name="date2"><display/></field>
+        <field name="integer1"><display/></field>
+        <field name="integer2"><display/></field>
+        <field name="string1"><display/></field>
+        <field name="string2"><display/></field>
+    </form>
+
+    <form name="ListTemporalExpressions" extends="BasicExpressionList" list-name="listIt" paginate="true">
+        <actions>
+            <service service-name="performFind" result-map-name="result" result-map-list-name="listIt">
+                <field-map field-name="inputFields" env-name="parameters"/>
+                <field-map field-name="entityName" value="TemporalExpression"/>
+            </service>
+        </actions>
+    </form>
+
+    <form name="ListChildExpressions" extends="BasicExpressionList" list-name="childExpressionList" paginate-target="editTemporalExpression?tempExprId=${tempExprId}">
+        <field name="exprAssocType"><display/></field>
+        <field name="deleteButton" title=" " widget-style="buttontext">
+            <hyperlink also-hidden="false" description="${uiLabelMap.CommonDelete}" target="deleteTemporalExpressionAssoc?tempExprId=${parameters.tempExprId}&amp;fromTempExprId=${fromTempExprId}&amp;toTempExprId=${tempExprId}"/>
+        </field>
+    </form>
+
+</forms>

Propchange: ofbiz/trunk/framework/webtools/webapp/webtools/tempexpr/tempExprForms.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 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=700310&view=auto
==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/tempexpr/tempExprMacros.ftl (added)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/tempexpr/tempExprMacros.ftl Mon Sep 29 16:58:59 2008
@@ -0,0 +1,139 @@
+<#--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<#--
+To use these macros in your template, insert the following line in
+your template file:
+<#include "component://common/webcommon/includes/tempExprMacros.ftl"/>
+-->
+
+<#include "component://common/webcommon/includes/commonMacros.ftl"/>
+
+<#assign
+  occurrenceList = Static["org.ofbiz.service.calendar.ExpressionUiHelper"].getOccurrenceList()
+  frequencyTypeList = Static["org.ofbiz.service.calendar.ExpressionUiHelper"].getFrequencyValueList(uiLabelMap)
+/>
+
+<#macro DateRange formName="" fromDate="" toDate="">
+  <tr>
+    <td class="label">${uiLabelMap.CommonFrom}</td>
+    <td>
+      <@DateField formName=formName fieldName="date1" fieldValue=fromDate/>
+    </td>
+  </tr>
+  <tr>
+    <td class="label">${uiLabelMap.CommonTo}</td>
+    <td>
+      <@DateField formName=currentForm fieldName="date2" fieldValue=toDate/>
+    </td>
+  </tr>
+</#macro>
+
+<#macro DayInMonth fieldValue=0>
+  <tr>
+    <td class="label">${uiLabelMap.TemporalExpressionOccurrence}</td>
+    <td>
+      <select name="integer2">
+        <#list 1..5 as i>
+          <option value="${i}"<#if i == fieldValue> selected="selected"</#if>>${i}</option>
+        </#list>
+        <#list -1..-5 as i>
+          <option value="${i}"<#if i == fieldValue> selected="selected"</#if>>${i}</option>
+        </#list>
+      </select>
+    </td>
+  </tr>
+  <tr>
+    <td class="label">${uiLabelMap.CommonDay}</td>
+    <td><@DayOfWeekField fieldName="integer1" fieldValue=(temporalExpression.integer1)?default(1)/></td>
+  </tr>
+</#macro>
+
+<#macro DayOfMonthRange fromDay=1 toDay=31>
+  <tr>
+    <td class="label">${uiLabelMap.CommonFrom}</td>
+    <td><@DayOfMonthField fieldName="integer1" fieldValue=fromDay/></td>
+  </tr>
+  <tr>
+    <td class="label">${uiLabelMap.CommonTo}</td>
+    <td><@DayOfMonthField fieldName="integer2" fieldValue=toDay/></td>
+  </tr>
+</#macro>
+
+<#macro DayOfWeekRange fromDay=1 toDay=7>
+  <tr>
+    <td class="label">${uiLabelMap.CommonFrom}</td>
+    <td><@DayOfWeekField fieldName="integer1" fieldValue=fromDay/></td>
+  </tr>
+  <tr>
+    <td class="label">${uiLabelMap.CommonTo}</td>
+    <td><@DayOfWeekField fieldName="integer2" fieldValue=toDay/></td>
+  </tr>
+</#macro>
+
+<#macro Frequency formName="" fromDate="" freqType=-1 freqValue=0>
+  <tr>
+    <td class="label">${uiLabelMap.CommonFrom}</td>
+    <td>
+      <@DateField formName=formName fieldName="date1" fieldValue=(temporalExpression.date1)?default("")/>
+    </td>
+  </tr>
+  <tr>
+    <td class="label">${uiLabelMap.TemporalExpressionFreqType}</td>
+    <td>
+      <select name="integer1">
+        <#list frequencyTypeList as freqTypeItem>
+          <option value="${freqTypeItem.value}"<#if freqTypeItem.value == freqType> selected="selected"</#if>>${freqTypeItem.description}</option>
+        </#list>
+      </select>
+    </td>
+  </tr>
+  <tr>
+    <td class="label">${uiLabelMap.TemporalExpressionFreqCount}</td>
+    <td>
+      <select name="integer2">
+        <#list 1..50 as i>
+          <option value="${i}"<#if i == freqValue> selected="selected"</#if>>${i}</option>
+        </#list>
+      </select>
+    </td>
+  </tr>
+</#macro>
+
+<#macro MonthRange fromMonth=0 toMonth=11>
+  <tr>
+    <td class="label">${uiLabelMap.CommonFrom}</td>
+    <td><@MonthField fieldName="integer1" fieldValue=fromMonth/></td>
+  </tr>
+  <tr>
+    <td class="label">${uiLabelMap.CommonTo}</td>
+    <td><@MonthField fieldName="integer2" fieldValue=toMonth/></td>
+  </tr>
+</#macro>
+
+<#macro TimeOfDayRange fromTime="" toTime="">
+  <tr>
+    <td class="label">${uiLabelMap.CommonFrom}</td>
+    <td><input type="text" name="string1" value="${fromTime}" maxlength="8" size="8"/><span class="tooltip">${uiLabelMap.TemporalExpressionTimeFormat}</span></td>
+  </tr>
+  <tr>
+    <td class="label">${uiLabelMap.CommonTo}</td>
+    <td><input type="text" name="string2" value="${toTime}" maxlength="8" size="8"/><span class="tooltip">${uiLabelMap.TemporalExpressionTimeFormat}</span></td>
+  </tr>
+</#macro>

Propchange: ofbiz/trunk/framework/webtools/webapp/webtools/tempexpr/tempExprMacros.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 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=700310&view=auto
==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/tempexpr/tempExprMaint.ftl (added)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/tempexpr/tempExprMaint.ftl Mon Sep 29 16:58:59 2008
@@ -0,0 +1,150 @@
+<#--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<#include "component://webtools/webapp/webtools/tempexpr/tempExprMacros.ftl"/>
+<h1>${title}</h1>
+<#if temporalExpression?has_content>
+  <#-- Edit existing expression -->
+  <table class="basic-table" cellspacing="0">
+    <tr>
+      <td class="label">${uiLabelMap.TemporalExpressionId}</td>
+      <td>${temporalExpression.tempExprId}</td>
+    </tr>
+    <tr>
+      <td class="label">${uiLabelMap.TemporalExpressionType}</td>
+      <td>${uiLabelMap.get("TemporalExpression_" + temporalExpression.tempExprTypeId)}</td>
+    </tr>
+    <#if !"INTERSECTION.UNION.DIFFERENCE"?contains(temporalExpression.tempExprTypeId)>
+      <form name="updateExpression" method="post" action="<@ofbizUrl>updateTemporalExpression</@ofbizUrl>">
+        <input type="hidden" name="tempExprId" value="${temporalExpression.tempExprId}"/>
+        <input type="hidden" name="tempExprTypeId" value="${temporalExpression.tempExprTypeId}"/>
+    </#if>
+    <#if temporalExpression.tempExprTypeId == "DATE_RANGE">
+      <@DateRange formName="updateExpression" fromDate=temporalExpression.date1 toDate=temporalExpression.date2/>
+    <#elseif temporalExpression.tempExprTypeId == "DAY_IN_MONTH">
+      <@DayInMonth/>
+    <#elseif temporalExpression.tempExprTypeId == "DAY_OF_MONTH_RANGE">
+      <@DayOfMonthRange fromDay=temporalExpression.integer1 toDay=temporalExpression.integer2/>
+    <#elseif temporalExpression.tempExprTypeId == "DAY_OF_WEEK_RANGE">
+      <@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 == "TIME_OF_DAY_RANGE">
+      <@TimeOfDayRange fromTime=temporalExpression.string1 toTime=temporalExpression.string2/>
+    <#elseif "INTERSECTION.UNION.DIFFERENCE"?contains(temporalExpression.tempExprTypeId)>
+      <#assign candidateIdList = Static["org.ofbiz.service.calendar.ExpressionUiHelper"].getCandidateIncludeIds(delegator, temporalExpression.tempExprId)/>
+      <#if "INTERSECTION.UNION"?contains(temporalExpression.tempExprTypeId)>
+        <tr>
+          <td class="label">${uiLabelMap.TemporalExpressionInclude}</td>
+          <td><@CreateExprAssocForm formName="includeExpression"/></td>
+        </tr>
+      <#else>
+        <#assign hasInclude = false hasExclude = false/>
+        <#if childExpressionList?has_content>
+          <#list childExpressionList as childExpression>
+            <#if childExpression.exprAssocType == "INCLUDE">
+              <#assign hasInclude = true/>
+            <#elseif childExpression.exprAssocType == "EXCLUDE">
+              <#assign hasExclude = true/>
+            </#if>
+          </#list>
+        </#if>
+        <#if !hasInclude>
+          <tr>
+            <td class="label">${uiLabelMap.TemporalExpressionInclude}</td>
+            <td><@CreateExprAssocForm formName="includeExpression" exprAssocType="INCLUDE"/></td>
+          </tr>
+        </#if>
+        <#if !hasExclude>
+          <tr>
+            <td class="label">${uiLabelMap.TemporalExpressionExclude}</td>
+            <td><@CreateExprAssocForm formName="excludeExpression" exprAssocType="EXCLUDE"/></td>
+          </tr>
+        </#if>
+      </#if>
+    </#if>
+    <#if !"INTERSECTION.UNION.DIFFERENCE"?contains(temporalExpression.tempExprTypeId)>
+        <tr>
+          <td>&nbsp;</td>
+          <td><input type="submit" name="submitBtn" value="${uiLabelMap.CommonSave}"/></td>
+        </tr>
+      </form>
+    </#if>
+  </table>
+<#else>
+  <#-- Create new expression -->
+  <@CreateForm "DATE_RANGE" CreateDateRange/>
+  <hr/>
+  <@CreateForm "DAY_IN_MONTH" DayInMonth/>
+  <hr/>
+  <@CreateForm "DAY_OF_MONTH_RANGE" DayOfMonthRange/>
+  <hr/>
+  <@CreateForm "DAY_OF_WEEK_RANGE" DayOfWeekRange/>
+  <hr/>
+  <@CreateForm "FREQUENCY" Frequency/>
+  <hr/>
+  <@CreateForm "MONTH_RANGE" MonthRange/>
+  <hr/>
+  <@CreateForm "TIME_OF_DAY_RANGE" TimeOfDayRange/>
+  <hr/>
+  <@CreateForm "INTERSECTION"/>
+  <hr/>
+  <@CreateForm "UNION"/>
+  <hr/>
+  <@CreateForm "DIFFERENCE"/>
+</#if>
+
+<#macro CreateForm expressionTypeId="" formContents=NullMacro>
+  <form name="${currentForm}" method="post" action="<@ofbizUrl>createTemporalExpression</@ofbizUrl>">
+    <input type="hidden" name="tempExprTypeId" value="${expressionTypeId}"/>
+    <table class="basic-table" cellspacing="0">
+      <#assign mapExpression = "TemporalExpression_" + expressionTypeId/>
+      <#assign headingText = uiLabelMap[mapExpression]/>
+      <tr><td colspan="2" class="h2">${headingText}</td></tr>
+      <tr>
+        <td class="label">${uiLabelMap.TemporalExpressionId}</td>
+        <td><input name="tempExprId" type="text" maxlength="20" size="20"/><span class="tooltip">${uiLabelMap.CommonAutoAssignedId}</span></td>
+      </tr>
+      <@formContents/>
+      <tr>
+        <td>&nbsp;</td>
+        <td><input type="submit" name="submitBtn" value="${uiLabelMap.CommonSave}"/></td>
+      </tr>
+    </table>
+  </form>
+</#macro>
+
+<#macro CreateDateRange>
+  <@DateRange formName="DATE_RANGE"/>
+</#macro>
+
+<#macro CreateExprAssocForm formName="" exprAssocType="">
+  <form name="${formName}" method="post" action="<@ofbizUrl>createTemporalExpressionAssoc</@ofbizUrl>">
+    <input type="hidden" name="tempExprId" value="${temporalExpression.tempExprId}"/>
+    <input type="hidden" name="fromTempExprId" value="${temporalExpression.tempExprId}"/>
+    <input type="hidden" name="exprAssocType" value="${exprAssocType}"/>
+    <select name="toTempExprId">
+      <#list candidateIdList as candidate>
+        <option value="${candidate}">${candidate}</option>
+      </#list>
+    </select>
+    <input type="submit" name="submitBtn" value="${uiLabelMap.CommonSave}"/>
+  </form>
+</#macro>

Propchange: ofbiz/trunk/framework/webtools/webapp/webtools/tempexpr/tempExprMaint.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: ofbiz/trunk/framework/webtools/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/widget/CommonScreens.xml?rev=700310&r1=700309&r2=700310&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/framework/webtools/widget/CommonScreens.xml Mon Sep 29 16:58:59 2008
@@ -24,6 +24,7 @@
         <section>
             <actions>
                 <!-- base/top/specific map first, then more common map added for shared labels -->
+                <property-map resource="TemporalExpressionUiLabels" map-name="uiLabelMap" global="true"/>
                 <property-map resource="WebtoolsUiLabels" map-name="uiLabelMap" global="true"/>
                 <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
                 <set field="layoutSettings.companyName" from-field="uiLabelMap.WebtoolsCompanyName" global="true"/>

Added: ofbiz/trunk/framework/webtools/widget/TempExprScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/widget/TempExprScreens.xml?rev=700310&view=auto
==============================================================================
--- ofbiz/trunk/framework/webtools/widget/TempExprScreens.xml (added)
+++ ofbiz/trunk/framework/webtools/widget/TempExprScreens.xml Mon Sep 29 16:58:59 2008
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
+    
+    <screen name="TemporalExpressionDecorator">
+        <section>
+            <actions>
+                <set field="headerItem" value="tempexpr"/>
+                <property-map resource="TemporalExpressionUiLabels" map-name="uiLabelMap" global="true"/>
+                <set field="title" value="${uiLabelMap.${titleProperty}}" global="true"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <section>
+                            <condition>
+                                <if-service-permission service-name="tempExprPermissionCheck" main-action="VIEW"/>
+                            </condition>
+                            <widgets>
+                                <decorator-section-include name="body"/>
+                            </widgets>
+                            <fail-widgets>
+                                <label style="h3">${uiLabelMap.WebtoolsPermissionError}</label>
+                            </fail-widgets>
+                        </section>                    
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+
+    <screen name="FindTemporalExpression">
+        <section>
+            <actions>
+                <set field="tabMenuItem" value="findExpression"/>
+                <set field="titleProperty" value="${titleProperty}" default-value="TemporalExpressionFind"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="TemporalExpressionDecorator" location="${parameters.tempExprDecoratorLocation}">
+                    <decorator-section name="body">
+                        <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
+                            <decorator-section name="menu-bar">
+                                <section>
+                                    <condition>
+                                        <if-service-permission service-name="tempExprPermissionCheck" main-action="CREATE"/>
+                                    </condition>
+                                    <widgets>
+                                        <container style="button-bar"><link target="editTemporalExpression" text="${uiLabelMap.CommonCreate}" style="buttontext"/></container>
+                                    </widgets>
+                                </section>
+                            </decorator-section>
+                            <decorator-section name="search-options">
+                                <include-form name="FindTemporalExpression" location="component://webtools/webapp/webtools/tempexpr/tempExprForms.xml"/>
+                            </decorator-section>
+                            <decorator-section name="search-results">
+                                <include-form name="ListTemporalExpressions" location="component://webtools/webapp/webtools/tempexpr/tempExprForms.xml"/>
+                            </decorator-section>
+                        </decorator-screen>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+
+    <screen name="EditTemporalExpression">
+        <section>
+            <actions>
+                <set field="tabMenuItem" value="editExpression"/>
+                <set field="titleProperty" value="${titleProperty}" default-value="TemporalExpressionMaintenance"/>
+                <entity-one value-name="temporalExpression" entity-name="TemporalExpression"/>
+                <set field="fromTempExprId" from-field="parameters.tempExprId"/>
+                <entity-condition list-name="childExpressionList" entity-name="TemporalExpressionChild">
+                    <condition-expr field-name="fromTempExprId" env-name="fromTempExprId"/>
+                </entity-condition>
+            </actions>
+            <widgets>
+                <decorator-screen name="TemporalExpressionDecorator" location="${parameters.tempExprDecoratorLocation}">
+                    <decorator-section name="body">
+                        <include-menu name="TempExprTabBar" location="component://webtools/widget/WebToolsMenus.xml"/>
+                        <platform-specific>
+                            <html><html-template location="component://webtools/webapp/webtools/tempexpr/tempExprMaint.ftl"/></html>
+                        </platform-specific>
+                        <section>
+                            <condition>
+                                <not><if-empty field-name="childExpressionList"/></not>
+                            </condition>
+                            <widgets>
+                                <include-form name="ListChildExpressions" location="component://webtools/webapp/webtools/tempexpr/tempExprForms.xml"/>
+                            </widgets>
+                        </section>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+
+</screens>

Propchange: ofbiz/trunk/framework/webtools/widget/TempExprScreens.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: ofbiz/trunk/framework/webtools/widget/WebToolsMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/widget/WebToolsMenus.xml?rev=700310&r1=700309&r2=700310&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/widget/WebToolsMenus.xml (original)
+++ ofbiz/trunk/framework/webtools/widget/WebToolsMenus.xml Mon Sep 29 16:58:59 2008
@@ -63,4 +63,18 @@
             <link target="LogConfiguration"/>
         </menu-item>
     </menu>
-</menus>
\ No newline at end of file
+
+    <menu name="TempExprTabBar" type="simple" menu-container-style="button-bar tab-bar"
+        default-selected-style="selected" selected-menuitem-context-field-name="tabMenuItem">
+        <menu-item name="findExpression" title="${uiLabelMap.CommonFind}">
+            <link target="findTemporalExpression"/>
+        </menu-item>
+        <menu-item name="editExpression" title="${uiLabelMap.CommonEdit}">
+            <condition>
+                <not><if-empty field-name="temporalExpression"/></not>
+            </condition>
+            <link target="editTemporalExpression?tempExprId=${temporalExpression.tempExprId}"/>
+        </menu-item>
+    </menu>
+
+</menus>