Author: truong.le
Date: 2009-11-26 06:10:15 -0500 (Thu, 26 Nov 2009)
New Revision: 810
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/navigation/webui/component/UISiteManagement.gtmpl
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationManagement.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java
Log:
GTNPORTAL-298: The modification in group navigation seems to not be really saved to DB
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java 2009-11-26
09:56:54 UTC (rev 809)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java 2009-11-26
11:10:15 UTC (rev 810)
@@ -216,8 +216,7 @@
else
{
uiPortalApp.addMessage(new
ApplicationMessage("UISiteManagement.msg.portal-not-exist",
- new String[]{portalName}));
- ;
+ new String[]{portalName}));
return;
}
@@ -251,11 +250,18 @@
String portalName = event.getRequestContext().getRequestParameter(OBJECTID);
UserPortalConfigService service =
uicomp.getApplicationComponent(UserPortalConfigService.class);
PortalRequestContext prContext = Util.getPortalRequestContext();
+ UIPortalApplication portalApp =
(UIPortalApplication)prContext.getUIApplication();
UserPortalConfig userConfig = service.getUserPortalConfig(portalName,
prContext.getRemoteUser());
+
+ if(userConfig == null)
+ {
+ portalApp.addMessage(new
ApplicationMessage("UISiteManagement.msg.portal-not-exist",
+ new String[]{portalName}));
+ return;
+ }
PortalConfig portalConfig = userConfig.getPortalConfig();
- UIPortalApplication portalApp =
(UIPortalApplication)prContext.getUIApplication();
UserACL userACL = portalApp.getApplicationComponent(UserACL.class);
if (!userACL.hasEditPermission(portalConfig))
{
@@ -306,6 +312,12 @@
UIApplication uiApplication = context.getUIApplication();
UserPortalConfig userConfig = service.getUserPortalConfig(portalName,
prContext.getRemoteUser());
+ if(userConfig == null)
+ {
+ uiApplication.addMessage(new
ApplicationMessage("UISiteManagement.msg.portal-not-exist",
+ new String[]{portalName}));
+ return;
+ }
PortalConfig portalConfig = userConfig.getPortalConfig();
UserACL userACL = uicomp.getApplicationComponent(UserACL.class);
@@ -314,7 +326,7 @@
uiApplication.addMessage(new
ApplicationMessage("UISiteManagement.msg.Invalid-editPermission", null));
;
return;
- }
+ }
UIPopupWindow popUp = uicomp.getChild(UIPopupWindow.class);
Modified:
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/navigation/webui/component/UISiteManagement.gtmpl
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/navigation/webui/component/UISiteManagement.gtmpl 2009-11-26
09:56:54 UTC (rev 809)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/navigation/webui/component/UISiteManagement.gtmpl 2009-11-26
11:10:15 UTC (rev 810)
@@ -22,7 +22,7 @@
<td class="ActionBlock">
<a href="<%=uicomponent.event("EditPortalLayout",
portalConfig.getName());%>"
class="EditLayoutIcon"><%=_ctx.appRes("UISiteManagement.label.editLayout")%></a>
<a href="<%=uicomponent.event("EditNavigation",
portalConfig.getName());%>"
class="EditNavIcon"><%=_ctx.appRes("UISiteManagement.label.editNav")%></a>
- <a
href="javascript:ajaxGet(eXo.env.server.createPortalURL('UIPortal',
'EditPortalProperties', true,
['<%=portalConfig.getName()%>']))"
class="EditNavIcon"><%=_ctx.appRes("UISiteManagement.label.editPortalProp")%></a>
+ <a
href="javascript:ajaxGet(eXo.env.server.createPortalURL('UIPortal',
'EditPortalProperties', true,
[{name:'portalName',value:'<%=portalConfig.getName()%>'}]))"
class="EditNavIcon"><%=_ctx.appRes("UISiteManagement.label.editPortalProp")%></a>
<a href="<%=uicomponent.url("DeletePortal",
portalConfig.getName());%>"
class="DeleteIcon"><%=_ctx.appRes("UISiteManagement.label.deletePortal")%></a>
</td>
</tr>
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationManagement.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationManagement.java 2009-11-26
09:56:54 UTC (rev 809)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationManagement.java 2009-11-26
11:10:15 UTC (rev 810)
@@ -19,8 +19,11 @@
package org.exoplatform.portal.webui.navigation;
+import org.exoplatform.portal.application.PortalRequestContext;
+import org.exoplatform.portal.config.UserPortalConfig;
import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.webui.page.UIPageNodeForm2;
import org.exoplatform.portal.webui.portal.UIPortal;
import org.exoplatform.portal.webui.util.Util;
@@ -95,19 +98,28 @@
UserPortalConfigService portalConfigService =
uiManagement.getApplicationComponent(UserPortalConfigService.class);
PageNavigation navigation = uiNodeSelector.getSelectedNavigation();
- List<String> allPortalNames = portalConfigService.getAllPortalNames();
- if(allPortalNames.contains(navigation.getOwnerId()))
+ PortalRequestContext prContext = Util.getPortalRequestContext();
+ if(navigation.getOwnerType() == PortalConfig.PORTAL_TYPE)
{
+ UserPortalConfig portalConfig =
portalConfigService.getUserPortalConfig(navigation.getOwnerId(),
prContext.getRemoteUser());
+ if(portalConfig != null)
+ {
+ portalConfigService.update(navigation);
+ }
+
+ }
+ else
+ {
portalConfigService.update(navigation);
- }
+ }
UIPortal uiPortal = Util.getUIPortal();
setNavigation(uiPortal.getNavigations(), navigation);
UIPopupWindow uiPopup = uiManagement.getParent();
uiPopup.setShow(false);
UIPortalApplication uiPortalApp = Util.getUIPortalApplication();
UIWorkingWorkspace uiWorkingWS =
uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
- Util.getPortalRequestContext().addUIComponentToUpdateByAjax(uiWorkingWS);
- Util.getPortalRequestContext().setFullRender(true);
+ prContext.addUIComponentToUpdateByAjax(uiWorkingWS);
+ prContext.setFullRender(true);
}
private void setNavigation(List<PageNavigation> navs, PageNavigation nav)
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java 2009-11-26
09:56:54 UTC (rev 809)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java 2009-11-26
11:10:15 UTC (rev 810)
@@ -24,6 +24,7 @@
import org.exoplatform.commons.utils.PageList;
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.config.UserACL;
+import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.ApplicationType;
import org.exoplatform.portal.config.model.CloneApplicationState;
import org.exoplatform.portal.config.model.Container;
@@ -508,10 +509,15 @@
public void execute(Event<UIPortal> event) throws Exception
{
String portalName =
event.getRequestContext().getRequestParameter("portalName");
-
UIPortal uiPortal = Util.getUIPortal();
- UIPortalApplication uiApp =
uiPortal.getAncestorOfType(UIPortalApplication.class);
-
+ UIPortalApplication uiApp =
uiPortal.getAncestorOfType(UIPortalApplication.class);
+ UserPortalConfigService service =
uiApp.getApplicationComponent(UserPortalConfigService.class);
+ if(portalName !=null && service.getUserPortalConfig(portalName,
event.getRequestContext().getRemoteUser()) == null)
+ {
+ uiApp.addMessage(new
ApplicationMessage("UISiteManagement.msg.portal-not-exist",new
String[]{portalName}));
+ return;
+ }
+
UIMaskWorkspace uiMaskWS =
uiApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
UIPortalForm portalForm = uiMaskWS.createUIComponent(UIPortalForm.class, null,
"UIPortalForm");
portalForm.setPortalOwner(portalName);
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2009-11-26
09:56:54 UTC (rev 809)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2009-11-26
11:10:15 UTC (rev 810)
@@ -161,7 +161,13 @@
PortalConfig portalConfig =
(PortalConfig)PortalDataMapper.buildModelObject(editPortal);
UserPortalConfigService configService =
getApplicationComponent(UserPortalConfigService.class);
- configService.update(portalConfig);
+
+ List<String> allPortalNames = configService.getAllPortalNames();
+ if(allPortalNames.contains(portalConfig.getName()))
+ {
+ configService.update(portalConfig);
+ }
+
uiPortalApp.getUserPortalConfig().setPortal(portalConfig);
String remoteUser = prContext.getRemoteUser();
String ownerUser = prContext.getPortalOwner();