You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ha...@apache.org on 2009/05/03 09:38:25 UTC

svn commit: r771035 - in /ofbiz/trunk/framework: resources/templates/Forms.xml widget/src/org/ofbiz/widget/menu/ModelMenu.java

Author: hansbak
Date: Sun May  3 07:38:25 2009
New Revision: 771035

URL: http://svn.apache.org/viewvc?rev=771035&view=rev
Log:
portal page generated menu changed other menus when cache was enabled, tabs for spaces and deleted empty forms file

Removed:
    ofbiz/trunk/framework/resources/templates/Forms.xml
Modified:
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java?rev=771035&r1=771034&r2=771035&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenu.java Sun May  3 07:38:25 2009
@@ -360,26 +360,26 @@
                             EntityOperator.AND);
                     portalPages = delegator.findList("PortalPage", cond, null, null, null, false);
                     if (UtilValidate.isNotEmpty(context.get("userLogin"))) { // check if a user is logged in
-                    	String userLoginId = ((GenericValue)context.get("userLogin")).getString("userLoginId");
-                    	// replace with private pages
-                    	for (GenericValue portalPage : portalPages) {
-                    		cond = EntityCondition.makeCondition(UtilMisc.toList(
-                    				EntityCondition.makeCondition("ownerUserLoginId", EntityOperator.EQUALS, userLoginId),
-                    				EntityCondition.makeCondition("originalPortalPageId", EntityOperator.EQUALS, portalPage.getString("portalPageId"))),
-                    				EntityOperator.AND);
-                    		List <GenericValue> privatePortalPages = delegator.findList("PortalPage", cond, null, null, null, false);
-                    		if (UtilValidate.isNotEmpty(privatePortalPages)) {
-                    			portalPages.remove(portalPage);
-                    			portalPages.add(privatePortalPages.get(0));
-                    		}
-                    	}
-                    	// add any other created private pages
-                    	cond = EntityCondition.makeCondition(UtilMisc.toList(
-                    			EntityCondition.makeCondition("ownerUserLoginId", EntityOperator.EQUALS, userLoginId),
-                    			EntityCondition.makeCondition("originalPortalPageId", EntityOperator.EQUALS, null),
-                    			EntityCondition.makeCondition("parentPortalPageId", EntityOperator.EQUALS, parentPortalPageId)),
-                    			EntityOperator.AND);
-                    	portalPages.addAll(delegator.findList("PortalPage", cond, null, null, null, false));
+                        String userLoginId = ((GenericValue)context.get("userLogin")).getString("userLoginId");
+                        // replace with private pages
+                        for (GenericValue portalPage : portalPages) {
+                            cond = EntityCondition.makeCondition(UtilMisc.toList(
+                                    EntityCondition.makeCondition("ownerUserLoginId", EntityOperator.EQUALS, userLoginId),
+                                    EntityCondition.makeCondition("originalPortalPageId", EntityOperator.EQUALS, portalPage.getString("portalPageId"))),
+                                    EntityOperator.AND);
+                            List <GenericValue> privatePortalPages = delegator.findList("PortalPage", cond, null, null, null, false);
+                            if (UtilValidate.isNotEmpty(privatePortalPages)) {
+                                portalPages.remove(portalPage);
+                                portalPages.add(privatePortalPages.get(0));
+                            }
+                        }
+                        // add any other created private pages
+                        cond = EntityCondition.makeCondition(UtilMisc.toList(
+                                EntityCondition.makeCondition("ownerUserLoginId", EntityOperator.EQUALS, userLoginId),
+                                EntityCondition.makeCondition("originalPortalPageId", EntityOperator.EQUALS, null),
+                                EntityCondition.makeCondition("parentPortalPageId", EntityOperator.EQUALS, parentPortalPageId)),
+                                EntityOperator.AND);
+                        portalPages.addAll(delegator.findList("PortalPage", cond, null, null, null, false));
                     }
                     portalPages = EntityUtil.orderBy(portalPages, UtilMisc.toList("sequenceNum"));
                 } catch (GenericEntityException e) {
@@ -387,11 +387,13 @@
                 }
                 for (GenericValue portalPage : portalPages) {
                     if (UtilValidate.isNotEmpty(portalPage.getString("portalPageName"))) {
-                        item.setName(portalPage.getString("portalPageId"));
-                        item.setTitle(portalPage.getString("portalPageName"));
-                        item.link = new Link(item);
-                        item.link.setTarget("showPortalPage?portalPageId=" + portalPage.getString("portalPageId") + "&parentPortalPageId=" + parentPortalPageId);
-                        item.renderMenuItemString(writer, context, menuStringRenderer);
+                        ModelMenuItem localItem = new ModelMenuItem(item.getModelMenu());
+                        localItem.name =  portalPage.getString("portalPageId");
+                        localItem.setTitle(portalPage.getString("portalPageName"));
+                        localItem.link = new Link(item);
+                        localItem.link.setTarget("showPortalPage?portalPageId=" + portalPage.getString("portalPageId") + "&parentPortalPageId=" + parentPortalPageId);
+                        localItem.link.setText(portalPage.getString("portalPageName"));
+                        localItem.renderMenuItemString(writer, context, menuStringRenderer);
                     }
                 }
             } else {



Re: svn commit: r771035 - in /ofbiz/trunk/framework: resources/templates/Forms.xml widget/src/org/ofbiz/widget/menu/ModelMenu.java

Posted by Vikas Mayur <vi...@hotwaxmedia.com>.
Hi Hans,

AFAIK, this empty file is part of create-component ant target. I am  
sure this was added on purpose. For example, services.xml is also  
empty but we should not delete them. IMO, this file should be added  
back.

If a user does not need some files (those are created by create- 
component target) then they can also also be removed manually.

Vikas

On May 3, 2009, at 1:08 PM, hansbak@apache.org wrote:

> Author: hansbak
> Date: Sun May  3 07:38:25 2009
> New Revision: 771035
>
> URL: http://svn.apache.org/viewvc?rev=771035&view=rev
> Log:
> portal page generated menu changed other menus when cache was  
> enabled, tabs for spaces and deleted empty forms file
>
> Removed:
>    ofbiz/trunk/framework/resources/templates/Forms.xml
> Modified:
>    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ 
> ModelMenu.java
>