You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ad...@apache.org on 2009/08/17 17:43:04 UTC

svn commit: r805012 [7/11] - in /ofbiz/branches/executioncontext20090812: ./ applications/accounting/ applications/accounting/config/ applications/accounting/data/ applications/accounting/script/org/ofbiz/accounting/invoice/ applications/accounting/scr...

Modified: ofbiz/branches/executioncontext20090812/framework/common/src/org/ofbiz/common/CommonServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/common/src/org/ofbiz/common/CommonServices.java?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/common/src/org/ofbiz/common/CommonServices.java (original)
+++ ofbiz/branches/executioncontext20090812/framework/common/src/org/ofbiz/common/CommonServices.java Mon Aug 17 15:42:56 2009
@@ -294,7 +294,7 @@
         GenericDelegator delegator = dctx.getDelegator();
         int count = ((Integer) context.get("count")).intValue();
 
-        for (int i = 0; i < count; i++ ) {
+        for (int i = 0; i < count; i++) {
             GenericValue v = delegator.makeValue("Visit");
             String seqId = delegator.getNextSeqId("Visit");
 

Modified: ofbiz/branches/executioncontext20090812/framework/common/src/org/ofbiz/common/FindServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/common/src/org/ofbiz/common/FindServices.java?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/common/src/org/ofbiz/common/FindServices.java (original)
+++ ofbiz/branches/executioncontext20090812/framework/common/src/org/ofbiz/common/FindServices.java Mon Aug 17 15:42:56 2009
@@ -663,7 +663,7 @@
         try {
             EntityListIterator it = (EntityListIterator) result.get("listIt");
             list = it.getPartialList(1, 1); // list starts at '1'
-            if (list != null && list.size() > 0 ) {
+            if (list != null && list.size() > 0) {
                 item = list.get(0);
             }
             it.close();

Modified: ofbiz/branches/executioncontext20090812/framework/common/src/org/ofbiz/common/image/ImageTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/common/src/org/ofbiz/common/image/ImageTransform.java?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/common/src/org/ofbiz/common/image/ImageTransform.java (original)
+++ ofbiz/branches/executioncontext20090812/framework/common/src/org/ofbiz/common/image/ImageTransform.java Mon Aug 17 15:42:56 2009
@@ -167,7 +167,7 @@
             bufImgType = bufImg.getType();
         }
 
-        bufNewImg = new BufferedImage( (int) (imgWidth * scaleFactor), (int) (imgHeight * scaleFactor), bufImgType);
+        bufNewImg = new BufferedImage((int) (imgWidth * scaleFactor), (int) (imgHeight * scaleFactor), bufImgType);
 
         result.put("responseMessage", "success");
         result.put("bufferedImage", bufNewImg);

Modified: ofbiz/branches/executioncontext20090812/framework/common/src/org/ofbiz/common/login/LoginServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/common/src/org/ofbiz/common/login/LoginServices.java?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/common/src/org/ofbiz/common/login/LoginServices.java (original)
+++ ofbiz/branches/executioncontext20090812/framework/common/src/org/ofbiz/common/login/LoginServices.java Mon Aug 17 15:42:56 2009
@@ -948,7 +948,7 @@
         }
         Debug.logInfo(" password.change.history.limit is set to " + passwordChangeHistoryLimit, module);
         Debug.logInfo(" userLogin is set to " + userLogin, module);
-        if (passwordChangeHistoryLimit > 0 && userLogin != null ) {
+        if (passwordChangeHistoryLimit > 0 && userLogin != null) {
             Debug.logInfo(" checkNewPassword Checking if user is tyring to use old password " + passwordChangeHistoryLimit, module);
             GenericDelegator delegator = userLogin.getDelegator();
             String newPasswordHash = newPassword;

Modified: ofbiz/branches/executioncontext20090812/framework/common/webcommon/WEB-INF/actions/includes/GetParentPortalPageId.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/common/webcommon/WEB-INF/actions/includes/GetParentPortalPageId.groovy?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/common/webcommon/WEB-INF/actions/includes/GetParentPortalPageId.groovy (original)
+++ ofbiz/branches/executioncontext20090812/framework/common/webcommon/WEB-INF/actions/includes/GetParentPortalPageId.groovy Mon Aug 17 15:42:56 2009
@@ -24,31 +24,31 @@
 
 // executes only on startup when only the basic parameters.portalPageId (from commonscreens.xml) is available
 if (userLogin && parameters.parentPortalPageId && !parameters.portalPageId) {
-	// look for system page according the current securitygroup
-	//get the security group
-	condSec = EntityCondition.makeCondition([
-			EntityCondition.makeCondition("portalPageId", EntityOperator.LIKE, parameters.parentPortalPageId + "%"),
+    // look for system page according the current securitygroup
+    //get the security group
+    condSec = EntityCondition.makeCondition([
+            EntityCondition.makeCondition("portalPageId", EntityOperator.LIKE, parameters.parentPortalPageId + "%"),
             EntityCondition.makeCondition("parentPortalPageId", EntityOperator.EQUALS, null),
-			EntityCondition.makeCondition("userLoginId", EntityOperator.EQUALS, userLogin.userLoginId)
-			],EntityOperator.AND);
-	portalMainPages = EntityUtil.filterByDate(delegator.findList("PortalPageAndUserLogin", condSec, null, null, null, false));
-	if (!portalMainPages) { // look for a null securityGroup if not found
-	    condSec = EntityCondition.makeCondition([
+            EntityCondition.makeCondition("userLoginId", EntityOperator.EQUALS, userLogin.userLoginId)
+            ],EntityOperator.AND);
+    portalMainPages = EntityUtil.filterByDate(delegator.findList("PortalPageAndUserLogin", condSec, null, null, null, false));
+    if (!portalMainPages) { // look for a null securityGroup if not found
+        condSec = EntityCondition.makeCondition([
             EntityCondition.makeCondition("securityGroupId", EntityOperator.EQUALS, null),
             EntityCondition.makeCondition("parentPortalPageId", EntityOperator.EQUALS, null),
             EntityCondition.makeCondition("portalPageId", EntityOperator.LIKE, parameters.parentPortalPageId + "%")
-	        ],EntityOperator.AND);
-	    portalMainPages = delegator.findList("PortalPage", condSec, null, null, null, false);
-	}
+            ],EntityOperator.AND);
+        portalMainPages = delegator.findList("PortalPage", condSec, null, null, null, false);
+    }
     if (portalMainPages) {
-    	portalPageId = portalMainPages.get(0).portalPageId;
-    	// check if overridden with a privat page
-    	privatMainPages = delegator.findByAnd("PortalPage", [originalPortalPageId : portalPageId, ownerUserLoginId : userLogin.userLoginId]);
-    	if (privatMainPages) {
+        portalPageId = portalMainPages.get(0).portalPageId;
+        // check if overridden with a privat page
+        privatMainPages = delegator.findByAnd("PortalPage", [originalPortalPageId : portalPageId, ownerUserLoginId : userLogin.userLoginId]);
+        if (privatMainPages) {
             context.parameters.portalPageId = privatMainPages.get(0).portalPageId;
-    	} else {
-    		context.parameters.portalPageId = portalPageId;
-    	}
+        } else {
+            context.parameters.portalPageId = portalPageId;
+        }
     }
 }
 // Debug.log('======portalPageId: ' + parameters.portalPageId);
@@ -58,11 +58,11 @@
         if (portalPage.parentPortalPageId) {
             context.parameters.parentPortalPageId = portalPage.parentPortalPageId;
         } else {
-        	if ("_NA_".equals(portalPage.ownerUserLoginId)) {
-        		context.parameters.parentPortalPageId = portalPage.portalPageId;
-        	} else {
+            if ("_NA_".equals(portalPage.ownerUserLoginId)) {
+                context.parameters.parentPortalPageId = portalPage.portalPageId;
+            } else {
                 context.parameters.parentPortalPageId = portalPage.originalPortalPageId;
-        	}
+            }
         }
     }
 }

Modified: ofbiz/branches/executioncontext20090812/framework/common/webcommon/includes/ajaxAutocompleteOptions.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/common/webcommon/includes/ajaxAutocompleteOptions.ftl?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/common/webcommon/includes/ajaxAutocompleteOptions.ftl (original)
+++ ofbiz/branches/executioncontext20090812/framework/common/webcommon/includes/ajaxAutocompleteOptions.ftl Mon Aug 17 15:42:56 2009
@@ -20,7 +20,7 @@
 <#if autocompleteOptions?exists>
   <ul>
     <#list autocompleteOptions as autocompleteOption>
-  	  <#assign fields = autocompleteOption.values()/>
+        <#assign fields = autocompleteOption.values()/>
       <li><#list fields as field><#if field_index == 1><span class="informal"> </#if>${field}<#if (field_index > 0)><#if field_has_next> <#else></span></#if></#if></#list></li>
     </#list>
   </ul>

Modified: ofbiz/branches/executioncontext20090812/framework/common/webcommon/includes/helplink.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/common/webcommon/includes/helplink.ftl?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/common/webcommon/includes/helplink.ftl (original)
+++ ofbiz/branches/executioncontext20090812/framework/common/webcommon/includes/helplink.ftl Mon Aug 17 15:42:56 2009
@@ -18,17 +18,22 @@
 -->
 
   <#assign helpTopic = webSiteId + "_" + requestAttributes._CURRENT_VIEW_ />
-  <#assign helpUrlTopic = helpUrlsMap["HelpNotFound"]/>
   <#assign helpUrlPrefix = "" />
   <#assign helpUrlSuffix = "" />
 
-<#-- uncomment this to show the current screen help topic key (this is usefull to cut and paste in the help link resources files
-${helpTopic}
--->
   <#if Static["org.ofbiz.base.component.ComponentConfig"].componentExists("content")>
-    <#assign helpContent = delegator.findByAnd("Content", {"contentId" : helpTopic})?if_exists>
+    <#if (helpTopic?length > 20)> 
+     <#assign helpTopic = helpTopic?substring(0,20)>
+    </#if>
+    <#assign helpContent = delegator.findByAnd("Content", {"contentId" : helpTopic})>
+    <#if !helpContent?has_content>
+      <#assign helpContent = delegator.findByAnd("Content", {"contentId" : webSiteId})>
+    </#if>
   </#if>
 
+<#-- uncomment this to show the current screen help topic key (this is usefull to cut and paste in the help link resources files
+${helpTopic}
+-->
   <#if helpUrlsMap["Prefix"] != "Prefix">
     <#assign helpUrlPrefix = helpUrlsMap["Prefix"] />
   </#if>
@@ -37,4 +42,6 @@
   </#if>
   <#if helpUrlsMap[helpTopic] != helpTopic >
     <#assign helpUrlTopic = helpUrlsMap[helpTopic] />
+  <#else>
+    <#assign helpTopic = "navigateHelp"/>
   </#if>

Modified: ofbiz/branches/executioncontext20090812/framework/common/webcommon/includes/insertDropDown.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/common/webcommon/includes/insertDropDown.ftl?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/common/webcommon/includes/insertDropDown.ftl (original)
+++ ofbiz/branches/executioncontext20090812/framework/common/webcommon/includes/insertDropDown.ftl Mon Aug 17 15:42:56 2009
@@ -23,12 +23,12 @@
   <#if topLine.dropDownList.size() gt 1>
   <#if topLine.hiddenFieldList?exists>
     <#list topLine.hiddenFieldList as field>
-	  <input type="hidden" name="${field.name}" value="${field.value}"/>
+      <input type="hidden" name="${field.name}" value="${field.value}"/>
     </#list>
   </#if>
   <select name="${topLine.selectionName?if_exists}" onChange="javascript:document.${topLine.action}.submit();">
     <#list topLine.dropDownList as option>
-	  <option <#if option.key == topLine.selectedKey >selected="selected"</#if> value="${option.key?if_exists}">${option.value?if_exists}</option>
+      <option <#if option.key == topLine.selectedKey >selected="selected"</#if> value="${option.key?if_exists}">${option.value?if_exists}</option>
     </#list>
   </select>
 <#else>

Modified: ofbiz/branches/executioncontext20090812/framework/common/webcommon/includes/lookup.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/common/webcommon/includes/lookup.ftl?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/common/webcommon/includes/lookup.ftl (original)
+++ ofbiz/branches/executioncontext20090812/framework/common/webcommon/includes/lookup.ftl Mon Aug 17 15:42:56 2009
@@ -31,6 +31,17 @@
     <script language="javascript" src="<@o...@ofbizContentUrl>" type="text/javascript"></script>
     <script language="javascript" src="<@o...@ofbizContentUrl>" type="text/javascript"></script>
     <script language="javascript" src="<@o...@ofbizContentUrl>" type="text/javascript"></script>
+    <#if layoutSettings.javaScripts?has_content>
+        <#--layoutSettings.javaScripts is a list of java scripts. -->
+        <#-- use a Set to make sure each javascript is declared only once, but iterate the list to maintain the correct order -->
+        <#assign javaScriptsSet = Static["org.ofbiz.base.util.UtilMisc"].toSet(layoutSettings.javaScripts)/>
+        <#list layoutSettings.javaScripts as javaScript>
+            <#if javaScriptsSet.contains(javaScript)>
+                <#assign nothing = javaScriptsSet.remove(javaScript)/>
+                <script src="<@o...@ofbizContentUrl>" type="text/javascript"></script>
+            </#if>
+        </#list>
+    </#if>
     <#if layoutSettings.styleSheets?has_content>
         <#list layoutSettings.styleSheets as styleSheet>
             <link rel="stylesheet" href="<@o...@ofbizContentUrl>" type="text/css"/>
@@ -86,15 +97,15 @@
             var thisForm = obj_caller.target.form;
             var evalString = "";
 
-    		if (arguments.length > 2 ) {
-        		for(var i=1; i < arguments.length; i=i+2) {
+            if (arguments.length > 2 ) {
+                for(var i=1; i < arguments.length; i=i+2) {
                     evalString = "setSourceColor(thisForm." + arguments[i] + ")";
                     eval(evalString);
-        			evalString = "thisForm." + arguments[i] + ".value='" + arguments[i+1] + "'";
-        			eval(evalString);
-        		}
-    		}
-    		window.close();
+                    evalString = "thisForm." + arguments[i] + ".value='" + arguments[i+1] + "'";
+                    eval(evalString);
+                }
+            }
+            window.close();
          }
     </script>
 </head>

Modified: ofbiz/branches/executioncontext20090812/framework/common/webcommon/portal/editPortalPage.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/common/webcommon/portal/editPortalPage.ftl?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/common/webcommon/portal/editPortalPage.ftl (original)
+++ ofbiz/branches/executioncontext20090812/framework/common/webcommon/portal/editPortalPage.ftl Mon Aug 17 15:42:56 2009
@@ -30,15 +30,15 @@
             <input name="portalPageId" value="${portalPage.portalPageId}" type="hidden"/>
             <input name="columnSeqId" value="${portalPageColumn.columnSeqId}" type="hidden"/>
             <input name="parentPortalPageId" value="${parameters.parentPortalPageId}" type="hidden"/>
-	        <select name="columnWidthPercentage" onchange="javascript:document.updatePortalPageColum_${portalPageColumn_index}.submit()">
-	          <option value="">${uiLabelMap.CommonSetColumnWidth}</option>
-	          <option <#if portalPageColumn.columnWidthPercentage?default(0) == 10> selected</#if> value="25">25%</option>
-	          <option <#if portalPageColumn.columnWidthPercentage?default(0) == 20> selected</#if> value="50">50%</option>
-	          <option <#if portalPageColumn.columnWidthPercentage?default(0) == 30> selected</#if> value="75">75%</option>
-	        </select>
-	       </form>
-	      </li>
-	    </ul>
+            <select name="columnWidthPercentage" onchange="javascript:document.updatePortalPageColum_${portalPageColumn_index}.submit()">
+              <option value="">${uiLabelMap.CommonSetColumnWidth}</option>
+              <option <#if portalPageColumn.columnWidthPercentage?default(0) == 10> selected</#if> value="25">25%</option>
+              <option <#if portalPageColumn.columnWidthPercentage?default(0) == 20> selected</#if> value="50">50%</option>
+              <option <#if portalPageColumn.columnWidthPercentage?default(0) == 30> selected</#if> value="75">75%</option>
+            </select>
+           </form>
+          </li>
+        </ul>
       </td>
       <#if portalPageColumn_has_next>
         <td>&nbsp;</td>

Modified: ofbiz/branches/executioncontext20090812/framework/common/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/common/widget/CommonScreens.xml?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/common/widget/CommonScreens.xml (original)
+++ ofbiz/branches/executioncontext20090812/framework/common/widget/CommonScreens.xml Mon Aug 17 15:42:56 2009
@@ -232,14 +232,14 @@
                     </widgets>
                     <fail-widgets>
                         <screenlet title="${title}" id="findScreenlet" collapsible="true" padded="false">
-	                        <container id="search-options">
-	                            <decorator-section-include name="search-options"/>
-	                        </container>
+                            <container id="search-options">
+                                <decorator-section-include name="search-options"/>
+                            </container>
                         </screenlet>
                         <screenlet>
-		                    <container id="search-results">
-		                        <decorator-section-include name="search-results"/>
-		                    </container>
+                            <container id="search-results">
+                                <decorator-section-include name="search-results"/>
+                            </container>
                         </screenlet>
                     </fail-widgets>
                 </section>

Modified: ofbiz/branches/executioncontext20090812/framework/common/widget/PortalPageForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/common/widget/PortalPageForms.xml?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/common/widget/PortalPageForms.xml (original)
+++ ofbiz/branches/executioncontext20090812/framework/common/widget/PortalPageForms.xml Mon Aug 17 15:42:56 2009
@@ -124,7 +124,7 @@
             </entity-and>
         </actions>
         <field name="portletName">
-            <hyperlink also-hidden="false" target="showHelp?helpTopic=PortLet${portalPortletId}" description="${portletName}" ></hyperlink>
+            <hyperlink also-hidden="false" target="showHelp?helpTopic=HELP_${portalPortletId}" description="${portletName}" ></hyperlink>
         </field>
         <field name="description"><display/></field>
     </form>

Modified: ofbiz/branches/executioncontext20090812/framework/entity/config/entityengine.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/entity/config/entityengine.xml?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/entity/config/entityengine.xml (original)
+++ ofbiz/branches/executioncontext20090812/framework/entity/config/entityengine.xml Mon Aug 17 15:42:56 2009
@@ -38,7 +38,7 @@
     </transaction-factory>
     -->
     <!--
-    	It is common to use UserTransaction for the TransactionManager, but if that doesn't work, try this: <transaction-manager-jndi jndi-server-name="default" jndi-name="java:comp/TransactionManager"/>
+        It is common to use UserTransaction for the TransactionManager, but if that doesn't work, try this: <transaction-manager-jndi jndi-server-name="default" jndi-name="java:comp/TransactionManager"/>
         Common UserTransaction locations:
             java:comp/UserTransaction (most servers: Resin, Orion, OC4J, etc)
             UserTransaction (RexIP)

Modified: ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/condition/EntityDateFilterCondition.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/condition/EntityDateFilterCondition.java?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/condition/EntityDateFilterCondition.java (original)
+++ ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/condition/EntityDateFilterCondition.java Mon Aug 17 15:42:56 2009
@@ -117,16 +117,16 @@
     public static EntityExpr makeCondition(Timestamp moment, String fromDateName, String thruDateName) {
         return EntityCondition.makeCondition(
             EntityCondition.makeCondition(
-                EntityCondition.makeCondition( thruDateName, EntityOperator.EQUALS, null ),
+                EntityCondition.makeCondition(thruDateName, EntityOperator.EQUALS, null),
                 EntityOperator.OR,
-                EntityCondition.makeCondition( thruDateName, EntityOperator.GREATER_THAN, moment )
-            ),
+                EntityCondition.makeCondition(thruDateName, EntityOperator.GREATER_THAN, moment)
+           ),
             EntityOperator.AND,
             EntityCondition.makeCondition(
-                EntityCondition.makeCondition( fromDateName, EntityOperator.EQUALS, null ),
+                EntityCondition.makeCondition(fromDateName, EntityOperator.EQUALS, null),
                 EntityOperator.OR,
-                EntityCondition.makeCondition( fromDateName, EntityOperator.LESS_THAN_EQUAL_TO, moment )
-            )
-       );
+                EntityCondition.makeCondition(fromDateName, EntityOperator.LESS_THAN_EQUAL_TO, moment)
+           )
+      );
     }
 }

