svn commit: r757086 [1/4] - in /ofbiz/trunk/applications/content/src: ./ org/ofbiz/content/ org/ofbiz/content/blog/ org/ofbiz/content/cms/ org/ofbiz/content/compdoc/ org/ofbiz/content/content/ org/ofbiz/content/data/ org/ofbiz/content/layout/ org/ofbiz...

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

svn commit: r757086 [1/4] - in /ofbiz/trunk/applications/content/src: ./ org/ofbiz/content/ org/ofbiz/content/blog/ org/ofbiz/content/cms/ org/ofbiz/content/compdoc/ org/ofbiz/content/content/ org/ofbiz/content/data/ org/ofbiz/content/layout/ org/ofbiz...

doogie-3
Author: doogie
Date: Sat Mar 21 23:43:51 2009
New Revision: 757086

URL: http://svn.apache.org/viewvc?rev=757086&view=rev
Log:
Fix purely empty whitespace lines, and remove trailing whitespace.

Modified:
    ofbiz/trunk/applications/content/src/ControlApplet.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementEvents.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementWorker.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/ConvertTree.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/blog/BlogRssServices.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/cms/CmsEvents.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/compdoc/CompDocEvents.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/compdoc/CompDocServices.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentEvents.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentMapFacade.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentPermissionServices.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentServices.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentServicesComplex.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWrapper.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/content/PermissionRecorder.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/content/UploadContentAndImage.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataEvents.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataServices.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/layout/LayoutEvents.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/layout/LayoutServices.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/layout/LayoutWorker.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/openoffice/OpenOfficeByteArrayInputStream.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/openoffice/OpenOfficeByteArrayOutputStream.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/openoffice/OpenOfficeServices.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/openoffice/OpenOfficeWorker.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/output/OutputServices.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/report/JREntityListIteratorDataSource.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/report/JRMapCollectionDataSource.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/search/ContentDocument.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/search/DataResourceDocument.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/search/SearchEvents.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/search/SearchServices.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/PdfSurveyServices.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/view/SimpleContentViewHandler.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/CheckPermissionTransform.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/EditRenderSubContentCacheTransform.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/EditRenderSubContentTransform.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/InjectNodeTrailCsvTransform.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/LimitedSubContentCacheTransform.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/LoopSubContentTransform.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentAndSubContent.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentAsText.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderContentTransform.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentAsText.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentCacheTransform.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/RenderSubContentTransform.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/TraverseSubContentCacheTransform.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/TraverseSubContentTransform.java
    ofbiz/trunk/applications/content/src/org/ofbiz/content/webapp/ftl/WrapSubContentCacheTransform.java

Modified: ofbiz/trunk/applications/content/src/ControlApplet.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/ControlApplet.java?rev=757086&r1=757085&r2=757086&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/ControlApplet.java (original)
+++ ofbiz/trunk/applications/content/src/ControlApplet.java Sat Mar 21 23:43:51 2009
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -36,82 +36,82 @@
  * Control Applet - Client applet for page pushing and (future) chat
  */
 public class ControlApplet extends Applet implements Runnable {
-    
+
     private static String pushUrl = "/commonapp/control/pushapplet";
     private static String pullUrl = "/commonapp/control/pullapplet";
-    
+
     protected AppletContext ctx = null;
-    
+
     protected String sessionId = null;
     protected String visitId = null;
-    protected String serverUrl = null;    
+    protected String serverUrl = null;
     protected String timeoutUrl = null;
-    protected String currentPage = null;    
+    protected String currentPage = null;
     protected String debug = null;
-    
+
     protected int waitTime = 1500;
     protected int timeout = 300000;
-    
+
     protected boolean isRunning = false;
     protected boolean stopped = true;
-    
+
     protected Thread thread = null;
-    
+
     public void init() {
         ctx = this.getAppletContext();
         this.sessionId = this.getParameter("sessionId");
         this.visitId = this.getParameter("visitId");
-        this.serverUrl = this.getParameter("serverUrl");        
-        this.timeoutUrl = this.getParameter("timeoutUrl");  
-        this.currentPage = this.getParameter("currentPage");      
+        this.serverUrl = this.getParameter("serverUrl");
+        this.timeoutUrl = this.getParameter("timeoutUrl");
+        this.currentPage = this.getParameter("currentPage");
         this.debug = this.getParameter("debug");
-        
+
         // see if we override the integer values
         try {
             int waitInt = Integer.parseInt(this.getParameter("waitTime"));
             if (waitInt > 0)
-                waitTime = waitInt;            
+                waitTime = waitInt;
         } catch (NumberFormatException e) {
         }
         try {
             int outInt = Integer.parseInt(this.getParameter("timeout"));
-            if (outInt > 0)
+            if (outInt > 0)
                 timeout = outInt;
         } catch (NumberFormatException e) {
         }
-                
+
         if (serverUrl != null) {
             boolean sessionOkay = false;
             boolean visitOkay = false;
-            boolean pageOkay = false;        
-            
+            boolean pageOkay = false;
+
             if (sessionId != null && sessionId.length() > 0)
                 sessionOkay = true;
             if (visitId != null && visitId.length() > 0)
-                visitOkay = true;  
-            if (currentPage != null && currentPage.length() > 0)    
-                pageOkay = true;          
-            
-            if (sessionOkay && visitOkay && pageOkay) {                    
+                visitOkay = true;
+            if (currentPage != null && currentPage.length() > 0)
+                pageOkay = true;
+
+            if (sessionOkay && visitOkay && pageOkay) {
                 // tell the host about our current page (mainly for followers)
                 this.push();
             }
-        
+
             // start the polling thread
             this.isRunning = true;
             this.stopped = false;
             thread = new Thread(this);
-            thread.setDaemon(false);    
+            thread.setDaemon(false);
             thread.start();
-        }            
+        }
     }
-    
+
     public void destroy() {
-        this.stopped = true;      
+        this.stopped = true;
     }
-    
+
     // poll the servlet for page request
-    public void run() {                  
+    public void run() {
         while (isRunning && !stopped) {
             this.pull();
             try {
@@ -119,55 +119,55 @@
             } catch (InterruptedException e) {
                 this.stopped = true;
                 this.isRunning = false;
-            }                                
+            }
         }
         if (debug != null && debug.equalsIgnoreCase("true"))
             System.out.println("Polling finished.");
     }
-    
-    protected void pull() {    
+
+    protected void pull() {
         Map params = new HashMap();
         params.put("sessionId", this.sessionId.trim());
         params.put("visitId", this.visitId.trim());
-                            
+
         String pullResp = null;
         URL callPullUrl = null;
         try {
             callPullUrl = new URL(serverUrl + pullUrl);
         } catch (MalformedURLException e) {
         }
-        
+
         if (callPullUrl != null) {
             try {
                 pullResp = callServer(callPullUrl, params);
             } catch (IOException e) {
-            }      
+            }
         }
-        
+
         if (pullResp != null && pullResp.length() > 0) {
             URL docUrl = null;
             try {
                 docUrl = new URL(pullResp);
             } catch (MalformedURLException e) {
             }
-            if (docUrl != null)
+            if (docUrl != null)
                 ctx.showDocument(docUrl, "appletWindow");
         }
     }
-    
+
     protected void push() {
-        Map params = new HashMap();  
+        Map params = new HashMap();
         params.put("sessionId", this.sessionId.trim());
-        params.put("visitId", this.visitId.trim());  
-        params.put("currentPage", this.currentPage.trim());      
-        
+        params.put("visitId", this.visitId.trim());
+        params.put("currentPage", this.currentPage.trim());
+
         String pushResp = null;
         URL callPushUrl = null;
         try {
-            callPushUrl = new URL(serverUrl + pushUrl);      
+            callPushUrl = new URL(serverUrl + pushUrl);
         } catch (MalformedURLException e) {
         }
-        
+
         if (callPushUrl != null) {
             try {
                 pushResp = callServer(callPushUrl, params);
@@ -175,19 +175,19 @@
             }
         }
     }
-    
-    private String callServer(URL serverUrl, Map parms) throws IOException {    
-        // send the request  
-        String parameters = this.encodeArgs(parms);  
-        if (debug != null && debug.equalsIgnoreCase("true"))
-            System.out.println("Sending parameters: " + parameters);                      
+
+    private String callServer(URL serverUrl, Map parms) throws IOException {
+        // send the request
+        String parameters = this.encodeArgs(parms);
+        if (debug != null && debug.equalsIgnoreCase("true"))
+            System.out.println("Sending parameters: " + parameters);
         URLConnection uc = serverUrl.openConnection();
         uc.setDoOutput(true);
         uc.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
         PrintWriter pw = new PrintWriter(uc.getOutputStream());
         pw.println(parameters);
         pw.close();
-        
+
         // read the response
         BufferedReader in = new BufferedReader(new InputStreamReader(uc.getInputStream()));
         String responseStr = in.readLine();
@@ -195,10 +195,10 @@
         if (responseStr != null)
             responseStr = responseStr.trim();
         if (debug != null && debug.equalsIgnoreCase("true"))
-            System.out.println("Receive response: " + responseStr);                    
-        return responseStr;                
+            System.out.println("Receive response: " + responseStr);
+        return responseStr;
     }
-    
+
     public String encodeArgs(Map args) {
         StringBuffer buf = new StringBuffer();
         if (args != null) {
@@ -214,24 +214,24 @@
                     } else {
                         valueStr = value.toString();
                     }
-                    
+
                     if (valueStr != null && valueStr.length() > 0) {
                         if (buf.length() > 0) buf.append('&');
                         try {
                             buf.append(URLEncoder.encode(name, "UTF-8"));
                         } catch (UnsupportedEncodingException e) {
-                            e.printStackTrace();                        
+                            e.printStackTrace();
                         }
                         buf.append('=');
                         try {
                             buf.append(URLEncoder.encode(valueStr, "UTF-8"));
                         } catch (UnsupportedEncodingException e) {
-                            e.printStackTrace();                        
+                            e.printStackTrace();
                         }
                     }
                 }
             }
         }
         return buf.toString();
