svn commit: r1229278 [2/4] - in /ofbiz/branches/jackrabbit20100709: ./ applications/accounting/config/ applications/accounting/data/ applications/accounting/entitydef/ applications/accounting/script/org/ofbiz/accounting/test/ applications/accounting/we...

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

svn commit: r1229278 [2/4] - in /ofbiz/branches/jackrabbit20100709: ./ applications/accounting/config/ applications/accounting/data/ applications/accounting/entitydef/ applications/accounting/script/org/ofbiz/accounting/test/ applications/accounting/we...

sascharodekamp
Modified: ofbiz/branches/jackrabbit20100709/applications/product/entitydef/entitymodel_old.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/product/entitydef/entitymodel_old.xml?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/product/entitydef/entitymodel_old.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/product/entitydef/entitymodel_old.xml Mon Jan  9 17:59:01 2012
@@ -56,5 +56,41 @@ under the License.
         <key-map field-name="roleTypeId"/>
       </relation>
     </entity>
+    <entity entity-name="OldProductKeyword" table-name="PRODUCT_KEYWORD"
+            package-name="org.ofbiz.product.facility"
+            title="Old Product Keyword Entity">
+      <field name="productId" type="id-ne"></field>
+      <field name="keyword" type="short-varchar"></field>
+      <field name="relevancyWeight" type="numeric"></field>
+      <prim-key field="productId"/>
+      <prim-key field="keyword"/>
+      <relation type="one" fk-name="PROD_KWD_PROD" rel-entity-name="Product">
+        <key-map field-name="productId"/>
+      </relation>
+      <index name="PROD_KWD_KWD">
+        <index-field name="keyword"/>
+      </index>
+    </entity>
+    <entity entity-name="OldProductKeywordResult" table-name="PRODUCT_KEYWORD_RESULT"
+            package-name="org.ofbiz.product.product"
+            never-cache="true"
+            title="Product Keyword Result Entity">
+      <field name="productKeywordResultId" type="id-ne"></field>
+      <field name="visitId" type="id"></field>
+      <field name="productCategoryId" type="id"></field>
+      <field name="searchString" type="short-varchar"></field>
+      <field name="intraKeywordOperator" type="very-short"></field>
+      <field name="anyPrefix" type="indicator"></field>
+      <field name="anySuffix" type="indicator"></field>
+      <field name="removeStems" type="indicator"></field>
+      <field name="numResults" type="numeric"></field>
+      <prim-key field="productKeywordResultId"/>
+      <relation type="one" fk-name="PROD_KWDRES_VST" rel-entity-name="Visit">
+        <key-map field-name="visitId"/>
+      </relation>
+      <relation type="one-nofk" rel-entity-name="ProductCategory">
+        <key-map field-name="productCategoryId"/>
+      </relation>
+    </entity>
 
 </entitymodel>

Modified: ofbiz/branches/jackrabbit20100709/applications/product/entitydef/entitymodel_shipment.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/product/entitydef/entitymodel_shipment.xml?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/product/entitydef/entitymodel_shipment.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/product/entitydef/entitymodel_shipment.xml Mon Jan  9 17:59:01 2012
@@ -1358,6 +1358,7 @@ under the License.
       <alias entity-alias="SPRS" name="shipmentPackageSeqId"/>
       <alias entity-alias="SPRS" name="shipmentRouteSegmentId"/>
       <alias entity-alias="SPRS" name="labelPrinted"/>
+      <alias entity-alias="SPRS" name="trackingCode"/>
       <alias entity-alias="SRS" name="carrierPartyId"/>
       <alias entity-alias="SRS" name="carrierServiceStatusId"/>
       <alias entity-alias="SRS" name="shipmentMethodTypeId"/>

Modified: ofbiz/branches/jackrabbit20100709/applications/product/ofbiz-component.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/product/ofbiz-component.xml?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/product/ofbiz-component.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/product/ofbiz-component.xml Mon Jan  9 17:59:01 2012
@@ -72,9 +72,20 @@ under the License.
     <test-suite loader="main" location="testdef/FacilityTest.xml"/>
     <test-suite loader="main" location="testdef/CostTests.xml"/>
     <test-suite loader="main" location="testdef/GroupOrderTest.xml"/>
+    <test-suite loader="main" location="testdef/ProductTagTest.xml"/>
 
-    <webapp name="catalog" title="Catalog" server="default-server" location="webapp/catalog"
-        base-permission="OFBTOOLS,CATALOG" mount-point="/catalog"/>
-    <webapp name="facility" title="Facility" server="default-server" location="webapp/facility"
-        base-permission="OFBTOOLS,FACILITY" mount-point="/facility"/>
+    <webapp name="catalog"
+        title="Catalog"
+        description="CatalogComponentDescription"
+        server="default-server"
+        location="webapp/catalog"
+        base-permission="OFBTOOLS,CATALOG"
+        mount-point="/catalog"/>
+    <webapp name="facility"
+        title="Facility"
+        description="FacilityComponentDescription"
+        server="default-server"
+        location="webapp/facility"
+        base-permission="OFBTOOLS,FACILITY"
+        mount-point="/facility"/>
 </ofbiz-component>

Modified: ofbiz/branches/jackrabbit20100709/applications/product/script/org/ofbiz/product/UpgradeServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/product/script/org/ofbiz/product/UpgradeServices.xml?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/product/script/org/ofbiz/product/UpgradeServices.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/product/script/org/ofbiz/product/UpgradeServices.xml Mon Jan  9 17:59:01 2012
@@ -56,4 +56,23 @@ under the License.
         </iterate>
     </simple-method>
 
+     <simple-method method-name="migrateProductKeyword" short-description="Migrate Data From OldProductKeyword To ProductKeyword">
+        <entity-condition entity-name="OldProductKeyword" list="oldProductKeywords"/>
+        <iterate list="oldProductKeywords" entry="oldProductKeyword">
+            <entity-one entity-name="ProductKeyword" value-field="checkProductKeyword">
+                <field-map field-name="productId" from-field="oldProductKeyword.productId"/>
+                <field-map field-name="keyword" from-field="oldProductKeyword.keyword"/>
+                <field-map field-name="keywordTypeId" value="KWT_KEYWORD"/>
+            </entity-one>
+            <if-empty field="checkProductKeyword">
+                <make-value entity-name="ProductKeyword" value-field="productKeyword"/>
+                <set field="productKeyword.productId" from-field="oldProductKeyword.productId"/>
+                <set field="productKeyword.keyword" from-field="oldProductKeyword.keyword"/>
+                <set field="productKeyword.keywordTypeId" value="KWT_KEYWORD"/>
+                <set field="productKeyword.relevancyWeight" from-field="oldProductKeyword.relevancyWeight"/>
+                <create-value value-field="productKeyword"/>
+            </if-empty>
+        </iterate>
+    </simple-method>
+
 </simple-methods>

Modified: ofbiz/branches/jackrabbit20100709/applications/product/script/org/ofbiz/product/product/ProductServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/product/script/org/ofbiz/product/product/ProductServices.xml?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/product/script/org/ofbiz/product/product/ProductServices.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/product/script/org/ofbiz/product/product/ProductServices.xml Mon Jan  9 17:59:01 2012
@@ -1072,32 +1072,27 @@ under the License.
             <set field="jobSandbox.runTime" from-field="parameters.thruDate"/>
             <store-value value-field="jobSandbox"/>
         </if-not-empty>
-
-        <entity-one entity-name="UserLogin" value-field="systemUserLogin">
-            <field-map field-name="userLoginId" value="system"/>
-        </entity-one>
-        <if-compare field="productGroupOrder.soldOrderQty" operator="equals" value="${productGroupOrder.reqOrderQty}">
-            <set field="checkProductGroupOrderExpiredMap.userLogin" from-field="systemUserLogin"/>
-            <set field="checkProductGroupOrderExpiredMap.groupOrderId" from-field="productGroupOrder.groupOrderId"/>
-            <call-service service-name="checkProductGroupOrderExpired" in-map-name="checkProductGroupOrderExpiredMap"/>
-
-            <set field="cancelScheduledJobMap.userLogin" from-field="systemUserLogin"/>
-            <set field="cancelScheduledJobMap.jobId" from-field="productGroupOrder.jobId"/>
-            <call-service service-name="cancelScheduledJob" in-map-name="cancelScheduledJobMap"/>
-        </if-compare>
     </simple-method>
 
     <simple-method method-name="deleteProductGroupOrder" short-description="Delete ProductGroupOrder">
         <entity-one entity-name="ProductGroupOrder" value-field="productGroupOrder"/>
+        <remove-value value-field="productGroupOrder"/>
+        
         <entity-one entity-name="JobSandbox" value-field="jobSandbox">
             <field-map field-name="jobId" from-field="productGroupOrder.jobId"/>
         </entity-one>
+        <remove-value value-field="jobSandbox"/>
+        
+        <entity-and entity-name="JobSandbox" list="jobSandboxList">
+            <field-map field-name="runtimeDataId" from-field="jobSandbox.runtimeDataId"/>
+        </entity-and>
+        <iterate entry="jobSandboxRelatedRuntimeData" list="jobSandboxList">
+            <remove-value value-field="jobSandboxRelatedRuntimeData"/>
+        </iterate>
+        
         <entity-one entity-name="RuntimeData" value-field="runtimeData">
             <field-map field-name="runtimeDataId" from-field="jobSandbox.runtimeDataId"/>
         </entity-one>
-        
-        <remove-value value-field="productGroupOrder"/>
-        <remove-value value-field="jobSandbox"/>
         <remove-value value-field="runtimeData"/>
     </simple-method>
 