Modified: ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/condition/EntityOperator.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/condition/EntityOperator.java?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/condition/EntityOperator.java (original)
+++ ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/condition/EntityOperator.java Mon Aug 17 15:42:56 2009
@@ -66,14 +66,14 @@
 
     public static EntityComparisonOperator lookupComparison(String name) {
         EntityOperator operator = lookup(name);
-        if ( !(operator instanceof EntityComparisonOperator ) )
+        if (!(operator instanceof EntityComparisonOperator))
             throw new IllegalArgumentException(name + " is not a comparison operator");
         return (EntityComparisonOperator)operator;
     }
 
     public static EntityJoinOperator lookupJoin(String name) {
         EntityOperator operator = lookup(name);
-        if ( !(operator instanceof EntityJoinOperator ) )
+        if (!(operator instanceof EntityJoinOperator))
             throw new IllegalArgumentException(name + " is not a join operator");
         return (EntityJoinOperator)operator;
     }
@@ -92,7 +92,7 @@
             }
         }
     };
-    static { register( "equals", EQUALS ); }
+    static { register("equals", EQUALS); }
     public static final EntityComparisonOperator NOT_EQUAL = new EntityComparisonOperator(ID_NOT_EQUAL, "<>") {
         @Override
         public boolean compare(Comparable lhs, Object rhs) { return EntityComparisonOperator.compareNotEqual(lhs, rhs); }
@@ -105,74 +105,74 @@
             }
         }
     };