-    }          
+    }
 }

Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementEvents.java?rev=757086&r1=757085&r2=757086&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementEvents.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementEvents.java Sat Mar 21 23:43:51 2009
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -287,7 +287,7 @@
                         serviceIn.put("targetOperationList", targetOperationList);
                         serviceIn.put("contentPurposeList", contentPurposeList);
                         results = dispatcher.runSync("createContentAssoc", serviceIn);
-                        responseMessage = (String)results.get(ModelService.RESPONSE_MESSAGE);
+                        responseMessage = (String)results.get(ModelService.RESPONSE_MESSAGE);
                         if (UtilValidate.isNotEmpty(responseMessage)) {
                             errorMessage = (String)results.get(ModelService.ERROR_MESSAGE);
                             Debug.logError("in updatePublishLinks, serviceIn:" + serviceIn , module);

Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java?rev=757086&r1=757085&r2=757086&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java Sat Mar 21 23:43:51 2009
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -75,17 +75,17 @@
         //Security security = dctx.getSecurity();
         GenericDelegator delegator = dctx.getDelegator();
         //LocalDispatcher dispatcher = dctx.getDispatcher();
-        String contentId = (String) context.get("contentId");
-        String subContentId = (String) context.get("subContentId");
-        String mapKey = (String) context.get("mapKey");
+        String contentId = (String) context.get("contentId");
+        String subContentId = (String) context.get("subContentId");
+        String mapKey = (String) context.get("mapKey");
         GenericValue userLogin = (GenericValue)context.get("userLogin");
         Timestamp fromDate = (Timestamp)context.get("fromDate");
-        List assocTypes = (List) context.get("assocTypes");
+        List assocTypes = (List) context.get("assocTypes");
         String assocTypesString = (String)context.get("assocTypesString");
         if (UtilValidate.isNotEmpty(assocTypesString)) {
             List lst = StringUtil.split(assocTypesString, "|");
             if (assocTypes == null) {
-                assocTypes = FastList.newInstance();  
+                assocTypes = FastList.newInstance();
             }
             assocTypes.addAll(lst);
         }
@@ -112,7 +112,7 @@
     public static Map<String, Object> getContent(DispatchContext dctx, Map<String, ? extends Object> context) {
         //Security security = dctx.getSecurity();
         GenericDelegator delegator = dctx.getDelegator();
-        String contentId = (String) context.get("contentId");
+        String contentId = (String) context.get("contentId");
         //GenericValue userLogin = (GenericValue)context.get("userLogin");
         GenericValue view = null;
 
@@ -137,8 +137,8 @@
         //Security security = dctx.getSecurity();
         //GenericDelegator delegator = dctx.getDelegator();
         //LocalDispatcher dispatcher = dctx.getDispatcher();
-        //HttpServletRequest request = (HttpServletRequest)context.get("request");  
-        //String suffix = (String) context.get("suffix");
+        //HttpServletRequest request = (HttpServletRequest)context.get("request");
+        //String suffix = (String) context.get("suffix");
         GenericValue val = (GenericValue)context.get("pk");
         GenericPK pk = val.getPrimaryKey();
         HttpSession session = (HttpSession)context.get("session");
@@ -151,32 +151,32 @@
     /**
      * persistContentAndAssoc
      * A combination method that will create or update all or one of the following:
-     * a Content entity, a ContentAssoc related to the Content, and
+     * a Content entity, a ContentAssoc related to the Content, and
      * the ElectronicText that may be associated with the Content.
      * The keys for determining if each entity is created is the presence
      * of the contentTypeId, contentAssocTypeId and dataResourceTypeId.
      * This service tries to handle DataResource fields with and
      * without "dr" prefixes.
      * Assumes binary data is always in field, "imageData".
-     *
+     *
      * This service does not accept straight ContentAssoc parameters. They must be prefaced with "ca" + cap first letter
      */
     public static Map<String, Object> persistContentAndAssoc(DispatchContext dctx, Map<String, ? extends Object> rcontext) throws GenericServiceException {
         GenericDelegator delegator = dctx.getDelegator();
         LocalDispatcher dispatcher = dctx.getDispatcher();
         Map<String, Object> context = UtilMisc.makeMapWritable(rcontext);
-        
+
         Debug.logInfo("=========== type:" + (String)context.get("dataresourceTypeId") , module);
         // Knowing why a request fails permission check is one of the more difficult
         // aspects of content management. Setting "displayFailCond" to true will
         // put an html table in result.errorMessage that will show what tests were performed
         Boolean bDisplayFailCond = (Boolean)context.get("displayFailCond");
-        String mapKey = (String) context.get("mapKey");
-        
+        String mapKey = (String) context.get("mapKey");
+
         // If "deactivateExisting" is set, other Contents that are tied to the same
         // contentIdTo will be deactivated (thruDate set to now)
         String deactivateString = (String) context.get("deactivateExisting");
-        boolean deactivateExisting = "true".equalsIgnoreCase(deactivateString);
+        boolean deactivateExisting = "true".equalsIgnoreCase(deactivateString);
 
         if (Debug.infoOn()) Debug.logInfo("in persist... mapKey(0):" + mapKey, null);
 
@@ -190,12 +190,12 @@
             contentPurposeList.addAll(tmpPurposes);
         }
         if (contentPurposeList != null ) {
-            context.put("contentPurposeList", contentPurposeList);  
-            context.put("contentPurposeString", null);  
+            context.put("contentPurposeList", contentPurposeList);
+            context.put("contentPurposeString", null);
         }
         if (Debug.infoOn()) Debug.logInfo("in persist... contentPurposeList(0):" + contentPurposeList, null);
         if (Debug.infoOn()) Debug.logInfo("in persist... textData(0):" + context.get("textData"), null);
-        
+
 
         GenericValue content = delegator.makeValue("Content");
         content.setPKFields(context);
@@ -228,7 +228,7 @@
         GenericValue electronicText = delegator.makeValue("ElectronicText");
         electronicText.setPKFields(context);
         electronicText.setNonPKFields(context);
-        
+
         // save expected primary keys on result now in case there is no operation that uses them
         Map results = ServiceUtil.returnSuccess();
         results.put("contentId", content.get("contentId"));
@@ -239,15 +239,15 @@
         results.put("caContentId", contentAssoc.get("contentId"));
         results.put("caFromDate", contentAssoc.get("fromDate"));
         results.put("caContentAssocTypeId", contentAssoc.get("contentAssocTypeId"));
-        
+
         // get user info for multiple use
-        GenericValue userLogin = (GenericValue) context.get("userLogin");
+        GenericValue userLogin = (GenericValue) context.get("userLogin");
 
         // TODO: DEJ20060221 Should these be used somewhere?
         //String textData = (String)electronicText.get("textData");
 
         //String userLoginId = (String)userLogin.get("userLoginId");
-        
+
         //String createdByUserLogin = userLoginId;
         //String lastModifiedByUserLogin = userLoginId;
         //Timestamp createdDate = UtilDateTime.nowTimestamp();
@@ -349,7 +349,7 @@
                         while (iter.hasNext()) {
                             String contentPurposeTypeId = (String)iter.next();
                             GenericValue contentPurpose = delegator.makeValue("ContentPurpose",
-                                   UtilMisc.toMap("contentId", contentId,
+                                   UtilMisc.toMap("contentId", contentId,
                                                   "contentPurposeTypeId", contentPurposeTypeId) );
                             contentPurpose.create();
                         }
@@ -369,7 +369,7 @@
                 if (Debug.infoOn()) Debug.logInfo("in persist... context:" + context, module);
                 Map r = ContentServices.updateContentMethod(dctx, map);
                 boolean isError = ModelService.RESPOND_ERROR.equals(r.get(ModelService.RESPONSE_MESSAGE));
-                if (isError)
+                if (isError)
                     return ServiceUtil.returnError( (String)r.get(ModelService.ERROR_MESSAGE));
             }
         }
@@ -448,8 +448,8 @@
     }
 
     /**
-    Service for update publish sites with a ContentRole that will tie them to the passed
-    in party.
+    Service for update publish sites with a ContentRole that will tie them to the passed
+    in party.
    */
     public static Map<String, Object> updateSiteRoles(DispatchContext dctx, Map<String, ? extends Object> context) {
         LocalDispatcher dispatcher = dctx.getDispatcher();
@@ -476,7 +476,7 @@
       } catch (GenericEntityException e) {
           return ServiceUtil.returnError( e.toString());
       }
