Author: ashish
Date: Sat Jul 16 14:10:10 2016
New Revision: 1752965

URL: http://svn.apache.org/viewvc?rev=1752965&view=rev
Log:
Applied patch from jira issue - OFBIZ-7838 - Clean up commented out code in 
Java source for Content.
Thanks so much Harsh for the contribution.

Modified:
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementEvents.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementServices.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementWorker.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ConvertTree.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/cms/CmsEvents.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/compdoc/CompDocEvents.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/compdoc/CompDocServices.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentEvents.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentKeywordIndex.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentMapFacade.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentPermissionServices.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearch.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServices.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServicesComplex.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/PermissionRecorder.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/UploadContentAndImage.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/data/DataResourceWorker.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/data/DataServices.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/layout/LayoutEvents.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/layout/LayoutWorker.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/openoffice/OpenOfficeByteArrayOutputStream.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/openoffice/OpenOfficeServices.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/openoffice/OpenOfficeWorker.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/survey/PdfSurveyServices.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/survey/SurveyWrapper.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/CheckPermissionTransform.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/EditRenderSubContentCacheTransform.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/EditRenderSubContentTransform.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/InjectNodeTrailCsvTransform.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/LimitedSubContentCacheTransform.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/LoopSubContentTransform.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderContentAndSubContent.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderContentAsText.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderContentTransform.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderSubContentAsText.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderSubContentCacheTransform.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderSubContentTransform.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/TraverseSubContentCacheTransform.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/TraverseSubContentTransform.java
    
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/WrapSubContentCacheTransform.java

Modified: 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementEvents.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementEvents.java?rev=1752965&r1=1752964&r2=1752965&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementEvents.java
 (original)
+++ 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementEvents.java
 Sat Jul 16 14:10:10 2016
