Author: trong.tran
Date: 2010-09-27 07:28:04 -0400 (Mon, 27 Sep 2010)
New Revision: 4398
Modified:
portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java
Log:
Fix to use the correct request context in a Portlet action
Modified:
portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java
===================================================================
---
portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java 2010-09-27
09:37:56 UTC (rev 4397)
+++
portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java 2010-09-27
11:28:04 UTC (rev 4398)
@@ -253,23 +253,23 @@
public void execute(Event<UIPageBrowser> event) throws Exception
{
UIPageBrowser uiPageBrowser = event.getSource();
- PortalRequestContext pcontext = Util.getPortalRequestContext();
- String id = pcontext.getRequestParameter(OBJECTID);
+ WebuiRequestContext context = event.getRequestContext();
+ String id = context.getRequestParameter(OBJECTID);
UserPortalConfigService service =
uiPageBrowser.getApplicationComponent(UserPortalConfigService.class);
DataStorage dataService =
uiPageBrowser.getApplicationComponent(DataStorage.class);
- UIPortalApplication uiPortalApp =
(UIPortalApplication)pcontext.getUIApplication();
+ UIApplication uiApp = context.getUIApplication();
if (service.getPage(id) == null)
{
- uiPortalApp.addMessage(new
ApplicationMessage("UIPageBrowser.msg.PageNotExist", new String[]{id}, 1));
- pcontext.addUIComponentToUpdateByAjax(uiPortalApp.getUIPopupMessages());
+ uiApp.addMessage(new
ApplicationMessage("UIPageBrowser.msg.PageNotExist", new String[]{id}, 1));
+ context.addUIComponentToUpdateByAjax(uiApp.getUIPopupMessages());
return;
}
- Page page = service.getPage(id, pcontext.getRemoteUser());
+ Page page = service.getPage(id, context.getRemoteUser());
if (page == null || !page.isModifiable())
{
- uiPortalApp.addMessage(new
ApplicationMessage("UIPageBrowser.msg.delete.NotDelete", new String[]{id}, 1));
- pcontext.addUIComponentToUpdateByAjax(uiPortalApp.getUIPopupMessages());
+ uiApp.addMessage(new
ApplicationMessage("UIPageBrowser.msg.delete.NotDelete", new String[]{id}, 1));
+ context.addUIComponentToUpdateByAjax(uiApp.getUIPopupMessages());
return;
}
@@ -385,9 +385,10 @@
public void execute(Event<UIPageBrowser> event) throws Exception
{
UIPageBrowser uiPageBrowser = event.getSource();
- PortalRequestContext pcontext = Util.getPortalRequestContext();
+ WebuiRequestContext context = event.getRequestContext();
+ PortalRequestContext pcontext =
(PortalRequestContext)context.getParentAppRequestContext();
UIPortalApplication uiPortalApp =
(UIPortalApplication)pcontext.getUIApplication();
- String id = pcontext.getRequestParameter(OBJECTID);
+ String id = context.getRequestParameter(OBJECTID);
UserPortalConfigService service =
uiPageBrowser.getApplicationComponent(UserPortalConfigService.class);
//Check existence of the page
@@ -395,7 +396,7 @@
if (page == null)
{
uiPortalApp.addMessage(new
ApplicationMessage("UIPageBrowser.msg.PageNotExist", new String[]{id}, 1));
- pcontext.addUIComponentToUpdateByAjax(uiPortalApp.getUIPopupMessages());
+ context.addUIComponentToUpdateByAjax(uiPortalApp.getUIPopupMessages());
return;
}
@@ -404,7 +405,7 @@
if (!userACL.hasEditPermission(page))
{
uiPortalApp.addMessage(new
ApplicationMessage("UIPageBrowser.msg.edit.NotEditPage", new String[]{id}, 1));
- pcontext.addUIComponentToUpdateByAjax(uiPortalApp.getUIPopupMessages());
+ context.addUIComponentToUpdateByAjax(uiPortalApp.getUIPopupMessages());
return;
}
Show replies by date