-        
+
       Iterator siteRoleIter = siteRoles.iterator();
       while (siteRoleIter.hasNext()) {
           Map serviceContext = FastMap.newInstance();
@@ -510,7 +510,7 @@
                       if (Debug.infoOn()) Debug.logInfo("updateSiteRoles, serviceContext(1):" + serviceContext, module);
                       permResults = dispatcher.runSync("createContentRole", serviceContext);
                       String errMsg = ServiceUtil.getErrorMessage(permResults);
-                      if (UtilValidate.isNotEmpty(errMsg))
+                      if (UtilValidate.isNotEmpty(errMsg))
                         return ServiceUtil.returnError(errMsg);
                       //addRoleToUser(delegator, dispatcher, serviceContext);
                   } catch (GenericServiceException e) {
@@ -537,7 +537,7 @@
                       newContext.put("userLogin", userLogin);
                       Map permResults = dispatcher.runSync("deactivateAllContentRoles", newContext);
                       String errMsg = ServiceUtil.getErrorMessage(permResults);
-                      if (UtilValidate.isNotEmpty(errMsg))
+                      if (UtilValidate.isNotEmpty(errMsg))
                         return ServiceUtil.returnError(errMsg);
                   } catch (GenericServiceException e) {
                       Debug.logError(e, e.toString(), module);
@@ -551,7 +551,7 @@
       }
       return results;
   }
-  
+
     public static Map<String, Object> persistDataResourceAndData(DispatchContext dctx, Map<String, ? extends Object> context) {
       //GenericDelegator delegator = dctx.getDelegator();
       LocalDispatcher dispatcher = dctx.getDispatcher();
@@ -567,7 +567,7 @@
               result = persistDataResourceAndDataMethod(dctx, context);
           }
           else {
-            return ServiceUtil.returnError("no access to upload image");  
+            return ServiceUtil.returnError("no access to upload image");
           }
       } catch (GenericServiceException e) {
           Debug.logError(e, e.toString(), module);
@@ -585,7 +585,7 @@
       }
       return result;
     }
-  
+
     public static Map<String, Object> persistDataResourceAndDataMethod(DispatchContext dctx, Map<String, ? extends Object> rcontext) throws GenericServiceException, GenericEntityException, Exception {
       GenericDelegator delegator = dctx.getDelegator();
       LocalDispatcher dispatcher = dctx.getDispatcher();
@@ -597,13 +597,13 @@
       dataResource.setNonPKFields(context);
       dataResource.setAllFields(context, false, "dr", null);
       context.putAll(dataResource);
-      
+
       GenericValue electronicText = delegator.makeValue("ElectronicText");
       electronicText.setPKFields(context);
       electronicText.setNonPKFields(context);
       String textData = (String)electronicText.get("textData");
 
-      
+
       String dataResourceId = (String)dataResource.get("dataResourceId");
       String dataResourceTypeId = (String)dataResource.get("dataResourceTypeId");
       if (Debug.infoOn()) Debug.logInfo("in persist... dataResourceId(0):" + dataResourceId, null);
@@ -620,7 +620,7 @@
               return ServiceUtil.returnError(e.toString());
           }
       }
-      GenericValue userLogin = (GenericValue) context.get("userLogin");
+      GenericValue userLogin = (GenericValue) context.get("userLogin");
       //String userLoginId = (String)userLogin.get("userLoginId");
       ModelService dataResourceModel = dispatcher.getDispatchContext().getModelService("updateDataResource");
       Map ctx = dataResourceModel.makeValid(dataResource, "IN");
@@ -637,7 +637,7 @@
           }
           newDrContext.put("mimeTypeId", mimeTypeId);
       }
-      
+
       if (!dataResourceExists) {
           Map thisResult = dispatcher.runSync("createDataResource", newDrContext);
       String errorMsg = ServiceUtil.getErrorMessage(thisResult);
@@ -755,13 +755,13 @@
           }
       }
     }
-    
+
     result.put("dataResourceId", dataResourceId);
     result.put("drDataResourceId", dataResourceId);
     context.put("dataResourceId", dataResourceId);
     return result;
   }
-  
+
     public static void addRoleToUser(GenericDelegator delegator, LocalDispatcher dispatcher, Map serviceContext) throws GenericServiceException, GenericEntityException {
     String partyId = (String)serviceContext.get("partyId");
     Map findMap = UtilMisc.toMap("partyId", partyId);
@@ -887,14 +887,14 @@
                     if (Debug.infoOn()) Debug.logInfo("in updateOrRemove, entityValueExisting: REMOVED", module);
                 }
             }
-            
+
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
             return ServiceUtil.returnError(e.toString());
         }
-        return results;
+        return results;
     }
-    
+
     public static Map<String, Object> resequence(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
 
         Map result = FastMap.newInstance();
@@ -926,7 +926,7 @@
                      if (contentId.equals(thisContentId)) {
                          if (dir.startsWith("up")) {
                              if (i > 0) {
-                                 // Swap with previous entry
+                                 // Swap with previous entry
                                  try {
                                      GenericValue prevValue = (GenericValue)listFiltered.get(i-1);
                                      Long prevSeqNum = (Long)prevValue.get("sequenceNum");
@@ -935,12 +935,12 @@
                                      contentAssoc.put("sequenceNum", prevSeqNum);
                                      contentAssoc.store();
                                  } catch (Exception e) {
-                                     return ServiceUtil.returnError(e.toString());            
+                                     return ServiceUtil.returnError(e.toString());
                                  }
                              }
                          } else {
                              if (i < listFiltered.size()) {
-                                 // Swap with next entry
+                                 // Swap with next entry
                                  GenericValue nextValue = (GenericValue)listFiltered.get(i+1);
                                  nextValue.put("sequenceNum", Long.valueOf(seqNum));
                                  nextValue.store();
@@ -962,13 +962,13 @@
              }
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
-            return ServiceUtil.returnError(e.toString());            
+            return ServiceUtil.returnError(e.toString());
          }
-        
-      
+
+
         return result;
     }
-    
+
     public static Map<String, Object> changeLeafToNode(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
         Map result = FastMap.newInstance();
         GenericDelegator delegator = dctx.getDelegator();
@@ -1000,7 +1000,7 @@
             content.set("lastModifiedDate", UtilDateTime.nowTimestamp());
             content.set("lastModifiedByUserLogin", userLoginId);
             content.store();
-            
+
             if (UtilValidate.isNotEmpty(dataResourceId)) {
                 // add previous DataResource as part of new subcontent
                 GenericValue contentClone = (GenericValue)content.clone();
@@ -1009,7 +1009,7 @@
                 content.set("lastModifiedByUserLogin", userLoginId);
                 content.set("createdDate", UtilDateTime.nowTimestamp());
                 content.set("createdByUserLogin", userLoginId);
-                
+
                 contentClone.set("contentId", null);
                 ModelService modelService = dctx.getModelService("persistContentAndAssoc");
                 Map serviceIn = modelService.makeValid(contentClone, "IN");
@@ -1020,22 +1020,22 @@
                 try {
                     Map thisResult = dispatcher.runSync("persistContentAndAssoc", serviceIn);
                 } catch (ServiceAuthException e) {
-                    return ServiceUtil.returnError(e.toString());            
+                    return ServiceUtil.returnError(e.toString());
                 }
-                
+
                 List typeList = UtilMisc.toList("SUB_CONTENT");
                 int leafCount = ContentManagementWorker.updateStatsTopDown(delegator, contentId, typeList);
             }
-            
+
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
-            return ServiceUtil.returnError(e.toString());            
+            return ServiceUtil.returnError(e.toString());
         }
-        
-      
+
+
         return result;
     }