@@ -64,7 +64,6 @@ public class ContentManagementEvents {
         Delegator delegator = (Delegator)request.getAttribute("delegator");
         LocalDispatcher dispatcher = 
(LocalDispatcher)request.getAttribute("dispatcher");
         Map<String, Object> paramMap = UtilHttp.getParameterMap(request);
-        //if (Debug.infoOn()) Debug.logInfo("in updateStaticValues, paramMap:" 
+ paramMap , module);
         String parentPlaceholderId = (String)paramMap.get("ph");
         if (UtilValidate.isEmpty(parentPlaceholderId)) {
             request.setAttribute("_ERROR_MESSAGE_", "ParentPlaceholder is 
empty.");
@@ -82,33 +81,15 @@ public class ContentManagementEvents {
             request.setAttribute("_ERROR_MESSAGE_", e.getMessage());
             return "error";
         }
-/*
-        Set keySet = paramMap.keySet();
-        Iterator itKeySet = keySet.iterator();
-        Map contentIdLookup = new HashMap<String, Object>();
-        while (itKeySet.hasNext()) {
-            String idxAndContentId = (String)itKeySet.next();
-            int pos = idxAndContentId.indexOf("_");
-            if (pos > 0) {
-                String idxStr = idxAndContentId.substring(0, pos);
-                int idx = Integer.parseInt(idxStr);
-                String contentId = idxAndContentId.substring(pos + 1);
-                contentIdLookup.put(contentId, Integer.valueOf(idx));
-            }
-        }
-*/
 
         int counter = 0;
         for (Map<String, Object> map : valueList) {
             String contentId = (String)map.get("contentId");
-            //Integer idxObj = (Integer)contentIdLookup.get(contentId);
-            //int idx = idxObj.intValue();
             for (String [] pubArr : permittedPublishPointList) {
                 String pubContentId = pubArr[0];
                 String pubValue = (String)map.get(pubContentId);
                 String paramName = Integer.toString(counter)  + "_" + 
pubContentId;
                 String paramValue = (String)paramMap.get(paramName);
-                //if (Debug.infoOn()) Debug.logInfo("in updateStaticValues, 
contentId:" + contentId + " pubContentId:" + pubContentId + " pubValue:" + 
pubValue + " paramName:" + paramName + " paramValue:" + paramValue, module);
                 Map<String, Object> serviceIn = new HashMap<String, Object>();
                 serviceIn.put("userLogin", userLogin);
                 serviceIn.put("contentIdTo", contentId);
@@ -160,7 +141,6 @@ public class ContentManagementEvents {
         Delegator delegator = (Delegator)request.getAttribute("delegator");
         LocalDispatcher dispatcher = 
(LocalDispatcher)request.getAttribute("dispatcher");
         Map<String, Object> paramMap = UtilHttp.getParameterMap(request);
-        //if (Debug.infoOn()) Debug.logInfo("in updatePublishLinks, paramMap:" 
+ paramMap , module);
         String targContentId = (String)paramMap.get("contentId"); // The 
content to be linked to one or more sites
         String roles = null;
         String authorId = null;
@@ -174,7 +154,6 @@ public class ContentManagementEvents {
 
         // Determine if user is owner of target content
         String userLoginId = userLogin.getString("userLoginId");
-        //if (Debug.infoOn()) Debug.logInfo("in updatePublishLinks, 
userLoginId:" + userLoginId + " authorId:" + authorId , module);
         List<String> roleTypeList = null;
         if (authorId != null && userLoginId != null && 
authorId.equals(userLoginId)) {
             roles = "OWNER";
@@ -182,7 +161,6 @@ public class ContentManagementEvents {
         }
         List<String> targetOperationList = 
UtilMisc.<String>toList("CONTENT_PUBLISH");
         List<String> contentPurposeList = null; //UtilMisc.toList("ARTICLE");
-        //if (Debug.infoOn()) Debug.logInfo("in updatePublishLinks, roles:" + 
roles +" roleTypeList:" + roleTypeList , module);
         String permittedAction = (String)paramMap.get("permittedAction"); // 
The content to be linked to one or more sites
         String permittedOperations = 
(String)paramMap.get("permittedOperations"); // The content to be linked to one 
or more sites
         if (UtilValidate.isEmpty(targContentId)) {
@@ -203,40 +181,31 @@ public class ContentManagementEvents {
             request.setAttribute("_ERROR_MESSAGE_", e2.getMessage());
             return "error";
         }
-                //if (Debug.infoOn()) Debug.logInfo("in updatePublishLinks, 
origPublishedLinkList:" + origPublishedLinkList , module);
 
         // make a map of the values that are passed in using the top subSite 
as the key.
         // Content can only be linked to one subsite under a top site (ends 
with "_MASTER")
         Map<String, String> siteIdLookup = new HashMap<String, String>();
         for (String param : paramMap.keySet()) {
             int pos = param.indexOf("select_");
-                //if (Debug.infoOn()) Debug.logInfo("in updatePublishLinks, 
param:" + param + " pos:" + pos , module);
             if (pos >= 0) {
                 String siteId = param.substring(7);
                 String subSiteVal = (String)paramMap.get(param);
                 siteIdLookup.put(siteId, subSiteVal);
             }
         }
-        //if (Debug.infoOn()) Debug.logInfo("in updatePublishLinks, 
siteIdLookup:" + siteIdLookup , module);
 
         // Loop thru all the possible subsites
         Timestamp nowTimestamp = UtilDateTime.nowTimestamp();
-        // int counter = 0;
         String responseMessage = null;
         String errorMessage = null;
-        // String permissionMessage = null;
         boolean statusIdUpdated = false;
         Map<String, Object> results = null;
         for (Object [] arr : origPublishedLinkList) {
-            //if (Debug.infoOn()) Debug.logInfo("in updatePublishLinks, arr:" 
+ Arrays.asList(arr) , module);
             String contentId = (String)arr[0]; // main (2nd level) site id
             String origSubContentId = null;
             List<Object []> origSubList = UtilGenerics.checkList(arr[1]);
-            // Timestamp topFromDate = (Timestamp)arr[3];
             Timestamp origFromDate = null;
             for (Object [] pubArr : origSubList) {
-            // see if a link already exists by looking for non-null fromDate
-                //if (Debug.infoOn()) Debug.logInfo("in updatePublishLinks, 
pubArr:" + Arrays.asList(pubArr) , module);
                 Timestamp fromDate = (Timestamp)pubArr[2];
                 origSubContentId = null;
                 if (fromDate != null) {
@@ -247,8 +216,6 @@ public class ContentManagementEvents {
             }
 
             String currentSubContentId = siteIdLookup.get(contentId);
-            //if (Debug.infoOn()) Debug.logInfo("in updatePublishLinks, 
currentSubContentId:" + currentSubContentId , module);
-            //if (Debug.infoOn()) Debug.logInfo("in updatePublishLinks, 
origSubContentId:" + origSubContentId , module);
             try {
                 if (UtilValidate.isNotEmpty(currentSubContentId)) {
                     if (!currentSubContentId.equals(origSubContentId)) {
@@ -263,7 +230,6 @@ public class ContentManagementEvents {
                             for (GenericValue cAssoc : oldActiveValues) {
                                 cAssoc.set("thruDate", nowTimestamp);
                                 cAssoc.store();
-                                //if (Debug.infoOn()) Debug.logInfo("in 
updatePublishLinks, deactivating:" + cAssoc , module);
                             }
                         }
                         // create new link
@@ -295,9 +261,7 @@ public class ContentManagementEvents {
                         serviceIn.put("roleTypeList", roleTypeList);
                         serviceIn.put("targetOperationList", 
targetOperationList);
                         serviceIn.put("contentPurposeList", 
contentPurposeList);
-                        //if (Debug.infoOn()) Debug.logInfo("in 
updatePublishLinks, serviceIn(3b):" + serviceIn , module);
                         results = dispatcher.runSync("createContentAssoc", 
serviceIn);
-                        //if (Debug.infoOn()) Debug.logInfo("in 
updatePublishLinks, results(3b):" + results , module);
                         if (!statusIdUpdated) {
                             try {
                                 GenericValue targContent = 
EntityQuery.use(delegator).from("Content").where("contentId", 
targContentId).queryOne();

Modified: 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementServices.java?rev=1752965&r1=1752964&r2=1752965&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementServices.java
 (original)
+++ 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementServices.java
 Sat Jul 16 14:10:10 2016
@@ -71,9 +71,7 @@ public class ContentManagementServices {
      * This service calls a same-named method in ContentWorker to do the work.
      */
     public static Map<String, Object> getSubContent(DispatchContext dctx, 
Map<String, ? extends Object> context) {
-        //Security security = dctx.getSecurity();
         Delegator 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");
@@ -109,10 +107,8 @@ public class ContentManagementServices {
      * This service calls a same-named method in ContentWorker to do the work.
      */
     public static Map<String, Object> getContent(DispatchContext dctx, 
Map<String, ? extends Object> context) {
-        //Security security = dctx.getSecurity();
         Delegator delegator = dctx.getDelegator();
         String contentId = (String) context.get("contentId");
-        //GenericValue userLogin = (GenericValue)context.get("userLogin");
         GenericValue view = null;
 
         try {
@@ -233,22 +229,6 @@ public class ContentManagementServices {
 
         // get user info for multiple use
         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();
-        //Timestamp lastModifiedDate = UtilDateTime.nowTimestamp();
-
-        // Do update and create permission checks on DataResource if warranted.
-        //boolean updatePermOK = false;
-        //boolean createPermOK = false;
-
-
         boolean dataResourceExists = true;
         if (Debug.infoOn()) {
             Debug.logInfo("in persist... dataResourceTypeId(0):" + 
dataResourceTypeId, module);
@@ -296,11 +276,8 @@ public class ContentManagementServices {
                     return ServiceUtil.returnError(e.toString());
                 }
             }
-            //List targetOperations = new LinkedList<String>();
-            //context.put("targetOperations", targetOperations);
             context.putAll(content);
             if (contentExists) {
-                //targetOperations.add("CONTENT_UPDATE");
                 Map<String, Object> contentContext = new HashMap<String, 
Object>();
                 ModelService contentModel = 
dispatcher.getDispatchContext().getModelService("updateContent");
                 contentContext.putAll(contentModel.makeValid(content, "IN"));
@@ -312,9 +289,7 @@ public class ContentManagementServices {
                 if (ServiceUtil.isError(thisResult) || 
ServiceUtil.isFailure(thisResult)) {
                     return 
ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"ContentContentUpdatingError", UtilMisc.toMap("serviceName", 
"persistContentAndAssoc"), locale), null, null, thisResult);
                 }
-                //Map thisResult = ContentServices.updateContentMethod(dctx, 
context);
             } else {
-                //targetOperations.add("CONTENT_CREATE");
                 Map<String, Object> contentContext = new HashMap<String, 
Object>();
                 ModelService contentModel = 
dispatcher.getDispatchContext().getModelService("createContent");
                 contentContext.putAll(contentModel.makeValid(content, "IN"));
@@ -326,8 +301,6 @@ public class ContentManagementServices {
                 if (ServiceUtil.isError(thisResult) || 
ServiceUtil.isFailure(thisResult)) {
                     return 
ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"ContentContentCreatingError", UtilMisc.toMap("serviceName", 
"persistContentAndAssoc"), locale), null, null, thisResult);
                 }
-                //Map thisResult = ContentServices.createContentMethod(dctx, 
context);
-
                 contentId = (String) thisResult.get("contentId");
             }
             results.put("contentId", contentId);
@@ -392,17 +365,6 @@ public class ContentManagementServices {
                     if (ServiceUtil.isError(thisResult) || 
ServiceUtil.isFailure(thisResult) || UtilValidate.isNotEmpty(errMsg)) {
                         return ServiceUtil.returnError(errMsg);
                     }
-                    // results.put("contentIdTo",
-                    // thisResult.get("contentIdTo"));
-                    // results.put("contentIdFrom",
-                    // thisResult.get("contentIdFrom"));
-                    // results.put("contentId",
-                    // thisResult.get("contentIdFrom"));
-                    // results.put("contentAssocTypeId",
-                    // thisResult.get("contentAssocTypeId"));
-                    // results.put("fromDate", thisResult.get("fromDate"));
-                    // results.put("sequenceNum",
-                    // thisResult.get("sequenceNum"));
 
                     results.put("caContentIdTo", 
thisResult.get("contentIdTo"));
                     results.put("caContentId", 
thisResult.get("contentIdFrom"));
@@ -450,21 +412,13 @@ public class ContentManagementServices {
         LocalDispatcher dispatcher = dctx.getDispatcher();
         Delegator delegator = dctx.getDelegator();
         GenericValue userLogin = (GenericValue)context.get("userLogin");
-        //String userLoginPartyId = userLogin.getString("partyId");
       Map<String, Object> results = new HashMap<String, Object>();
-      // siteContentId will equal "ADMIN_MASTER", "AGINC_MASTER", etc.
-      // Remember that this service is called in the "multi" mode,
-      // with a new siteContentId each time.
-      // siteContentId could also have been name deptContentId, since this same
-      // service is used for updating department roles, too.
       String siteContentId = (String)context.get("contentId");
       String partyId = (String)context.get("partyId");
 
       if (UtilValidate.isEmpty(siteContentId) || UtilValidate.isEmpty(partyId))
           return results;
 
-      //Debug.logInfo("updateSiteRoles, context(0):" + context, module);
-
       List<GenericValue> siteRoles = null;
       try {
           siteRoles = 
EntityQuery.use(delegator).from("RoleType").where("parentTypeId", 
"BLOG").cache().queryList();
@@ -495,7 +449,6 @@ public class ContentManagementServices {
           serviceContext.put("roleTypeId", siteRole);
           if (siteRoleVal != null && siteRoleVal.equalsIgnoreCase("Y")) {
               // for now, will assume that any error is due to duplicates - 
ignore
-              //return ServiceUtil.returnError(e.toString());
               if (fromDate == null) {
                   try {
                       Map<String, Object> newContext = new HashMap<String, 
Object>();
@@ -511,7 +464,6 @@ public class ContentManagementServices {
                       if (UtilValidate.isNotEmpty(errMsg)) {
                           return ServiceUtil.returnError(errMsg);
                       } 
-                      //addRoleToUser(delegator, dispatcher, serviceContext);
                   } catch (GenericServiceException e) {
                       Debug.logError(e, e.toString(), module);
                       return ServiceUtil.returnError(e.toString());
@@ -523,12 +475,8 @@ public class ContentManagementServices {
           } else {
               if (fromDate != null) {
                   // for now, will assume that any error is due to 
non-existence - ignore
-                  //return ServiceUtil.returnError(e.toString());
                   try {
                       Debug.logInfo("updateSiteRoles, serviceContext(2):" + 
serviceContext, module);
-                      //Timestamp thruDate = UtilDateTime.nowTimestamp();
-                      //serviceContext.put("thruDate", thruDate);
-                      //serviceContext.put("fromDate", fromDate);
                       Map<String, Object> newContext = new HashMap<String, 
Object>();
                       newContext.put("contentId", 
serviceContext.get("contentId"));
                       newContext.put("partyId", serviceContext.get("partyId"));
@@ -552,13 +500,10 @@ public class ContentManagementServices {
   }
 
     public static Map<String, Object> 
persistDataResourceAndData(DispatchContext dctx, Map<String, ? extends Object> 
context) {
-      //Delegator delegator = dctx.getDelegator();
       LocalDispatcher dispatcher = dctx.getDispatcher();
-      //String contentId = (String)context.get("contentId");
       Locale locale = (Locale) context.get("locale");
       Map<String, Object> result = new HashMap<String, Object>();
       try {
-          //GenericValue content = 
EntityQuery.use(delegator).from("Content").where("contentId", 
contentId).queryOne();
           ModelService checkPermModel = 
dispatcher.getDispatchContext().getModelService("checkContentPermission");
           Map<String, Object> ctx = checkPermModel.makeValid(context, "IN");
           Map<String, Object> thisResult = 
dispatcher.runSync("checkContentPermission", ctx);
@@ -624,7 +569,6 @@ public class ContentManagementServices {
           }
       }
       GenericValue userLogin = (GenericValue) context.get("userLogin");
-      //String userLoginId = (String)userLogin.get("userLoginId");
       ModelService dataResourceModel = 
dispatcher.getDispatchContext().getModelService("updateDataResource");
       Map<String, Object> ctx = dataResourceModel.makeValid(dataResource, 
"IN");
       newDrContext.putAll(ctx);
@@ -751,8 +695,6 @@ public class ContentManagementServices {
         String partyId = (String)context.get("partyId");
         serviceContext.put("partyId", partyId);
         serviceContext.put("contentId", siteContentId);
-        //Debug.logInfo("updateSiteRoles, serviceContext(0):" + 
serviceContext, module);
-        //Debug.logInfo("updateSiteRoles, context(0):" + context, module);
 
         List<GenericValue> siteRoles = null;
         try {
@@ -763,14 +705,12 @@ public class ContentManagementServices {
         for (GenericValue roleType : siteRoles) {
             String siteRole = (String)roleType.get("roleTypeId"); // 
BLOG_EDITOR, BLOG_ADMIN, etc.
             String cappedSiteRole = ModelUtil.dbNameToVarName(siteRole);
-            //if (Debug.infoOn()) Debug.logInfo("updateSiteRoles, 
cappediteRole(1):" + cappedSiteRole, module);
 
             String siteRoleVal = (String)context.get(cappedSiteRole);
             Object fromDate = context.get(cappedSiteRole + "FromDate");
             serviceContext.put("roleTypeId", siteRole);
             if (siteRoleVal != null && siteRoleVal.equalsIgnoreCase("Y")) {
                 // for now, will assume that any error is due to duplicates - 
ignore
-                //return ServiceUtil.returnError(e.toString());
                 if (fromDate == null) {
                     try {
                         serviceContext.put("fromDate", 
UtilDateTime.nowTimestamp());
@@ -791,9 +731,6 @@ public class ContentManagementServices {
                     //return ServiceUtil.returnError(e.toString());
                     try {
                         Debug.logInfo("updateSiteRoles, serviceContext(2):" + 
serviceContext, module);
-                        //Timestamp thruDate = UtilDateTime.nowTimestamp();
-                        //serviceContext.put("thruDate", thruDate);
-                        //serviceContext.put("fromDate", fromDate);
                         Map<String, Object> newContext = new HashMap<String, 
Object>();
                         newContext.put("contentId", 
serviceContext.get("contentId"));
                         newContext.put("partyId", 
serviceContext.get("partyId"));
@@ -952,7 +889,6 @@ public class ContentManagementServices {
         GenericValue userLogin = (GenericValue)context.get("userLogin");
         String userLoginId = userLogin.getString("userLoginId");
         Locale locale = (Locale) context.get("locale");
-        //int seqNum = 9999;
         try {
             GenericValue content = 
EntityQuery.use(delegator).from("Content").where("contentId", 
contentId).queryOne();
             if (content == null) {
@@ -960,17 +896,6 @@ public class ContentManagementServices {
                 return 
ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"ContentNoContentFound", UtilMisc.toMap("contentId", ""), locale));
             }
             String dataResourceId = content.getString("dataResourceId");
-            //String contentTypeIdTo = content.getString("contentTypeId");
-            /* this does not seem to be correct or needed
-            if (UtilValidate.isNotEmpty(contentTypeIdTo)) {
-                if (contentTypeIdTo.equals("OUTLINE_NODE")) {
-                    content.put("contentTypeId", "OUTLINE_NODE");
-                } else if (contentTypeIdTo.equals("PAGE_NODE")) {
-                    content.put("contentTypeId", "SUBPAGE_NODE");
-                } else
-                    content.put("contentTypeId", "PAGE_NODE");
-            }
-            */
 
             content.set("dataResourceId", null);
             content.set("lastModifiedDate", UtilDateTime.nowTimestamp());
@@ -1028,61 +953,6 @@ public class ContentManagementServices {
         return result;
     }
 
-/*
-    public static Map<String, Object> updateLeafChange(DispatchContext dctx, 
Map<String, ? extends Object> context) throws GenericServiceException{
-
-        Map result = new HashMap<String, Object>();
-        Delegator delegator = dctx.getDelegator();
-        List typeList = (List)context.get("typeList");
-        if (typeList == null)
-            typeList = UtilMisc.toList("PUBLISH_LINK", "SUB_CONTENT");
-        String contentId = (String)context.get("contentId");
-
-        try {
-            GenericValue thisContent = 
EntityQuery.use(delegator).from("Content").where("contentId", 
contentId).queryOne();
-            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();
-            String mode = (String)context.get("mode");
-            if (mode != null && mode.equalsIgnoreCase("remove")) {
-                subLeafCount *= -1;
-            } else {
-                // 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 listFiltered = 
EntityQuery.use(delegator).from("ContentAssoc").where(mainCondition).cache().filterByDate().queryList();
-            Iterator iter = listFiltered.iterator();
-            while (iter.hasNext()) {
-                GenericValue contentAssoc = (GenericValue)iter.next();
-                String subContentId = contentAssoc.getString("contentId");
-                GenericValue contentTo = 
EntityQuery.use(delegator).from("Content").where("contentId", 
subContentId).cache().queryOne();
-                Integer childBranchCount = 
(Integer)contentTo.get("childBranchCount");
-                int branchCount = (childBranchCount == null) ? 1 : 
childBranchCount.intValue();
-                if (mode != null && mode.equalsIgnoreCase("remove"))
-                    branchCount += -1;
-                else
-                    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 result;
-    }
-    */
 
     /**
      * This service changes the contentTypeId of the current content and its 
children depending on the pageMode.
@@ -1222,23 +1092,13 @@ public class ContentManagementServices {
                 visitedSet.add(contentId);
             }
         }
-        // String contentTypeId = content.getString("contentTypeId");
         String newContentTypeId = "SUBPAGE_NODE";
-//        if (contentTypeId == null || contentTypeId.equals("DOCUMENT")) {
-//            newContentTypeId = "SUBPAGE_NODE";
-//        } 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<GenericValue> kids = ContentWorker.getAssociatedContent(content, 
"from", UtilMisc.toList("SUB_CONTENT"), null, null, null);
         for (GenericValue kidContent : kids) {
             updatePageNodeChildren(kidContent, context);
         }
-        //}
     }
 
     public static void updateOutlineNodeChildren(GenericValue content, boolean 
forceOutline, Map<String, Object> context) throws GenericEntityException {
@@ -1275,7 +1135,6 @@ public class ContentManagementServices {
         content.store();
 
         if (contentTypeId == null || contentTypeId.equals("DOCUMENT") || 
contentTypeId.equals("OUTLINE_NODE")) {
-        //if (contentTypeId == null || contentTypeId.equals("DOCUMENT")) {
             List<GenericValue> kids = 
ContentWorker.getAssociatedContent(content, "from", 
UtilMisc.toList("SUB_CONTENT"), null, null, null);
             for (GenericValue kidContent : kids) {
                 updateOutlineNodeChildren(kidContent, forceOutline, context);
@@ -1334,8 +1193,6 @@ public class ContentManagementServices {
             content.set("childBranchCount", Long.valueOf(0));
         }
 
-        //content.store();
-
         return result;
     }
 
@@ -1656,8 +1513,6 @@ public class ContentManagementServices {
         return result;
     }
 
-    /**
-   */
   public static Map<String, Object> persistContentWithRevision(DispatchContext 
dctx, Map<String, ? extends Object> context) {
       Map<String, Object> result = null;
       Delegator delegator = dctx.getDelegator();

Modified: 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementWorker.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementWorker.java?rev=1752965&r1=1752964&r2=1752965&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementWorker.java
 (original)
+++ 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementWorker.java
 Sat Jul 16 14:10:10 2016
@@ -249,7 +249,6 @@ public final class ContentManagementWork
                         }
                     }
                 } else {
-                    //useCached = false;
                     usePassed = false;
                 }
             }
@@ -298,7 +297,6 @@ public final class ContentManagementWork
                  targetOperationList = StringUtil.split(permittedOperations, 
"|");
             }
             Map<String, Object> results = null;
-            //if (Debug.infoOn()) Debug.logInfo("in getPermittedPublishPoints, 
content:" + content, module);
             results = EntityPermissionChecker.checkPermission(content, 
statusId, userLogin, passedPurposes, targetOperationList, roles, delegator, 
security, entityAction);
             String permissionStatus = (String)results.get("permissionStatus");
             if (permissionStatus != null && 
permissionStatus.equalsIgnoreCase("granted")) {
@@ -328,7 +326,6 @@ public final class ContentManagementWork
         GenericValue webSitePublishPoint = null;
         for (GenericValue contentAssoc : relatedPubPts) {
            String pub = (String)contentAssoc.get("contentId");
-           //webSitePublishPoint = 
EntityQuery.use(delegator).from("WebSitePublishPoint").where("contentId", 
pub).cache().queryOne();
            webSitePublishPoint = getWebSitePublishPoint(delegator, pub, false);
            allPublishPoints.add(webSitePublishPoint);
         }
@@ -416,7 +413,6 @@ public final class ContentManagementWork
             if (webSitePublishPoint == null) {
                 webSitePublishPoint = 
delegator.makeValue("WebSitePublishPoint", UtilMisc.toMap("contentId", 
contentId));
             }
-            //if (Debug.infoOn()) Debug.logInfo("in getWebSitePublishPoint, 
contentId:" + contentId, module);
             webSitePublishPoint = overrideWebSitePublishPoint(delegator, 
webSitePublishPoint);
             cachedWebSitePublishPoints.put(contentId, webSitePublishPoint);
         }
@@ -427,9 +423,7 @@ public final class ContentManagementWork
         String contentId = passedValue.getString("contentId");
         GenericValue webSitePublishPoint = passedValue;
         String contentIdTo = getParentWebSitePublishPointId(delegator, 
contentId);
-            //if (Debug.infoOn()) Debug.logInfo("in 
overrideWebSitePublishPoint, contentIdTo:" + contentIdTo, module);
         if (contentIdTo != null) {
-            //webSitePublishPoint = getWebSitePublishPoint(delegator, 
contentIdTo, false);
             webSitePublishPoint = 
EntityQuery.use(delegator).from("WebSitePublishPoint").where("contentId", 
contentIdTo).cache().queryOne();
             if (webSitePublishPoint != null) {
                 webSitePublishPoint = GenericValue.create(webSitePublishPoint);
@@ -462,27 +456,14 @@ public final class ContentManagementWork
 
     public static GenericValue getStaticValue(Delegator delegator, String 
parentPlaceholderId, String webSitePublishPointId, boolean ignoreCache) throws 
GenericEntityException {
         GenericValue webSitePublishPoint = null;
-        // GenericValue staticValue = null;
         if (!ignoreCache) {
             Map<String, Object> subStaticValueMap = 
cachedStaticValues.get(parentPlaceholderId);
             if (subStaticValueMap == null) {
                 subStaticValueMap = new HashMap<String, Object>();
                 cachedStaticValues.put(parentPlaceholderId, subStaticValueMap);
             }
-            //Map staticValueMap = (GenericValue)cachedStaticValues.get(web);
         }
 
-/*
-        if (webSitePublishPoint == null) {
-            webSitePublishPoint = 
EntityQuery.use(delegator).from("WebSitePublishPoint").where("contentId", 
contentId).queryOne();
-            // If no webSitePublishPoint exists, still try to look for parent 
by making a dummy value
-            if (webSitePublishPoint == null) {
-                webSitePublishPoint = 
delegator.makeValue("WebSitePublishPoint", UtilMisc.toMap("contentId", 
contentId));
-            }
-            webSitePublishPoint = overrideStaticValues(delegator, 
webSitePublishPoint);
-            cachedWebSitePublishPoints.put(contentId, webSitePublishPoint);
-        }
-*/
         return webSitePublishPoint;
     }
 
@@ -490,14 +471,10 @@ public final class ContentManagementWork
         // Set up one map with all the top-level publish points (to which only 
one sub point can be attached to)
         // and another map (publishPointMapAll) that points to one of the 
top-level points.
         List<GenericValue> allPublishPointList = 
getAllPublishPoints(delegator, rootPubId);
-        //if (Debug.infoOn()) Debug.logInfo("in getPublishLinks, 
allPublishPointList:" + allPublishPointList, module);
         List<String []> publishPointList = 
getPermittedPublishPoints(delegator, allPublishPointList, userLogin, security , 
permittedAction, permittedOperations, passedRoles);
         Map<String, Object> publishPointMap = new HashMap<String, Object>();
         Map<String, Object> publishPointMapAll = new HashMap<String, Object>();
         for (String [] arr : publishPointList) {
-            //GenericValue webSitePublishPoint = (GenericValue)it.next();
-            //String contentId = (String)webSitePublishPoint.get("contentId");
-            //String description = 
(String)webSitePublishPoint.get("description");
             String contentId = arr[0];
             String description = arr[1];
             List<Object []> subPointList = new LinkedList<Object[]>();
@@ -507,9 +484,6 @@ public final class ContentManagementWork
             publishPointMapAll.put(contentId, contentId);
             List<GenericValue> subPublishPointList = 
getAllPublishPoints(delegator, contentId);
             for (GenericValue webSitePublishPoint2 : subPublishPointList) {
-                //String [] arr2 = (String [])it2.next();
-                //String contentId2 = (String)arr2[0];
-                //String description2 = (String)arr2[1];
                 String contentId2 = 
(String)webSitePublishPoint2.get("contentId");
                 String description2 = 
(String)webSitePublishPoint2.get("templateTitle");
                 publishPointMapAll.put(contentId2, contentId);
@@ -518,7 +492,6 @@ public final class ContentManagementWork
                 subPointList.add(subArr2);
             }
         }
-/* */
         List<GenericValue> assocValueList = null;
         try {
             assocValueList = EntityQuery.use(delegator).from("ContentAssoc")
@@ -531,7 +504,6 @@ public final class ContentManagementWork
             String contentIdTo = contentAssoc.getString("contentIdTo");
             String topContentId = (String)publishPointMapAll.get(contentIdTo);
             Object [] subArr = (Object [])publishPointMap.get(topContentId);
-                //if (Debug.infoOn()) Debug.logInfo("in getPublishLinks, 
subArr:" + Arrays.asList(subArr) , module);
             if (contentIdTo.equals(topContentId)) {
                 subArr[3] =  contentAssoc.get("fromDate");
             } else {
@@ -563,8 +535,6 @@ public final class ContentManagementWork
         try {
             List<String> assocTypes = UtilMisc.toList("AUTHOR");
             List<String> contentTypes = null;
-            // String fromDate = null;
-            // String thruDate = null;
             Map<String, Object> results =  
ContentServicesComplex.getAssocAndContentAndDataResourceCacheMethod(delegator, 
contentId, null, "To", null, null, assocTypes, contentTypes, Boolean.TRUE, 
null, null);
             List<GenericValue> valueList = 
UtilGenerics.checkList(results.get("entityList"));
             if (valueList.size() > 0) {
@@ -572,7 +542,6 @@ public final class ContentManagementWork
                 authorContent = delegator.makeValue("Content");
                 authorContent.setPKFields(value);
                 authorContent.setNonPKFields(value);
-            //if (Debug.infoOn()) Debug.logInfo("in getAuthorContent, 
authorContent:" + authorContent, module);
             }
         } catch (GenericEntityException e) {
         } catch (MiniLangException e2) {
@@ -601,7 +570,6 @@ public final class ContentManagementWork
                  targetOperationList = StringUtil.split(permittedOperations, 
"|");
             }
             Map<String, Object> results = null;
-            //if (Debug.infoOn()) Debug.logInfo("in 
getPermittedDepartmentPoints, content:" + content, module);
             results = EntityPermissionChecker.checkPermission(content, 
statusId, userLogin, passedPurposes, targetOperationList, roles, delegator, 
security, entityAction);
             String permissionStatus = (String)results.get("permissionStatus");
             if (permissionStatus != null && 
permissionStatus.equalsIgnoreCase("granted")) {

Modified: 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ConvertTree.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ConvertTree.java?rev=1752965&r1=1752964&r2=1752965&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ConvertTree.java
 (original)
+++ 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ConvertTree.java
 Sat Jul 16 14:10:10 2016
@@ -121,7 +121,6 @@ In order ta make this service active add
                              if (counterLine > 1) {
                                 size = line.length();
                                 String check = "\\", checkSubContent = ",", 
contentName = "", contentNameInprogress = "", data = line.substring(3, size);
-                                //Debug.logInfo("======Data======"+data);
                                 size = data.length();
 
                                 for (int index = 0; index< size; index++) 
{//start character in line
@@ -178,7 +177,6 @@ In order ta make this service active add
                                             delegator.create(Entity);
                                             hasFolder = false;
                                         } else {
-                                            //Debug.logInfo("Content Name = [ 
" + contentId + "] already exist.");//ShoW log file
                                             hasFolder = true;
                                         }
                                         //Relation Content
@@ -261,7 +259,6 @@ In order ta make this service active add
                 boolean contentNameMatch = false;
                 if (subContents.charAt(index) == check.charAt(0)) {//store data
                     contentName = contentName + contentNameInprogress;
-                    //Debug.logInfo("subcontentName---->"+contentName);
                     if (contentName.length()>100) {
                         contentName = contentName.substring(0,100);
                     }
@@ -286,7 +283,6 @@ In order ta make this service active add
                         Map<String,Object> data = new HashMap<String, 
Object>();
                         data.put("userLogin", userLogin);
                         String dataResourceId = 
dispatcher.runSync("createDataResource", data).get("dataResourceId").toString();
-                        //Debug.logInfo("==dataResourceId" + dataResourceId);
 
                         //create Content
                         contentId = delegator.getNextSeqId("Content");
@@ -348,7 +344,6 @@ In order ta make this service active add
                         Map<String,Object> data = new HashMap<String, 
Object>();
                         data.put("userLogin", userLogin);
                         String dataResourceId = 
dispatcher.runSync("createDataResource",data).get("dataResourceId").toString();
-                        //Debug.logInfo("==dataResourceId" + dataResourceId);
 
                         //create Content
                         contentId = delegator.getNextSeqId("Content");

Modified: 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/cms/CmsEvents.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/cms/CmsEvents.java?rev=1752965&r1=1752964&r2=1752965&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/cms/CmsEvents.java
 (original)
+++ 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/cms/CmsEvents.java
 Sat Jul 16 14:10:10 2016
@@ -266,10 +266,6 @@ public class CmsEvents {
 
                 response.setStatus(statusCode);
 
-                // 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);
-
                 try {
                     Writer writer = response.getWriter();
                     // TODO: replace "screen" to support dynamic rendering of 
different output

Modified: 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/compdoc/CompDocEvents.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/compdoc/CompDocEvents.java?rev=1752965&r1=1752964&r2=1752965&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/compdoc/CompDocEvents.java
 (original)
+++ 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/compdoc/CompDocEvents.java
 Sat Jul 16 14:10:10 2016
@@ -140,7 +140,6 @@ public class CompDocEvents {
 
     public static String genCompDocPdf(HttpServletRequest request, 
HttpServletResponse response) {
         String responseStr = "success";
-        //ByteBuffer byteBuffer = null;
         HttpSession session = request.getSession();
         GenericValue userLogin = 
(GenericValue)session.getAttribute("userLogin");
         ServletContext servletContext = session.getServletContext();
@@ -193,14 +192,6 @@ public class CompDocEvents {
 
         ByteArrayInputStream bais = new 
ByteArrayInputStream(outByteBuffer.array());
 
-        /*
-        try {
-            FileOutputStream fos = new 
FileOutputStream(FileUtil.getFile("/home/byersa/pdftest.pdf"));
-            fos.write(outByteBuffer.getBytes());
-        } catch (FileNotFoundException e) {
-        } catch (IOException e) {
-        }
-        */
         try {
             UtilHttp.streamContentToBrowser(response, bais, 
outByteBuffer.limit(), contentType);
         } catch (IOException e) {
@@ -211,7 +202,6 @@ public class CompDocEvents {
     }
     public static String genContentPdf(HttpServletRequest request, 
HttpServletResponse response) {
         String responseStr = "success";
-        //ByteBuffer byteBuffer = null;
         HttpSession session = request.getSession();
         GenericValue userLogin = 
(GenericValue)session.getAttribute("userLogin");
         ServletContext servletContext = session.getServletContext();
@@ -264,15 +254,6 @@ public class CompDocEvents {
 
         ByteArrayInputStream bais = new 
ByteArrayInputStream(outByteBuffer.array());
 
-        /*
-        try {
-            FileOutputStream fos = new 
FileOutputStream(FileUtil.getFile("/home/byersa/pdftest.pdf"));
-            fos.write(outByteBuffer.getBytes());
-            fos.close();
-        } catch (FileNotFoundException e) {
-        } catch (IOException e) {
-        }
-        */
         try {
             UtilHttp.streamContentToBrowser(response, bais, 
outByteBuffer.limit(), contentType);
         } catch (IOException e) {

Modified: 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/compdoc/CompDocServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/compdoc/CompDocServices.java?rev=1752965&r1=1752964&r2=1752965&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/compdoc/CompDocServices.java
 (original)
+++ 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/compdoc/CompDocServices.java
 Sat Jul 16 14:10:10 2016
@@ -77,7 +77,6 @@ public class CompDocServices {
         Locale locale = (Locale)context.get("locale");
         GenericValue userLogin = (GenericValue)context.get("userLogin");
         String contentId = (String)context.get("contentId");
-        //String instanceContentId = null;
 
         if (UtilValidate.isNotEmpty(contentId)) {
             try {
@@ -105,8 +104,6 @@ public class CompDocServices {
 
             contentId = (String) persistContentResult.get("contentId");
             result.putAll(persistContentResult);
-            //request.setAttribute("contentId", contentId);
-            // Update ContentRevision and ContentRevisonItem
 
             Map<String, Object> contentRevisionMap = new HashMap<String, 
Object>();
             contentRevisionMap.put("itemContentId", contentId);
@@ -160,14 +157,10 @@ public class CompDocServices {
             ByteArrayOutputStream baos = new ByteArrayOutputStream();
             Document document = new Document();
             document.setPageSize(PageSize.LETTER);
-            //Rectangle rect = document.getPageSize();
-            //PdfWriter writer = PdfWriter.getInstance(document, baos);
             PdfCopy writer = new PdfCopy(document, baos);
             document.open();
             int pgCnt = 0;
             for (GenericValue contentAssocRevisionItemView : compDocParts) {
-                //String thisContentId = 
contentAssocRevisionItemView.getString("contentId");
-                //String thisContentRevisionSeqId = 
contentAssocRevisionItemView.getString("maxRevisionSeqId");
                 String thisDataResourceId = 
contentAssocRevisionItemView.getString("dataResourceId");
                 GenericValue dataResource = 
EntityQuery.use(delegator).from("DataResource").where("dataResourceId", 
thisDataResourceId).queryOne();
                 String inputMimeType = null;
@@ -250,7 +243,6 @@ public class CompDocServices {
                     int n = reader.getNumberOfPages();
                     for (int i=0; i < n; i++) {
                         PdfImportedPage pg = writer.getImportedPage(reader, i 
+ 1);
-                        //cb.addTemplate(pg, left, height * pgCnt);
                         writer.addPage(pg);
                         pgCnt++;
                     }
@@ -292,12 +284,8 @@ public class CompDocServices {
         GenericValue userLogin = (GenericValue) context.get("userLogin");
 
         try {
-            //Timestamp nowTimestamp = UtilDateTime.nowTimestamp();
-            //ByteArrayOutputStream baos = new ByteArrayOutputStream();
             Document document = new Document();
             document.setPageSize(PageSize.LETTER);
-            //Rectangle rect = document.getPageSize();
-            //PdfCopy writer = new PdfCopy(document, baos);
             document.open();
 
             GenericValue dataResource = null;

Modified: 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentEvents.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentEvents.java?rev=1752965&r1=1752964&r2=1752965&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentEvents.java
 (original)
+++ 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentEvents.java
 Sat Jul 16 14:10:10 2016
@@ -53,7 +53,6 @@ public class ContentEvents {
      * @return String specifying the exit status of this event
      */
     public static String updateAllContentKeywords(HttpServletRequest request, 
HttpServletResponse response) {
-        //String errMsg = "";
         Delegator delegator = (Delegator) request.getAttribute("delegator");
         Security security = (Security) request.getAttribute("security");
 
@@ -98,7 +97,6 @@ public class ContentEvents {
                 try {
                     ContentKeywordIndex.indexKeywords(content, 
"Y".equals(doAll));
                 } catch (GenericEntityException e) {
-                    //request.setAttribute("_ERROR_MESSAGE_", errMsg);
                     Debug.logWarning("[ContentEvents.updateAllContentKeywords] 
Could not create content-keyword (write error); message: " + e.getMessage(), 
module);
                     errConts++;
                 }

Modified: 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentKeywordIndex.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentKeywordIndex.java?rev=1752965&r1=1752964&r2=1752965&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentKeywordIndex.java
 (original)
+++ 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentKeywordIndex.java
 Sat Jul 16 14:10:10 2016
@@ -178,17 +178,6 @@ public class ContentKeywordIndex {
             addWeightedKeywordSourceString(dataResource, "dataResourceName", 
strings);
             addWeightedKeywordSourceString(dataResource, "objectInfo", 
strings);
         }
-        /*List<GenericValue> contentDataResourceViews = 
EntityQuery.use(delegator).from("ContentDataResourceView").where("contentId", 
contentId).queryList();
-        for (GenericValue contentDataResourceView: contentDataResourceViews) {
-            int weight = 1;
-            addWeightedDataResourceString(contentDataResourceView, weight, 
strings, delegator, content);
-
-            List<GenericValue> alternateViews = 
contentDataResourceView.getRelated("ContentAssocDataResourceViewTo", 
UtilMisc.toMap("caContentAssocTypeId", "ALTERNATE_LOCALE"), 
UtilMisc.toList("-caFromDate"), false);
-            alternateViews = EntityUtil.filterByDate(alternateViews, 
UtilDateTime.nowTimestamp(), "caFromDate", "caThruDate", true);
-            for (GenericValue thisView: alternateViews) {
-                addWeightedDataResourceString(thisView, weight, strings, 
delegator, content);
-            }
-        }*/
 
         if (UtilValidate.isNotEmpty(strings)) {
             for (String str: strings) {

Modified: 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentMapFacade.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentMapFacade.java?rev=1752965&r1=1752964&r2=1752965&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentMapFacade.java
 (original)
+++ 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentMapFacade.java
 Sat Jul 16 14:10:10 2016
@@ -171,7 +171,6 @@ public class ContentMapFacade implements
     }
 
     public Set<Object> keySet() {
-        // Debug.logWarning("This method [keySet()] is not completely 
implemented in ContentMapFacade", module);
         return UtilGenerics.checkSet(mapKeySet);
     }
 
@@ -270,7 +269,6 @@ public class ContentMapFacade implements
                     }
                 }
                 String contextLink = rh.makeLink(request, response, 
contentUri, true, false, true);
-                // Debug.logInfo("Made link to content with ID [" + 
this.contentId + "]: " + contextLink, module);
                 return contextLink;
             } else {
                 return this.contentId;

Modified: 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentPermissionServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentPermissionServices.java?rev=1752965&r1=1752964&r2=1752965&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentPermissionServices.java
 (original)
+++ 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentPermissionServices.java
 Sat Jul 16 14:10:10 2016
@@ -142,7 +142,6 @@ public class ContentPermissionServices {
         // so I had to write this code to handle both list and strings
         List<String> passedPurposes = 
UtilGenerics.checkList(context.get("contentPurposeList"));
         String contentPurposeString = (String) 
context.get("contentPurposeString");
-        //Debug.logInfo("contentPurposeString(b):" + contentPurposeString, "");
         if (UtilValidate.isNotEmpty(contentPurposeString)) {
             List<String> purposesFromString = 
StringUtil.split(contentPurposeString, "|");
             if (passedPurposes == null) {
@@ -155,11 +154,8 @@ public class ContentPermissionServices {
         // Sometimes permissions need to be checked before an entity is 
created, so
         // there needs to be a method for setting a purpose list
         auxGetter.setList(passedPurposes);
-        //Debug.logInfo("passedPurposes(b):" + passedPurposes, "");
         List<String> targetOperations = 
UtilGenerics.checkList(context.get("targetOperationList"));
-        //Debug.logInfo("targetOperations(b):" + targetOperations, "");
         String targetOperationString = (String) 
context.get("targetOperationString");
-        //Debug.logInfo("targetOperationString(b):" + targetOperationString, 
"");
         if (UtilValidate.isNotEmpty(targetOperationString)) {
             List<String> operationsFromString = 
StringUtil.split(targetOperationString, "|");
             if (targetOperations == null) {
@@ -167,12 +163,10 @@ public class ContentPermissionServices {
             }
             targetOperations.addAll(operationsFromString);
         }
-        //Debug.logInfo("targetOperations(c):" + targetOperations, "");
         EntityPermissionChecker.StdPermissionConditionGetter permCondGetter = 
new 
EntityPermissionChecker.StdPermissionConditionGetter("ContentPurposeOperation", 
 "contentOperationId", "roleTypeId", "statusId", "contentPurposeTypeId", 
"privilegeEnumId");
         permCondGetter.setOperationList(targetOperations);
 
         EntityPermissionChecker.StdRelatedRoleGetter roleGetter = new 
EntityPermissionChecker.StdRelatedRoleGetter("Content",  "roleTypeId", 
"contentId", "partyId", "ownerContentId", "ContentRole");
-        //Debug.logInfo("targetOperations(b):" + targetOperations, "");
         List<String> passedRoles = 
UtilGenerics.checkList(context.get("roleTypeList"));
         if (passedRoles == null) passedRoles = new LinkedList<String>();
         String roleTypeString = (String) context.get("roleTypeString");
@@ -287,9 +281,6 @@ public class ContentPermissionServices {
                     "ContentContentToOrFromIsNull", 
                     UtilMisc.toMap("contentTo", contentTo, "contentFrom", 
contentFrom), locale));
         }
-        // boolean isMatch = false;
-        // boolean isMatchTo = false;
-        // boolean isMatchFrom = false;
         Map<String, Object> permResults = new HashMap<String, Object>();
 
         // Use the purposes from the from entity for both cases.

Modified: 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearch.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearch.java?rev=1752965&r1=1752964&r2=1752965&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearch.java
 (original)
+++ 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearch.java
 Sat Jul 16 14:10:10 2016
@@ -284,8 +284,6 @@ public class ContentSearch {
             dynamicViewEntity.addAlias("CNT", "contentId", null, null, null, 
Boolean.valueOf(contentIdGroupBy), null);
             EntityCondition whereCondition = 
EntityCondition.makeCondition(entityConditionList, EntityOperator.AND);
 
-            // Debug.logInfo("ContentSearch, whereCondition = " + 
whereCondition.toString(), module);
-
             EntityListIterator eli = null;
             try {
                 eli = EntityQuery.use(delegator)
@@ -313,19 +311,6 @@ public class ContentSearch {
             try {
                 boolean hasResults = false;
                 Object initialResult = null;
-
-                /* this method has been replaced by the following to address 
issue with SAP DB and possibly other DBs
-                if (resultOffset != null) {
-                    Debug.logInfo("Before relative, current index=" + 
eli.currentIndex(), module);
-                    hasResults = eli.relative(resultOffset.intValue());
-                } else {
-                    initialResult = eli.next();
-                    if (initialResult != null) {
-                        hasResults = true;
-                    }
-                }
-                 */
-
                 initialResult = eli.next();
                 if (initialResult != null) {
                     hasResults = true;
@@ -375,21 +360,6 @@ public class ContentSearch {
                     } else {
                         duplicatesFound++;
                     }
-
-                    /*
-                    StringBuilder lineMsg = new StringBuilder("Got search 
result line: ");
-                    Iterator<String> fieldsToSelectIter = 
fieldsToSelect.iterator();
-                    while (fieldsToSelectIter.hasNext()) {
-                        String fieldName = fieldsToSelectIter.next();
-                        lineMsg.append(fieldName);
-                        lineMsg.append("=");
-                        lineMsg.append(searchResult.get(fieldName));
-                        if (fieldsToSelectIter.hasNext()) {
-                            lineMsg.append(", ");
-                        }
-                    }
-                    Debug.logInfo(lineMsg.toString(), module);
-                    */
                 }
 
                 if (searchResult != null) {

Modified: 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServices.java?rev=1752965&r1=1752964&r2=1752965&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServices.java
 (original)
+++ 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServices.java
 Sat Jul 16 14:10:10 2016
@@ -228,16 +228,6 @@ public class ContentServices {
      * reflection performance penalty.
      */
     public static Map<String, Object> createContent(DispatchContext dctx, 
Map<String, ? extends Object> context) {
-        /*
-        context.put("entityOperation", "_CREATE");
-        List targetOperationList = 
ContentWorker.prepTargetOperationList(context, "_CREATE");
-
-        List contentPurposeList = 
ContentWorker.prepContentPurposeList(context);
-        context.put("targetOperationList", targetOperationList);
-        context.put("contentPurposeList", contentPurposeList); // for checking 
permissions
-        //context.put("skipPermissionCheck", null);
-        */
-
         Map<String, Object> result = createContentMethod(dctx, context);
         return result;
     }
@@ -261,7 +251,6 @@ public class ContentServices {
         Delegator delegator = dctx.getDelegator();
         LocalDispatcher dispatcher = dctx.getDispatcher();
         String contentId = (String) context.get("contentId");
-        //String contentTypeId = (String) context.get("contentTypeId");
 
         if (UtilValidate.isEmpty(contentId)) {
             contentId = delegator.getNextSeqId("Content");
@@ -386,31 +375,6 @@ public class ContentServices {
                 contentIdFrom = contentId;
         }
 
-        /*
-        String deactivateExisting = (String) context.get("deactivateExisting");
-        if (deactivateExisting != null && 
deactivateExisting.equalsIgnoreCase("true")) {
-            Map andMap = new HashMap<String, Object>();
-            andMap.put("contentIdTo", contentIdTo);
-            andMap.put("contentAssocTypeId", 
context.get("contentAssocTypeId"));
-
-            String mapKey = (String) context.get("mapKey");
-            if (UtilValidate.isNotEmpty(mapKey)) {
-                andMap.put("mapKey", mapKey);
-            }
-            if (Debug.infoOn()) Debug.logInfo("DEACTIVATING CONTENTASSOC 
andMap: " + andMap, null);
-
-            List assocList = 
EntityQuery.use(delegator).from("ContentAssoc").where(andMap).queryList();
-            Iterator iter = assocList.iterator();
-            while (iter.hasNext()) {
-                GenericValue val = (GenericValue) iter.next();
-                if (Debug.infoOn()) Debug.logInfo("DEACTIVATING CONTENTASSOC 
val: " + val, null);
-
-                val.set("thruDate", UtilDateTime.nowTimestamp());
-                val.store();
-            }
-        }
-        */
-
         GenericValue contentAssoc = delegator.makeValue("ContentAssoc");
         contentAssoc.put("contentId", contentIdFrom);
         contentAssoc.put("contentIdTo", contentIdTo);
@@ -492,8 +456,6 @@ public class ContentServices {
         result.put("contentIdFrom", contentIdFrom);
         result.put("fromDate", contentAssoc.get("fromDate"));
         result.put("contentAssocTypeId", 
contentAssoc.get("contentAssocTypeId"));
-        //Debug.logInfo("result:" + result, module);
-        //Debug.logInfo("contentAssoc:" + contentAssoc, module);
 
         return result;
     }
@@ -731,15 +693,9 @@ public class ContentServices {
         GenericValue pk = delegator.makeValue("ContentAssoc");
         pk.setAllFields(context, false, null, Boolean.TRUE);
         pk.setAllFields(context, false, "ca", Boolean.TRUE);
-        //String contentIdFrom = (String) context.get("contentId");
-        //String contentIdTo = (String) context.get("contentIdTo");
-        //String contentId = (String) context.get("contentId");
-        //String contentAssocTypeId = (String) 
context.get("contentAssocTypeId");
-        //Timestamp fromDate = (Timestamp) context.get("fromDate");
 
         GenericValue contentAssoc = null;
         try {
-            //contentAssoc = 
EntityQuery.use(delegator).from("ContentAssoc").where("contentId", contentId, 
"contentIdTo", contentIdTo, "contentAssocTypeId", contentAssocTypeId, 
"fromDate", fromDate).queryOne();
             contentAssoc = 
EntityQuery.use(delegator).from("ContentAssoc").where(pk).queryOne();
         } catch (GenericEntityException e) {
             Debug.logError(e, "Entity Error:" + e.getMessage(), module);
@@ -837,12 +793,10 @@ public class ContentServices {
             List<GenericValue> relatedAssocs = 
EntityQuery.use(delegator).from("ContentAssoc")
                     .where(assocExprList)
                     .orderBy("fromDate").filterByDate().queryList();
-            //if (Debug.infoOn()) Debug.logInfo("in deactivateAssocs, 
relatedAssocs:" + relatedAssocs, module);
 
             for (GenericValue val : relatedAssocs) {
                 val.set("thruDate", nowTimestamp);
                 val.store();
-                //if (Debug.infoOn()) Debug.logInfo("in deactivateAssocs, 
val:" + val, module);
             }
             results.put("deactivatedList", relatedAssocs);
         } catch (GenericEntityException e) {
@@ -863,8 +817,6 @@ public class ContentServices {
 
         Map<String,Object> templateContext = 
UtilGenerics.checkMap(context.get("templateContext"));
         String contentId = (String) context.get("contentId");
-        // Timestamp fromDate = (Timestamp) context.get("fromDate");
-        // GenericValue userLogin = (GenericValue) context.get("userLogin");
 
         if (templateContext != null && UtilValidate.isEmpty(contentId)) {
             contentId = (String) templateContext.get("contentId");
@@ -873,10 +825,6 @@ public class ContentServices {
         if (templateContext != null && UtilValidate.isEmpty(mapKey)) {
             mapKey = (String) templateContext.get("mapKey");
         }
-        //String subContentId = (String) context.get("subContentId");
-        //if (templateContext != null && UtilValidate.isEmpty(subContentId)) {
-            //subContentId = (String) templateContext.get("subContentId");
-        //}
         String mimeTypeId = (String) context.get("mimeTypeId");
         if (templateContext != null && UtilValidate.isEmpty(mimeTypeId)) {
             mimeTypeId = (String) templateContext.get("mimeTypeId");
@@ -924,7 +872,6 @@ public class ContentServices {
         Writer out = (Writer) context.get("outWriter");
 
         Map<String,Object> templateContext = 
UtilGenerics.checkMap(context.get("templateContext"));
-        //GenericValue userLogin = (GenericValue)context.get("userLogin");
         String contentId = (String) context.get("contentId");
         if (templateContext != null && UtilValidate.isEmpty(contentId)) {
             contentId = (String) templateContext.get("contentId");
@@ -997,12 +944,6 @@ public class ContentServices {
                 if (Debug.infoOn()) Debug.logInfo("in publishContent, 
statusId:" + statusId + " contentStatusId:" + contentStatusId + " 
privilegeEnumId:" + privilegeEnumId + " contentPrivilegeEnumId:" + 
contentPrivilegeEnumId, module);
                 // Don't do anything if link was already there
                 if (!isPublished) {
-                    //Map thisResults = dispatcher.runSync("deactivateAssocs", 
mapIn);
-                    //String errorMsg = 
ServiceUtil.getErrorMessage(thisResults);
-                    //if (UtilValidate.isNotEmpty(errorMsg)) {
-                    //Debug.logError("Problem running deactivateAssocs. " + 
errorMsg, "ContentServices");
-                    //return ServiceUtil.returnError(errorMsg);
-                    //}
                     content.put("privilegeEnumId", privilegeEnumId);
                     content.put("statusId", statusId);
                     content.store();
@@ -1066,7 +1007,6 @@ public class ContentServices {
             for (Map.Entry<String, Object> entry : entrySet) {
                 String key = entry.getKey();
                 if (key.startsWith(prefix)) {
-                    // String keyBase = key.substring(prefix.length());
                     Object value = entry.getValue();
                     mapOut.put(key, value);
                 }

Modified: 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServicesComplex.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServicesComplex.java?rev=1752965&r1=1752964&r2=1752965&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServicesComplex.java
 (original)
+++ 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServicesComplex.java
 Sat Jul 16 14:10:10 2016
@@ -74,7 +74,6 @@ public class ContentServicesComplex {
         String contentId = (String)context.get("contentId");
         String direction = (String)context.get("direction");
         String mapKey = (String)context.get("mapKey");
-        // Boolean nullThruDatesOnly = 
(Boolean)context.get("nullThruDatesOnly");
         Map<String, Object> results = 
getAssocAndContentAndDataResourceMethod(delegator, contentId, mapKey, 
direction, fromDate, thruDate, fromDateStr, thruDateStr, assocTypes, 
contentTypes);
         return results;
     }
@@ -115,7 +114,6 @@ public class ContentServicesComplex {
         }
         if (thruDate != null) {
             List<EntityExpr> thruList = new LinkedList<EntityExpr>();
-            //thruDate = UtilDateTime.getDayStart(thruDate, daysLater);
 
             EntityExpr thruExpr = EntityCondition.makeCondition("caThruDate", 
EntityOperator.LESS_THAN, thruDate);
             thruList.add(thruExpr);

Modified: 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java?rev=1752965&r1=1752964&r2=1752965&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java
 (original)
+++ 
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java
 Sat Jul 16 14:10:10 2016
@@ -386,7 +386,6 @@ public class ContentWorker implements or
                 .orderBy("-fromDate").cache(cache).filterByDate().queryFirst();
 
         if (subContent == null) {
-            //throw new GeneralException("No sub-content found with map-key [" 
+ mapKey + "] for content [" + contentId + "]");
             Debug.logWarning("No sub-content found with map-key [" + mapKey + 
"] for content [" + contentId + "]", module);
         } else {
             String subContentId = subContent.getString("contentIdTo");
@@ -455,7 +454,6 @@ public class ContentWorker implements or
     }
 
     public static void traverse(Delegator delegator, GenericValue content, 
Timestamp fromDate, Timestamp thruDate, Map<String, Object> whenMap, int 
depthIdx, Map<String, Object> masterNode, String contentAssocTypeId, 
List<GenericValue> pickList, String direction) {
-        //String startContentAssocTypeId = null;
         String contentTypeId = null;
         String contentId = null;
         try {
@@ -488,7 +486,6 @@ public class ContentWorker implements or
             Map<String, Object> context = new HashMap<String, Object>();
             context.put("content", content);
             context.put("contentAssocTypeId", contentAssocTypeId);
-            //context.put("related", related);
             context.put("purposes", purposes);
             context.put("topics", topics);
             context.put("keywords", keywords);
@@ -521,7 +518,6 @@ public class ContentWorker implements or
                 for (GenericValue assocValue : relatedAssocs) {
                     contentAssocTypeId = (String) 
assocValue.get("contentAssocTypeId");
                     assocContext.put("contentAssocTypeId", contentAssocTypeId);
-                    //assocContext.put("contentTypeId", 
assocValue.get("contentTypeId"));
                     assocContext.put("parentContent", content);
                     String assocRelation = null;
                     // This needs to be the opposite
@@ -611,7 +607,6 @@ public class ContentWorker implements or
                         idx++;
                         continue;
                     }
-                    // String contentAssocTypeId = 
(String)currentNode.get("contentAssocTypeId");
                     nodeTrail.add(currentNode);
                     ContentWorker.traceNodeTrail("16",nodeTrail);
                     Boolean isPick = (Boolean)currentNode.get("isPick");
@@ -690,7 +685,6 @@ public class ContentWorker implements or
         String contentTypeId = (String) ctx.get("contentTypeId");
         String mapKey = (String) ctx.get("mapKey");
         String parentContentId = (String) parentContent.get("contentId");
-        //if (Debug.infoOn()) Debug.logInfo("traverse, contentAssocTypeId:" + 
contentAssocTypeId,null);
         Map<String, Object> whenMap = 
UtilGenerics.checkMap(ctx.get("whenMap"));
         List<Map<String, Object>> kids = new LinkedList<Map<String,Object>>();
         currentNode.put("kids", kids);
@@ -698,8 +692,6 @@ public class ContentWorker implements or
         if (UtilValidate.isEmpty(direction)) {
             direction = "From";
         }
-        // Timestamp fromDate = (Timestamp) ctx.get("fromDate");
-        // Timestamp thruDate = (Timestamp) ctx.get("thruDate");
 
         List<String> assocTypeList = StringUtil.split(contentAssocTypeId, " ");
         List<String> contentTypeList = StringUtil.split(contentTypeId, " ");
@@ -714,13 +706,9 @@ public class ContentWorker implements or
             throw new RuntimeException(e2.getMessage());
         }
         List<GenericValue> relatedViews = 
UtilGenerics.checkList(results.get("entityList"));
-        //if (Debug.infoOn()) Debug.logInfo("traverse, relatedViews:" + 
relatedViews,null);
         for (GenericValue assocValue : relatedViews) {
             Map<String, Object> thisNode = ContentWorker.makeNode(assocValue);
             checkConditions(delegator, thisNode, null, whenMap);
-            // boolean isReturnBeforePick = 
booleanDataType(thisNode.get("isReturnBeforePick"));
-            // boolean isReturnAfterPick = 
booleanDataType(thisNode.get("isReturnAfterPick"));
-            // boolean isFollow = booleanDataType(thisNode.get("isFollow"));
             boolean isPick = booleanDataType(thisNode.get("isPick"));
             kids.add(thisNode);
             if (isPick) {
@@ -848,7 +836,6 @@ public class ContentWorker implements or
             thruDate = UtilDateTime.toTimestamp(strThruDate);
         }
         List<GenericValue> assocs = getContentAssocsWithId(delegator, 
origContentId, fromDate, thruDate, linkDir, assocTypes);
-        //if (Debug.infoOn()) Debug.logInfo(" origContentId:" + origContentId 
+ " linkDir:" + linkDir + " assocTypes:" + assocTypes, "");
         return assocs;
     }
 
@@ -870,7 +857,6 @@ public class ContentWorker implements or
         }
         if (thruDate != null) {
             List<EntityExpr> thruList = new LinkedList<EntityExpr>();
-            //thruDate = UtilDateTime.getDayStart(thruDate, daysLater);
 
             EntityExpr thruExpr = EntityCondition.makeCondition("thruDate", 
EntityOperator.LESS_THAN, thruDate);
             thruList.add(thruExpr);
@@ -1003,7 +989,6 @@ public class ContentWorker implements or
             contentIdOtherField = "contentId";
         }
 
-            //if (Debug.infoOn()) Debug.logInfo("getContentAncestry, 
contentId:" + contentId, "");
         try {
             GenericValue contentAssoc = 
EntityQuery.use(delegator).from("ContentAssoc")
                     .where(contentIdField, contentId, "contentAssocTypeId", 
contentAssocTypeId)
@@ -1067,7 +1052,6 @@ public class ContentWorker implements or
     }
 
     public static GenericValue getSubContent(Delegator delegator, String 
contentId, String mapKey, String subContentId, GenericValue userLogin, 
List<String> assocTypes, Timestamp fromDate) throws IOException {
-        //GenericValue content = null;
         GenericValue view = null;
         try {
             if (subContentId == null) {
@@ -1096,7 +1080,6 @@ public class ContentWorker implements or
     }
 
     public static GenericValue getSubContentCache(Delegator delegator, String 
contentId, String mapKey, String subContentId, GenericValue userLogin, 
List<String> assocTypes, Timestamp fromDate, Boolean nullThruDatesOnly, String 
contentAssocPredicateId) throws GenericEntityException {
-        //GenericValue content = null;
         GenericValue view = null;
         if (UtilValidate.isEmpty(subContentId)) {
             view = getSubContentCache(delegator, contentId, mapKey, userLogin, 
assocTypes, fromDate, nullThruDatesOnly, contentAssocPredicateId);
@@ -1107,7 +1090,6 @@ public class ContentWorker implements or
     }
 
     public static GenericValue getSubContentCache(Delegator delegator, String 
contentId, String mapKey, GenericValue userLogin, List<String> assocTypes, 
Timestamp fromDate, Boolean nullThruDatesOnly, String contentAssocPredicateId) 
throws GenericEntityException {
-        //GenericValue content = null;
         GenericValue view = null;
         if (contentId == null) {
             Debug.logError("ContentId is null", module);
@@ -1151,7 +1133,6 @@ public class ContentWorker implements or
         } else {
             passedGlobalNodeTrail = new LinkedList<Map<String,Object>>();
         }
-        //if (Debug.infoOn()) Debug.logInfo("in getCurrentContent, 
passedGlobalNodeTrail(3):" + passedGlobalNodeTrail , module);
         int sz = passedGlobalNodeTrail.size();
         if (sz > 0) {
             Map<String, Object> nd = passedGlobalNodeTrail.get(sz - 1);
@@ -1161,10 +1142,6 @@ public class ContentWorker implements or
                 viewContentId = (String)currentContent.get("contentId");
         }
 
-        //if (Debug.infoOn()) Debug.logInfo("in getCurrentContent, 
currentContent(3):" + currentContent , module);
-        //if (Debug.infoOn()) Debug.logInfo("getCurrentContent, contentId:" + 
contentId, "");
-        //if (Debug.infoOn()) Debug.logInfo("getCurrentContent, subContentId:" 
+ subContentId, "");
-        //if (Debug.infoOn()) Debug.logInfo("getCurrentContent, 
viewContentId:" + viewContentId, "");
         if (UtilValidate.isNotEmpty(subContentId)) {
             ctx.put("subContentId", subContentId);
             ctx.put("contentId", null);
@@ -1178,7 +1155,6 @@ public class ContentWorker implements or
                 return currentContent;
             }
         }
-        //if (Debug.infoOn()) Debug.logInfo("getCurrentContent(2), contentId:" 
+ contentId + " viewContentId:" + viewContentId + " subContentId:" + 
subContentId, "");
         if (UtilValidate.isNotEmpty(contentId) || 
UtilValidate.isNotEmpty(subContentId)) {
             try {
                 currentContent = ContentWorker.getSubContentCache(delegator, 
contentId, mapKey, subContentId, userLogin, assocTypes, fromDate, 
nullThruDatesOnly, contentAssocPredicateId);
@@ -1190,7 +1166,6 @@ public class ContentWorker implements or
         }
         ctx.put("globalNodeTrail", passedGlobalNodeTrail);
         ctx.put("indent", Integer.valueOf(sz));
-        //if (Debug.infoOn()) Debug.logInfo("getCurrentContent, 
currentContent:" + currentContent, "");
         return currentContent;
     }
 
@@ -1236,14 +1211,12 @@ public class ContentWorker implements or
         ctx.put("sections", sections);
         List<Object> topics = getTopics(thisContent);
         ctx.put("topics", topics);
-        //Debug.logInfo("buildPickContext, ctx:" + ctx, "");
         return ctx;
     }
 
     public static void checkConditions(Delegator delegator, Map<String, 
Object> trailNode, Map<String, Object> contentAssoc, Map<String, Object> 
whenMap) {
         Map<String, Object> context = new HashMap<String, Object>();
         GenericValue content = (GenericValue)trailNode.get("value");
-        // String contentId = (String)trailNode.get("contentId");
         if (contentAssoc == null && content != null && 
(content.getEntityName().indexOf("Assoc") >= 0)) {
             contentAssoc = delegator.makeValue("ContentAssoc");
             try {
@@ -1254,7 +1227,6 @@ public class ContentWorker implements or
                 context.put("mapKey", contentAssoc.get("mapKey"));
             } catch (MiniLangException e) {
                 Debug.logError(e.getMessage(), module);
-                //throw new GeneralException(e.getMessage());
             }
         } else {
             context.put("contentAssocTypeId", null);
@@ -1356,7 +1328,6 @@ public class ContentWorker implements or
         Debug.logInfo("recorder(0):" + recorder, "");
         if (recorder != null && recorder.isOn()) {
             String permissionMessage = recorder.toHtml();
-            //Debug.logInfo("permissionMessage(0):" + permissionMessage, "");
             errorMessage += " \n " + permissionMessage;
         }
         return errorMessage;
@@ -1512,7 +1483,6 @@ public class ContentWorker implements or
                     }
                 } catch (GenericEntityException e) {
                     Debug.logError(e.getMessage(), module);
-                    //throw new GeneralException(e.getMessage());
                 }
             }
         }
@@ -1658,32 +1628,6 @@ public class ContentWorker implements or
     }
 
     public static void traceNodeTrail(String lbl, List<Map<String, Object>> 
nodeTrail) {
-        /*
-                if (!Debug.verboseOn()) {
-                    return;
-                }
-                if (nodeTrail == null) {
-                    return;
-                }
-                String s = "";
-                int sz = nodeTrail.size();
-                s = "nTsz:" + sz;
-                if (sz > 0) {
-                    Map cN = (Map)nodeTrail.get(sz - 1);
-                    if (cN != null) {
-                        String cid = (String)cN.get("contentId");
-                        s += " cN[" + cid + "]";
-                        List kids = (List)cN.get("kids");
-                        int kSz = (kids == null) ? 0 : kids.size();
-                        s += " kSz:" + kSz;
-                        Boolean isPick = (Boolean)cN.get("isPick");
-                        s += " isPick:" + isPick;
-                        Boolean isFollow = (Boolean)cN.get("isFollow");
-                        s += " isFollow:" + isFollow;
-                        Boolean isReturnAfterPick = 
(Boolean)cN.get("isReturnAfterPick");
-                        s += " isReturnAfterPick:" + isReturnAfterPick;
-                    }
-                }
-        */
+
     }
 }


Reply via email to