@@ -1135,9 +1130,7 @@ under the License.
     </simple-method>
 
     <simple-method method-name="checkOrderItemForProductGroupOrder" short-description="Check OrderItem For ProductGroupOrder">
-        <entity-one entity-name="UserLogin" value-field="systemUserLogin">
-            <field-map field-name="userLoginId" value="system"/>
-        </entity-one>
+        <entity-one entity-name="OrderHeader" value-field="orderHeader"/>
         <entity-and entity-name="OrderItem" list="orderItems">
             <field-map field-name="orderId" from-field="parameters.orderId"/>
         </entity-and>
@@ -1159,31 +1152,28 @@ under the License.
                 <field-map field-name="productId" from-field="productId"/>
             </entity-and>
             <iterate entry="productGroupOrder" list="productGroupOrders">
-                <if-compare field="productGroupOrder.soldOrderQty" operator="less" value="${productGroupOrder.reqOrderQty}">
+                <if-compare field="orderHeader.statusId" operator="equals" value="ORDER_CREATED">
                     <calculate field="productGroupOrder.soldOrderQty">
                         <calcop field="productGroupOrder.soldOrderQty" operator="add">
                             <calcop field="orderItem.quantity" operator="get"/>
                         </calcop>
                     </calculate>
-                    <store-value value-field="productGroupOrder"/>
-
-                    <if-compare field="productGroupOrder.soldOrderQty" operator="equals" value="${productGroupOrder.reqOrderQty}">
-                        <set field="checkProductGroupOrderExpiredMap.userLogin" from-field="systemUserLogin"/>
-                        <set field="checkProductGroupOrderExpiredMap.groupOrderId" from-field="productGroupOrder.groupOrderId"/>
-                        <call-service service-name="checkProductGroupOrderExpired" in-map-name="checkProductGroupOrderExpiredMap"/>
-
-                        <set field="cancelScheduledJobMap.userLogin" from-field="systemUserLogin"/>
-                        <set field="cancelScheduledJobMap.jobId" from-field="productGroupOrder.jobId"/>
-                        <call-service service-name="cancelScheduledJob" in-map-name="cancelScheduledJobMap"/>
-                    </if-compare>
                 </if-compare>
+                <if-compare field="orderHeader.statusId" operator="equals" value="ORDER_CANCELLED">
+                    <calculate field="productGroupOrder.soldOrderQty">
+                        <calcop field="productGroupOrder.soldOrderQty" operator="subtract">
+                            <calcop field="orderItem.quantity" operator="get"/>
+                        </calcop>
+                    </calculate>
+                </if-compare>
+                <store-value value-field="productGroupOrder"/>
             </iterate>
         </iterate>
     </simple-method>
 
     <simple-method method-name="checkProductGroupOrderExpired" short-description="Check ProductGroupOrder Expired">
         <entity-one entity-name="ProductGroupOrder" value-field="productGroupOrder"/>
-        <if-compare field="productGroupOrder.soldOrderQty" operator="equals" value="${productGroupOrder.reqOrderQty}">
+        <if-compare field="productGroupOrder.soldOrderQty" operator="greater-equals" value="${productGroupOrder.reqOrderQty}">
             <set field="newItemStatusId" value="ITEM_APPROVED"/>
         <else>
             <set field="newItemStatusId" value="ITEM_CANCELLED"/>

Modified: ofbiz/branches/jackrabbit20100709/applications/product/script/org/ofbiz/product/test/GroupOrderTest.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/product/script/org/ofbiz/product/test/GroupOrderTest.xml?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/product/script/org/ofbiz/product/test/GroupOrderTest.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/product/script/org/ofbiz/product/test/GroupOrderTest.xml Mon Jan  9 17:59:01 2012
@@ -24,9 +24,10 @@ under the License.
     <simple-method method-name="testGroupOrderLimitReached" short-description="Test GroupOrder the limit is reached" login-required="false">
         <!-- Test GroupOrder the limit is reached
              Step 1) Create ProductGroupOrder .
-             Step 2) Create order.
+             Step 2) Create an order.
              Step 3) Check soldOrderQty is added.
-             Step 4) Check Order Item should approved.
+             Step 4) Check ProductGroupOrder expired.
+             Step 5) Check Order Item should approved.
         -->
         <!-- Step 1 -->
         <now-timestamp field="nowTimestamp"/>
@@ -123,6 +124,10 @@ under the License.
             <if-compare field="productGroupOrder.soldOrderQty" operator="not-equals" value="0"/>
         </assert>
         <!-- Step 4 -->
+        <set field="checkProductGroupOrderExpiredMap.userLogin" from-field="systemUserLogin"/>
+        <set field="checkProductGroupOrderExpiredMap.groupOrderId" from-field="productGroupOrder.groupOrderId"/>
+        <call-service service-name="checkProductGroupOrderExpired" in-map-name="checkProductGroupOrderExpiredMap"/>
+        <!-- Step 5 -->
         <entity-condition entity-name="OrderHeader" list="orderHeaders">
             <condition-expr field-name="orderTypeId" value="SALES_ORDER"/>
             <order-by field-name="-orderDate"/>
@@ -143,9 +148,10 @@ under the License.
     <simple-method method-name="testGroupOrderLimitNotReached" short-description="Test GroupOrder the limit is not reached" login-required="false">
         <!-- Test GroupOrder the limit is not reached
              Step 1) Create ProductGroupOrder.
-             Step 2) Create order.
-             Step 2) Check ProductGroupOrder expired.
-             Step 3) Check Order Item should cancelled.
+             Step 2) Create an order.
+             Step 3) Check soldOrderQty is added.
+             Step 4) Check ProductGroupOrder expired.
+             Step 5) Check Order Item should cancelled.
         -->
         <!-- Step 1 -->
         <now-timestamp field="nowTimestamp"/>
@@ -238,10 +244,14 @@ under the License.
         <entity-one entity-name="ProductGroupOrder" value-field="productGroupOrder">
             <field-map field-name="groupOrderId" from-field="groupOrderId"/>
         </entity-one>
+        <assert>
+            <if-compare field="productGroupOrder.soldOrderQty" operator="not-equals" value="0"/>
+        </assert>
+        <!-- Step 4 -->
         <set field="checkProductGroupOrderExpiredMap.userLogin" from-field="systemUserLogin"/>
         <set field="checkProductGroupOrderExpiredMap.groupOrderId" from-field="productGroupOrder.groupOrderId"/>
         <call-service service-name="checkProductGroupOrderExpired" in-map-name="checkProductGroupOrderExpiredMap"/>
-        <!-- Step 4 -->
+        <!-- Step 5 -->
         <entity-condition entity-name="OrderHeader" list="orderHeaders">
             <condition-expr field-name="orderTypeId" value="SALES_ORDER"/>
             <order-by field-name="-orderDate"/>

Modified: ofbiz/branches/jackrabbit20100709/applications/product/servicedef/services_upgrade.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/product/servicedef/services_upgrade.xml?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/product/servicedef/services_upgrade.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/product/servicedef/services_upgrade.xml Mon Jan  9 17:59:01 2012
@@ -41,5 +41,16 @@ under the License.
             The field Facility.squareFootageSince has been deprecated since revision 929912 (2010-04-01)
         </description>
     </service>
+    <service name="migrateProductKeyword" engine="simple"
+            location="component://product/script/org/ofbiz/product/UpgradeServices.xml" invoke="migrateProductKeyword">
+        <description>
+            Migrate data from oldProductKeyword to ProductKeyword.
+            The entity oldProductKeyword has been deprecated.
+            This service can be used to upgrade existing data from the oldProductKeyword entity to the new
+            ProductKeyword entity.
+            Before running this service, load the seed data for the KeywordType entity from the file:
+            common/data/CommonTypeData.xml
+        </description>
+    </service>
 
 </services>

Modified: ofbiz/branches/jackrabbit20100709/applications/product/src/org/ofbiz/product/product/KeywordIndex.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/product/src/org/ofbiz/product/product/KeywordIndex.java?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/product/src/org/ofbiz/product/product/KeywordIndex.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/product/src/org/ofbiz/product/product/KeywordIndex.java Mon Jan  9 17:59:01 2012
@@ -194,7 +194,7 @@ public class KeywordIndex {
         int keywordMaxLength = Integer.parseInt(UtilProperties.getPropertyValue("prodsearch", "product.keyword.max.length"));
         for (Map.Entry<String, Long> entry: keywords.entrySet()) {
             if (entry.getKey().length() <= keywordMaxLength) {
-                GenericValue productKeyword = delegator.makeValue("ProductKeyword", UtilMisc.toMap("productId", product.getString("productId"), "keyword", entry.getKey(), "relevancyWeight", entry.getValue()));
+                GenericValue productKeyword = delegator.makeValue("ProductKeyword", UtilMisc.toMap("productId", product.getString("productId"), "keyword", entry.getKey(), "keywordTypeId", "KWT_KEYWORD", "relevancyWeight", entry.getValue()));
                 toBeStored.add(productKeyword);
             }
         }

Modified: ofbiz/branches/jackrabbit20100709/applications/product/src/org/ofbiz/product/product/ProductEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/product/src/org/ofbiz/product/product/ProductEvents.java?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/product/src/org/ofbiz/product/product/ProductEvents.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/product/src/org/ofbiz/product/product/ProductEvents.java Mon Jan  9 17:59:01 2012
@@ -24,6 +24,8 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -1170,5 +1172,40 @@ public class ProductEvents {
         }
         return new BigDecimal(bigDecimalString);
     }