-    
+
     public static Map<String, Object> updateLeafCount(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
 
         Map result = FastMap.newInstance();
@@ -1049,11 +1049,11 @@
             result.put("leafCount", Integer.valueOf(leafCount));
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
-            return ServiceUtil.returnError(e.toString());            
+            return ServiceUtil.returnError(e.toString());
         }
         return result;
     }
-    
+
 /*
     public static Map<String, Object> updateLeafChange(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
 
@@ -1063,12 +1063,12 @@
         if (typeList == null)
             typeList = UtilMisc.toList("PUBLISH_LINK", "SUB_CONTENT");
         String contentId = (String)context.get("contentId");
-        
+
         try {
             GenericValue thisContent = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId));
             if (thisContent == null)
                 throw new RuntimeException("No entity found for id=" + contentId);
-            
+
             String thisContentId = thisContent.getString("contentId");
             Long leafCount = (Long)thisContent.get("nodeLeafCount");
             int subLeafCount = (leafCount == null) ? 1 : leafCount.intValue();
@@ -1079,7 +1079,7 @@
                 // TODO: ??? what is this supposed to do:
                 //subLeafCount = subLeafCount;
             }
-            
+
            EntityCondition conditionType = EntityCondition.makeCondition("contentAssocTypeId", EntityOperator.IN, typeList);
            EntityCondition conditionMain = EntityCondition.makeCondition(UtilMisc.toList( EntityCondition.makeCondition("contentId", EntityOperator.EQUALS, thisContentId), conditionType), EntityOperator.AND);
             List listAll = delegator.findByConditionCache("ContentAssoc", conditionMain, null, null);
@@ -1097,29 +1097,29 @@
                     branchCount += 1;
                 // For the level just above only, update the branch count
                 contentTo.put("childBranchCount", Integer.valueOf(branchCount));
-                
+
                 // Start the updating of leaf counts above
                 ContentManagementWorker.updateStatsBottomUp(delegator, subContentId, typeList, subLeafCount);
             }
-        
-        
+
+
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
-            return ServiceUtil.returnError(e.toString());            
+            return ServiceUtil.returnError(e.toString());
         }
         return result;
     }
     */
-    
+
     /**
      * This service changes the contentTypeId of the current content and its children depending on the pageMode.
-     * if pageMode == "outline" then if the contentTypeId of children is not "OUTLINE_NODE" or "PAGE_NODE"
+     * if pageMode == "outline" then if the contentTypeId of children is not "OUTLINE_NODE" or "PAGE_NODE"
      * (it could be DOCUMENT or SUBPAGE_NODE) then it will get changed to PAGE_NODE.`
-     * if pageMode == "page" then if the contentTypeId of children is not "PAGE_NODE" or "SUBPAGE_NODE"
-     * (it could be DOCUMENT or OUTLINE_NODE) then it will get changed to SUBPAGE_NODE.`    
+     * if pageMode == "page" then if the contentTypeId of children is not "PAGE_NODE" or "SUBPAGE_NODE"
+     * (it could be DOCUMENT or OUTLINE_NODE) then it will get changed to SUBPAGE_NODE.`
      */
     public static Map<String, Object> updatePageType(DispatchContext dctx, Map<String, ? extends Object> rcontext) throws GenericServiceException{
-        
+
         GenericDelegator delegator = dctx.getDelegator();
         Map<String, Object> context = UtilMisc.makeMapWritable(rcontext);
         Map results = FastMap.newInstance();
@@ -1127,7 +1127,7 @@
         if (visitedSet == null) {
             visitedSet = FastSet.newInstance();
             context.put("visitedSet", visitedSet);
-        }
+        }
         String pageMode = (String)context.get("pageMode");
         String contentId = (String)context.get("contentId");
         visitedSet.add(contentId);
@@ -1155,12 +1155,12 @@
             Debug.logError(e, module);
             return ServiceUtil.returnError(e.toString());
         }
-            
+
         return results;
     }
-    
+
     public static Map<String, Object> resetToOutlineMode(DispatchContext dctx, Map<String, ? extends Object> rcontext) throws GenericServiceException{
-        
+
         GenericDelegator delegator = dctx.getDelegator();
         Map<String, Object> context = UtilMisc.makeMapWritable(rcontext);
         Map results = FastMap.newInstance();
@@ -1168,7 +1168,7 @@
         if (visitedSet == null) {
             visitedSet = FastSet.newInstance();
             context.put("visitedSet", visitedSet);
-        }
+        }
         String contentId = (String)context.get("contentId");
         String pageMode = (String)context.get("pageMode");
         String contentTypeId = "OUTLINE_NODE";
@@ -1202,10 +1202,10 @@
             Debug.logError(e, module);
             return ServiceUtil.returnError(e.toString());
         }
-            
+
         return results;
     }
-    
+
     public static Map<String, Object> clearContentAssocViewCache(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
         Map results = FastMap.newInstance();
 
@@ -1214,7 +1214,7 @@
         if (utilCache != null) {
             utilCache.clear();
         }
-        
+
         utilCache = UtilCache.findCache("entitycache.entity-list.default.ContentAssocViewTo");
         if (utilCache != null) {
             utilCache.clear();
@@ -1222,16 +1222,16 @@
 
         return results;
     }
-    
+
     public static Map<String, Object> clearContentAssocDataResourceViewCache(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
-    
+
         Map results = FastMap.newInstance();
 
         UtilCache utilCache = UtilCache.findCache("entitycache.entity-list.default.ContentAssocViewDataResourceFrom");
         if (utilCache != null) {
             utilCache.clear();
         }
-        
+
         utilCache = UtilCache.findCache("entitycache.entity-list.default.ContentAssocViewDataResourceTo");
         if (utilCache != null) {
             utilCache.clear();
@@ -1239,9 +1239,9 @@
 
         return results;
     }
-    
+
     public static void updatePageNodeChildren(GenericValue content, Map context) throws GenericEntityException {
-        
+
         String contentId = content.getString("contentId");
         Set visitedSet = (Set)context.get("visitedSet");
         if (visitedSet == null) {
@@ -1252,7 +1252,7 @@
                 Debug.logWarning("visitedSet already contains:" + contentId, module);
                 return;
             } else {
-                visitedSet.add(contentId);  
+                visitedSet.add(contentId);
             }
         }
         String contentTypeId = content.getString("contentTypeId");
@@ -1262,10 +1262,10 @@
 //        } else if (contentTypeId.equals("OUTLINE_NODE")) {
 //            newContentTypeId = "PAGE_NODE";
 //        }
-            
+
         content.put("contentTypeId", newContentTypeId);
         content.store();
-        
+
         //if (contentTypeId == null || contentTypeId.equals("OUTLINE_DOCUMENT") || contentTypeId.equals("DOCUMENT")) {
             List kids = ContentWorker.getAssociatedContent(content, "from", UtilMisc.toList("SUB_CONTENT"), null, null, null);
             Iterator iter = kids.iterator();
@@ -1277,7 +1277,7 @@
     }
 
     public static void updateOutlineNodeChildren(GenericValue content, boolean forceOutline, Map context) throws GenericEntityException {
-        
+
         String contentId = content.getString("contentId");
         Set visitedSet = (Set)context.get("visitedSet");
         if (visitedSet == null) {
@@ -1288,7 +1288,7 @@
                 Debug.logWarning("visitedSet already contains:" + contentId, module);
                 return;
             } else {
-                visitedSet.add(contentId);  
+                visitedSet.add(contentId);
             }
         }
         String contentTypeId = content.getString("contentTypeId");
@@ -1305,10 +1305,10 @@
         } else if (contentTypeId.equals("SUBPAGE_NODE")) {
             newContentTypeId = "PAGE_NODE";
         }
-            
+
         content.put("contentTypeId", newContentTypeId);
         content.store();
-        
+
         if (contentTypeId == null || contentTypeId.equals("DOCUMENT") || contentTypeId.equals("OUTLINE_NODE")) {
         //if (contentTypeId == null || contentTypeId.equals("DOCUMENT")) {
             List kids = ContentWorker.getAssociatedContent(content, "from", UtilMisc.toList("SUB_CONTENT"), null, null, null);
@@ -1337,11 +1337,11 @@
              results.put("_LIST_", lst);
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
-            return ServiceUtil.returnError(e.toString());            
+            return ServiceUtil.returnError(e.toString());
         }
         return results;
     }