-    static { register( "not-equal", NOT_EQUAL ); }
-    static { register( "not-equals", NOT_EQUAL ); }
-    static { register( "notEqual", NOT_EQUAL ); }
+    static { register("not-equal", NOT_EQUAL); }
+    static { register("not-equals", NOT_EQUAL); }
+    static { register("notEqual", NOT_EQUAL); }
     public static final EntityComparisonOperator LESS_THAN = new EntityComparisonOperator(ID_LESS_THAN, "<") {
         @Override
         public <T> boolean compare(Comparable<T> lhs, T rhs) { return EntityComparisonOperator.compareLessThan(lhs, rhs); }
     };
-    static { register( "less", LESS_THAN ); }
-    static { register( "less-than", LESS_THAN ); }
-    static { register( "lessThan", LESS_THAN ); }
+    static { register("less", LESS_THAN); }
+    static { register("less-than", LESS_THAN); }
+    static { register("lessThan", LESS_THAN); }
     public static final EntityComparisonOperator GREATER_THAN = new EntityComparisonOperator(ID_GREATER_THAN, ">") {
         @Override
         public <T> boolean compare(Comparable<T> lhs, T rhs) { return EntityComparisonOperator.compareGreaterThan(lhs, rhs); }
     };
-    static { register( "greater", GREATER_THAN ); }
-    static { register( "greater-than", GREATER_THAN ); }
-    static { register( "greaterThan", GREATER_THAN ); }
+    static { register("greater", GREATER_THAN); }
+    static { register("greater-than", GREATER_THAN); }
+    static { register("greaterThan", GREATER_THAN); }
     public static final EntityComparisonOperator LESS_THAN_EQUAL_TO = new EntityComparisonOperator(ID_LESS_THAN_EQUAL_TO, "<=") {
         @Override
         public <T> boolean compare(Comparable<T> lhs, T rhs) { return EntityComparisonOperator.compareLessThanEqualTo(lhs, rhs); }
     };
-    static { register( "less-equals", LESS_THAN_EQUAL_TO ); }
-    static { register( "less-than-equal-to", LESS_THAN_EQUAL_TO ); }
-    static { register( "lessThanEqualTo", LESS_THAN_EQUAL_TO ); }
+    static { register("less-equals", LESS_THAN_EQUAL_TO); }
+    static { register("less-than-equal-to", LESS_THAN_EQUAL_TO); }
+    static { register("lessThanEqualTo", LESS_THAN_EQUAL_TO); }
     public static final EntityComparisonOperator GREATER_THAN_EQUAL_TO = new EntityComparisonOperator(ID_GREATER_THAN_EQUAL_TO, ">=") {
         @Override
         public <T> boolean compare(Comparable<T> lhs, T rhs) { return EntityComparisonOperator.compareGreaterThanEqualTo(lhs, rhs); }
     };
-    static { register( "greater-equals", GREATER_THAN_EQUAL_TO ); }
-    static { register( "greater-than-equal-to", GREATER_THAN_EQUAL_TO ); }
-    static { register( "greaterThanEqualTo", GREATER_THAN_EQUAL_TO ); }
+    static { register("greater-equals", GREATER_THAN_EQUAL_TO); }
+    static { register("greater-than-equal-to", GREATER_THAN_EQUAL_TO); }
+    static { register("greaterThanEqualTo", GREATER_THAN_EQUAL_TO); }
     public static final EntityComparisonOperator IN = new EntityComparisonOperator(ID_IN, "IN") {
         @Override
         public <T> boolean compare(Comparable<T> lhs, T rhs) { return EntityComparisonOperator.compareIn(lhs, rhs); }
         @Override
         protected void makeRHSWhereStringValue(ModelEntity entity, List<EntityConditionParam> entityConditionParams, StringBuilder sb, ModelField field, Object rhs, DatasourceInfo datasourceInfo) { appendRHSList(entityConditionParams, sb, field, rhs); }
     };
-    static { register( "in", IN ); }
+    static { register("in", IN); }
     public static final EntityComparisonOperator BETWEEN = new EntityComparisonOperator(ID_BETWEEN, "BETWEEN") {
         @Override
         public <T> boolean compare(Comparable<T> lhs, T rhs) { return EntityComparisonOperator.compareIn(lhs, rhs); }
         @Override
         protected void makeRHSWhereStringValue(ModelEntity entity, List<EntityConditionParam> entityConditionParams, StringBuilder sb, ModelField field, Object rhs, DatasourceInfo datasourceInfo) { appendRHSBetweenList(entityConditionParams, sb, field, rhs); }
     };
-    static { register( "between", BETWEEN ); }
+    static { register("between", BETWEEN); }
     public static final EntityComparisonOperator NOT = new EntityComparisonOperator(ID_NOT, "NOT");