-
-}
+    
+    /** Event add product tags */
+    public static String addProductTags (HttpServletRequest request, HttpServletResponse response) {
+        Delegator delegator = (Delegator) request.getAttribute("delegator");
+        LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher");
+        String productId = request.getParameter("productId");
+        String productTags = request.getParameter("productTags");
+        if (UtilValidate.isNotEmpty(productId) && UtilValidate.isNotEmpty(productTags)) {
+            List<String> matchList = FastList.newInstance();
+            Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'");
+            Matcher regexMatcher = regex.matcher(productTags);
+            while (regexMatcher.find()) {
+                matchList.add(regexMatcher.group().replace("'", ""));
+            }
+            
+            GenericValue userLogin = null;
+            try {
+                userLogin = delegator.findByPrimaryKeyCache("UserLogin", UtilMisc.toMap("userLoginId", "system"));
+            } catch (GenericEntityException e) {
+                request.setAttribute("_ERROR_MESSAGE_", e.getMessage());
+                return "error";
+            }
+            
+            if(UtilValidate.isNotEmpty(matchList)) {
+                for (String keywordStr : matchList) {
+                    try {
+                        dispatcher.runSync("createProductKeyword", UtilMisc.toMap("productId", productId, "keyword", keywordStr.trim(), "keywordTypeId", "KWT_TAG","statusId","KW_PENDING" , "userLogin", userLogin));
+                    } catch (GenericServiceException e) {
+                        request.setAttribute("_ERROR_MESSAGE_", e.getMessage());
+                        return "error";
+                    }
+                }
+            }
+        }
+        return "success";
+    }
+}
\ No newline at end of file