-    
+
     public static String updateTypeAndFile(GenericValue dataResource, Map context) {
         String retVal = null;
         String mimeTypeId = (String) context.get("_imageData_contentType");
@@ -1360,20 +1360,20 @@
 
     public static Map<String, Object> initContentChildCounts(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
         Map result = FastMap.newInstance();
-        
+
             GenericValue content = (GenericValue)context.get("content");
             if (content == null) {
                     return ServiceUtil.returnError("No Content found.");
             }
             Long leafCount = (Long)content.get("childLeafCount");
             if (leafCount == null) {
-                content.set("childLeafCount", Long.valueOf(0));
+                content.set("childLeafCount", Long.valueOf(0));
             }
             Long branchCount = (Long)content.get("childBranchCount");
             if (branchCount == null) {
-                content.set("childBranchCount", Long.valueOf(0));
+                content.set("childBranchCount", Long.valueOf(0));
             }
-            
+
             //content.store();
 
         return result;
@@ -1382,10 +1382,10 @@
     public static Map<String, Object> incrementContentChildStats(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
         Map result = FastMap.newInstance();
         GenericDelegator delegator = dctx.getDelegator();
-        
+
             String contentId = (String)context.get("contentId");
             String contentAssocTypeId = (String)context.get("contentAssocTypeId");
-            
+
             try {
                     GenericValue content = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", contentId));
                 if (content == null) {
@@ -1397,21 +1397,21 @@
                 }
                 int changeLeafCount = leafCount.intValue() + 1;
                 int changeBranchCount = 1;
-                
+
                 ContentManagementWorker.updateStatsBottomUp(delegator, contentId, UtilMisc.toList(contentAssocTypeId), changeBranchCount, changeLeafCount);
             } catch (GenericEntityException e) {
                     return ServiceUtil.returnError(e.toString());
             }
         return result;
     }
-    
+
     public static Map<String, Object> decrementContentChildStats(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
         Map result = FastMap.newInstance();
         GenericDelegator delegator = dctx.getDelegator();
-        
+
             String contentId = (String)context.get("contentId");
             String contentAssocTypeId = (String)context.get("contentAssocTypeId");
-            
+
             try {
                     GenericValue content = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", contentId));
                 if (content == null) {
@@ -1423,7 +1423,7 @@
                 }
                 int changeLeafCount = -1 * leafCount.intValue() - 1;
                 int changeBranchCount = -1;
-                
+
                 ContentManagementWorker.updateStatsBottomUp(delegator, contentId, UtilMisc.toList(contentAssocTypeId), changeBranchCount, changeLeafCount);
             } catch (GenericEntityException e) {
                     return ServiceUtil.returnError(e.toString());
@@ -1434,7 +1434,7 @@
     public static Map<String, Object> updateContentChildStats(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
         Map result = FastMap.newInstance();
         GenericDelegator delegator = dctx.getDelegator();
-    
+
         String contentId = (String)context.get("contentId");
         String contentAssocTypeId = (String)context.get("contentAssocTypeId");
         List typeList = FastList.newInstance();
@@ -1443,7 +1443,7 @@
         } else {
             typeList = UtilMisc.toList("PUBLISH_LINK", "SUB_CONTENT");
         }
-        
+
         try {
             ContentManagementWorker.updateStatsTopDown(delegator, contentId, typeList);
         } catch (GenericEntityException e) {
@@ -1451,13 +1451,13 @@
         }
         return result;
     }
-    
+
     public static Map<String, Object> updateContentSubscription(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
         Map result = FastMap.newInstance();
         GenericDelegator delegator = dctx.getDelegator();
         LocalDispatcher dispatcher = dctx.getDispatcher();
         Timestamp nowTimestamp = UtilDateTime.nowTimestamp();
-        
+
         String partyId = (String) context.get("partyId");
         String webPubPt = (String) context.get("contentId");
         String roleTypeId = (String) context.get("useRoleTypeId");
@@ -1477,7 +1477,7 @@
         } catch (GenericEntityException e) {
             return ServiceUtil.returnError(e.toString());
         }
-        
+
         if (contentRole == null) {
             contentRole = delegator.makeValue("ContentRole");
             contentRole.set("contentId", webPubPt);
@@ -1485,7 +1485,7 @@
             contentRole.set("roleTypeId", roleTypeId);
             contentRole.set("fromDate", nowTimestamp);
         }
-        
+
         Timestamp thruDate = (Timestamp) contentRole.get("thruDate");
         if (thruDate == null) {
             // no thruDate? start with NOW
@@ -1501,13 +1501,13 @@
         calendar.setTime(thruDate);
         int field = Calendar.MONTH;
         if ("TF_day".equals(useTimeUomId)) {
-            field = Calendar.DAY_OF_YEAR;  
+            field = Calendar.DAY_OF_YEAR;
         } else if ("TF_wk".equals(useTimeUomId)) {
-            field = Calendar.WEEK_OF_YEAR;  
+            field = Calendar.WEEK_OF_YEAR;
         } else if ("TF_mon".equals(useTimeUomId)) {
-            field = Calendar.MONTH;  
+            field = Calendar.MONTH;
         } else if ("TF_yr".equals(useTimeUomId)) {
-            field = Calendar.YEAR;  
+            field = Calendar.YEAR;
         } else {
             Debug.logWarning("Don't know anything about useTimeUomId [" + useTimeUomId + "], defaulting to month", module);
         }
@@ -1530,7 +1530,7 @@
         }
         return result;
     }
-    
+
     public static Map<String, Object> updateContentSubscriptionByProduct(DispatchContext dctx, Map<String, ? extends Object> rcontext) throws GenericServiceException{
         Map<String, Object> context = UtilMisc.makeMapWritable(rcontext);
         Map result = FastMap.newInstance();
@@ -1541,10 +1541,10 @@
         if (qty == null) {
             qty = Integer.valueOf(1);
         }
-        
+
         Timestamp orderCreatedDate = (Timestamp) context.get("orderCreatedDate");
         if (orderCreatedDate == null) {
-            orderCreatedDate = UtilDateTime.nowTimestamp();  
+            orderCreatedDate = UtilDateTime.nowTimestamp();
         }
         GenericValue productContent = null;
            try {
@@ -1553,9 +1553,9 @@
             List listOrdered = EntityUtil.orderBy(listFiltered, UtilMisc.toList("purchaseFromDate", "purchaseThruDate"));
             List listThrusOnly = EntityUtil.filterOutByCondition(listOrdered, EntityCondition.makeCondition("purchaseThruDate", EntityOperator.EQUALS, null));
             if (listThrusOnly.size() > 0) {
-                productContent = (GenericValue) listThrusOnly.get(0);  
+                productContent = (GenericValue) listThrusOnly.get(0);
             } else if (listOrdered.size() > 0) {
-                productContent = (GenericValue) listOrdered.get(0);  
+                productContent = (GenericValue) listOrdered.get(0);
             }
         } catch (GenericEntityException e) {
             Debug.logError(e.toString(), module);
@@ -1564,7 +1564,7 @@
         if (productContent == null) {
             String msg = "No ProductContent found for productId:" + productId;
             Debug.logError(msg, module);
-            return ServiceUtil.returnError(msg);
+            return ServiceUtil.returnError(msg);
         }
         Long useTime = (Long)productContent.get("useTime");
         Integer newUseTime = Integer.valueOf(useTime.intValue() * qty.intValue());
@@ -1577,16 +1577,16 @@
         result = dispatcher.runSync("updateContentSubscription", ctx);
         return result;
     }
-    
+
     public static Map<String, Object> updateContentSubscriptionByOrder(DispatchContext dctx, Map<String, ? extends Object> rcontext) throws GenericServiceException{
         Map<String, Object> context = UtilMisc.makeMapWritable(rcontext);
         Map result = FastMap.newInstance();
         GenericDelegator delegator = dctx.getDelegator();
         LocalDispatcher dispatcher = dctx.getDispatcher();
         String orderId = (String) context.get("orderId");
-        
+
         Debug.logInfo("In updateContentSubscriptionByOrder service with orderId: " + orderId, module);
-        
+
         GenericValue orderHeader = null;
         try {
             List orderRoleList = delegator.findByAnd("OrderRole", UtilMisc.toMap("orderId", orderId, "roleTypeId", "END_USER_CUSTOMER"));
@@ -1596,13 +1596,13 @@
                 context.put("partyId", partyId);
             } else {
                 String msg = "No OrderRole found for orderId:" + orderId;
-                return ServiceUtil.returnFailure(msg);
-                
+                return ServiceUtil.returnFailure(msg);
+
             }
             orderHeader = delegator.findByPrimaryKeyCache("OrderHeader", UtilMisc.toMap("orderId", orderId));
             if (orderHeader == null) {
                 String msg = "No OrderHeader found for orderId:" + orderId;
-                return ServiceUtil.returnError(msg);
+                return ServiceUtil.returnError(msg);
             }
             Timestamp orderCreatedDate = (Timestamp) orderHeader.get("orderDate");
             context.put("orderCreatedDate", orderCreatedDate);
@@ -1610,7 +1610,7 @@
             Iterator orderItemIter = orderItemList.iterator();
                 ModelService subscriptionModel = dispatcher.getDispatchContext().getModelService("updateContentSubscriptionByProduct");
             while (orderItemIter.hasNext()) {
-                GenericValue orderItem = (GenericValue)orderItemIter.next();  
+                GenericValue orderItem = (GenericValue)orderItemIter.next();
                 BigDecimal qty = orderItem.getBigDecimal("quantity");
                 String productId = (String) orderItem.get("productId");
                 List productContentList = delegator.findByAnd("ProductContent", UtilMisc.toMap("productId", productId, "productContentTypeId", "ONLINE_ACCESS"));
@@ -1619,7 +1619,7 @@
                     context.put("productId", productId);
                     context.put("quantity", Integer.valueOf(qty.intValue()));
                     Map ctx = subscriptionModel.makeValid(context, "IN");
-                    Map thisResult = dispatcher.runSync("updateContentSubscriptionByProduct", ctx);  
+                    Map thisResult = dispatcher.runSync("updateContentSubscriptionByProduct", ctx);
                 }
             }
         } catch (GenericEntityException e) {
@@ -1630,7 +1630,7 @@
     }
 
     public static Map<String, Object> followNodeChildren(DispatchContext dctx, Map<String, ? extends Object> context) throws GenericServiceException{
-        
+
         Map result = null;
         GenericDelegator delegator = dctx.getDelegator();
         LocalDispatcher dispatcher = dctx.getDispatcher();
@@ -1644,16 +1644,16 @@
         String contentAssocTypeId = (String)context.get("contentAssocTypeId");
         List contentAssocTypeIdList = FastList.newInstance();
         if (UtilValidate.isNotEmpty(contentAssocTypeId)) {
-             contentAssocTypeIdList = StringUtil.split(contentAssocTypeId, "|");  
+             contentAssocTypeIdList = StringUtil.split(contentAssocTypeId, "|");
         }
         if (contentAssocTypeIdList.size() == 0) {
-            contentAssocTypeIdList.add("SUB_CONTENT");  
+            contentAssocTypeIdList.add("SUB_CONTENT");
         }
         Map ctx = FastMap.newInstance();
         ctx.put("userLogin", userLogin);
         ctx.put("contentAssocTypeIdList", contentAssocTypeIdList);
         try {
-            
+
             GenericValue content = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId));
             result = followNodeChildrenMethod(content, dispatcher, serviceName, ctx);
         } catch (GenericEntityException e) {
@@ -1662,9 +1662,9 @@
         }
         return result;
     }