-    static { register( "not", NOT ); }
+    static { register("not", NOT); }
     public static final EntityJoinOperator AND = new EntityJoinOperator(ID_AND, "AND", false);
-    static { register( "and", AND ); }
+    static { register("and", AND); }
     public static final EntityJoinOperator OR = new EntityJoinOperator(ID_OR, "OR", true);
-    static { register( "or", OR ); }
+    static { register("or", OR); }
     public static final EntityComparisonOperator LIKE = new EntityComparisonOperator(ID_LIKE, "LIKE") {
         @Override
         public boolean compare(Comparable lhs, Object rhs) { return EntityComparisonOperator.compareLike(lhs, rhs); }
     };
-    static { register( "like", LIKE ); }
+    static { register("like", LIKE); }
     public static final EntityComparisonOperator NOT_LIKE = new EntityComparisonOperator(ID_NOT_LIKE, "NOT LIKE") {
         @Override
         public <T> boolean compare(Comparable<T> lhs, T rhs) { return !EntityComparisonOperator.compareLike(lhs, rhs); }
     };
-    static { register( "not-like", NOT_LIKE); }
+    static { register("not-like", NOT_LIKE); }
     public static final EntityComparisonOperator NOT_IN = new EntityComparisonOperator(ID_NOT_IN, "NOT IN") {
         @Override
         public <T> boolean compare(Comparable<T> lhs, T rhs) { return !EntityComparisonOperator.compareIn(lhs, rhs); }
         @Override
         protected void makeRHSWhereStringValue(ModelEntity entity, List<EntityConditionParam> entityConditionParams, StringBuilder sb, ModelField field, Object rhs, DatasourceInfo datasourceInfo) { appendRHSList(entityConditionParams, sb, field, rhs); }
     };
-    static { register( "not-in", NOT_IN ); }
+    static { register("not-in", NOT_IN); }
 
     protected int idInt;
     protected String codeString;

Modified: ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/finder/EntityFinderUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/finder/EntityFinderUtil.java?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/finder/EntityFinderUtil.java (original)
+++ ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/finder/EntityFinderUtil.java Mon Aug 17 15:42:56 2009
@@ -211,7 +211,7 @@
                 }
             }
             
-            if(modelEntity.getField(fieldName) == null) {
+            if (modelEntity.getField(fieldName) == null) {
                 throw new IllegalArgumentException("Error in Entity Find: could not find field [" + fieldName + "] in entity with name [" + modelEntity.getEntityName() + "]");
             }
 

Modified: ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/jdbc/SqlJdbcUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/jdbc/SqlJdbcUtil.java?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/jdbc/SqlJdbcUtil.java (original)
+++ ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/jdbc/SqlJdbcUtil.java Mon Aug 17 15:42:56 2009
@@ -902,14 +902,14 @@
 
     public static void addValue(StringBuilder buffer, ModelField field, Object value, List<EntityConditionParam> params) {
         if (value instanceof Collection) {
-            buffer.append("( ");
+            buffer.append("(");
             Iterator<Object> it = UtilGenerics.checkCollection(value).iterator();
             while (it.hasNext()) {
                 Object thisValue = it.next();
                 addValueSingle(buffer, field, thisValue, params);
                 if (it.hasNext()) buffer.append(", ");
             }
-            buffer.append(" )");
+            buffer.append(")");
         } else {
             addValueSingle(buffer, field, value, params);
         }

Modified: ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java (original)
+++ ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java Mon Aug 17 15:42:56 2009
@@ -158,7 +158,7 @@
             GenericValue testing = delegator.makeValue("Testing",
                             "testingId", delegator.getNextSeqId("Testing"),
                             "testingTypeId", "TEST-1"
-                    );
+                   );
             testing.put("testingName", "leaf-#" + node.getString("testingNodeId"));
             testing.put("description", "level1 leaf");
             testing.put("comments", "No-comments");
@@ -169,7 +169,7 @@
             GenericValue member = delegator.makeValue("TestingNodeMember",
                             "testingNodeId", node.get("testingNodeId"),
                             "testingId", testing.get("testingId")
-                    );
+                   );
 
             member.put("fromDate", now);
             member.put("thruDate", UtilDateTime.getNextDayStart(now));

