svn commit: r442460 - /incubator/ofbiz/trunk/applications/content/widget/contentsetup/userpermprep.bsh

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

svn commit: r442460 - /incubator/ofbiz/trunk/applications/content/widget/contentsetup/userpermprep.bsh

jacopoc
Author: jacopoc
Date: Mon Sep 11 22:50:13 2006
New Revision: 442460

URL: http://svn.apache.org/viewvc?view=rev&rev=442460
Log:
Applied patch from Marco Risaliti to fix wrong syntax (blogRoles.size instead of blogRoles.size()!)) in bsh script (Apache OFBIZ-231).
Also cleaned up formatting.

Modified:
    incubator/ofbiz/trunk/applications/content/widget/contentsetup/userpermprep.bsh

Modified: incubator/ofbiz/trunk/applications/content/widget/contentsetup/userpermprep.bsh
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/content/widget/contentsetup/userpermprep.bsh?view=diff&rev=442460&r1=442459&r2=442460
==============================================================================
--- incubator/ofbiz/trunk/applications/content/widget/contentsetup/userpermprep.bsh (original)
+++ incubator/ofbiz/trunk/applications/content/widget/contentsetup/userpermprep.bsh Mon Sep 11 22:50:13 2006
@@ -56,37 +56,37 @@
 blogRoles = delegator.findByAndCache("RoleType", UtilMisc.toMap("parentTypeId", "BLOG"));
 
 if (UtilValidate.isNotEmpty(forumId)) {
-        siteRoleMap = new HashMap();
-        for (int i=0; i < blogRoles.size; i++) {
-            roleType = blogRoles.get(i);
-            roleTypeId = roleType.getString("roleTypeId");
-            contentRoleList = delegator.findByAnd("ContentRole", UtilMisc.toMap("contentId", forumId, "roleTypeId", roleTypeId));
-            filteredRoleList = EntityUtil.filterByDate(contentRoleList);
-            cappedBlogRoleName = ModelUtil.dbNameToVarName(roleTypeId);
+    siteRoleMap = new HashMap();
+    for (int i=0; i < blogRoles.size(); i++) {
+        roleType = blogRoles.get(i);
+        roleTypeId = roleType.getString("roleTypeId");
+        contentRoleList = delegator.findByAnd("ContentRole", UtilMisc.toMap("contentId", forumId, "roleTypeId", roleTypeId));
+        filteredRoleList = EntityUtil.filterByDate(contentRoleList);
+        cappedBlogRoleName = ModelUtil.dbNameToVarName(roleTypeId);
 
-            iter = filteredRoleList.iterator();
-            while (iter.hasNext()) {
-                contentRole = iter.next();
-                partyId = contentRole.getString("partyId");
-                fromDate = contentRole.get("fromDate");
-                map = siteRoleMap.get(partyId);
-                if (map == null) {
-                    map = new HashMap();
-                    map.put("partyId", partyId);
-                    siteRoleMap.put(partyId, map);
-                }
-                map.put( cappedBlogRoleName, "Y");
-                map.put( cappedBlogRoleName + "FromDate", fromDate);
+        iter = filteredRoleList.iterator();
+        while (iter.hasNext()) {
+            contentRole = iter.next();
+            partyId = contentRole.getString("partyId");
+            fromDate = contentRole.get("fromDate");
+            map = siteRoleMap.get(partyId);
+            if (map == null) {
+                map = new HashMap();
+                map.put("partyId", partyId);
+                siteRoleMap.put(partyId, map);
             }
+            map.put( cappedBlogRoleName, "Y");
+            map.put( cappedBlogRoleName + "FromDate", fromDate);
         }
-        siteList = new ArrayList(siteRoleMap.values());
-        context.put("siteList", siteList);
-        context.put("rowCount", siteList.size());
-        blogRoleIter = blogRoles.iterator();
-        blogRoleList = new ArrayList();
-        while (blogRoleIter.hasNext()) {
-            roleType = blogRoleIter.next();
-            blogRoleList.add(roleType.get("roleTypeId"));
-        }
-        context.put("blogRoleIdList", blogRoleList);
+    }
+    siteList = new ArrayList(siteRoleMap.values());
+    context.put("siteList", siteList);
+    context.put("rowCount", siteList.size());
+    blogRoleIter = blogRoles.iterator();
+    blogRoleList = new ArrayList();
+    while (blogRoleIter.hasNext()) {
+        roleType = blogRoleIter.next();
+        blogRoleList.add(roleType.get("roleTypeId"));
+    }
+    context.put("blogRoleIdList", blogRoleList);
 }