-    public static Map followNodeChildrenMethod(GenericValue content,  LocalDispatcher dispatcher, String serviceName, Map context)
+    public static Map followNodeChildrenMethod(GenericValue content,  LocalDispatcher dispatcher, String serviceName, Map context)
         throws GenericEntityException, GenericServiceException {
-        
+
         Map result = null;
         String contentId = content.getString("contentId");
         List contentAssocTypeIdList = (List)context.get("contentAssocTypeIdList" );
@@ -1677,13 +1677,13 @@
                 Debug.logWarning("visitedSet already contains:" + contentId, module);
                 return ServiceUtil.returnError("visitedSet already contains:" + contentId);
             } else {
-                visitedSet.add(contentId);  
+                visitedSet.add(contentId);
             }
         }
 
         GenericValue userLogin = (GenericValue)context.get("userLogin");
         result = dispatcher.runSync(serviceName, UtilMisc.toMap("content", content, "userLogin", userLogin));
-        
+
         List kids = ContentWorker.getAssociatedContent(content, "from", contentAssocTypeIdList, null, null, null);
         Iterator iter = kids.iterator();
         while (iter.hasNext()) {
@@ -1713,7 +1713,7 @@
               return ServiceUtil.returnError(e.toString());
           }
       }
-      
+
       try {
           ModelService persistContentAndAssocModel = dispatcher.getDispatchContext().getModelService("persistContentAndAssoc");
           Map ctx = persistContentAndAssocModel.makeValid(context, "IN");
@@ -1738,7 +1738,7 @@
           } else {
               parentList.add(masterRevisionContentId);
           }
-          
+
           // Update ContentRevision and ContentRevisonItem
           Map contentRevisionMap = FastMap.newInstance();
           contentRevisionMap.put("itemContentId", contentId);
@@ -1754,7 +1754,7 @@
                   return ServiceUtil.returnError(errorMsg);
               }
           }
-          
+
       } catch (GenericServiceException e) {
           Debug.logError(e.toString(), module);
           return ServiceUtil.returnError(e.toString());

Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementWorker.java?rev=757086&r1=757085&r2=757086&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementWorker.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementWorker.java Sat Mar 21 23:43:51 2009
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -82,7 +82,7 @@
         if (lookupCaches == null) {
             lookupCaches = FastMap.newInstance();
             session.setAttribute("lookupCaches", lookupCaches);
-        }    
+        }
         String entityName = pk.getEntityName();
 
         mruAddByEntityName( entityName, pk, lookupCaches);
@@ -92,7 +92,7 @@
     * Makes an entry in the "most recently used" cache. It picks the cache
     * by the entity name and builds a signature from the primary key values.
     *
-    * @param entityName
+    * @param entityName
     * @param lookupCaches
     * @param pk either a GenericValue or GenericPK - populated
     */
@@ -103,8 +103,8 @@
         if (lkupCache == null) {
             lkupCache    = new LifoSet();
             lookupCaches.put(cacheEntityName, lkupCache);
-        }    
-        
+        }
+
         lkupCache.add(pk.getPrimaryKey());
         if (Debug.infoOn()) Debug.logInfo("in mruAddByEntityName, entityName:" + entityName + " lifoSet.size()" + lkupCache.size(), module);
     }
@@ -116,8 +116,8 @@
         if (lkupCache == null) {
             lkupCache    = new LifoSet();
             lookupCaches.put(cacheEntityName, lkupCache);
-        }    
-        
+        }
+
         Iterator mrvIterator = lkupCache.iterator();
         return mrvIterator;
     }
@@ -153,7 +153,7 @@
 
 
     public static void setCurrentEntityMap(HttpServletRequest request, GenericEntity ent) {
-    
+
         String entityName = ent.getEntityName();
         setCurrentEntityMap(request, entityName, ent);
     }
@@ -306,7 +306,7 @@
             request.setAttribute("currentPK", currentPK);
             GenericValue currentValue = null;
             try {
-                currentValue = delegator.findOne(currentPK.getEntityName(), currentPK, false);
+                currentValue = delegator.findOne(currentPK.getEntityName(), currentPK, false);
             } catch (GenericEntityException e) {
             }
             request.setAttribute("currentValue", currentValue);