Modified: ofbiz/branches/jackrabbit20100709/applications/product/src/org/ofbiz/product/product/ProductSearch.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/product/src/org/ofbiz/product/product/ProductSearch.java?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/product/src/org/ofbiz/product/product/ProductSearch.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/product/src/org/ofbiz/product/product/ProductSearch.java Mon Jan  9 17:59:01 2012
@@ -181,6 +181,9 @@ public class ProductSearch {
         public Set<String> excludeFeatureGroupIds = FastSet.newInstance();
         public Set<String> alwaysIncludeFeatureGroupIds = FastSet.newInstance();
 
+        public List<String> keywordTypeIds = FastList.newInstance();
+        public String statusId = null;
+
         public ProductSearchContext(Delegator delegator, String visitId) {
             this.delegator = delegator;
             this.visitId = visitId;
@@ -282,9 +285,34 @@ public class ProductSearch {
 
                     dynamicViewEntity.addMemberEntity(entityAlias, "ProductKeyword");
                     dynamicViewEntity.addAlias(entityAlias, prefix + "Keyword", "keyword", null, null, null, null);
+                    
+                    // keyword type filter
+                    if (UtilValidate.isNotEmpty(keywordTypeIds)) {
+                        dynamicViewEntity.addAlias(entityAlias, "keywordTypeId");
+                    }
+                    
+                    // keyword status filter
+                    if (UtilValidate.isNotEmpty(statusId)) {
+                        dynamicViewEntity.addAlias(entityAlias, "statusId");
+                    }
+                    
                     dynamicViewEntity.addViewLink("PROD", entityAlias, Boolean.FALSE, ModelKeyMap.makeKeyMapList("productId"));
                     entityConditionList.add(EntityCondition.makeCondition(prefix + "Keyword", EntityOperator.LIKE, keyword));
-
+                    
+                    // keyword type filter
+                    if (UtilValidate.isNotEmpty(keywordTypeIds)) {
+                        List<EntityCondition> keywordTypeCons = FastList.newInstance();
+                        for (String keywordTypeId : keywordTypeIds) {
+                            keywordTypeCons.add(EntityCondition.makeCondition("keywordTypeId", EntityOperator.EQUALS, keywordTypeId));
+                        }
+                        entityConditionList.add(EntityCondition.makeCondition(keywordTypeCons, EntityOperator.OR));
+                    }
+                    
+                    // keyword status filter
+                    if (UtilValidate.isNotEmpty(statusId)) {
+                        entityConditionList.add(EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, statusId));
+                    }
+                    
                     //don't add an alias for this, will be part of a complex alias: dynamicViewEntity.addAlias(entityAlias, prefix + "RelevancyWeight", "relevancyWeight", null, null, null, null);
                     //needed when doingBothAndOr or will get an SQL error
                     if (doingBothAndOr) {

Modified: ofbiz/branches/jackrabbit20100709/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java Mon Jan  9 17:59:01 2012
@@ -859,6 +859,7 @@ public class ProductSearchSession {
         productSearchOptions.setPaging((String) parameters.get("PAGING"));
     }
 
+    @SuppressWarnings("unchecked")
     public static Map<String, Object> getProductSearchResult(HttpServletRequest request, Delegator delegator, String prodCatalogId) {
 
         // ========== Create View Indexes
@@ -869,6 +870,14 @@ public class ProductSearchSession {
         int listSize = 0;
         String paging = "Y";
         int previousViewSize = 20;
+        Map<String, Object> requestParams = UtilHttp.getCombinedMap(request);
+        List<String> keywordTypeIds = FastList.newInstance();
+        if (requestParams.get("keywordTypeId") instanceof String) {
+            keywordTypeIds.add((String) requestParams.get("keywordTypeId"));
+        } else if (requestParams.get("keywordTypeId") instanceof List){
+            keywordTypeIds = (List<String>) requestParams.get("keywordTypeId");
+        }
+        String statusId = (String) requestParams.get("statusId");
 
         HttpSession session = request.getSession();
         ProductSearchOptions productSearchOptions = getProductSearchOptions(session);
@@ -902,7 +911,6 @@ public class ProductSearchSession {
         List<String> productIds = FastList.newInstance();
         String visitId = VisitHandler.getVisitId(session);
         List<ProductSearchConstraint> productSearchConstraintList = ProductSearchOptions.getConstraintList(session);
-        Map<String, Object> requestParams = UtilHttp.getParameterMap(request);
         String noConditionFind = (String) requestParams.get("noConditionFind");
         if (UtilValidate.isEmpty(noConditionFind)) {
             noConditionFind = UtilProperties.getPropertyValue("widget", "widget.defaultNoConditionFind");
@@ -965,7 +973,17 @@ public class ProductSearchSession {
             productSearchContext.setResultSortOrder(resultSortOrder);
             productSearchContext.setResultOffset(resultOffset);
             productSearchContext.setMaxResults(maxResults);
-
+            
+            if (UtilValidate.isNotEmpty(keywordTypeIds)) {
+                productSearchContext.keywordTypeIds = keywordTypeIds;
+            } else {
+                 productSearchContext.keywordTypeIds = UtilMisc.toList("KWT_KEYWORD");
+            }
+            
+            if (UtilValidate.isNotEmpty(statusId)) {
+                productSearchContext.statusId = statusId;
+            }
+            
             List<String> foundProductIds = productSearchContext.doSearch();
             if (maxResultsInt > 0) {
                 productIds.addAll(foundProductIds);

Modified: ofbiz/branches/jackrabbit20100709/applications/product/webapp/catalog/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/product/webapp/catalog/WEB-INF/controller.xml?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/product/webapp/catalog/WEB-INF/controller.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/product/webapp/catalog/WEB-INF/controller.xml Mon Jan  9 17:59:01 2012
@@ -800,6 +800,12 @@ under the License.
         <response name="success" type="view" value="EditProductKeyword"/>
         <response name="error" type="view" value="EditProductKeyword"/>
     </request-map>
+    <request-map uri="updateProductKeyword">
+        <security https="true" auth="true"/>
+        <event type="service" path="" invoke="updateProductKeyword"/>
+        <response name="success" type="view" value="EditProductKeyword"/>
+        <response name="error" type="view" value="EditProductKeyword"/>
+    </request-map>
     <request-map uri="deleteProductKeyword">
         <security https="true" auth="true"/>
         <event type="service" path="" invoke="deleteProductKeyword"/>
@@ -3020,6 +3026,19 @@ under the License.
         <response name="success" type="view" value="ViewProductGroupOrder"/>
         <response name="error" type="view" value="ViewProductGroupOrder"/>
     </request-map>
+    
+    <!-- ================ Product Tag Requests ================= -->
+    <request-map uri="EditProductTag">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="EditProductTag"/>
+    </request-map>
+
+    <request-map uri="updateProductTag">
+        <security https="true" auth="true"/>
+        <event type="service-multi" path="" invoke="updateProductKeyword"/>
+        <response name="success" type="request-redirect" value="EditProductTag"/>
+        <response name="error" type="view" value="EditProductTag"/>
+    </request-map>
     <!-- end of request mappings -->
 
     <!-- View Mappings -->
@@ -3183,6 +3202,8 @@ under the License.
     <view-map name="ListShipmentMethodTypes" type="screen" page="component://product/widget/catalog/ShippingScreens.xml#ListShipmentMethodTypes"/>
     <view-map name="ListCarrierShipmentMethods" type="screen" page="component://product/widget/catalog/ShippingScreens.xml#ListCarrierShipmentMethods"/>
 
+    <view-map name="EditProductTag" type="screen" page="component://product/widget/catalog/ProductScreens.xml#EditProductTag"/>
+
     <!-- Lookup request mappings -->
     <view-map name="LookupContent" page="component://content/widget/content/ContentScreens.xml#LookupContent" type="screen"/>
     <view-map name="LookupFixedAsset" type="screen" page="component://accounting/widget/LookupScreens.xml#LookupFixedAsset"/>

Modified: ofbiz/branches/jackrabbit20100709/applications/product/webapp/catalog/imagemanagement/ImageFrame.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/product/webapp/catalog/imagemanagement/ImageFrame.ftl?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/product/webapp/catalog/imagemanagement/ImageFrame.ftl (original)
+++ ofbiz/branches/jackrabbit20100709/applications/product/webapp/catalog/imagemanagement/ImageFrame.ftl Mon Jan  9 17:59:01 2012
@@ -27,14 +27,14 @@ under the License.
         var width = jQuery('td.image-src img').width();
         var height = jQuery('td.image-src img').height();
         jQuery('td.image-src img').css("width", 200);
-        var dimention = width + " x " + height + " pixels";
-        jQuery('td.dimention').text(dimention);
+        var dimension = width + " x " + height + " pixels";
+        jQuery('td.dimension').text(dimension);
         
         var widthFrame = jQuery('td.image-fr img').width();
         var heightFrame = jQuery('td.image-fr img').height();
         jQuery('td.image-fr img').css("width", 200);
-        var dimentionFrame = widthFrame + " x " + heightFrame + " pixels";
-        jQuery('td.frameDimention').text(dimentionFrame);
+        var dimensionFrame = widthFrame + " x " + heightFrame + " pixels";
+        jQuery('td.frameDimension').text(dimensionFrame);
     });
     function setTargetWindows(target) {
         if ((target == "upload") || (target == "choose")) {

Modified: ofbiz/branches/jackrabbit20100709/applications/product/webapp/catalog/imagemanagement/ImageWatermark.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/product/webapp/catalog/imagemanagement/ImageWatermark.ftl?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/product/webapp/catalog/imagemanagement/ImageWatermark.ftl (original)
+++ ofbiz/branches/jackrabbit20100709/applications/product/webapp/catalog/imagemanagement/ImageWatermark.ftl Mon Jan  9 17:59:01 2012
@@ -90,7 +90,7 @@ under the License.
            jQuery('#ImageWatermarking_previewCount').attr('value', next);
        });
     }
-    function setImageDimention() {
+    function setImageDimension() {
        var productId = jQuery('#ImageWatermarking_productId').val();
        var imageName = jQuery('#ImageWatermarking_imageName').val();
        var positionX = jQuery('#ImageWatermarking_positionX').val();

Modified: ofbiz/branches/jackrabbit20100709/applications/product/webapp/catalog/thesaurus/EditKeywordThesaurus.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/product/webapp/catalog/thesaurus/EditKeywordThesaurus.ftl?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/product/webapp/catalog/thesaurus/EditKeywordThesaurus.ftl (original)
+++ ofbiz/branches/jackrabbit20100709/applications/product/webapp/catalog/thesaurus/EditKeywordThesaurus.ftl Mon Jan  9 17:59:01 2012
@@ -57,7 +57,11 @@ under the License.
                     <form method="post" action="<@ofbizUrl>createKeywordThesaurus</@ofbizUrl>">
                       <div>
                         ${keyword.enteredKeyword}
-                        <a href="<@ofbizUrl>deleteKeywordThesaurus?enteredKeyword=${keyword.enteredKeyword}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonDeleteAll}</a>
+                        <form method="post" action="<@ofbizUrl>deleteKeywordThesaurus</@ofbizUrl>" name="deleteKeywordThesaurus">
+                          <input type="hidden" name="enteredKeyword" value="${keyword.enteredKeyword}" />
+                          <input type="hidden" name="alternateKeyword" value="${keyword.alternateKeyword}" />
+                          <input type="submit" value="${uiLabelMap.CommonDeleteAll}" />
+                        </form>
                       </div>
                       <div>
                         <input type="hidden" name="enteredKeyword" value="${keyword.enteredKeyword}" />
@@ -70,7 +74,11 @@ under the License.
                   <td>
               </#if>
               <div>
-                <a href="<@ofbizUrl>deleteKeywordThesaurus?enteredKeyword=${keyword.enteredKeyword}&amp;alternateKeyword=${keyword.alternateKeyword}</@ofbizUrl>" class="buttontext">X</a>
+                <form method="post" action="<@ofbizUrl>deleteKeywordThesaurus</@ofbizUrl>" name="deleteKeywordThesaurus">
+                  <input type="hidden" name="enteredKeyword" value="${keyword.enteredKeyword}" />
+                  <input type="hidden" name="alternateKeyword" value="${keyword.alternateKeyword}" />
+                  <input type="submit" value="X" />
+                </form>
                 ${keyword.alternateKeyword}&nbsp;(${uiLabelMap.ProductRelationship}:${(relationship.get("description",locale))?default(keyword.relationshipEnumId?if_exists)})
               </div>
               <#-- toggle the row color -->

Modified: ofbiz/branches/jackrabbit20100709/applications/product/widget/catalog/CatalogMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/product/widget/catalog/CatalogMenus.xml?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/product/widget/catalog/CatalogMenus.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/product/widget/catalog/CatalogMenus.xml Mon Jan  9 17:59:01 2012
@@ -271,24 +271,24 @@ under the License.
         </menu-item>
         <menu-item name="Expand" title="${uiLabelMap.CommonExpandAll}">
             <condition>
-             <or>
-             <if-compare operator="equals" value="EditProductStore" field="tabButtonItem"/>
-             <if-compare operator="equals" value="EditProductStoreShipmentCostEstimates" field="tabButtonItem"/>
-            </or>
+                <or>
+                    <if-compare operator="equals" value="EditProductStore" field="tabButtonItem"/>
+                    <if-compare operator="equals" value="EditProductStoreShipmentCostEstimates" field="tabButtonItem"/>
+                </or>
             </condition>
             <link target="javascript:expandAll(true);" url-mode="plain"/>
         </menu-item>
         <menu-item name="Collapse" title="${uiLabelMap.CommonCollapseAll}">
             <condition>
-             <or>
-             <if-compare operator="equals" value="EditProductStore" field="tabButtonItem"/>
-             <if-compare operator="equals" value="EditProductStoreShipmentCostEstimates" field="tabButtonItem"/>
-            </or>
+                <or>
+                    <if-compare operator="equals" value="EditProductStore" field="tabButtonItem"/>
+                    <if-compare operator="equals" value="EditProductStoreShipmentCostEstimates" field="tabButtonItem"/>
+                </or>
             </condition>
             <link target="javascript:expandAll(false);" url-mode="plain"/>
         </menu-item>
- </menu>
-
+    </menu>
+
     <menu name="ProductStoreFacility" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
         <menu-item name="AddProductStoreFacility" title="${uiLabelMap.ProductAddFacility}">
             <link target="javascript:ajaxUpdateArea('ProductStoreFacilityEditArea', 'editProductStoreFacility', 'productStoreId=${parameters.productStoreId}');"
@@ -537,6 +537,9 @@ under the License.
                 <parameter param-name="productId"/>
             </link>
         </menu-item>
+        <menu-item name="ProductTags" title="${uiLabelMap.ProductTags}">
+            <link target="EditProductTag"/>
+        </menu-item>
         <menu-item name="ExpandAll" title="${uiLabelMap.CommonExpandAll}" widget-style="buttontext expand-all">
             <condition>
                 <and>
@@ -579,9 +582,9 @@ under the License.
             </link>
         </menu-item>
     </menu>
-    
 
-     <menu name="ImageManagementTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml" selected-menuitem-context-field-name="userTabButtonImage">
+    <menu name="ImageManagementTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml"
+           selected-menuitem-context-field-name="userTabButtonImage" menu-container-style="button-bar button-style-2 no-clear">
         <menu-item name="main" title="${uiLabelMap.CommonMain}">
             <condition>
                 <if-has-permission permission="IMAGE_MANAGEMENT_ADMIN"/>
@@ -610,7 +613,7 @@ under the License.
                 <parameter param-name="productId"/>
             </link>
         </menu-item>
-        <menu-item name="ImageApprove" title="${uiLabelMap.ImageManamentApprove}">
+        <menu-item name="ImageApprove" title="${uiLabelMap.ImageManagementApprove}">
             <condition>
                 <or>
                     <if-has-permission permission="IMAGE_MANAGEMENT_APPROVE"/>

Modified: ofbiz/branches/jackrabbit20100709/applications/product/widget/catalog/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/product/widget/catalog/CommonScreens.xml?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/product/widget/catalog/CommonScreens.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/product/widget/catalog/CommonScreens.xml Mon Jan  9 17:59:01 2012
@@ -319,7 +319,7 @@ under the License.
     <screen name="categorytree">
         <section>
             <actions>
-                <script location="component://product/webapp/catalog/WEB-INF/actions/category/CategoryTree.groovy"></script>
+                <script location="component://product/webapp/catalog/WEB-INF/actions/category/CategoryTree.groovy"/>
             </actions>
             <widgets>
                 <screenlet id="ProductBrowseCategoriesPanel" title="${uiLabelMap.ProductBrowseCatalogeAndCategories}" collapsible="true">
@@ -353,18 +353,17 @@ under the License.
             </widgets>
         </section>
      </screen>
-    
+
     <screen name="ImageManagementDecorator">
         <section>
             <actions>
-                <set field="headerItem" value="Imagemanagement"/><!-- this highlights the selected menu-item with name "main" -->
-                <set field="userTabButtonMainAppBar" value="Imagemanagement"/>
+                <set field="headerItem" value="Imagemanagement"/>
             </actions>
             <widgets>
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="left-column">
                         <include-screen name="leftbar"/>
-                    </decorator-section>                    
+                    </decorator-section>
                     <decorator-section name="body">
                         <section>
                             <condition>
@@ -372,20 +371,18 @@ under the License.
                             </condition>
                             <widgets>
                                 <include-menu name="ImageManagementTabBar" location="component://product/widget/catalog/CatalogMenus.xml"/>
-                                <container style="h1">
-                                <label text=" "/>
-                                </container>
+                                <decorator-section-include name="body"/>
                             </widgets>
                             <fail-widgets>
                                 <label style="h3">${uiLabelMap.ProductCatalogViewPermissionError}</label>
                             </fail-widgets>
                         </section>
-                        <decorator-section-include name="body"/>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
         </section>
     </screen>
+
     <screen name="listMiniproduct">
         <section>
             <actions>

Modified: ofbiz/branches/jackrabbit20100709/applications/product/widget/catalog/FeatureScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/product/widget/catalog/FeatureScreens.xml?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/product/widget/catalog/FeatureScreens.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/product/widget/catalog/FeatureScreens.xml Mon Jan  9 17:59:01 2012
@@ -24,7 +24,7 @@
         <section>
             <widgets>
                 <decorator-screen name="main-decorator"  location="${parameters.mainDecoratorLocation}">
-    <decorator-section name="left-column">
+                    <decorator-section name="left-column">
                         <include-screen name="leftbar" location="component://product/widget/catalog/CommonScreens.xml"/>
                     </decorator-section>                    
                     <decorator-section name="body">

Modified: ofbiz/branches/jackrabbit20100709/applications/product/widget/catalog/ImageManagementForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/product/widget/catalog/ImageManagementForms.xml?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/product/widget/catalog/ImageManagementForms.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/product/widget/catalog/ImageManagementForms.xml Mon Jan  9 17:59:01 2012
@@ -403,17 +403,17 @@ under the License.
         <field name="productId"><hidden value="${parameters.productId}"/></field>
         <field name="contentId"><hidden value="${parameters.contentId}"/></field>
         <field name="dataResourceId"><hidden value="${parameters.dataResourceId}"/></field>
-        <field name="frameContentId"><hidden value="${frameContentId}"></hidden></field>
-        <field name="frameDataResourceId"><hidden value="${frameDataResourceId}"></hidden></field>
+        <field name="frameContentId"><hidden value="${frameContentId}"/></field>
+        <field name="frameDataResourceId"><hidden value="${frameDataResourceId}"/></field>
         <field name="checkFrame"><hidden value="T"/></field>
         <field name="frameURL"><hidden value="${parameters.checkFrame}"/></field>
         <field name="imageName"><hidden value="${contentDataResource.drDataResourceName}"/></field>
         <field name="imageShare" use-when="imageURL != null" title="${uiLabelMap.CommonImage}" widget-area-style="image-src"><image value="${imageURL}"/></field>
         <field name="imageShare" use-when="imageURL == null" title="${uiLabelMap.CommonImage}"><image value="/images/defaultImage.jpg" width="200"/></field>
-        <field name="imageDimention" widget-area-style="dimention"><display></display></field>
+        <field name="imageDimension" widget-area-style="dimension"><display/></field>
         <field name="imageFrame" use-when="frameURL != null" title="${uiLabelMap.ImageManagementFrame}" widget-area-style="image-fr"><image value="${frameURL}"/></field>
         <field name="imageFrame" use-when="frameURL == null" title="${uiLabelMap.ImageManagementFrame}" widget-area-style="image-fr"><image value="/images/defaultImage.jpg" width="200"/></field>
-        <field name="frameDimention" use-when="frameURL != null" widget-area-style="frameDimention"><display></display></field>
+        <field name="frameDimension" use-when="frameURL != null" widget-area-style="frameDimension"><display/></field>
         <field name="uploadedFile" title="${uiLabelMap.ImageManagementUploadNewFrame}" event="onClick" action="javascript:setUploadTarget('_self');"><file/></field>
         <field name="uploadButton" title="${uiLabelMap.CommonUpload}" widget-style="smallSubmit" event="onClick" action="javascript:document.ImageFrames.setAttribute('enctype', 'multipart/form-data');setTargetWindows('upload');document.ImageFrames.submit();"><submit button-type="button"/></field>
         <field name="imageFrameContentId" title="${uiLabelMap.ImageManagementChooseExistFrame}"><lookup target-form-name="LookupImageFrame"/></field>
@@ -424,7 +424,7 @@ under the License.
         <field name="submitButton" title="${uiLabelMap.CommonCreate}" use-when="frameURL != null" widget-style="smallSubmit" event="onClick" action="javascript:setTargetWindows('_self');"><submit button-type="button"/></field>
         <field name="cancelButton" title=" " widget-style="buttontext" event="onClick" action="javascript:deletePreviewFrameImage();">
             <hyperlink target="ListImageManage" description="${uiLabelMap.CommonCancel}">
-                <parameter param-name="productId" from-field="parameters.productId"></parameter>
+                <parameter param-name="productId" from-field="parameters.productId"/>
             </hyperlink>
         </field>
     </form>
@@ -451,7 +451,7 @@ under the License.
         <field name="imageName"><hidden value="${contentDataResource.drDataResourceName}"/></field>
         <field name="imageWatermark" use-when="imageURL != null" title="${uiLabelMap.CommonImage}" widget-area-style="img-src"><image value="${imageURL}"/></field>
         <field name="imageWatermark" use-when="imageURL == null" title="${uiLabelMap.CommonImage}" widget-area-style="img-src-de"><image value="/images/defaultImage.jpg"/></field>
-        <field name="" widget-style="h3"><display description="Click directly on the image to adjust the location of the watermark"></display></field>
+        <field name="" widget-style="h3"><display description="${uiLabelMap.ImageManagementWatermarkingLocation}"/></field>
         <field name="imageOpacity" title="${uiLabelMap.ImageManagementOpacity}" widget-area-style="opacity">
             <drop-down no-current-selected-key="0.5">
                 <option key="0.1" description="10%"/>
@@ -467,7 +467,7 @@ under the License.
             </drop-down>
         </field>
         <field name="textWatermark" title="${uiLabelMap.CommonText}" widget-area-style="watermark_txt"><text default-value="DEFAULT"/></field>
-        <field name="previewButton" title=" " widget-style="buttontext" widget-area-style="preview"><hyperlink target="#" target-type="plain" description="${uiLabelMap.CommonPreview}"></hyperlink></field>
+        <field name="previewButton" title=" " widget-style="buttontext" widget-area-style="preview"><hyperlink target="#" target-type="plain" description="${uiLabelMap.CommonPreview}"/></field>
         <field name="colorWatermark" title="${uiLabelMap.ImageManagementTextColor}" widget-area-style="txt_color">
             <drop-down allow-empty="true" no-current-selected-key="TEXT_BLACK">
                 <entity-options description="${description}" entity-name="ProductFeature" key-field-name="productFeatureId">
@@ -486,10 +486,10 @@ under the License.
                 </entity-options>
             </drop-down>
         </field>
-        <field name="submitButton" title="${uiLabelMap.CommonSubmit}" event="onClick" action="javascript:setImageDimention()" widget-style="smallSubmit" ><submit button-type="button"/></field>
+        <field name="submitButton" title="${uiLabelMap.CommonSubmit}" event="onClick" action="javascript:setImageDimension()" widget-style="smallSubmit" ><submit button-type="button"/></field>
         <field name="cancelButton" title=" " widget-style="buttontext" event="onClick" action="javascript:deletePreviewWatermarkImage();">
             <hyperlink target="ListImageManage" description="${uiLabelMap.CommonCancel}">
-                <parameter param-name="productId" from-field="parameters.productId"></parameter>
+                <parameter param-name="productId" from-field="parameters.productId"/>
             </hyperlink>
         </field>
     </form>
@@ -538,7 +538,7 @@ under the License.
         <field name="submitButton" title="${uiLabelMap.CommonSubmit}" widget-style="smallSubmit" position="1"><submit button-type="button"/></field>
         <field name="cancelButton" title=" " widget-style="buttontext">
             <hyperlink target="ListImageManage" description="${uiLabelMap.CommonCancel}">
-                <parameter param-name="productId" from-field="parameters.productId"></parameter>
+                <parameter param-name="productId" from-field="parameters.productId"/>
             </hyperlink>
         </field>
     </form>
@@ -568,10 +568,10 @@ under the License.
         <field name="imageShare" use-when="imageURL == null" title="${uiLabelMap.CommonImage}"><image value="/images/defaultImage.jpg" width="200"/></field>
         <field name="link" title="${uiLabelMap.CommonLink}"  event="onClick" action="javascript:select();"><text/></field>
         <field name="direct" title="${uiLabelMap.ImageManagementDirectLink}"  event="onClick" action="javascript:select();"><text/></field>
-        <field name="forumCode" title="${uiLabelMap.ImageManagementForumCode}" event="onClick" action="javascript:select();"><text></text></field>
-        <field name="forumThumbnail" title="${uiLabelMap.ImageManagementForumThumbnail}" event="onClick" action="javascript:select();"><text></text></field>
-        <field name="altForumCode" title="${uiLabelMap.ImageManagementAltForumCode}" event="onClick" action="javascript:select();"><text></text></field>
-        <field name="altForumThumbnail" title="${uiLabelMap.ImageManagementAltForumThumbnail}" event="onClick" action="javascript:select();"><text></text></field>
+        <field name="forumCode" title="${uiLabelMap.ImageManagementForumCode}" event="onClick" action="javascript:select();"><text/></field>
+        <field name="forumThumbnail" title="${uiLabelMap.ImageManagementForumThumbnail}" event="onClick" action="javascript:select();"><text/></field>
+        <field name="altForumCode" title="${uiLabelMap.ImageManagementAltForumCode}" event="onClick" action="javascript:select();"><text/></field>
+        <field name="altForumThumbnail" title="${uiLabelMap.ImageManagementAltForumThumbnail}" event="onClick" action="javascript:select();"><text/></field>
         <field name="html" title="${uiLabelMap.ImageManagementHTMLCode}" event="onClick" action="javascript:select();"><text/></field>
         <field name="htmlThumbnail" title="${uiLabelMap.ImageManagementHTMLThumbnail}" event="onClick" action="javascript:select();"><text/></field>
     </form>
@@ -719,7 +719,7 @@ under the License.
         <field name="statusId" title="${uiLabelMap.CommonStatus}">
             <display-entity entity-name="StatusItem" key-field-name="statusId" description="${description}"/>
         </field>
-        <field name="purchaseFromDate" title="${uiLabelMap.ImageManamentApprovedDate}"><display/></field>
+        <field name="purchaseFromDate" title="${uiLabelMap.ImageManagementApprovedDate}"><display/></field>
         <field name="viewButton" title="${uiLabelMap.CommonView}" widget-style="buttontext">
             <hyperlink target="${origContentDataResourceViews[0].drObjectInfo}" target-window="_blank" description="${uiLabelMap.CommonView}" also-hidden="false" target-type="content"/>
         </field>

Modified: ofbiz/branches/jackrabbit20100709/applications/product/widget/catalog/ImageManagementScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/product/widget/catalog/ImageManagementScreens.xml?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/product/widget/catalog/ImageManagementScreens.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/product/widget/catalog/ImageManagementScreens.xml Mon Jan  9 17:59:01 2012
@@ -23,8 +23,7 @@ under the License.
     <screen name="Imagemanagement">
         <section>
             <actions>
-                <set field="headerItem" value="Imagemanagement"/><!-- this highlights the selected menu-item with name "main" -->
-                <set field="userTabButtonMainAppBar" value="Imagemanagement"/>
+                <set field="userTabButtonImage" value="main"/>
             </actions>
             <widgets>
                 <decorator-screen name="ImageManagementDecorator" location="${parameters.mainDecoratorLocation}">
@@ -223,7 +222,7 @@ under the License.
                                 <platform-specific>
                                     <html><html-template location="component://product/webapp/catalog/imagemanagement/showPeopleApprove.ftl"/></html>
                                 </platform-specific>
-                                <screenlet title="${uiLabelMap.ImageManamentApprove}">
+                                <screenlet title="${uiLabelMap.ImageManagementApprove}">
                                     <include-form name="ImageApprove" location="component://product/widget/catalog/ImageManagementForms.xml"/>
                                 </screenlet>
                             </widgets>
@@ -757,7 +756,7 @@ under the License.
     <screen name="ViewImage">
         <section>
             <widgets>
-                <image src="${parameters.drObjectInfo}"></image>
+                <image src="${parameters.drObjectInfo}"/>
                 <platform-specific>
                     <html><html-template location="component://product/webapp/catalog/imagemanagement/ResizeImage.ftl"/></html>
                 </platform-specific>
@@ -771,7 +770,7 @@ under the License.
                 <property-to-field resource="catalog" property="image.management.url" field="imageServerUrl"/>
             </actions>
             <widgets>
-                <image src="${imageServerUrl}/preview/previewImage.jpg"></image>
+                <image src="${imageServerUrl}/preview/previewImage.jpg"/>
             </widgets>
         </section>
     </screen>

Modified: ofbiz/branches/jackrabbit20100709/applications/product/widget/catalog/ProductForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/product/widget/catalog/ProductForms.xml?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/product/widget/catalog/ProductForms.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/product/widget/catalog/ProductForms.xml Mon Jan  9 17:59:01 2012
@@ -1951,13 +1951,59 @@ under the License.
         <auto-fields-service service-name="createProductKeyword"/>
         <field name="productId"><hidden/></field>
         <field name="relevancyWeight"><text default-value="1"/></field>
+        <field name="keywordTypeId">
+            <drop-down>
+                <entity-options entity-name="Enumeration" key-field-name="enumId" description="${description}">
+                    <entity-constraint name="enumTypeId" operator="equals" value="KEYWORD_TYPE"/>
+                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="statusId">
+            <drop-down allow-empty="true">
+                <entity-options entity-name="StatusItem" key-field-name="statusId" description="${description}">
+                    <entity-constraint name="statusTypeId" value="KEYWORD_STATUS"/>
+                    <entity-order-by field-name="sequenceId"/>
+                </entity-options>
+            </drop-down>
+        </field>
         <field name="submitButton" title="${uiLabelMap.CommonCreate}"><submit button-type="button"/></field>
     </form>
-    <form name="UpdateProductKeyword" type="list" target="deleteProductKeyword" title="" list-name="productKeywords"
+    <form name="UpdateProductKeyword" type="list" target="updateProductKeyword" title="" list-name=""
         odd-row-style="alternate-row" default-table-style="basic-table">
-        <auto-fields-entity entity-name="ProductKeyword" default-field-type="display"/>
+        <actions>
+            <entity-condition entity-name="ProductKeyword">
+                <condition-list combine="and">
+                    <condition-expr field-name="productId" operator="equals" from-field="productId"/>
+                    <condition-expr field-name="keywordTypeId" operator="equals" from-field="keywordTypeId"/>
+                </condition-list>
+                <order-by field-name="statusId"/>
+                <order-by field-name="-relevancyWeight"/>
+                <order-by field-name="keyword"/>
+            </entity-condition>
+        </actions>
         <field name="productId"><hidden/></field>
-        <field name="submitButton" title="${uiLabelMap.CommonDelete}"><submit button-type="button"/></field>
+        <field name="keyword"><display/></field>
+        <field name="keywordTypeId" title="${uiLabelMap.FormFieldTitle_keywordType}">
+            <display-entity entity-name="Enumeration" description="${description}" key-field-name="enumId"/>
+        </field>
+        <field name="relevancyWeight"><display/></field>
+        <field name="statusId">
+            <drop-down allow-empty="true">
+                <entity-options entity-name="StatusItem" key-field-name="statusId" description="${description}">
+                    <entity-constraint name="statusTypeId" value="KEYWORD_STATUS"/>
+                    <entity-order-by field-name="sequenceId"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="submitButton" title="${uiLabelMap.CommonUpdate}"><submit button-type="button"/></field>
+        <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext">
+            <hyperlink target="deleteProductKeyword" description="${uiLabelMap.CommonDelete}" also-hidden="false">
+                <parameter param-name="productId"/>
+                <parameter param-name="keyword"/>
+                <parameter param-name="keywordTypeId"/>
+            </hyperlink>
+        </field>
     </form>
     <!-- ProductAttribute -->
     <form name="AddProductAttribute" type="single" target="createProductAttribute" title=""
@@ -2153,4 +2199,35 @@ under the License.
         <field name="thruDate" title="${uiLabelMap.ProductDealEndDate}*"><date-time/></field>
         <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field>
     </form>
+
+    <form name="ListProductTag" type="multi" target="updateProductTag" title="" list-name=""
+        odd-row-style="alternate-row" default-table-style="basic-table" paginate-target="EditProductTag" separate-columns="true">
+        <actions>
+            <entity-condition entity-name="ProductKeyword">
+                <condition-list combine="and">
+                    <condition-expr field-name="keywordTypeId" operator="equals" value="KWT_TAG"/>
+                    <condition-expr field-name="statusId" operator="equals" value="KW_PENDING"/>
+                </condition-list>
+                <order-by field-name="productId"/>
+                <order-by field-name="keyword"/>
+            </entity-condition>
+        </actions>
+        <field name="keywordTypeId"><hidden/></field>
+        <field name="productId">
+            <hyperlink target="EditProduct" description="${productId}">
+                <parameter param-name="productId"/>
+            </hyperlink>
+        </field>
+        <field name="keyword" title="${uiLabelMap.ProductTag}"><display/></field>
+        <field name="statusId">
+            <drop-down allow-empty="true">
+                <entity-options entity-name="StatusItem" key-field-name="statusId" description="${description}">
+                    <entity-constraint name="statusTypeId" value="KEYWORD_STATUS"/>
+                    <entity-order-by field-name="sequenceId"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="_rowSubmit" title="${uiLabelMap.CommonSelect}"><check/></field>
+        <field name="submitButton" title="${uiLabelMap.CommonUpdate}"><submit button-type="button"/></field>
+    </form>
  </forms>

Modified: ofbiz/branches/jackrabbit20100709/applications/product/widget/catalog/ProductScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/product/widget/catalog/ProductScreens.xml?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/product/widget/catalog/ProductScreens.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/product/widget/catalog/ProductScreens.xml Mon Jan  9 17:59:01 2012
@@ -621,9 +621,9 @@ under the License.
                 <set field="labelTitleProperty" value="ProductKeywords"/>
                 <set field="productId" from-field="parameters.productId"/>
                 <entity-one entity-name="Product" value-field="product"/>
-                <set field="orderByList[]" value="-relevancyWeight"/>
-                <set field="orderByList[]" value="keyword"/>
-                <get-related value-field="product" relation-name="ProductKeyword" list="productKeywords" order-by-list="orderByList"/>
+                <entity-and entity-name="Enumeration" list="keywordTypeList">
+                    <field-map field-name="enumTypeId" value="KEYWORD_TYPE"/>
+                </entity-and>
             </actions>
             <widgets>
                 <decorator-screen name="CommonProductDecorator" location="${parameters.productDecoratorLocation}">
@@ -639,9 +639,18 @@ under the License.
                         <screenlet title="${uiLabelMap.ProductAddProductKeyword}">
                             <include-form name="AddProductKeyword" location="component://product/widget/catalog/ProductForms.xml"/>
                         </screenlet>
-                        <screenlet title="${uiLabelMap.PageTitleEditProductKeywords}">
-                            <include-form name="UpdateProductKeyword" location="component://product/widget/catalog/ProductForms.xml"/>
-                        </screenlet>
+                        <iterate-section entry="keywordType" list="keywordTypeList">
+                            <section>
+                                <actions>
+                                    <set field="keywordTypeId" from-field="keywordType.enumId"/>
+                                </actions>
+                                <widgets>
+                                    <screenlet title="${uiLabelMap.PageTitleEditProductKeywords} : ${keywordType.description}">
+                                        <include-form name="UpdateProductKeyword" location="component://product/widget/catalog/ProductForms.xml"/>
+                                    </screenlet>
+                                </widgets>
+                            </section>
+                        </iterate-section>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
@@ -1431,4 +1440,18 @@ under the License.
             </widgets>
         </section>
     </screen>
+
+    <screen name="EditProductTag">
+        <section>
+            <widgets>
+                <decorator-screen name="CommonProductDecorator" location="${parameters.productDecoratorLocation}">
+                    <decorator-section name="body">
+                        <screenlet title="${uiLabelMap.PageTitleEditProductTags}">
+                            <include-form name="ListProductTag" location="component://product/widget/catalog/ProductForms.xml"/>
+                        </screenlet>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>

Modified: ofbiz/branches/jackrabbit20100709/applications/workeffort/config/WorkEffortUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/workeffort/config/WorkEffortUiLabels.xml?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/workeffort/config/WorkEffortUiLabels.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/workeffort/config/WorkEffortUiLabels.xml Mon Jan  9 17:59:01 2012
@@ -378,14 +378,14 @@
     </property>
     <property key="FormFieldTitle_reminderOffset">
         <value xml:lang="en">Reminder Offset</value>
-        <value xml:lang="fr">Récurrence de décalage</value>
+        <value xml:lang="fr">Décalage 1er rappel</value>
         <value xml:lang="it">Intervallo promemoria</value>
         <value xml:lang="zh">提醒偏移量</value>
     </property>
     <property key="FormFieldTitle_repeatInterval">
         <value xml:lang="de">Wiederholungsintervall</value>
         <value xml:lang="en">Repeat Interval</value>
-        <value xml:lang="fr">Répéter intervalle</value>
+        <value xml:lang="fr">Intervalle de répétition</value>
         <value xml:lang="it">Ripeti intervallo</value>
         <value xml:lang="zh">重复间隔</value>
         <value xml:lang="zh_TW">重複間隔</value>
@@ -4135,6 +4135,7 @@
     </property>
     <property key="WorkEffortTimesheetAlreadyExists">
         <value xml:lang="en">Time sheet already exist, not created an other one.</value>
+        <value xml:lang="fr">La feuille d'activité existe déjà, pas de nouvelle création.</value>
         <value xml:lang="it">Timbratura già esistente, non crearne un'altra.</value>
         <value xml:lang="zh">已经存在时间表,不能再建一个。</value>
     </property>

Modified: ofbiz/branches/jackrabbit20100709/applications/workeffort/data/WorkEffortDemoData.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/workeffort/data/WorkEffortDemoData.xml?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/workeffort/data/WorkEffortDemoData.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/workeffort/data/WorkEffortDemoData.xml Mon Jan  9 17:59:01 2012
@@ -26,7 +26,12 @@ under the License.
     <WorkEffort workEffortId="STAFF_MTG" workEffortTypeId="MEETING" currentStatusId="CAL_TENTATIVE" lastStatusUpdate="2008-01-01 00:00:00.0" scopeEnumId="WES_PUBLIC" workEffortName="Staff Meeting" description="Staff Meeting" tempExprId="STAFF_MTG" estimatedStartDate="2008-01-01 00:00:00.0" estimatedMilliSeconds="3600000"/>
     <FixedAsset fixedAssetId="DEMO_PROJECTOR" fixedAssetName="Overhead Projector" fixedAssetTypeId="EQUIPMENT" purchaseCost="2000" purchaseCostUomId="USD"/>
     <WorkEffortFixedAssetAssign workEffortId="STAFF_MTG" fixedAssetId="DEMO_PROJECTOR" statusId="FA_ASGN_REQUESTED" availabilityStatusId="WEFA_IN_USE" fromDate="2008-01-01 00:00:00.0"/>
-    
+
+    <Party partyId="WorkEffortUser" partyTypeId="PERSON" statusId="PARTY_ENABLED" />
+    <Person partyId="WorkEffortUser" firstName="WorkEffort" lastName="User" />
+    <UserLogin userLoginId="WorkEffortUser" partyId="WorkEffortUser" currentPassword="{SHA}47ca69ebb4bdc9ae0adec130880165d2cc05db1a" />
+    <UserLoginSecurityGroup groupId="WORKEFFORT_USER" userLoginId="WorkEffortUser" fromDate="2011-01-01 00:00:00.0" />
+
     <!-- Publish the staff meeting calendar event in iCalendar format -->
     <WorkEffort workEffortId="CALENDAR_PUB_DEMO" workEffortTypeId="PUBLISH_PROPS" currentStatusId="CAL_CANCELLED" scopeEnumId="WES_PUBLIC" description="Demo Project 1 Customer 1" workEffortName="iCalendar Publish Demonstration"/>
     <WorkEffortPartyAssignment workEffortId="CALENDAR_PUB_DEMO" partyId="admin" statusId="PRTYASGN_ASSIGNED" roleTypeId="CAL_OWNER" fromDate="2008-01-01 00:00:00.0"/>

Modified: ofbiz/branches/jackrabbit20100709/applications/workeffort/data/WorkEffortTypeData.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/workeffort/data/WorkEffortTypeData.xml?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/workeffort/data/WorkEffortTypeData.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/workeffort/data/WorkEffortTypeData.xml Mon Jan  9 17:59:01 2012
@@ -40,6 +40,7 @@ under the License.
     <EnumerationType description="Calendar Type" enumTypeId="CALENDAR_TYPE" hasTable="N" parentTypeId=""/>
     <Enumeration description="Personal Calendar" enumCode="PERSONAL" enumId="CAL_PERSONAL" sequenceId="01" enumTypeId="CALENDAR_TYPE"/>
     <Enumeration description="Manufacturing Calendar" enumCode="MANUFACTURING" enumId="CAL_MANUFACTURING" sequenceId="02" enumTypeId="CALENDAR_TYPE"/>
+    <Enumeration description="None" enumId="CAL_NONE" sequenceId="03" enumTypeId="CALENDAR_TYPE"/>
 
     <!-- workeffort status -->
     <StatusType description="WorkEffort Asset" hasTable="N" parentTypeId="" statusTypeId="WORK_EFF_ASSET_STTS"/>

Modified: ofbiz/branches/jackrabbit20100709/applications/workeffort/script/isCalOwner.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/workeffort/script/isCalOwner.groovy?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/workeffort/script/isCalOwner.groovy (original)
+++ ofbiz/branches/jackrabbit20100709/applications/workeffort/script/isCalOwner.groovy Mon Jan  9 17:59:01 2012
@@ -17,16 +17,15 @@
  * under the License.
  */
 
-
+import java.util.*;
 import org.ofbiz.entity.util.*;
 
-
-partyAssign = EntityUtil.filterByDate(delegator.findByAnd("WorkEffortPartyAssignment", ["workEffortId" : parameters.workEffortId, "partyId" : parameters.userLogin.partyId]));
-
-if (partyAssign) {
-    if (partyAssign.get(0).roleTypeId.equals("CAL_OWNER")) {
-        context.isCalOwner = new Boolean(true);
-    } else{
-        context.isCalOwner = new Boolean(false);
+boolean isCalOwner = false;
+List partyAssignments = EntityUtil.filterByDate(delegator.findByAnd("WorkEffortPartyAssignment", ["workEffortId" : parameters.workEffortId, "partyId" : parameters.userLogin.partyId]));
+for (partyAssign in partyAssignments) {
+    if ("CAL_OWNER".equals(partyAssign.roleTypeId) || "CAL_DELEGATE".equals(partyAssign.roleTypeId)) {
+        isCalOwner = true;
+        break;
     }
 }
+context.isCalOwner = isCalOwner;

Modified: ofbiz/branches/jackrabbit20100709/applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml Mon Jan  9 17:59:01 2012
@@ -26,9 +26,16 @@ under the License.
         <call-service service-name="createWorkEffort" in-map-name="create">
             <result-to-field result-name="workEffortId"/>
         </call-service>
-        <set-service-fields service-name="assignPartyToWorkEffort" map="parameters" to-map="assign"/>
-        <set field="assign.workEffortId" from-field="workEffortId"/>
-        <call-service service-name="assignPartyToWorkEffort" in-map-name="assign"/>
+        <check-errors />
+        <make-value value-field="newEntity" entity-name="WorkEffortPartyAssignment"/>
+        <set-pk-fields map="parameters" value-field="newEntity"/>
+        <set-nonpk-fields map="parameters" value-field="newEntity"/>
+        <set field="newEntity.workEffortId" from-field="workEffortId"/>
+        <if-empty field="newEntity.fromDate">
+            <now-timestamp field="newEntity.fromDate"/>
+        </if-empty>
+        <set field="newEntity.assignedByUserLoginId" from-field="userLogin.userLoginId"/>
+        <create-value value-field="newEntity"/>
         <field-to-result field="workEffortId"/>
     </simple-method>
 

Modified: ofbiz/branches/jackrabbit20100709/applications/workeffort/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/workeffort/servicedef/services.xml?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/workeffort/servicedef/services.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/workeffort/servicedef/services.xml Mon Jan  9 17:59:01 2012
@@ -266,7 +266,10 @@ under the License.
           If filterOutCanceledEvents is set to Boolean(true) then workEfforts with currentStatusId=EVENT_CANCELLED will not be returned.
           To limit the events to a particular partyId, specify the partyId.  To limit the events to a set of partyIds, specify a Collection of partyIds.
         </description>
-        <attribute name="calendarType" type="String" mode="IN" optional="true"/>
+        <attribute name="calendarType" type="String" mode="IN" optional="true">
+            <description>Can be either CAL_PERSONAL or CAL_MANUFACTURING, defaults to CAL_PERSONAL. The value controls the type of work efforts
+            returned. To bypass this behavior, use an invalid value (like VOID).</description>
+        </attribute>
         <attribute name="partyId" type="String" mode="IN" optional="true"/>
         <attribute name="partyIds" type="java.util.Collection" mode="IN" optional="true"/>
         <attribute name="facilityId" type="String" mode="IN" optional="true"/>

Modified: ofbiz/branches/jackrabbit20100709/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java Mon Jan  9 17:59:01 2012
@@ -508,6 +508,8 @@ public class WorkEffortServices {
 
         String calendarType = (String) context.get("calendarType");
         if (UtilValidate.isEmpty(calendarType)) {
+            // This is a bad idea. This causes the service to return only those work efforts that are assigned
+            // to the current user even when the service parameters have nothing to do with the current user.
             calendarType = "CAL_PERSONAL";
         }
         String partyId = (String) context.get("partyId");
@@ -536,7 +538,9 @@ public class WorkEffortServices {
         }
 
         // get a timestamp (date) for the beginning of today and for beginning of numDays+1 days from now
-        Timestamp startStamp = UtilDateTime.getDayStart(startDay, timeZone, locale);
+        // Commenting this out because it interferes with periods that do not start at the beginning of the day
+        // Timestamp startStamp = UtilDateTime.getDayStart(startDay, timeZone, locale);
+        Timestamp startStamp = startDay;
         Timestamp endStamp = UtilDateTime.adjustTimestamp(startStamp, periodType, 1, timeZone, locale);
         long periodLen = endStamp.getTime() - startStamp.getTime();
         endStamp = UtilDateTime.adjustTimestamp(startStamp, periodType, numPeriods, timeZone, locale);
@@ -721,6 +725,9 @@ public class WorkEffortServices {
                         calEntry.put("workEffort", workEffort);
                         long length = ((weRange.end().after(endStamp) ? endStamp.getTime() : weRange.end().getTime()) - (weRange.start().before(startStamp) ? startStamp.getTime() : weRange.start().getTime()));
                         int periodSpan = (int) Math.ceil((double) length / periodLen);
+                        if (length % periodLen == 0 && startDate.getTime() > periodRange.start().getTime()) {
+                            periodSpan++;
+                        }
                         calEntry.put("periodSpan", Integer.valueOf(periodSpan));
                         DateRange calEntryRange = new DateRange((weRange.start().before(startStamp) ? startStamp : weRange.start()), (weRange.end().after(endStamp) ? endStamp : weRange.end()));
                         calEntry.put("calEntryRange", calEntryRange);

Modified: ofbiz/branches/jackrabbit20100709/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/CreateUrlParam.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/CreateUrlParam.groovy?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/CreateUrlParam.groovy (original)
+++ ofbiz/branches/jackrabbit20100709/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/CreateUrlParam.groovy Mon Jan  9 17:59:01 2012
@@ -17,60 +17,18 @@
  * under the License.
  */
 
-facilityId = parameters.facilityId;
-fixedAssetId = parameters.fixedAssetId;
-partyId = parameters.partyId;
-workEffortTypeId = parameters.workEffortTypeId;
-calendarType = parameters.calendarType;
-hideEvents = parameters.hideEvents;
+import java.util.*;
+import org.ofbiz.base.util.*;
 
-urlParam = "";
-if (facilityId) {
-    urlParam = "facilityId=" + facilityId;
+// Allow containing screens to specify URL parameters to be included in calendar navigation links
+List urlParameterNames = context.urlParameterNames;
+if (urlParameterNames == null) {
+    urlParameterNames = UtilMisc.toList("fixedAssetId", "partyId", "workEffortTypeId", "calendarType", "hideEvents", "portalPageId");
 }
-if (fixedAssetId) {
-    if (urlParam) {
-        urlParam = urlParam + "&";
+StringBuilder sb = new StringBuilder();
+for (entry in parameters.entrySet()) {
+    if (urlParameterNames.contains(entry.getKey())) {
+        sb.append("&").append(entry.getKey()).append("=").append(entry.getValue());
     }
-    urlParam = urlParam + "fixedAssetId=" + fixedAssetId;
 }
-if (partyId) {
-    if (urlParam) {
-        urlParam = urlParam + "&";
-    }
-    urlParam = urlParam + "partyId=" + partyId;
-}
-
-if (workEffortTypeId) {
-    if (urlParam) {
-        urlParam = urlParam + "&";
-    }
-    urlParam = urlParam + "workEffortTypeId=" + workEffortTypeId;
-}
-
-if (calendarType) {
-    if (urlParam) {
-        urlParam = urlParam + "&";
-    }
-    urlParam = urlParam + "calendarType=" + calendarType;
-}
-
-if (hideEvents) {
-    if (urlParam) {
-        urlParam = urlParam + "&";
-    }
-    urlParam = urlParam + "hideEvents=" + hideEvents;
-}
-
-if (parameters.portalPageId) {
-    if (urlParam) {
-        urlParam = urlParam + "&";
-    }
-    urlParam = urlParam + "portalPageId=" + parameters.portalPageId;
-}
-
-if (urlParam) {
-    urlParam = "&" + urlParam;
-}
-
-context.put("urlParam", urlParam);
+context.put("urlParam", sb.toString());

Modified: ofbiz/branches/jackrabbit20100709/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Days.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Days.groovy?rev=1229278&r1=1229277&r2=1229278&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Days.groovy (original)
+++ ofbiz/branches/jackrabbit20100709/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/Days.groovy Mon Jan  9 17:59:01 2012
@@ -18,22 +18,10 @@
  */
 
 import java.util.*;
-import java.text.*;
-import org.ofbiz.entity.*;
-import org.ofbiz.base.util.*;
-import org.ofbiz.webapp.pseudotag.*;
-import org.ofbiz.workeffort.workeffort.*;
 import java.sql.Timestamp;
+import org.ofbiz.base.util.*;
 
-String currentDay = parameters.get("currentDay");
 String startParam = parameters.get("start");
-facilityId = parameters.facilityId;
-fixedAssetId = parameters.fixedAssetId;
-partyId = parameters.partyId;
-workEffortTypeId = parameters.workEffortTypeId;
-calendarType = parameters.calendarType;
-entityExprList = context.entityExprList;
-
 Timestamp start = null;
 if (UtilValidate.isNotEmpty(startParam)) {
     start = new Timestamp(Long.parseLong(startParam));
@@ -43,21 +31,18 @@ if (start == null) {
 } else {
     start = UtilDateTime.getDayStart(start, timeZone, locale);
 }
-
 Timestamp prev = UtilDateTime.getDayStart(start, -1, timeZone, locale);
 context.prevMillis = new Long(prev.getTime()).toString();
 Timestamp next = UtilDateTime.getDayStart(start, 1, timeZone, locale);
 context.nextMillis = new Long(next.getTime()).toString();
-
-Map serviceCtx = UtilMisc.toMap("userLogin", userLogin,"start",start,"numPeriods", 24,"periodType", Calendar.HOUR);
-serviceCtx.putAll(UtilMisc.toMap("partyId", partyId, "facilityId", facilityId, "fixedAssetId", fixedAssetId, "workEffortTypeId", workEffortTypeId, "calendarType", calendarType, "locale", locale, "timeZone", timeZone));
-if (entityExprList) {
-    serviceCtx.putAll(["entityExprList" : entityExprList]);
+Map serviceCtx = dispatcher.getDispatchContext().makeValidContext("getWorkEffortEventsByPeriod", "IN", parameters);
+serviceCtx.putAll(UtilMisc.toMap("userLogin", userLogin, "start", start, "numPeriods", 24, "periodType", Calendar.HOUR, "locale", locale, "timeZone", timeZone));
+if (context.entityExprList) {
+    serviceCtx.entityExprList = entityExprList;
 }
-
-Map result = dispatcher.runSync("getWorkEffortEventsByPeriod",serviceCtx);
-context.put("periods",result.get("periods"));
-context.put("maxConcurrentEntries",result.get("maxConcurrentEntries"));
-context.put("start",start);
-context.put("prev",prev);
-context.put("next",next);
+Map result = dispatcher.runSync("getWorkEffortEventsByPeriod", serviceCtx);
+context.put("periods", result.get("periods"));
+context.put("maxConcurrentEntries", result.get("maxConcurrentEntries"));
+context.put("start", start);
+context.put("prev", prev);
+context.put("next", next);