Author: tan_pham_dinh
Date: 2010-02-09 06:10:41 -0500 (Tue, 09 Feb 2010)
New Revision: 1585
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/GroupPortalConfigListener.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigListener.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java
portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIGroupNavigationManagement.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIAddNewApplication.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIAddGroupNavigation.java
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/UIPageNavigationForm.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/PageUtils.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIDesktopPage.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageForm.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageNodeForm2.java
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/UIPortalForm.java
Log:
GTNPORTAL-602: Clean up code in UserPortalConfigService
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/GroupPortalConfigListener.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/GroupPortalConfigListener.java 2010-02-09
10:34:27 UTC (rev 1584)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/GroupPortalConfigListener.java 2010-02-09
11:10:41 UTC (rev 1585)
@@ -49,9 +49,7 @@
/** . */
private final OrganizationService orgService;
- public GroupPortalConfigListener(
- UserPortalConfigService portalConfigService,
- DataStorage dataStorage,
+ public GroupPortalConfigListener(UserPortalConfigService portalConfigService,
DataStorage dataStorage,
OrganizationService orgService)
{
this.portalConfigService = portalConfigService;
@@ -67,7 +65,7 @@
String groupId = group.getId().trim();
// Remove all descendant navigations
- removeGroupNavigation(group, portalConfigService);
+ removeGroupNavigation(group, dataStorage);
portalConfigService.removeUserPortalConfig(PortalConfig.GROUP_TYPE, groupId);
}
@@ -163,16 +161,16 @@
}
}
- private void removeGroupNavigation(Group group, UserPortalConfigService
portalConfigService) throws Exception
+ private void removeGroupNavigation(Group group, DataStorage dataService) throws
Exception
{
GroupHandler groupHandler = orgService.getGroupHandler();
Collection<String> descendantGroups = getDescendantGroups(group,
groupHandler);
PageNavigation navigation = null;
for (String childGroup : descendantGroups)
{
- navigation = portalConfigService.getPageNavigation(PortalConfig.GROUP_TYPE,
childGroup);
+ navigation = dataService.getPageNavigation(PortalConfig.GROUP_TYPE,
childGroup);
if (navigation != null)
- portalConfigService.remove(navigation);
+ dataService.remove(navigation);
}
}
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigListener.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigListener.java 2010-02-09
10:34:27 UTC (rev 1584)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigListener.java 2010-02-09
11:10:41 UTC (rev 1585)
@@ -93,7 +93,7 @@
pageNav.setOwnerId(userName);
pageNav.setPriority(5);
pageNav.setNodes(new ArrayList<PageNode>());
- portalConfigService.create(pageNav);
+ dataStorage.create(pageNav);
}
}
finally
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java 2010-02-09
10:34:27 UTC (rev 1584)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java 2010-02-09
11:10:41 UTC (rev 1585)
@@ -105,7 +105,7 @@
}
List<PageNavigation> navigations = new ArrayList<PageNavigation>();
- PageNavigation navigation = getPageNavigation(PortalConfig.PORTAL_TYPE,
portalName);
+ PageNavigation navigation = storage_.getPageNavigation(PortalConfig.PORTAL_TYPE,
portalName);
if (navigation != null)
{
navigation.setModifiable(userACL_.hasPermission(portal.getEditPermission()));
@@ -121,7 +121,7 @@
}
else
{
- navigation = getPageNavigation(PortalConfig.USER_TYPE, accessUser);
+ navigation = storage_.getPageNavigation(PortalConfig.USER_TYPE, accessUser);
if (navigation != null)
{
navigation.setModifiable(true);
@@ -145,7 +145,7 @@
{
continue;
}
- navigation = getPageNavigation(PortalConfig.GROUP_TYPE, groupId);
+ navigation = storage_.getPageNavigation(PortalConfig.GROUP_TYPE, groupId);
if (navigation == null)
{
continue;
@@ -254,6 +254,7 @@
* @param portal
* @throws Exception
*/
+ @Deprecated
public void update(PortalConfig portal) throws Exception
{
storage_.save(portal);
@@ -302,6 +303,7 @@
* @param page the page to remove
* @throws Exception any exception
*/
+ @Deprecated
public void remove(Page page) throws Exception
{
storage_.remove(page);
@@ -314,6 +316,7 @@
* @param page the page to create
* @throws Exception any exception
*/
+ @Deprecated
public void create(Page page) throws Exception
{
storage_.create(page);
@@ -327,6 +330,7 @@
* @return the list of model changes that occured
* @throws Exception any exception
*/
+ @Deprecated
public List<ModelChange> update(Page page) throws Exception
{
List<ModelChange> changes = storage_.save(page);
@@ -340,6 +344,7 @@
* @param navigation the navigation to create
* @throws Exception any exception
*/
+ @Deprecated
public void create(PageNavigation navigation) throws Exception
{
storage_.create(navigation);
@@ -352,6 +357,7 @@
* @param navigation the navigation to update
* @throws Exception any exception
*/
+ @Deprecated
public void update(PageNavigation navigation) throws Exception
{
storage_.save(navigation);
@@ -364,11 +370,13 @@
* @param navigation the navigation to remove
* @throws Exception any exception
*/
+ @Deprecated
public void remove(PageNavigation navigation) throws Exception
{
storage_.remove(navigation);
}
+ @Deprecated
public PageNavigation getPageNavigation(String ownerType, String id) throws Exception
{
PageNavigation navigation = storage_.getPageNavigation(ownerType, id);
@@ -389,7 +397,7 @@
public PageNode createNodeFromPageTemplate(String nodeName, String nodeLabel, String
pageId, String ownerType,
String ownerId) throws Exception
{
- Page page = renewPage(pageId, nodeName, ownerType, ownerId);
+ Page page = storage_.clonePage(pageId, nodeName, ownerType, ownerId);
PageNode pageNode = new PageNode();
if (nodeLabel == null || nodeLabel.trim().length() < 1)
{
@@ -411,6 +419,7 @@
* @return the newly created page
* @throws Exception any exception
*/
+ @Deprecated
public Page renewPage(String pageId, String pageName, String ownerType, String
ownerId) throws Exception
{
return storage_.clonePage(pageId, ownerType, ownerId, pageName);
Modified:
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java
===================================================================
---
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java 2010-02-09
10:34:27 UTC (rev 1584)
+++
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java 2010-02-09
11:10:41 UTC (rev 1585)
@@ -110,7 +110,8 @@
};
PortalContainer container = getContainer();
- userPortalConfigSer_ =
(UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class);
+ userPortalConfigSer_ =
+
(UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class);
orgService_ =
(OrganizationService)container.getComponentInstanceOfType(OrganizationService.class);
mgr =
(POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
authenticator =
(Authenticator)container.getComponentInstanceOfType(Authenticator.class);
@@ -148,7 +149,8 @@
return map;
}
- public void testUpdatePortalConfig() {
+ public void testUpdatePortalConfig()
+ {
new UnitTest()
{
public void execute() throws Exception
@@ -161,16 +163,16 @@
assertEquals("classic", portalCfg.getName());
assertEquals("en", portalCfg.getLocale());
portalCfg.setLocale("fr");
-
- userPortalConfigSer_.update(portalCfg);
+ storage_.save(portalCfg);
+
userPortalCfg = userPortalConfigSer_.getUserPortalConfig("classic",
"root");
portalCfg = userPortalCfg.getPortalConfig();
assertEquals("fr", portalCfg.getLocale());
}
}.execute("root");
}
-
+
public void testRootGetUserPortalConfig()
{
new UnitTest()
@@ -446,7 +448,7 @@
page.setOwnerId("/platform/administrators");
page.setName("newAccount");
assertTrue(events.isEmpty());
- userPortalConfigSer_.remove(page);
+ storage_.remove(page);
assertEquals(1, events.size());
Event event = events.removeFirst();
assertEquals(DataStorage.PAGE_REMOVED, event.getEventName());
@@ -470,7 +472,7 @@
page.setOwnerId("/platform/administrators");
page.setName("whatever");
assertTrue(events.isEmpty());
- userPortalConfigSer_.create(page);
+ storage_.create(page);
assertEquals(1, events.size());
Event event = events.removeFirst();
assertEquals(DataStorage.PAGE_CREATED, event.getEventName());
@@ -496,11 +498,11 @@
page.setOwnerId("/platform/administrators");
page.setName("whatever");
page.setTitle("testTitle");
- userPortalConfigSer_.create(page);
+ storage_.create(page);
String newName = "newPage";
- Page newPage =
- userPortalConfigSer_.renewPage(page.getPageId(), newName,
page.getOwnerType(), page.getOwnerId());
+ Page newPage = storage_.clonePage(page.getPageId(), page.getOwnerType(),
page.getOwnerId(), newName);
+
assertEquals(newName, newPage.getName());
assertEquals(page.getTitle(), newPage.getTitle());
}
@@ -520,7 +522,7 @@
page.setShowMaxWindow(true);
page.setTitle("newAccount title");
assertTrue(events.isEmpty());
- userPortalConfigSer_.create(page);
+ storage_.create(page);
assertEquals(1, events.size());
Event event = events.removeFirst();
assertEquals(DataStorage.PAGE_CREATED, event.getEventName());
@@ -530,38 +532,37 @@
assertEquals("newAccount", p.getName());
assertEquals("newAccount title", p.getTitle());
assertTrue(p.isShowMaxWindow());
-
+
p.setShowMaxWindow(false);
- userPortalConfigSer_.update(p);
+ storage_.save(p);
p =
userPortalConfigSer_.getPage("group::/platform/administrators::newAccount");
assertFalse(p.isShowMaxWindow());
p.setShowMaxWindow(true);
- userPortalConfigSer_.update(p);
+ storage_.save(p);
p =
userPortalConfigSer_.getPage("group::/platform/administrators::newAccount");
assertTrue(p.isShowMaxWindow());
p.setShowMaxWindow(false);
- userPortalConfigSer_.update(p);
+ storage_.save(p);
p =
userPortalConfigSer_.getPage("group::/platform/administrators::newAccount");
assertFalse(p.isShowMaxWindow());
p.setShowMaxWindow(true);
- userPortalConfigSer_.update(p);
+ storage_.save(p);
p =
userPortalConfigSer_.getPage("group::/platform/administrators::newAccount");
assertTrue(p.isShowMaxWindow());
-
+
Page p2 =
userPortalConfigSer_.getPage("group::/platform/administrators::newAccount");
assertEquals("group", p2.getOwnerType());
assertEquals("/platform/administrators", p2.getOwnerId());
assertEquals("newAccount", p2.getName());
-// assertFalse(p2.isShowMaxWindow());
+ // assertFalse(p2.isShowMaxWindow());
p2.setTitle("newAccount title 1");
p2.setShowMaxWindow(true);
- userPortalConfigSer_.update(p2);
-
+ storage_.save(p2);
+
Page p3 =
userPortalConfigSer_.getPage("group::/platform/administrators::newAccount");
assertEquals("newAccount title 1", p3.getTitle());
-// assertTrue(p3.isShowMaxWindow());
-
-
+ // assertTrue(p3.isShowMaxWindow());
+
}
}.execute(null);
}
@@ -576,14 +577,14 @@
navigation.setOwnerType("group");
navigation.setOwnerId("/platform/administrators");
assertTrue(events.isEmpty());
- userPortalConfigSer_.remove(navigation);
+ storage_.remove(navigation);
assertEquals(1, events.size());
Event event = events.removeFirst();
assertEquals(DataStorage.NAVIGATION_REMOVED, event.getEventName());
PageNavigation n = ((PageNavigation)event.getData());
assertEquals("group", n.getOwnerType());
assertEquals("/platform/administrators", n.getOwnerId());
- assertEquals(null, userPortalConfigSer_.getPageNavigation("group",
"/platform/administrators"));
+ assertEquals(null, storage_.getPageNavigation("group",
"/platform/administrators"));
}
}.execute(null);
}
@@ -597,82 +598,82 @@
PageNavigation navigation = new PageNavigation();
navigation.setOwnerType("group");
navigation.setOwnerId("/platform/administrators");
- userPortalConfigSer_.remove(navigation);
+ storage_.remove(navigation);
assertNotNull(events.removeLast());
assertTrue(events.isEmpty());
- userPortalConfigSer_.create(navigation);
+ storage_.create(navigation);
assertEquals(1, events.size());
Event event = events.removeFirst();
assertEquals(DataStorage.NAVIGATION_CREATED, event.getEventName());
PageNavigation n = ((PageNavigation)event.getData());
assertEquals("group", n.getOwnerType());
assertEquals("/platform/administrators", n.getOwnerId());
- PageNavigation n2 = userPortalConfigSer_.getPageNavigation("group",
"/platform/administrators");
+ PageNavigation n2 = storage_.getPageNavigation("group",
"/platform/administrators");
assertEquals("group", n2.getOwnerType());
assertEquals("/platform/administrators", n2.getOwnerId());
}
}.execute(null);
}
-/*
- public void testCreateMultipleNavigations(){
- for(int i =0; i < 10; i++){
- createNavigation(null, "group", "/platform/administrators" +
i);
+ /*
+ public void testCreateMultipleNavigations(){
+ for(int i =0; i < 10; i++){
+ createNavigation(null, "group",
"/platform/administrators" + i);
+ }
}
- }
-
- private void createNavigation(final String user, final String ownerType, final String
ownerId)
- {
- new UnitTest()
+
+ private void createNavigation(final String user, final String ownerType, final
String ownerId)
{
-
- public void execute() throws Exception
+ new UnitTest()
{
- createNavigationInSeperatedThread();
- }
- private void createNavigationInSeperatedThread()
- {
- Thread task = new Thread()
+ public void execute() throws Exception
{
- public void run()
+ createNavigationInSeperatedThread();
+ }
+
+ private void createNavigationInSeperatedThread()
+ {
+ Thread task = new Thread()
{
- PageNavigation navigation = new PageNavigation();
- navigation.setOwnerType(ownerType);
- navigation.setOwnerId(ownerId);
- try
+ public void run()
{
- userPortalConfigSer_.create(navigation);
- Event event = events.removeFirst();
- assertEquals(DataStorage.CREATE_NAVIGATION_EVENT,
event.getEventName());
- PageNavigation n1 = (PageNavigation)event.getSource();
- assertEquals(ownerType, n1.getOwnerType());
- assertEquals(ownerId, n1.getOwnerId());
- PageNavigation n2 =
userPortalConfigSer_.getPageNavigation(ownerType, ownerId);
- assertEquals(ownerType, n2.getOwnerType());
- assertEquals(ownerId, n2.getOwnerId());
+ PageNavigation navigation = new PageNavigation();
+ navigation.setOwnerType(ownerType);
+ navigation.setOwnerId(ownerId);
+ try
+ {
+ userPortalConfigSer_.create(navigation);
+ Event event = events.removeFirst();
+ assertEquals(DataStorage.CREATE_NAVIGATION_EVENT,
event.getEventName());
+ PageNavigation n1 = (PageNavigation)event.getSource();
+ assertEquals(ownerType, n1.getOwnerType());
+ assertEquals(ownerId, n1.getOwnerId());
+ PageNavigation n2 = storage_.getPageNavigation(ownerType,
ownerId);
+ assertEquals(ownerType, n2.getOwnerType());
+ assertEquals(ownerId, n2.getOwnerId());
+ }
+ catch (Exception ex)
+ {
+ assertTrue("Failed while create '" + ownerType +
" ' navigation for owner: " + ownerId, false);
+ ex.printStackTrace();
+ }
}
- catch (Exception ex)
- {
- assertTrue("Failed while create '" + ownerType +
" ' navigation for owner: " + ownerId, false);
- ex.printStackTrace();
- }
+ };
+
+ task.start();
+ try
+ {
+ task.sleep(200);
}
- };
-
- task.start();
- try
- {
- task.sleep(200);
+ catch (InterruptedException ex)
+ {
+ ex.printStackTrace();
+ }
}
- catch (InterruptedException ex)
- {
- ex.printStackTrace();
- }
- }
- }.execute(user);
- }
-*/
+ }.execute(user);
+ }
+ */
public void testUpdateNavigation()
{
@@ -685,7 +686,7 @@
navigation.setOwnerId("/platform/administrators");
navigation.setPriority(3);
assertTrue(events.isEmpty());
- userPortalConfigSer_.update(navigation);
+ storage_.save(navigation);
assertEquals(1, events.size());
Event event = events.removeFirst();
assertEquals(DataStorage.NAVIGATION_UPDATED, event.getEventName());
@@ -693,7 +694,7 @@
assertEquals("group", n.getOwnerType());
assertEquals("/platform/administrators", n.getOwnerId());
assertEquals(3, n.getPriority());
- PageNavigation n2 = userPortalConfigSer_.getPageNavigation("group",
"/platform/administrators");
+ PageNavigation n2 = storage_.getPageNavigation("group",
"/platform/administrators");
assertEquals("group", n2.getOwnerType());
assertEquals("/platform/administrators", n2.getOwnerId());
assertEquals(3, n2.getPriority());
@@ -707,7 +708,7 @@
{
public void execute() throws Exception
{
- Page clone = userPortalConfigSer_.renewPage("portal::test::test4",
"test5", "portal", "test");
+ Page clone = storage_.clonePage("portal::test::test4",
"portal", "test", "test5");
assertNotNull(clone);
assertEquals("portal", clone.getOwnerType());
assertEquals("test", clone.getOwnerId());
@@ -770,7 +771,6 @@
PortalConfig cfg = storage_.getPortalConfig(PortalConfig.USER_TYPE,
"overwritelayout");
assertNotNull(cfg);
-
Container container = cfg.getPortalLayout();
assertNotNull(container);
assertEquals(2, container.getChildren().size());
@@ -863,10 +863,10 @@
mgr.clearCache();
DataCache cache = mgr.getDecorator(DataCache.class);
long readCount0 = cache.getReadCount();
- userPortalConfigSer_.getPageNavigation("portal",
"test");
+ storage_.getPageNavigation("portal", "test");
long readCount1 = cache.getReadCount();
assertTrue(readCount1 > readCount0);
- userPortalConfigSer_.getPageNavigation("portal",
"test");
+ storage_.getPageNavigation("portal", "test");
long readCount2 = cache.getReadCount();
assertEquals(readCount1, readCount2);
}
Modified:
portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java
===================================================================
---
portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java 2010-02-09
10:34:27 UTC (rev 1584)
+++
portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java 2010-02-09
11:10:41 UTC (rev 1585)
@@ -20,6 +20,7 @@
package org.exoplatform.dashboard.webui.component;
import org.exoplatform.portal.application.PortalRequestContext;
+import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PageNavigation;
@@ -69,6 +70,8 @@
private UserPortalConfigService configService;
+ private DataStorage dataService;
+
private PageNavigation pageNavigation;
private UIPortal uiPortal;
@@ -80,6 +83,7 @@
public UITabPaneDashboard() throws Exception
{
configService = getApplicationComponent(UserPortalConfigService.class);
+ dataService = getApplicationComponent(DataStorage.class);
uiPortal = Util.getUIPortal();
initPageNavigation();
}
@@ -165,7 +169,7 @@
boolean isRemoved = true; // To check
PageNavigation updateNav =
- configService.getPageNavigation(pageNavigation.getOwnerType(),
pageNavigation.getOwnerId());
+ dataService.getPageNavigation(pageNavigation.getOwnerType(),
pageNavigation.getOwnerId());
for (PageNode pageNode : updateNav.getNodes())
{
if (pageNode.getUri().equals(tobeRemoved.getUri()))
@@ -199,13 +203,13 @@
{
Page page = configService.getPage(pageRef);
if (page != null)
- configService.remove(page);
+ dataService.remove(page);
UIPortal uiPortal = Util.getUIPortal();
// Remove from cache
uiPortal.setUIPage(pageRef, null);
}
//uiPortal.setSelectedNode(selectedNode);
- configService.update(pageNavigation);
+ dataService.save(pageNavigation);
}
}
else
@@ -269,8 +273,8 @@
//uiPortal.setSelectedNode(pageNode);
- configService.create(page);
- configService.update(pageNavigation);
+ dataService.create(page);
+ dataService.save(pageNavigation);
return fullName;
}
@@ -348,7 +352,7 @@
renamedNode.setUri(newUri);
- configService.update(pageNavigation);
+ dataService.save(pageNavigation);
return newUri;
}
catch (Exception ex)
@@ -379,7 +383,7 @@
nodes.set(firstIndex, secondNode);
nodes.set(secondIndex, firstNode);
- configService.update(pageNavigation);
+ dataService.save(pageNavigation);
return true;
}
catch (Exception ex)
@@ -428,7 +432,7 @@
return;
}
String uri = tabPane.createNewPageNode(newTabLabel);
-
+
//If new node is created with success, then redirect to it
if (uri != null)
{
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIGroupNavigationManagement.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIGroupNavigationManagement.java 2010-02-09
10:34:27 UTC (rev 1584)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIGroupNavigationManagement.java 2010-02-09
11:10:41 UTC (rev 1585)
@@ -294,8 +294,7 @@
UIPortal uiPortal = Util.getUIPortal();
removeNavigationByID(uiPortal.getNavigations(), navigation);
- UserPortalConfigService dataService =
uicomp.getApplicationComponent(UserPortalConfigService.class);
- dataService.remove(navigation);
+ service.remove(navigation);
event.getRequestContext().addUIComponentToUpdateByAjax(uicomp);
//Update UserToolbarGroupPortlet
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 2010-02-09
10:34:27 UTC (rev 1584)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java 2010-02-09
11:10:41 UTC (rev 1585)
@@ -309,6 +309,7 @@
UISiteManagement uicomp = event.getSource();
String portalName = event.getRequestContext().getRequestParameter(OBJECTID);
UserPortalConfigService service =
uicomp.getApplicationComponent(UserPortalConfigService.class);
+ DataStorage dataService = uicomp.getApplicationComponent(DataStorage.class);
PortalRequestContext prContext = Util.getPortalRequestContext();
WebuiRequestContext context = event.getRequestContext();
UIApplication uiApplication = context.getUIApplication();
@@ -336,7 +337,8 @@
naviManager.setOwner(portalName);
naviManager.setOwnerType(PortalConfig.PORTAL_TYPE);
- PageNavigation navi = service.getPageNavigation(PortalConfig.PORTAL_TYPE,
portalName);
+ PageNavigation navi = dataService.getPageNavigation(PortalConfig.PORTAL_TYPE,
portalName);
+
uicomp.setSelectedNavigation(navi);
UINavigationNodeSelector selector =
naviManager.getChild(UINavigationNodeSelector.class);
ArrayList<PageNavigation> list = new ArrayList<PageNavigation>();
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIAddNewApplication.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIAddNewApplication.java 2010-02-09
10:34:27 UTC (rev 1584)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIAddNewApplication.java 2010-02-09
11:10:41 UTC (rev 1585)
@@ -25,6 +25,7 @@
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.portal.application.PortalRequestContext;
+import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.ApplicationType;
import org.exoplatform.portal.config.model.CloneApplicationState;
@@ -250,12 +251,12 @@
if (uiPage.isModifiable())
{
Page page = (Page)PortalDataMapper.buildModelObject(uiPage);
- UserPortalConfigService configService =
uiPortalApp.getApplicationComponent(UserPortalConfigService.class);
if (page.getChildren() == null)
{
page.setChildren(new ArrayList<ModelObject>());
}
- configService.update(page);
+ DataStorage dataService =
uiPortalApp.getApplicationComponent(DataStorage.class);
+ dataService.save(page);
}
PortalRequestContext pcontext = Util.getPortalRequestContext();
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIAddGroupNavigation.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIAddGroupNavigation.java 2010-02-09
10:34:27 UTC (rev 1584)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIAddGroupNavigation.java 2010-02-09
11:10:41 UTC (rev 1585)
@@ -121,7 +121,6 @@
{
WebuiRequestContext ctx = event.getRequestContext();
UIAddGroupNavigation uicomp = event.getSource();
- UserPortalConfigService service =
uicomp.getApplicationComponent(UserPortalConfigService.class);
// get navigation id
String ownerId = event.getRequestContext().getRequestParameter(OBJECTID);
@@ -148,7 +147,7 @@
}
// create navigation for group
- service.create(pageNav);
+ dataService.create(pageNav);
// add navigation to UIPortal 's navigations
UIPortal uiPortal = Util.getUIPortal();
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 2010-02-09
10:34:27 UTC (rev 1584)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationManagement.java 2010-02-09
11:10:41 UTC (rev 1585)
@@ -20,6 +20,7 @@
package org.exoplatform.portal.webui.navigation;
import org.exoplatform.portal.application.PortalRequestContext;
+import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.config.UserPortalConfig;
import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.PageNavigation;
@@ -98,6 +99,7 @@
PortalRequestContext prContext = Util.getPortalRequestContext();
UINavigationManagement uiManagement = event.getSource();
UINavigationNodeSelector uiNodeSelector =
uiManagement.getChild(UINavigationNodeSelector.class);
+ DataStorage dataService =
uiManagement.getApplicationComponent(DataStorage.class);
UserPortalConfigService portalConfigService =
uiManagement.getApplicationComponent(UserPortalConfigService.class);
@@ -105,7 +107,7 @@
String editedOwnerType = navigation.getOwnerType();
String editedOwnerId = navigation.getOwnerId();
// Check existed
- PageNavigation persistNavigation =
portalConfigService.getPageNavigation(editedOwnerType, editedOwnerId);
+ PageNavigation persistNavigation =
dataService.getPageNavigation(editedOwnerType, editedOwnerId);
if (persistNavigation == null) {
UIApplication uiApp = Util.getPortalRequestContext().getUIApplication();
uiApp.addMessage(new
ApplicationMessage("UINavigationManagement.msg.NavigationNotExistAnymore",
null));
@@ -123,7 +125,7 @@
UserPortalConfig portalConfig =
portalConfigService.getUserPortalConfig(navigation.getOwnerId(),
prContext.getRemoteUser());
if(portalConfig != null)
{
- portalConfigService.update(navigation);
+ dataService.save(persistNavigation);
} else {
UIApplication uiApp = Util.getPortalRequestContext().getUIApplication();
uiApp.addMessage(new
ApplicationMessage("UIPortalForm.msg.notExistAnymore", null));
@@ -138,7 +140,7 @@
}
else
{
- portalConfigService.update(navigation);
+ dataService.save(navigation);
}
UIPortalApplication uiPortalApp = Util.getUIPortalApplication();
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPageNavigationForm.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPageNavigationForm.java 2010-02-09
10:34:27 UTC (rev 1584)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPageNavigationForm.java 2010-02-09
11:10:41 UTC (rev 1585)
@@ -21,7 +21,6 @@
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.config.DataStorage;
-import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.PageNavigation;
import org.exoplatform.portal.webui.util.Util;
import org.exoplatform.portal.webui.workspace.UIPortalApplication;
@@ -161,9 +160,8 @@
// Check existed
PortalRequestContext prContext = Util.getPortalRequestContext();
- UserPortalConfigService portalConfigService =
uiForm.getApplicationComponent(UserPortalConfigService.class);
- PageNavigation persistNavigation =
- portalConfigService.getPageNavigation(pageNav.getOwnerType(),
pageNav.getOwnerId());
+ DataStorage dataService = uiForm.getApplicationComponent(DataStorage.class);
+ PageNavigation persistNavigation =
dataService.getPageNavigation(pageNav.getOwnerType(), pageNav.getOwnerId());
if (persistNavigation == null)
{
UIApplication uiApp = Util.getPortalRequestContext().getUIApplication();
@@ -178,8 +176,6 @@
WebuiRequestContext pcontext = event.getRequestContext();
- UserPortalConfigService service =
uiForm.getApplicationComponent(UserPortalConfigService.class);
-
// if edit navigation
if (pageNav != null)
{
@@ -189,7 +185,7 @@
pageNav.setPriority(priority);
// update navigation
- service.update(pageNav);
+ dataService.save(pageNav);
UIPopupWindow uiPopup = uiForm.getParent();
uiPopup.setShow(false);
@@ -214,7 +210,6 @@
UIPortalApplication uiPortalApp =
Util.getUIPortal().getAncestorOfType(UIPortalApplication.class);
// ensure this navigation is not exist
- DataStorage dataService = uiForm.getApplicationComponent(DataStorage.class);
if (dataService.getPageNavigation(pageNav.getOwnerType(), pageNav.getOwnerId())
!= null)
{
uiPortalApp.addMessage(new
ApplicationMessage("UIPageNavigationForm.msg.existPageNavigation",
@@ -223,9 +218,8 @@
}
// create navigation for group
+ dataService.create(pageNav);
- service.create(pageNav);
-
// close popup window, update popup window
UIPopupWindow uiPopup = uiForm.getParent();
uiPopup.setShow(false);
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/PageUtils.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/PageUtils.java 2010-02-09
10:34:27 UTC (rev 1584)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/PageUtils.java 2010-02-09
11:10:41 UTC (rev 1585)
@@ -19,6 +19,7 @@
package org.exoplatform.portal.webui.page;
+import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.PageNavigation;
import org.exoplatform.portal.config.model.PageNode;
@@ -75,7 +76,9 @@
node.setUri(node.getName());
navi.addNode(node);
- configService.update(navi);
+
+ DataStorage dataService = uiPortal.getApplicationComponent(DataStorage.class);
+ dataService.save(navi);
setNavigation(uiPortal.getNavigations(), navi);
}
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIDesktopPage.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIDesktopPage.java 2010-02-09
10:34:27 UTC (rev 1584)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIDesktopPage.java 2010-02-09
11:10:41 UTC (rev 1585)
@@ -19,7 +19,7 @@
package org.exoplatform.portal.webui.page;
-import org.exoplatform.portal.config.UserPortalConfigService;
+import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.config.model.ModelObject;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PageNavigation;
@@ -117,10 +117,10 @@
if (!uiPage.isModifiable())
return;
Page page = (Page)PortalDataMapper.buildModelObject(uiPage);
- UserPortalConfigService configService =
uiPage.getApplicationComponent(UserPortalConfigService.class);
if (page.getChildren() == null)
page.setChildren(new ArrayList<ModelObject>());
- configService.update(page);
+ DataStorage dataService = uiPage.getApplicationComponent(DataStorage.class);
+ dataService.save(page);
}
}
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java 2010-02-09
10:34:27 UTC (rev 1584)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java 2010-02-09
11:10:41 UTC (rev 1585)
@@ -22,7 +22,6 @@
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.config.UserPortalConfig;
-import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.Container;
import org.exoplatform.portal.config.model.ModelObject;
import org.exoplatform.portal.config.model.Page;
@@ -330,12 +329,12 @@
if (uiPage.isModifiable())
{
Page page = (Page)PortalDataMapper.buildModelObject(uiPage);
- UserPortalConfigService configService =
uiPage.getApplicationComponent(UserPortalConfigService.class);
if (page.getChildren() == null)
{
page.setChildren(new ArrayList<ModelObject>());
}
- configService.update(page);
+ DataStorage dataService =
uiPage.getApplicationComponent(DataStorage.class);
+ dataService.save(page);
}
break;
}
@@ -358,12 +357,12 @@
{
uiPage.removeChildById(id);
Page page = (Page)PortalDataMapper.buildModelObject(uiPage);
- UserPortalConfigService configService =
uiPage.getApplicationComponent(UserPortalConfigService.class);
if (page.getChildren() == null)
{
page.setChildren(new ArrayList<ModelObject>());
}
- configService.update(page);
+ DataStorage dataService = uiPage.getApplicationComponent(DataStorage.class);
+ dataService.save(page);
pcontext.setFullRender(false);
pcontext.setResponseComplete(true);
pcontext.getWriter().write(EventListener.RESULT_OK);
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java 2010-02-09
10:34:27 UTC (rev 1584)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java 2010-02-09
11:10:41 UTC (rev 1585)
@@ -20,7 +20,6 @@
package org.exoplatform.portal.webui.page;
import org.exoplatform.commons.serialization.api.annotations.Serialized;
-import org.exoplatform.commons.utils.LazyPageList;
import org.exoplatform.commons.utils.PageList;
import org.exoplatform.commons.utils.PageListAccess;
import org.exoplatform.portal.application.PortalRequestContext;
@@ -137,18 +136,17 @@
public boolean feedDataWithQuery(Query<Page> query) throws Exception
{
lastQuery_ = query;
-
+
UIVirtualList virtualList = getChild(UIVirtualList.class);
- DataStorage dataStorage = getApplicationComponent(DataStorage.class);
- if(lastQuery_ == null)
+ if (lastQuery_ == null)
{
lastQuery_ = new Query<Page>(null, null, null, null, Page.class);
}
virtualList.dataBind(new PageQueryAccessList(lastQuery_, 10));
-
+
UIRepeater repeater = (UIRepeater)virtualList.getDataFeed();
PageList datasource = repeater.getDataSource();
-
+
if (datasource.getAvailable() > 0)
{
return true;
@@ -158,7 +156,7 @@
return false;
}
}
-
+
/**
* Show a popup informing that no result available for the last query
*
@@ -169,7 +167,7 @@
uiApp.addMessage(new ApplicationMessage("UISearchForm.msg.empty",
null));
Util.getPortalRequestContext().addUIComponentToUpdateByAjax(uiApp.getUIPopupMessages());
}
-
+
public void quickSearch(UIFormInputSet quickSearchInput) throws Exception
{
UIFormStringInput input = (UIFormStringInput)quickSearchInput.getChild(0);
@@ -184,14 +182,14 @@
else if (selectBoxValue.equals("ownerId"))
query.setOwnerId(value);
query.setName(null);
-
+
lastQuery_ = query;
boolean dataAvailable = feedDataWithQuery(lastQuery_);
- if(!dataAvailable)
+ if (!dataAvailable)
{
showNoResultMessagePopup();
}
-
+
if (this.<UIComponent> getParent() instanceof UIPopupWindow)
{
UIPopupWindow popupWindow = getParent();
@@ -246,8 +244,8 @@
if (currentPage > 0)
datasource.getPage(currentPage);
}
- */
-
+ */
+
static public class DeleteActionListener extends EventListener<UIPageBrowser>
{
public void execute(Event<UIPageBrowser> event) throws Exception
@@ -256,6 +254,7 @@
PortalRequestContext pcontext = Util.getPortalRequestContext();
String id = pcontext.getRequestParameter(OBJECTID);
UserPortalConfigService service =
uiPageBrowser.getApplicationComponent(UserPortalConfigService.class);
+ DataStorage dataService =
uiPageBrowser.getApplicationComponent(DataStorage.class);
UIPortalApplication uiPortalApp =
(UIPortalApplication)pcontext.getUIApplication();
if (service.getPage(id) == null)
@@ -276,8 +275,9 @@
UIRepeater repeater = (UIRepeater)virtualList.getDataFeed();
PageListAccess datasource = (PageListAccess)repeater.getDataSource();
int currentPage = datasource.getCurrentPage();
- service.remove(page);
+ dataService.remove(page);
+
UIPortal uiPortal = Util.getUIPortal();
if (uiPortal.getSelectedNode().getPageReference().equals(page.getPageId()))
{
@@ -289,7 +289,7 @@
else
{
boolean dataAvailable =
uiPageBrowser.feedDataWithQuery(uiPageBrowser.getLastQuery());
- if(!dataAvailable)
+ if (!dataAvailable)
{
showNoResultMessagePopup();
}
@@ -417,12 +417,11 @@
UIPage uiPage = uiPageForm.getUIPage();
Page page = new Page();
uiPageForm.invokeSetBindingBean(page);
- UserPortalConfigService configService =
uiPageForm.getApplicationComponent(UserPortalConfigService.class);
+ DataStorage dataService =
uiPageForm.getApplicationComponent(DataStorage.class);
// create new page
if (uiPage == null)
{
- DataStorage dataStorage =
uiPageForm.getApplicationComponent(DataStorage.class);
- Page existPage = dataStorage.getPage(page.getPageId());
+ Page existPage = dataService.getPage(page.getPageId());
if (existPage != null)
{
uiPortalApp.addMessage(new
ApplicationMessage("UIPageForm.msg.sameName", null));
@@ -432,7 +431,7 @@
page.setModifiable(true);
if (page.getChildren() == null)
page.setChildren(new ArrayList<ModelObject>());
- configService.create(page);
+ dataService.create(page);
postSave(uiPortalApp, pcontext);
return;
}
@@ -456,7 +455,7 @@
// page.setTemplate(uiPage.getTemplate());
if (page.getChildren() == null)
page.setChildren(new ArrayList<ModelObject>());
- configService.update(page);
+ dataService.save(page);
postSave(uiPortalApp, pcontext);
return;
}
@@ -480,7 +479,7 @@
page.setChildren(new ArrayList<ModelObject>());
if (Page.DESKTOP_PAGE.equals(uiPage.getFactoryId()))
{
- configService.update(page);
+ dataService.save(page);
postSave(uiPortalApp, pcontext);
}
}
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java 2010-02-09
10:34:27 UTC (rev 1584)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java 2010-02-09
11:10:41 UTC (rev 1585)
@@ -21,7 +21,6 @@
import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.config.UserACL;
-import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PageNavigation;
import org.exoplatform.portal.config.model.PageNode;
@@ -37,7 +36,6 @@
import org.exoplatform.portal.webui.workspace.UIWorkingWorkspace;
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.web.application.JavascriptManager;
-import org.exoplatform.web.application.RequestContext;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.ComponentConfigs;
@@ -85,7 +83,7 @@
private void saveData() throws Exception
{
- UserPortalConfigService service =
getApplicationComponent(UserPortalConfigService.class);
+ DataStorage dataService = getApplicationComponent(DataStorage.class);
UIPagePreview uiPagePreview = getChild(UIPagePreview.class);
UIPage uiPage = (UIPage)uiPagePreview.getUIComponent();
UIPortal uiPortal = Util.getUIPortal();
@@ -129,8 +127,8 @@
}
uiNodeSelector.selectPageNodeByUri(pageNode.getUri());
- service.create(page);
- service.update(pageNav);
+ dataService.create(page);
+ dataService.save(pageNav);
setNavigation(uiPortal.getNavigations(), uiNodeSelector.getSelectedNavigation());
String uri = pageNav.getId() + "::" + pageNode.getUri();
PageNodeEvent<UIPortal> pnevent = new PageNodeEvent<UIPortal>(uiPortal,
PageNodeEvent.CHANGE_PAGE_NODE, uri);
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageForm.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageForm.java 2010-02-09
10:34:27 UTC (rev 1584)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageForm.java 2010-02-09
11:10:41 UTC (rev 1585)
@@ -22,6 +22,7 @@
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.portal.application.PortalRequestContext;
+import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.config.UserACL;
import org.exoplatform.portal.config.UserPortalConfig;
import org.exoplatform.portal.config.UserPortalConfigService;
@@ -331,8 +332,8 @@
pcontext.setFullRender(true);
UIWorkingWorkspace uiWorkingWS =
uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
pcontext.addUIComponentToUpdateByAjax(uiWorkingWS);
- UserPortalConfigService service =
uiPageForm.getApplicationComponent(UserPortalConfigService.class);
- service.update(page);
+ DataStorage dataService =
uiPageForm.getApplicationComponent(DataStorage.class);
+ dataService.save(page);
return;
}
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageNodeForm2.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageNodeForm2.java 2010-02-09
10:34:27 UTC (rev 1584)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageNodeForm2.java 2010-02-09
11:10:41 UTC (rev 1585)
@@ -22,7 +22,6 @@
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.config.UserACL;
-import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.ModelObject;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PageNavigation;
@@ -409,11 +408,9 @@
if (page.getChildren() == null)
page.setChildren(new ArrayList<ModelObject>());
- UserPortalConfigService service =
uiForm.getApplicationComponent(UserPortalConfigService.class);
-
// check page is exist
- DataStorage dataStorage = uiForm.getApplicationComponent(DataStorage.class);
- Page existPage = dataStorage.getPage(page.getPageId());
+ DataStorage dataService = uiForm.getApplicationComponent(DataStorage.class);
+ Page existPage = dataService.getPage(page.getPageId());
if (existPage != null)
{
uiPortalApp.addMessage(new
ApplicationMessage("UIPageForm.msg.sameName", null));
@@ -422,7 +419,7 @@
}
// save page to database
- service.create(page);
+ dataService.create(page);
pageSelector.setValue(page.getPageId());
}
}
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 2010-02-09
10:34:27 UTC (rev 1584)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2010-02-09
11:10:41 UTC (rev 1585)
@@ -167,10 +167,11 @@
PortalConfig portalConfig =
(PortalConfig)PortalDataMapper.buildModelObject(editPortal);
UserPortalConfigService configService =
getApplicationComponent(UserPortalConfigService.class);
+ DataStorage dataStorage = getApplicationComponent(DataStorage.class);
if (isPortalExist(editPortal))
{
- configService.update(portalConfig);
+ dataStorage.save(portalConfig);
}
else
{
@@ -639,7 +640,8 @@
}
// Perform mop update
- portalConfigService.update(page);
+ DataStorage dataService =
uiWorkingWS.getApplicationComponent(DataStorage.class);
+ dataService.save(page);
uiToolPanel.setUIComponent(null);
// Update UIPage cache on UIPortal
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java 2010-02-09
10:34:27 UTC (rev 1584)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java 2010-02-09
11:10:41 UTC (rev 1585)
@@ -161,11 +161,11 @@
invokeGetBindingBean(editPortal);
((UIFormStringInput)getChild(UIFormInputSet.class).getChildById(FIELD_NAME)).setValue(getPortalOwner());
-
-
+
LocaleConfigService localeConfigService =
getApplicationComponent(LocaleConfigService.class);
LocaleConfig localeConfig =
localeConfigService.getLocaleConfig(editPortal.getLocale());
- this.<UIFormInputSet>
getChildById("PortalSetting").<UIFormSelectBox>getChildById(FIELD_LOCALE).setValue(localeConfig.getLanguage());
+ this.<UIFormInputSet>
getChildById("PortalSetting").<UIFormSelectBox>
getChildById(FIELD_LOCALE).setValue(
+ localeConfig.getLanguage());
setActions(new String[]{"Save", "Close"});
}
@@ -193,7 +193,7 @@
SelectItemOption<String> option =
new
SelectItemOption<String>(localeConfig.getLocale().getDisplayName(currentLocate),
localeConfig
.getLanguage());
- if(defaultLanguage.equals(localeConfig.getLanguage()))
+ if (defaultLanguage.equals(localeConfig.getLanguage()))
{
option.setSelected(true);
}
@@ -271,6 +271,7 @@
{
UIPortalForm uiForm = event.getSource();
+ DataStorage dataService = uiForm.getApplicationComponent(DataStorage.class);
UserPortalConfigService service =
uiForm.getApplicationComponent(UserPortalConfigService.class);
PortalRequestContext prContext = Util.getPortalRequestContext();
@@ -287,7 +288,7 @@
{
PortalConfig portalConfig =
(PortalConfig)PortalDataMapper.buildModelObject(uiPortal);
UserPortalConfigService configService =
uiForm.getApplicationComponent(UserPortalConfigService.class);
- configService.update(portalConfig);
+ dataService.save(portalConfig);
}
else
{
@@ -334,9 +335,9 @@
UserPortalConfig userPortalConfig = service.getUserPortalConfig(portalName,
pcontext.getRemoteUser());
PortalConfig pconfig = userPortalConfig.getPortalConfig();
uiForm.invokeSetBindingBean(pconfig);
- PageNavigation navigation = service.getPageNavigation(PortalConfig.PORTAL_TYPE,
portalName);
- service.update(pconfig);
- service.update(navigation);
+ PageNavigation navigation =
dataService.getPageNavigation(PortalConfig.PORTAL_TYPE, portalName);
+ dataService.save(pconfig);
+ dataService.save(navigation);
UIPortalApplication uiPortalApp =
event.getSource().getAncestorOfType(UIPortalApplication.class);
UIMaskWorkspace uiMaskWS =
uiPortalApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
uiMaskWS.setUIComponent(null);