@@ -317,7 +317,7 @@
     public static List getPermittedPublishPoints(GenericDelegator delegator, List allPublishPoints, GenericValue userLogin, Security security, String permittedAction, String permittedOperations, String passedRoles) throws GeneralException {
 
         List permittedPublishPointList = FastList.newInstance();
-        
+
         // Check that user has permission to admin sites
         Iterator it = allPublishPoints.iterator();
         while (it.hasNext()) {
@@ -515,12 +515,12 @@
 
     public static String getParentWebSitePublishPointId(GenericDelegator delegator, String  contentId) throws GenericEntityException {
 
-        
+
         String contentIdTo = null;
         List contentAssocList = delegator.findByAndCache("ContentAssoc", UtilMisc.toMap("contentId", contentId, "contentAssocTypeId", "SUBSITE"));
         List filteredContentAssocList = EntityUtil.filterByDate(contentAssocList);
         if (filteredContentAssocList.size() > 0) {
-            GenericValue contentAssoc = (GenericValue)filteredContentAssocList.get(0);
+            GenericValue contentAssoc = (GenericValue)filteredContentAssocList.get(0);
             if (contentAssoc != null)
                 contentIdTo = contentAssoc.getString("contentIdTo");
         }
@@ -663,7 +663,7 @@
     public static List getPermittedDepartmentPoints(GenericDelegator delegator, List allDepartmentPoints, GenericValue userLogin, Security security, String permittedAction, String permittedOperations, String passedRoles) throws GeneralException {
 
         List permittedDepartmentPointList = FastList.newInstance();
-        
+
         // Check that user has permission to admin sites
         Iterator it = allDepartmentPoints.iterator();
         while (it.hasNext()) {
@@ -695,7 +695,7 @@
     }
 
     /**
-     Returns a list of "department" (having ContentAssoc of type "DEPARTMENT")
+     Returns a list of "department" (having ContentAssoc of type "DEPARTMENT")
      Content entities that are children of parentPubPt
 
      @param parentPubPt The parent publish point.
@@ -740,7 +740,7 @@
         GenericValue thisContent = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId));
         if (thisContent == null)
             throw new RuntimeException("No entity found for id=" + contentId);
-        
+
        EntityCondition conditionMain = null;
        if (typeList.size() > 0 ) {
            EntityCondition conditionType = EntityCondition.makeCondition("contentAssocTypeId", EntityOperator.IN, typeList);
@@ -756,22 +756,22 @@
             String subContentId = contentAssoc.getString("contentId");
             subLeafCount += updateStatsTopDown(delegator, subContentId, typeList);
         }
-        
+
         // If no children, count this as a leaf
         if (subLeafCount == 0)
             subLeafCount = 1;
         thisContent.put("childBranchCount", Long.valueOf(listFiltered.size()));
         thisContent.put("childLeafCount", Long.valueOf(subLeafCount));
         thisContent.store();
-        
+
         return subLeafCount;
     }
-    
+
     public static void updateStatsBottomUp(GenericDelegator delegator, String contentId, List typeList, int branchChangeAmount, int leafChangeAmount) throws GenericEntityException {
         GenericValue thisContent = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId));
         if (thisContent == null)
             throw new RuntimeException("No entity found for id=" + contentId);
-        
+
        EntityCondition conditionType = EntityCondition.makeCondition("contentAssocTypeId", EntityOperator.IN, typeList);
        EntityCondition conditionMain = EntityCondition.makeCondition(UtilMisc.toList( EntityCondition.makeCondition("contentId", EntityOperator.EQUALS, contentId), conditionType), EntityOperator.AND);
             List listAll = delegator.findList("ContentAssoc", conditionMain, null, null, null, true);
@@ -786,21 +786,21 @@
                 if (leafCount != null) {
                     intLeafCount = leafCount.intValue();
                 }
-                contentTo.set("childLeafCount", Long.valueOf(intLeafCount + leafChangeAmount));
-                
+                contentTo.set("childLeafCount", Long.valueOf(intLeafCount + leafChangeAmount));
+
                 if (branchChangeAmount != 0) {
                     int intBranchCount = 0;
                     Long branchCount = (Long)contentTo.get("childBranchCount");
                     if (branchCount != null) {
                         intBranchCount = branchCount.intValue();
                     }
-                    contentTo.set("childBranchCount", Long.valueOf(intBranchCount + branchChangeAmount));
+                    contentTo.set("childBranchCount", Long.valueOf(intBranchCount + branchChangeAmount));
                 }
                 contentTo.store();
                 updateStatsBottomUp(delegator, contentIdTo, typeList, 0, leafChangeAmount);
             }
-            
-        
+
+
     }
-    
+
 }

Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/ConvertTree.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/ConvertTree.java?rev=757086&r1=757085&r2=757086&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/ConvertTree.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/ConvertTree.java Sat Mar 21 23:43:51 2009
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -47,8 +47,8 @@
 This program will convert the output of the DOS 'tree' command into a contantAssoc tree.
 the leaves in the tree will point to filenames on the local disk.
 
-With this program and the content navigation a office file server can be replaced with a
-document tree in OFBiz. From that point on the documents can be connected to the cutomers,
+With this program and the content navigation a office file server can be replaced with a
+document tree in OFBiz. From that point on the documents can be connected to the cutomers,
 orders, invoices etc..
 
 In order ta make this service active add the following to the service definition file:
@@ -93,7 +93,7 @@
                         Entity.set("createdStamp",UtilDateTime.nowTimestamp());
                         Entity.set("createdTxStamp",UtilDateTime.nowTimestamp());
                         delegator.create(Entity);
-                        
+
                         Entity = null;
                         Entity = delegator.makeValue("Content");
                         Entity.set("contentId", "HOME_DUCUMENT");
@@ -117,13 +117,13 @@
                         int recordCount = 0;
                         while (( line = input.readLine()) != null) {//start line
                              boolean hasFolder=true;
-                             String
+                             String
                              rootContent=null,
                              contentId = null;
                              counterLine++;
                              if (counterLine>1) {
                                 size = line.length();
-                                String
+                                String
                                 check = "\\",
                                 checkSubContent = ",",
                                 contentName = "",
@@ -132,7 +132,7 @@
                                 //Debug.log("======Data======"+data);
                                 size = data.length();
                                 List<GenericValue> contents = null;
-                                
+
                                 for(int index = 0; index< size; index++) {//start character in line
                                     boolean contentNameMatch = false;
                                     int contentAssocSize=0;
@@ -160,7 +160,7 @@
                                                      GenericValue contentcheck = delegator.findByPrimaryKey("Content",UtilMisc.toMap("contentId",contentAss.get("contentId")));
                                                      if (contentcheck!=null) {
                                                          if (contentcheck.get("contentName").equals(contentName) && contentNameMatch==false) {
-                                                             contentNameMatch = true;
+                                                             contentNameMatch = true;
                                                              contentId = contentcheck.get("contentId").toString();
                                                          }
                                                      }
@@ -168,11 +168,11 @@
                                             } else {
                                                 rootContent = "HOME_DUCUMENT";
                                                 contentAssocs= delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId",contentId, "contentIdTo", rootContent));
-                                                
+
                                             }
                                             contentAssocSize=contentAssocs.size();
                                         }
-                                        
+
                                         if ( contentAssocSize == 0 && contentNameMatch==false) {//New Root Content
                                             Entity = null;
                                             contentId = delegator.getNextSeqId("Content");
@@ -197,7 +197,7 @@
                                         if (rootContent==null) {
                                             rootContent = "HOME_DUCUMENT";
                                         }
-                                            contentAssocs = delegator.findByAnd("ContentAssoc",
+                                            contentAssocs = delegator.findByAnd("ContentAssoc",
                                                     UtilMisc.toMap("contentId",contentId,"contentIdTo",rootContent,"contentAssocTypeId","TREE_CHILD"));
                                             if (contentAssocs.size()==0) {
                                                 contentAssoc = FastMap.newInstance();
@@ -253,12 +253,12 @@
                     return ServiceUtil.returnError(errMsg);
                 }
     }
-    
+
     public static  Map<String,Object> createSubContent(int index,String line,String rootContent, Map context, DispatchContext dctx) {
         GenericDelegator delegator = dctx.getDelegator();
         LocalDispatcher dispatcher = dctx.getDispatcher();
         GenericValue userLogin = (GenericValue) context.get("userLogin");
-        String
+        String
         subContents=null,
         check = ",",
         oldChar = "\"",
@@ -317,7 +317,7 @@
                         Entity.set("createdStamp",UtilDateTime.nowTimestamp());
                         Entity.set("createdTxStamp",UtilDateTime.nowTimestamp());
                         delegator.create(Entity);
-                        
+
                         //Relation Content
                         Map<String,Object> contentAssoc = FastMap.newInstance();
                         contentAssoc.put("contentId", contentId);
@@ -329,7 +329,7 @@
                     contentName ="";
                     contentNameInprogress="";
                 }
-                
+
                    if ((subContents.charAt(index))!= check.charAt(0)) {
                         contentNameInprogress = contentNameInprogress.concat(Character.toString(subContents.charAt(index)));
                         if (contentNameInprogress.length() > 99) {
@@ -377,7 +377,7 @@
                         Entity.set("createdStamp",UtilDateTime.nowTimestamp());
                         Entity.set("createdTxStamp",UtilDateTime.nowTimestamp());
                         delegator.create(Entity);
-                        
+
                         //create ContentAssoc
                         Map<String,Object> contentAssoc = FastMap.newInstance();
                         contentAssoc.put("contentId", contentId);
@@ -387,7 +387,7 @@
                         dispatcher.runSync("createContentAssoc", contentAssoc);
                     }
                    }
-    
+
             }
         return ServiceUtil.returnSuccess(sucMsg);
         } catch (GenericEntityException e) {

Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/blog/BlogRssServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/blog/BlogRssServices.java?rev=757086&r1=757085&r2=757086&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/blog/BlogRssServices.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/blog/BlogRssServices.java Sat Mar 21 23:43:51 2009
@@ -133,7 +133,7 @@
                     entry.setPublishedDate(v.getTimestamp("createdDate"));
                     entry.setDescription(desc);
                     entry.setLink(thisLink);
-                    entry.setAuthor((v.getString("createdByUserLogin")));                    
+                    entry.setAuthor((v.getString("createdByUserLogin")));
                     entries.add(entry);
                 }
             }

Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/cms/CmsEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/cms/CmsEvents.java?rev=757086&r1=757085&r2=757086&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/cms/CmsEvents.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/cms/CmsEvents.java Sat Mar 21 23:43:51 2009
@@ -65,7 +65,7 @@
         LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher");
         ServletContext servletContext = request.getSession().getServletContext();
         HttpSession session = request.getSession();
-        
+
         String webSiteId = (String) session.getAttribute("webSiteId");
         if (webSiteId == null) {
             webSiteId = WebSiteWorker.getWebSiteId(request);
@@ -130,9 +130,9 @@
             }
             if (pathInfo.endsWith("/")) {
                 pathInfo = pathInfo.substring(0, pathInfo.length() - 1);
-            }                        
+            }
             Debug.log("Path INFO for Alias: " + pathInfo, module);
-            
+
             GenericValue pathAlias = null;
             try {
                 pathAlias = delegator.findByPrimaryKeyCache("WebSitePathAlias", UtilMisc.toMap("webSiteId", webSiteId, "pathAlias", pathInfo));
@@ -198,12 +198,12 @@
                 MapStack<String> templateMap = MapStack.create();
                 ScreenRenderer.populateContextForRequest(templateMap, null, request, response, servletContext);
                 templateMap.put("formStringRenderer", new HtmlFormRenderer(request, response));
-                
+
                 // make the link prefix
                 ServletContext ctx = (ServletContext) request.getAttribute("servletContext");
                 RequestHandler rh = (RequestHandler) ctx.getAttribute("_REQUEST_HANDLER_");
                 templateMap.put("_REQUEST_HANDLER_", rh);
-                
+
                 // NOTE DEJ20080817: this is done in the ContentMapFacade class now to avoid problems with the jsessionid being in the middle of the URL and such
                 //String contextLinkPrefix = rh.makeLink(request, response, "", true, false, true);
                 //templateMap.put("_CONTEXT_LINK_PREFIX_", contextLinkPrefix);
@@ -226,7 +226,7 @@
                     if (UtilValidate.isEmpty(mapKey)) {
                         ContentWorker.renderContentAsText(dispatcher, delegator, contentId, writer, templateMap, locale, "text/html", true);
                     } else {
-                        ContentWorker.renderSubContentAsText(dispatcher, delegator, contentId, writer, mapKey, templateMap, locale, "text/html", true);                        
+                        ContentWorker.renderSubContentAsText(dispatcher, delegator, contentId, writer, mapKey, templateMap, locale, "text/html", true);
                     }
 
                 } catch (IOException e) {
@@ -253,7 +253,7 @@
             }
         }
         String siteName = null;
-        try {
+        try {
             siteName = delegator.findByPrimaryKeyCache("WebSite", UtilMisc.toMap("webSiteId", webSiteId)).getString("siteName");
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
@@ -281,7 +281,7 @@
             return true;
         } else {
             // the passed in contentId is not a publish point for the web site;
-            // however we will publish its content if it is a node of one of the trees that have a publish point as the root
+            // however we will publish its content if it is a node of one of the trees that have a publish point as the root
             List<GenericValue> topLevelContentValues = delegator.findByAndCache("WebSiteContent",
                 UtilMisc.toMap("webSiteId", webSiteId, "webSiteContentTypeId", "PUBLISH_POINT"), UtilMisc.toList("-fromDate"));
             topLevelContentValues = EntityUtil.filterByDate(topLevelContentValues);

Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/compdoc/CompDocEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/compdoc/CompDocEvents.java?rev=757086&r1=757085&r2=757086&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/compdoc/CompDocEvents.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/compdoc/CompDocEvents.java Sat Mar 21 23:43:51 2009
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -56,13 +56,13 @@
  */
 public class CompDocEvents {
     public static final String module = CompDocEvents.class.getName();
-    
-    /**
-     *
+
+    /**
+     *
      * @param request
      * @param response
      * @return
-     *
+     *
      * Creates the topmost Content entity of a Composite Document tree.
      * Also creates an "empty" Composite Document Instance Content entity.
      * Creates ContentRevision/Item records for each, as well.
@@ -78,7 +78,7 @@
         GenericValue userLogin = (GenericValue)session.getAttribute("userLogin");
         String contentId = (String)paramMap.get("contentId");
         //String instanceContentId = null;
-        
+
         boolean contentExists = true;
         if (UtilValidate.isEmpty(contentId)) {
             contentExists = false;
@@ -93,7 +93,7 @@
                 return "error";
            }
         }
-        
+
         ModelService modelService = null;
         try {
             modelService = dispatcher.getDispatchContext().getModelService("persistContentAndAssoc");
@@ -136,7 +136,7 @@
                 request.setAttribute("_ERROR_MESSAGE_", "<li>" + errMsg + "</li>");
                 return "error";
             }
-            
+
         } catch (GenericServiceException e) {
             String errMsg = "Error running serviceName, 'persistContentAndAssoc'. " + e.toString();
             Debug.logError(errMsg, module);
@@ -145,7 +145,7 @@
         }
         return "success";
     }
-    
+
     public static String padNumberWithLeadingZeros(Long num, Integer padLen) {
         String s = UtilFormatOut.formatPaddedNumber(num.longValue(), padLen.intValue());
         return s;
@@ -164,7 +164,7 @@
         String rootDir = null;
         String webSiteId = null;
         String https = null;
-        
+
         if (UtilValidate.isEmpty(rootDir)) {
             rootDir = servletContext.getRealPath("/");
         }
@@ -174,7 +174,7 @@
         if (UtilValidate.isEmpty(https)) {
             https = (String) servletContext.getAttribute("https");
         }
-        
+
         Map mapIn = FastMap.newInstance();
         mapIn.put("contentId", contentId);
         mapIn.put("locale", locale);
@@ -182,7 +182,7 @@
         mapIn.put("webSiteId", webSiteId);
         mapIn.put("https", https);
         mapIn.put("userLogin", userLogin);
-        
+
         Map results = null;
         try {
             results = dispatcher.runSync("renderCompDocPdf", mapIn);
@@ -196,19 +196,19 @@
             request.setAttribute("_ERROR_MESSAGE_", e.toString());
             return "error";
         }
-        
+
         if (ServiceUtil.isError(results)) {
             request.setAttribute("_ERROR_MESSAGE_", ServiceUtil.getErrorMessage(results));
             return "error";
         }
-        
+
         ByteBuffer outByteBuffer = (ByteBuffer) results.get("outByteBuffer");
 
         // setup content type
         String contentType = "application/pdf; charset=ISO-8859-1";
 
         ByteArrayInputStream bais = new ByteArrayInputStream(outByteBuffer.array());
-        
+
         /*
         try {
             FileOutputStream fos = new FileOutputStream(FileUtil.getFile("/home/byersa/pdftest.pdf"));
@@ -238,7 +238,7 @@
         String rootDir = null;
         String webSiteId = null;
         String https = null;
-        
+
         if (UtilValidate.isEmpty(rootDir)) {
             rootDir = servletContext.getRealPath("/");
         }
@@ -248,7 +248,7 @@
         if (UtilValidate.isEmpty(https)) {
             https = (String) servletContext.getAttribute("https");
         }
-        
+
         Map mapIn = FastMap.newInstance();
         mapIn.put("contentId", contentId);
         mapIn.put("locale", locale);
@@ -256,7 +256,7 @@
         mapIn.put("webSiteId", webSiteId);
         mapIn.put("https", https);
         mapIn.put("userLogin", userLogin);
-        
+
         Map results = null;
         try {
             results = dispatcher.runSync("renderContentPdf", mapIn);
@@ -270,19 +270,19 @@
             request.setAttribute("_ERROR_MESSAGE_", e.toString());
             return "error";
         }
-        
+
         if (ServiceUtil.isError(results)) {
             request.setAttribute("_ERROR_MESSAGE_", ServiceUtil.getErrorMessage(results));
             return "error";
         }
-        
+
         ByteBuffer outByteBuffer = (ByteBuffer) results.get("outByteBuffer");
 
         // setup content type
         String contentType = "application/pdf; charset=ISO-8859-1";
 
         ByteArrayInputStream bais = new ByteArrayInputStream(outByteBuffer.array());
-        
+
         /*
         try {
             FileOutputStream fos = new FileOutputStream(FileUtil.getFile("/home/byersa/pdftest.pdf"));