Modified: ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/transaction/TransactionUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/transaction/TransactionUtil.java?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/transaction/TransactionUtil.java (original)
+++ ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/transaction/TransactionUtil.java Mon Aug 17 15:42:56 2009
@@ -366,7 +366,7 @@
         if (parentTx == null) return;
         try {
             TransactionManager txMgr = TransactionFactory.getTransactionManager();
-            if (txMgr != null ) {
+            if (txMgr != null) {
                 setTransactionBeginStack(popTransactionBeginStackSave());
                 setSetRollbackOnlyCause(popSetRollbackOnlyCauseSave());
                 txMgr.resume(parentTx);

Modified: ofbiz/branches/executioncontext20090812/framework/entityext/src/org/ofbiz/entityext/eca/EntityEcaUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/entityext/src/org/ofbiz/entityext/eca/EntityEcaUtil.java?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/entityext/src/org/ofbiz/entityext/eca/EntityEcaUtil.java (original)
+++ ofbiz/branches/executioncontext20090812/framework/entityext/src/org/ofbiz/entityext/eca/EntityEcaUtil.java Mon Aug 17 15:42:56 2009
@@ -125,7 +125,7 @@
             numDefs++;
         }
         try {
-        	Debug.logImportant("Loaded [" + numDefs + "] Entity ECA definitions from " + handler.getFullLocation() + " in loader " + handler.getLoaderName(), module);
+            Debug.logImportant("Loaded [" + numDefs + "] Entity ECA definitions from " + handler.getFullLocation() + " in loader " + handler.getLoaderName(), module);
         } catch (GenericConfigException e) {
             Debug.logError(e, module);
             return;

Modified: ofbiz/branches/executioncontext20090812/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java (original)
+++ ofbiz/branches/executioncontext20090812/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java Mon Aug 17 15:42:56 2009
@@ -196,7 +196,7 @@
             return results;
         }
         try {
-            boolean check  = checkPermissionMethod( delegator, userLogin, targetOperations, "Content", entityIds, passedPurposes, null, privilegeEnumId);
+            boolean check  = checkPermissionMethod(delegator, userLogin, targetOperations, "Content", entityIds, passedPurposes, null, privilegeEnumId);
             if (check) {
                 results.put("permissionStatus", "granted");
             } else {
@@ -223,7 +223,7 @@
         if (!(targetOperationList == null) && userLoginId != null) {
             hasRoleOperation = checkHasRoleOperations(partyId, targetOperationList, delegator);
         }
-        if ( hasRoleOperation ) {
+        if (hasRoleOperation) {
             return true;
         }
         ModelEntity modelEntity = delegator.getModelEntity(entityName);
@@ -277,7 +277,7 @@
         if (hasPrivilegeOp && hasPrivilegeField) {
             int privilegeEnumSeq = -1;
 
-            if ( UtilValidate.isNotEmpty(privilegeEnumId)) {
+            if (UtilValidate.isNotEmpty(privilegeEnumId)) {
                 GenericValue privEnum = delegator.findByPrimaryKeyCache("Enumeration", UtilMisc.toMap("enumId", privilegeEnumId));
                 if (privEnum != null) {
                     String sequenceId = privEnum.getString("sequenceId");
@@ -382,7 +382,7 @@
             if (entity == null) continue;
             String entityId = entity.getString(pkFieldName);
             List<String> tmpPurposeList = purposes.get(entityId);
-            if (purposeList != null ) {
+            if (purposeList != null) {
                 if (tmpPurposeList != null) {
                     purposeList.addAll(tmpPurposeList);
                 }
@@ -391,7 +391,7 @@
             }
 
             List<String> tmpRoleList = getUserRoles(entity, userLogin, delegator);
-            if (roleList != null ) {
+            if (roleList != null) {
                 if (tmpRoleList != null) {
                     roleList.addAll(tmpRoleList);
                 }
@@ -504,7 +504,7 @@
 
         boolean checkAncestors = false;
         boolean hasRoleOperation =  checkHasRoleOperations(partyId, permissionConditionGetter, delegator);
-        if ( hasRoleOperation ) {
+        if (hasRoleOperation) {
             return true;
         }
         ModelEntity modelEntity = delegator.getModelEntity(entityName);
@@ -674,7 +674,7 @@
     public static boolean hasMatch(String entityName, List<GenericValue> targetOperations, List<String> roles, boolean hasPurposeOp, List<String> purposes, boolean hasStatusOp, String targStatusId) {
         boolean isMatch = false;
         int targPrivilegeSeq = 0;
-    //    if (UtilValidate.isNotEmpty(targPrivilegeEnumId) && !targPrivilegeEnumId.equals("_NA_") && !targPrivilegeEnumId.equals("_00_") ) {
+    //    if (UtilValidate.isNotEmpty(targPrivilegeEnumId) && !targPrivilegeEnumId.equals("_NA_") && !targPrivilegeEnumId.equals("_00_")) {
             // need to do a lookup here to find the seq value of targPrivilegeEnumId.
             // The lookup could be a static store or it could be done on Enumeration entity.
     //    }
@@ -692,10 +692,10 @@
                 //testPrivilegeEnumId = (String)targetOp.get("privilegeEnumId");
             //int testPrivilegeSeq = 0;
 
-            boolean purposesCond = ( !hasPurposeOp || (purposes != null && purposes.contains(testContentPurposeTypeId) ) || testContentPurposeTypeId.equals("_NA_") );
-            boolean statusCond = ( !hasStatusOp || testStatusId.equals("_NA_") || (targStatusId != null && targStatusId.equals(testStatusId) ) );
-            //boolean privilegeCond = ( !hasPrivilegeOp || testPrivilegeEnumId.equals("_NA_") || testPrivilegeSeq <= targPrivilegeSeq || testPrivilegeEnumId.equals(targPrivilegeEnumId) );
-            boolean roleCond = ( testRoleTypeId.equals("_NA_") || (roles != null && roles.contains(testRoleTypeId) ) );
+            boolean purposesCond = (!hasPurposeOp || (purposes != null && purposes.contains(testContentPurposeTypeId)) || testContentPurposeTypeId.equals("_NA_"));
+            boolean statusCond = (!hasStatusOp || testStatusId.equals("_NA_") || (targStatusId != null && targStatusId.equals(testStatusId)));
+            //boolean privilegeCond = (!hasPrivilegeOp || testPrivilegeEnumId.equals("_NA_") || testPrivilegeSeq <= targPrivilegeSeq || testPrivilegeEnumId.equals(targPrivilegeEnumId));
+            boolean roleCond = (testRoleTypeId.equals("_NA_") || (roles != null && roles.contains(testRoleTypeId)));
 
 
             if (purposesCond && statusCond && roleCond) {
@@ -743,14 +743,14 @@
         }
             if (Debug.verboseOn()) Debug.logVerbose("STATUS:" + targStatusId, module);
 
-        while (permissionConditionGetter.getNext() ) {
+        while (permissionConditionGetter.getNext()) {
             String roleConditionId = permissionConditionGetter.getRoleValue();
             String auxiliaryConditionId = permissionConditionGetter.getAuxiliaryValue();
             String statusConditionId = permissionConditionGetter.getStatusValue();
 
-            boolean auxiliaryCond = ( auxiliaryConditionId == null ||  auxiliaryConditionId.equals("_NA_") || (auxiliaryValueList != null && auxiliaryValueList.contains(auxiliaryConditionId) )  );
-            boolean statusCond = ( statusConditionId == null || statusConditionId.equals("_NA_") || (targStatusId != null && targStatusId.equals(statusConditionId) ) );
-            boolean roleCond = ( roleConditionId == null || roleConditionId.equals("_NA_") || (roleValueList != null && roleValueList.contains(roleConditionId) ) );
+            boolean auxiliaryCond = (auxiliaryConditionId == null ||  auxiliaryConditionId.equals("_NA_") || (auxiliaryValueList != null && auxiliaryValueList.contains(auxiliaryConditionId)) );
+            boolean statusCond = (statusConditionId == null || statusConditionId.equals("_NA_") || (targStatusId != null && targStatusId.equals(statusConditionId)));
+            boolean roleCond = (roleConditionId == null || roleConditionId.equals("_NA_") || (roleValueList != null && roleValueList.contains(roleConditionId)));
 
             if (auxiliaryCond && statusCond && roleCond) {
                 if (Debug.verboseOn()) Debug.logVerbose("MATCHED: role:" + roleConditionId + " status:" + statusConditionId + " aux:" + auxiliaryConditionId, module);
@@ -770,10 +770,10 @@
 
         List<String> purposeIds = null;
         if (passedPurposes == null) {
-            purposeIds = FastList.newInstance( );
+            purposeIds = FastList.newInstance();
         } else {
-            purposeIds = FastList.newInstance( );
-            purposeIds.addAll( passedPurposes );
+            purposeIds = FastList.newInstance();
+            purposeIds.addAll(passedPurposes);
         }
 
         String entityName = entity.getEntityName();
@@ -811,7 +811,7 @@
 
 
         roles.remove("OWNER"); // always test with the owner of the current content
-        if ( entity.get("createdByUserLogin") != null && userLogin != null) {
+        if (entity.get("createdByUserLogin") != null && userLogin != null) {
             String userLoginId = (String)userLogin.get("userLoginId");
             String userLoginIdCB = (String)entity.get("createdByUserLogin");
             //if (Debug.infoOn()) Debug.logInfo("userLoginId:" + userLoginId + ": userLoginIdCB:" + userLoginIdCB + ":", null);
@@ -825,7 +825,7 @@
         List<GenericValue> relatedRoles = null;
         List<GenericValue> tmpRelatedRoles = entity.getRelatedCache(entityName + "Role");
         relatedRoles = EntityUtil.filterByDate(tmpRelatedRoles);
-        if (relatedRoles != null ) {
+        if (relatedRoles != null) {
             for (GenericValue contentRole: relatedRoles) {
                 String roleTypeId = (String)contentRole.get("roleTypeId");
                 String targPartyId = (String)contentRole.get("partyId");
@@ -840,13 +840,13 @@
                     try {
                         party = contentRole.getRelatedOne("Party");
                         partyTypeId = (String)party.get("partyTypeId");
-                        if ( partyTypeId != null && partyTypeId.equals("PARTY_GROUP") ) {
+                        if (partyTypeId != null && partyTypeId.equals("PARTY_GROUP")) {
                            Map<String, Object> map = FastMap.newInstance();
 
                            // At some point from/thru date will need to be added
                            map.put("partyIdFrom", partyId);
                            map.put("partyIdTo", targPartyId);
-                           if ( isGroupMember( map, delegator ) ) {
+                           if (isGroupMember(map, delegator)) {
                                if (!roles.contains(roleTypeId))
                                    roles.add(roleTypeId);
                            }
@@ -864,7 +864,7 @@
     /**
      * Tests to see if the user belongs to a group
      */
-    public static boolean isGroupMember( Map<String, ?> partyRelationshipValues, GenericDelegator delegator ) {
+    public static boolean isGroupMember(Map<String, ?> partyRelationshipValues, GenericDelegator delegator) {
         boolean isMember = false;
         String partyIdFrom = (String)partyRelationshipValues.get("partyIdFrom") ;
         String partyIdTo = (String)partyRelationshipValues.get("partyIdTo") ;
@@ -873,16 +873,16 @@
         Timestamp fromDate = UtilDateTime.nowTimestamp();
         Timestamp thruDate = UtilDateTime.getDayStart(UtilDateTime.nowTimestamp(), 1);
 
-        if (partyRelationshipValues.get("roleTypeIdFrom") != null ) {
+        if (partyRelationshipValues.get("roleTypeIdFrom") != null) {
             roleTypeIdFrom = (String)partyRelationshipValues.get("roleTypeIdFrom") ;
         }
-        if (partyRelationshipValues.get("roleTypeIdTo") != null ) {
+        if (partyRelationshipValues.get("roleTypeIdTo") != null) {
             roleTypeIdTo = (String)partyRelationshipValues.get("roleTypeIdTo") ;
         }
-        if (partyRelationshipValues.get("fromDate") != null ) {
+        if (partyRelationshipValues.get("fromDate") != null) {
             fromDate = (Timestamp)partyRelationshipValues.get("fromDate") ;
         }
-        if (partyRelationshipValues.get("thruDate") != null ) {
+        if (partyRelationshipValues.get("thruDate") != null) {
             thruDate = (Timestamp)partyRelationshipValues.get("thruDate") ;
         }
 
@@ -898,7 +898,7 @@
 
         // This method is simplified to make it work, these conditions need to be added back in.
         //List joinList = UtilMisc.toList(fromExpr, thruCond, partyFromExpr, partyToExpr, relationExpr);
-        List<? extends EntityCondition> joinList = UtilMisc.toList( partyFromExpr, partyToExpr);
+        List<? extends EntityCondition> joinList = UtilMisc.toList(partyFromExpr, partyToExpr);
         EntityCondition condition = EntityCondition.makeCondition(joinList);
 
         List<GenericValue> partyRelationships = null;
@@ -956,7 +956,7 @@
             this.entityName = "ContentPurposeOperation";
         }
 
-        public StdPermissionConditionGetter ( String entityName, String operationFieldName, String roleFieldName, String statusFieldName, String auxiliaryFieldName, String privilegeFieldName) {
+        public StdPermissionConditionGetter (String entityName, String operationFieldName, String roleFieldName, String statusFieldName, String auxiliaryFieldName, String privilegeFieldName) {
 
             this.operationFieldName = operationFieldName;
             this.roleFieldName = roleFieldName ;
@@ -966,7 +966,7 @@
             this.entityName = entityName;
         }
 
-        public StdPermissionConditionGetter ( Element getterElement) {
+        public StdPermissionConditionGetter (Element getterElement) {
             this.operationFieldName = getterElement.getAttribute("operation-field-name");
             this.roleFieldName = getterElement.getAttribute("role-field-name");
             this.statusFieldName = getterElement.getAttribute("status-field-name");
@@ -1003,7 +1003,7 @@
             if (UtilValidate.isNotEmpty(privilegeFieldName)) {
                 privilegeEnumId = currentValue.getString(this.privilegeFieldName);
             }
-            if ( UtilValidate.isNotEmpty(privilegeEnumId)) {
+            if (UtilValidate.isNotEmpty(privilegeEnumId)) {
                 GenericValue privEnum = delegator.findByPrimaryKeyCache("Enumeration", UtilMisc.toMap("enumId", privilegeEnumId));
                 if (privEnum != null) {
                     String sequenceId = privEnum.getString("sequenceId");
@@ -1042,7 +1042,7 @@
             this.entityList = FastList.newInstance();
         }
 
-        public void init( GenericDelegator delegator) throws GenericEntityException {
+        public void init(GenericDelegator delegator) throws GenericEntityException {
             EntityCondition opCond = EntityCondition.makeCondition(operationFieldName, EntityOperator.IN, this.operationList);
             this.entityList = delegator.findList(this.entityName, opCond, null, null, null, true);
         }
@@ -1148,14 +1148,14 @@
             this.entityIdName = "contentId";
         }
 
-        public StdAuxiliaryValueGetter ( String entityName,  String auxiliaryFieldName, String entityIdName) {
+        public StdAuxiliaryValueGetter (String entityName,  String auxiliaryFieldName, String entityIdName) {
 
             this.auxiliaryFieldName = auxiliaryFieldName ;
             this.entityName = entityName;
             this.entityIdName = entityIdName;
         }
 
-        public StdAuxiliaryValueGetter ( Element getterElement) {
+        public StdAuxiliaryValueGetter (Element getterElement) {
 
             this.auxiliaryFieldName = getterElement.getAttribute("auxiliary-field-name");
             this.entityName = getterElement.getAttribute("entity-name");
@@ -1231,7 +1231,7 @@
             this.roleEntityIdName = "contentId";
         }
 
-        public StdRelatedRoleGetter ( String entityName,  String roleTypeFieldName, String roleEntityIdName, String partyFieldName, String ownerEntityFieldName, String roleEntityName) {
+        public StdRelatedRoleGetter (String entityName,  String roleTypeFieldName, String roleEntityIdName, String partyFieldName, String ownerEntityFieldName, String roleEntityName) {
 
             this.roleTypeFieldName = roleTypeFieldName ;
             this.partyFieldName = partyFieldName ;
@@ -1241,7 +1241,7 @@
             this.roleEntityIdName = roleEntityIdName;
         }
 
-        public StdRelatedRoleGetter ( Element getterElement) {
+        public StdRelatedRoleGetter (Element getterElement) {
 
             this.roleTypeFieldName = getterElement.getAttribute("role-type-field-name");
             this.partyFieldName = getterElement.getAttribute("party-field-name");
@@ -1283,7 +1283,7 @@
            }
         }
 
-        public boolean isOwner( GenericValue entity, String targetPartyId) {
+        public boolean isOwner(GenericValue entity, String targetPartyId) {
             boolean isOwner = false;
             if (entity == null || targetPartyId == null) {
                 return false;
@@ -1293,10 +1293,10 @@
             if (modelEntity.getField("createdByUserLogin") == null) {
                 return false;
             }
-            if ( entity.get("createdByUserLogin") != null) {
+            if (entity.get("createdByUserLogin") != null) {
                 String userLoginIdCB = (String)entity.get("createdByUserLogin");
                 try {
-                    GenericValue userLogin = delegator.findByPrimaryKeyCache("UserLogin", UtilMisc.toMap("userLoginId", userLoginIdCB ));
+                    GenericValue userLogin = delegator.findByPrimaryKeyCache("UserLogin", UtilMisc.toMap("userLoginId", userLoginIdCB));
                     if (userLogin != null) {
                         String partyIdCB = userLogin.getString("partyId");
                         if (partyIdCB != null) {
@@ -1351,7 +1351,7 @@
             String pkFieldName = modelEntity.getFirstPkFieldName();
             GenericValue ownerContent = delegator.findByPrimaryKeyCache(entityName, UtilMisc.toMap(pkFieldName, ownerContentId));
             if (ownerContent != null) {
-                getEntityOwners(delegator, ownerContent, contentOwnerList, entityName, ownerIdFieldName );
+                getEntityOwners(delegator, ownerContent, contentOwnerList, entityName, ownerIdFieldName);
             }
         }
 
@@ -1360,7 +1360,7 @@
     public static int getPrivilegeEnumSeq(GenericDelegator delegator, String privilegeEnumId) throws GenericEntityException {
         int privilegeEnumSeq = -1;
 
-        if ( UtilValidate.isNotEmpty(privilegeEnumId)) {
+        if (UtilValidate.isNotEmpty(privilegeEnumId)) {
             GenericValue privEnum = delegator.findByPrimaryKeyCache("Enumeration", UtilMisc.toMap("enumId", privilegeEnumId));
             if (privEnum != null) {
                 String sequenceId = privEnum.getString("sequenceId");

Modified: ofbiz/branches/executioncontext20090812/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncServices.java?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncServices.java (original)
+++ ofbiz/branches/executioncontext20090812/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncServices.java Mon Aug 17 15:42:56 2009
@@ -435,7 +435,7 @@
             }
 
             // if no more results from database to return, save final settings
-            if (!esc.hasMoreTimeToSync() ) {
+            if (!esc.hasMoreTimeToSync()) {
                 esc.saveFinalSyncResults();
             }
         } catch (SyncAbortException e) {

Modified: ofbiz/branches/executioncontext20090812/framework/example/webapp/appheader.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/example/webapp/appheader.ftl?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/example/webapp/appheader.ftl (original)
+++ ofbiz/branches/executioncontext20090812/framework/example/webapp/appheader.ftl Mon Aug 17 15:42:56 2009
@@ -29,11 +29,11 @@
         <li <#if selected = "${uiLabelMap.ExampleFormWidgetExamples}"> class="selected"</#if>><a href="<@o...@ofbizUrl>">${uiLabelMap.ExampleFormWidgetExamples}</a></li>
         <li <#if selected = "${uiLabelMap.ExampleAjaxExamples}"> class="selected"</#if>><a href="<@o...@ofbizUrl>">${uiLabelMap.ExampleAjaxExamples}</a></li>
         <#if portalPages?has_content>
-        	<#list portalPages as page>
-        	  <#if page.portalPageName?has_content>
-            	<li<#if selected = "${page.portalPageId}"> class="selected"</#if>><a href="<@o...@ofbizUrl>"><#if page.portalPageName?exists>${page.portalPageName}<#else>?</#if></a></li>
+            <#list portalPages as page>
+              <#if page.portalPageName?has_content>
+                <li<#if selected = "${page.portalPageId}"> class="selected"</#if>><a href="<@o...@ofbizUrl>"><#if page.portalPageName?exists>${page.portalPageName}<#else>?</#if></a></li>
               </#if>
-        	</#list>
+            </#list>
         </#if>
         <li class="opposed"><a href="<@o...@ofbizUrl>">${uiLabelMap.CommonDashboard}</a></li>
       </#if>

Modified: ofbiz/branches/executioncontext20090812/framework/example/webapp/example/reports/fonts.fo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/example/webapp/example/reports/fonts.fo.ftl?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/example/webapp/example/reports/fonts.fo.ftl (original)
+++ ofbiz/branches/executioncontext20090812/framework/example/webapp/example/reports/fonts.fo.ftl Mon Aug 17 15:42:56 2009
@@ -29,8 +29,8 @@
 
    <fo:page-sequence master-reference="portrait" initial-page-number="1">
      <fo:flow flow-name="xsl-region-body">
-	<fo:block text-align="center">Font samples</fo:block>
-	<fo:block></fo:block>
+    <fo:block text-align="center">Font samples</fo:block>
+    <fo:block></fo:block>
         <fo:block color="red">Helvetica</fo:block>
         <fo:block font-family="Helvetica" font-style="normal" font-weight="normal">the quick brown fox jumps over the lazy dog 1234657890</fo:block>
         <fo:block font-family="Helvetica" font-style="normal" font-weight="bold">the quick brown fox jumps over the lazy dog 1234657890</fo:block>

Modified: ofbiz/branches/executioncontext20090812/framework/guiapp/src/org/ofbiz/guiapp/xui/XuiContainer.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/guiapp/src/org/ofbiz/guiapp/xui/XuiContainer.java?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/guiapp/src/org/ofbiz/guiapp/xui/XuiContainer.java (original)
+++ ofbiz/branches/executioncontext20090812/framework/guiapp/src/org/ofbiz/guiapp/xui/XuiContainer.java Mon Aug 17 15:42:56 2009
@@ -145,7 +145,7 @@
                 suffix = "_" + suffix;
             }
             String language = UtilProperties.getPropertyValue(startupProperties, "Language");
-            if (language.compareTo("XuiLabels" + suffix ) != 0) {
+            if (language.compareTo("XuiLabels" + suffix) != 0) {
                 UtilProperties.setPropertyValue(startupProperties, "Language", "XuiLabels" + suffix);
             }
             frame.setVisible(true);

Modified: ofbiz/branches/executioncontext20090812/framework/minilang/src/org/ofbiz/minilang/method/callops/CallService.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/minilang/src/org/ofbiz/minilang/method/callops/CallService.java?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/minilang/src/org/ofbiz/minilang/method/callops/CallService.java (original)
+++ ofbiz/branches/executioncontext20090812/framework/minilang/src/org/ofbiz/minilang/method/callops/CallService.java Mon Aug 17 15:42:56 2009
@@ -322,7 +322,7 @@
                 methodContext.putEnv(simpleMethod.getEventErrorMessageName(), errorMessage);
             } else if (methodContext.getMethodType() == MethodContext.SERVICE) {
                 ServiceUtil.addErrors(UtilMisc.<String, String>getListFromMap(methodContext.getEnvMap(), this.simpleMethod.getServiceErrorMessageListName()), 
-                		UtilMisc.<String, String, Object>getMapFromMap(methodContext.getEnvMap(), this.simpleMethod.getServiceErrorMessageMapName()), result);
+                        UtilMisc.<String, String, Object>getMapFromMap(methodContext.getEnvMap(), this.simpleMethod.getServiceErrorMessageMapName()), result);
                 // the old way, makes a mess of messages passed up the stack: methodContext.putEnv(simpleMethod.getServiceErrorMessageName(), errorMessage);
                 Debug.logError(new Exception(errorMessage), module);
             }

Modified: ofbiz/branches/executioncontext20090812/framework/resources/templates/build.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/resources/templates/build.xml?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/resources/templates/build.xml (original)
+++ ofbiz/branches/executioncontext20090812/framework/resources/templates/build.xml Mon Aug 17 15:42:56 2009
@@ -9,7 +9,7 @@
 
     <property environment="env"/>
     <property name="desc" value="@component-resource-name@ Component"/>
-	<property name="name" value="ofbiz-@component-name@"/>
+    <property name="name" value="ofbiz-@component-name@"/>
     <property name="component-name" value="ofbiz-@component-name@"/>
     <property name="ofbiz.home.dir" value="../.."/>
     <property name="src.dir" value="src"/>

Modified: ofbiz/branches/executioncontext20090812/framework/security/src/org/ofbiz/security/authz/AbstractAuthorization.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/security/src/org/ofbiz/security/authz/AbstractAuthorization.java?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/security/src/org/ofbiz/security/authz/AbstractAuthorization.java (original)
+++ ofbiz/branches/executioncontext20090812/framework/security/src/org/ofbiz/security/authz/AbstractAuthorization.java Mon Aug 17 15:42:56 2009
@@ -31,91 +31,91 @@
 import org.ofbiz.base.util.string.FlexibleStringExpander;
 
 public abstract class AbstractAuthorization implements Authorization {
-	
+    
     private static final String module = AbstractAuthorization.class.getName();
     
-	/**
-	 * Used to manage Auto-Grant permissions for the current "request"
-	 */
-	private static ThreadLocal<List<String>> autoGrant = new ThreadLocal<List<String>>();
-	private static ThreadLocal<String> origPermission = new ThreadLocal<String>();
-	private static ThreadLocal<String> uid = new ThreadLocal<String>();
-	
-	private static final String[] basePermissions = { "access", "create", "read", "update", "delete" };
-	
-	/**
-	 * Checks to see if the user has a static permission
-	 * 
-	 * @param userId the user's userId
-	 * @param permission the expanded permission string
-	 * @param context name/value pairs used for permission lookup
-	 * @return true if the user has permission
-	 */
-	public abstract boolean hasStaticPermission(String userId, String permission, Map<String, ? extends Object> context);
-	
-	/**
-	 * Locates the Dynamic Access implementation for the permissions and invokes it
-	 * 
-	 * @param userId the user's userId
-	 * @param permission the expanded permission string
-	 * @param context name/value pairs used for permission lookup
-	 * @return true if the user has permission
-	 */
-	public abstract boolean hasDynamicPermission(String userId, String permission, Map<String, ? extends Object> context);
-	
-	/**
-	 * Obtains a list of permissions auto-granted by the given permission
-	 * 
-	 * @param userId the user's userId
-	 * @param permission the expanded permission string
-	 * @param context name/value pairs used for permission lookup
-	 * @return a List of permission strings to auto-grant the user
-	 */
-	public abstract List<String> getAutoGrantPermissions(String userId, String permission, Map<String, ? extends Object> context);
-	
-	/**
-	 * Takes a regular expression (permissionRegexp) and evaluates it against base permissions and returns permission
-	 * values for each match.
-	 * Example 1: ".*:example" will return values for access:example, create:example, read:example, update:example and delete:example
-	 * Example 2: "(access|read):example:${exampleId} will return values for access:example:${exampleId} and read:example:${exampleId} 
-	 *  
-	 * NOTE: the regular expression can only be part of the base permission (before the first colon)
-	 * 
-	 * @param userId the user's userId
-	 * @param permissionRegexp permission string containing regexp in the base position	
-	 * @param expanded  true if the permission string is already expanded, false if it will contain ${} context values
-	 * @return
-	 */
-	public Map<String, Boolean> findMatchingPermission(String userId, String permissionRegexp, Map<String, ? extends Object> context) {
-	    Map<String, Boolean> resultMap = FastMap.newInstance();
-	    
-	    String regexp = permissionRegexp.substring(0, permissionRegexp.indexOf(":"));
-	    String permStr = permissionRegexp.substring(permissionRegexp.indexOf(":"));
-	    
-	    Pattern p = Pattern.compile("^" + regexp + ":.*$");
-	    for (String base : basePermissions) {
-	        Matcher m = p.matcher(base + permStr);
-	        if (m.find()) {
-	            String permission = m.group();
-	            resultMap.put(permission, hasPermission(userId, permission, context));
-	        }
-	    }
-	    return resultMap;
-	}
-	
-	/**
-	 * Test to see if the specified user has permission
-	 * 
-	 * @param userId the user's userId
-	 * @param permission the raw permission string
-	 * @param context name/value pairs used for permission lookup	
-	 * @return true if the user has permission
-	 */
-	public boolean hasPermission(String userId, String permission, Map<String, ? extends Object> context) {
-	    // expand the permission string
-		String expandedPermission = FlexibleStringExpander.expandString(permission, context);
-		
-		// verify the ThreadLocal data; make sure it isn't stale (from a thread pool)
+    /**
+     * Used to manage Auto-Grant permissions for the current "request"
+     */
+    private static ThreadLocal<List<String>> autoGrant = new ThreadLocal<List<String>>();
+    private static ThreadLocal<String> origPermission = new ThreadLocal<String>();
+    private static ThreadLocal<String> uid = new ThreadLocal<String>();
+    
+    private static final String[] basePermissions = { "access", "create", "read", "update", "delete" };
+    
+    /**
+     * Checks to see if the user has a static permission
+     * 
+     * @param userId the user's userId
+     * @param permission the expanded permission string
+     * @param context name/value pairs used for permission lookup
+     * @return true if the user has permission
+     */
+    public abstract boolean hasStaticPermission(String userId, String permission, Map<String, ? extends Object> context);
+    
+    /**
+     * Locates the Dynamic Access implementation for the permissions and invokes it
+     * 
+     * @param userId the user's userId
+     * @param permission the expanded permission string
+     * @param context name/value pairs used for permission lookup
+     * @return true if the user has permission
+     */
+    public abstract boolean hasDynamicPermission(String userId, String permission, Map<String, ? extends Object> context);
+    
+    /**
+     * Obtains a list of permissions auto-granted by the given permission
+     * 
+     * @param userId the user's userId
+     * @param permission the expanded permission string
+     * @param context name/value pairs used for permission lookup
+     * @return a List of permission strings to auto-grant the user
+     */
+    public abstract List<String> getAutoGrantPermissions(String userId, String permission, Map<String, ? extends Object> context);
+    
+    /**
+     * Takes a regular expression (permissionRegexp) and evaluates it against base permissions and returns permission
+     * values for each match.
+     * Example 1: ".*:example" will return values for access:example, create:example, read:example, update:example and delete:example
+     * Example 2: "(access|read):example:${exampleId} will return values for access:example:${exampleId} and read:example:${exampleId} 
+     *  
+     * NOTE: the regular expression can only be part of the base permission (before the first colon)
+     * 
+     * @param userId the user's userId
+     * @param permissionRegexp permission string containing regexp in the base position    
+     * @param expanded  true if the permission string is already expanded, false if it will contain ${} context values
+     * @return
+     */
+    public Map<String, Boolean> findMatchingPermission(String userId, String permissionRegexp, Map<String, ? extends Object> context) {
+        Map<String, Boolean> resultMap = FastMap.newInstance();
+        
+        String regexp = permissionRegexp.substring(0, permissionRegexp.indexOf(":"));
+        String permStr = permissionRegexp.substring(permissionRegexp.indexOf(":"));
+        
+        Pattern p = Pattern.compile("^" + regexp + ":.*$");
+        for (String base : basePermissions) {
+            Matcher m = p.matcher(base + permStr);
+            if (m.find()) {
+                String permission = m.group();
+                resultMap.put(permission, hasPermission(userId, permission, context));
+            }
+        }
+        return resultMap;
+    }
+    
+    /**
+     * Test to see if the specified user has permission
+     * 
+     * @param userId the user's userId
+     * @param permission the raw permission string
+     * @param context name/value pairs used for permission lookup    
+     * @return true if the user has permission
+     */
+    public boolean hasPermission(String userId, String permission, Map<String, ? extends Object> context) {
+        // expand the permission string
+        String expandedPermission = FlexibleStringExpander.expandString(permission, context);
+        
+        // verify the ThreadLocal data; make sure it isn't stale (from a thread pool)
         String threadUid = uid.get();
         if (threadUid != null && !userId.equals(threadUid)) {
             origPermission.remove();
@@ -131,68 +131,68 @@
             uid.set(userId);
             initialCall = true;
         }
-                       	
-		// split the permission string; so we can walk up the levels
-		String[] permSplit = expandedPermission.split(":");
-		StringBuilder joined = new StringBuilder();
-		int index = 1;
-		
-		if (permSplit != null && permSplit.length > 1) {
-		    if (Debug.verboseOn()) Debug.logVerbose("Security 2.0 schema found -- walking tree : " + expandedPermission, module);
-    		// start walking
-    		for (String perm : permSplit) {
-    		    if (permSplit.length >= index) {
-        			if (joined.length() > 0) {
-        				joined.append(":");
-        			}
-        			joined.append(perm);
-        			
-        			// first check auto-granted permissions
-        			List<String> grantedPerms = autoGrant.get();
-        			if (grantedPerms != null && grantedPerms.size() > 0) {
-        			    Debug.logVerbose("Auto-Grant permissions found; looking for a match", module);
-        				for (String granted : grantedPerms) {
-        				    if (Debug.verboseOn()) Debug.logVerbose("Testing - " + granted + " - with - " + joined.toString(), module);
-        					if (joined.toString().equals(granted)) {
-        					    // permission granted
-        					    handleAutoGrantPermissions(userId, expandedPermission, context);
-        						return true;
-        					}
-        				}
-        			}
-        			
-        			// next check static permission
-        			if (hasStaticPermission(userId, joined.toString(), context)) {
-        				// permission granted
-        				handleAutoGrantPermissions(userId, expandedPermission, context);
-        				return true;
-        			}
-    		    }
-    			index++;
-    		}
-    		
-    		// finally check dynamic permission (outside the loop)
-    		String threadPerm = origPermission.get();
-    		if (initialCall || !permission.equals(threadPerm)) {
-        		if (hasDynamicPermission(userId, expandedPermission, context)) {
-        		    // permission granted
-        		    handleAutoGrantPermissions(userId, expandedPermission, context);
-        		    return true;
-        		}
-    		} else {
-    		    Debug.logWarning("Recursive permission check detected; do not call hasPermission() from a dynamic access implementation!", module);
-    		}
-		} else {
-		    // legacy mode; only call static permission check; no auto grants
-		    Debug.logVerbose("Legacy permission detected; falling back to static permission check", module);
-		    return hasStaticPermission(userId, expandedPermission, context);
-		}
-		return false;
-	}
-	
-	protected void handleAutoGrantPermissions(String userId, String expandedPermission, Map<String, ? extends Object> context) {	    	    
-	    List<String> granted = getAutoGrantPermissions(userId, expandedPermission, context);
-	    if (granted != null && granted.size() > 0) {
+                           
+        // split the permission string; so we can walk up the levels
+        String[] permSplit = expandedPermission.split(":");
+        StringBuilder joined = new StringBuilder();
+        int index = 1;
+        
+        if (permSplit != null && permSplit.length > 1) {
+            if (Debug.verboseOn()) Debug.logVerbose("Security 2.0 schema found -- walking tree : " + expandedPermission, module);
+            // start walking
+            for (String perm : permSplit) {
+                if (permSplit.length >= index) {
+                    if (joined.length() > 0) {
+                        joined.append(":");
+                    }
+                    joined.append(perm);
+                    
+                    // first check auto-granted permissions
+                    List<String> grantedPerms = autoGrant.get();
+                    if (grantedPerms != null && grantedPerms.size() > 0) {
+                        Debug.logVerbose("Auto-Grant permissions found; looking for a match", module);
+                        for (String granted : grantedPerms) {
+                            if (Debug.verboseOn()) Debug.logVerbose("Testing - " + granted + " - with - " + joined.toString(), module);
+                            if (joined.toString().equals(granted)) {
+                                // permission granted
+                                handleAutoGrantPermissions(userId, expandedPermission, context);
+                                return true;
+                            }
+                        }
+                    }
+                    
+                    // next check static permission
+                    if (hasStaticPermission(userId, joined.toString(), context)) {
+                        // permission granted
+                        handleAutoGrantPermissions(userId, expandedPermission, context);
+                        return true;
+                    }
+                }
+                index++;
+            }
+            
+            // finally check dynamic permission (outside the loop)
+            String threadPerm = origPermission.get();
+            if (initialCall || !permission.equals(threadPerm)) {
+                if (hasDynamicPermission(userId, expandedPermission, context)) {
+                    // permission granted
+                    handleAutoGrantPermissions(userId, expandedPermission, context);
+                    return true;
+                }
+            } else {
+                Debug.logWarning("Recursive permission check detected; do not call hasPermission() from a dynamic access implementation!", module);
+            }
+        } else {
+            // legacy mode; only call static permission check; no auto grants
+            Debug.logVerbose("Legacy permission detected; falling back to static permission check", module);
+            return hasStaticPermission(userId, expandedPermission, context);
+        }
+        return false;
+    }
+    
+    protected void handleAutoGrantPermissions(String userId, String expandedPermission, Map<String, ? extends Object> context) {                
+        List<String> granted = getAutoGrantPermissions(userId, expandedPermission, context);
+        if (granted != null && granted.size() > 0) {
             List<String> alreadyGranted = autoGrant.get();
             if (alreadyGranted == null) {
                 alreadyGranted = FastList.newInstance();
@@ -208,15 +208,15 @@
             }
             autoGrant.set(granted);            
         }
-	}
-	
-	/**
-	 * Used to clear the values set in ThreadLocal
-	 * -- needed when thread pools are used which do not handle clearing between requests
-	 */
-	public static void clearThreadLocal() {
-	    origPermission.remove();
+    }
+    
+    /**
+     * Used to clear the values set in ThreadLocal
+     * -- needed when thread pools are used which do not handle clearing between requests
+     */
+    public static void clearThreadLocal() {
+        origPermission.remove();
         autoGrant.remove();
         uid.remove();        
-	}
+    }
 }

Modified: ofbiz/branches/executioncontext20090812/framework/security/src/org/ofbiz/security/authz/Authorization.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/security/src/org/ofbiz/security/authz/Authorization.java?rev=805012&r1=805011&r2=805012&view=diff
==============================================================================
--- ofbiz/branches/executioncontext20090812/framework/security/src/org/ofbiz/security/authz/Authorization.java (original)
+++ ofbiz/branches/executioncontext20090812/framework/security/src/org/ofbiz/security/authz/Authorization.java Mon Aug 17 15:42:56 2009
@@ -26,17 +26,17 @@
 
 public interface Authorization {
 
-	/**
-	 * Test to see if the specified user has permission
-	 * 
-	 * @param userId the user's userId
-	 * @param permission the raw permission string
-	 * @param context name/value pairs used for permission lookup	
-	 * @return true if the user has permission
-	 */
-	public boolean hasPermission(String userId, String permission, Map<String, ? extends Object> context);
-		       
-	/**
+    /**
+     * Test to see if the specified user has permission
+     * 
+     * @param userId the user's userId
+     * @param permission the raw permission string
+     * @param context name/value pairs used for permission lookup    
+     * @return true if the user has permission
+     */
+    public boolean hasPermission(String userId, String permission, Map<String, ? extends Object> context);
+               
+    /**
      * Test to see if the specified user has permission
      * 
      * @param session HttpSession used to obtain the userId
@@ -45,7 +45,7 @@
      * @return true if the user has permission
      */
     public boolean hasPermission(HttpSession session, String permission, Map<String, ? extends Object> context);
-	
+    
     /**
      * Takes a regular expression (permissionRegexp) and evaluates it against base permissions and returns permission
      * values for each match.