Author: julien_viet
Date: 2009-10-23 09:56:49 -0400 (Fri, 23 Oct 2009)
New Revision: 410
Added:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/cache/
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/cache/DataStorageCache.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/NavigationContainer.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/NavigationKey.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/OwnerKey.java
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/DataStorage.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigListener.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/Mapper.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNavigation.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNode.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNodeContainer.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/DashboardTask.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageNavigationTask.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageTask.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PortalConfigTask.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PreferencesTask.java
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/SearchTask.java
portal/branches/performance/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java
portal/branches/performance/component/portal/src/test/java/org/exoplatform/portal/config/TestLoadedPOM.java
portal/branches/performance/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIGroupNavigationManagement.java
portal/branches/performance/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIAddGroupNavigation.java
portal/branches/performance/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationManagement.java
Log:
- work on caching navigations
Added:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/cache/DataStorageCache.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/cache/DataStorageCache.java
(rev 0)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/cache/DataStorageCache.java 2009-10-23
13:56:49 UTC (rev 410)
@@ -0,0 +1,255 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.cache;
+
+import org.exoplatform.commons.utils.LazyPageList;
+import org.exoplatform.commons.utils.ListAccess;
+import org.exoplatform.portal.application.PortletPreferences;
+import org.exoplatform.portal.config.DataStorage;
+import org.exoplatform.portal.config.Query;
+import org.exoplatform.portal.config.model.ApplicationState;
+import org.exoplatform.portal.config.model.Container;
+import org.exoplatform.portal.config.model.ModelChange;
+import org.exoplatform.portal.config.model.NavigationContainer;
+import org.exoplatform.portal.config.model.NavigationKey;
+import org.exoplatform.portal.config.model.OwnerKey;
+import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.portal.pom.config.POMTask;
+import org.exoplatform.portal.pom.config.Utils;
+import org.exoplatform.services.cache.CacheService;
+import org.exoplatform.services.cache.ExoCache;
+
+import java.util.Comparator;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public class DataStorageCache implements DataStorage
+{
+
+ /** . */
+ protected ExoCache<NavigationKey, NavigationContainer.Page>
pageNavigationCache;
+
+ /** . */
+ private DataStorage delegate;
+
+ public DataStorageCache(
+ CacheService cacheService,
+ DataStorage delegate)
+ {
+ this.pageNavigationCache =
cacheService.getCacheInstance(PageNavigation.class.getName());
+ this.delegate = delegate;
+ }
+
+ public <T extends POMTask> T execute(T task)
+ throws Exception
+ {
+ return delegate.execute(task);
+ }
+
+ public void create(PortalConfig config)
+ throws Exception
+ {
+ delegate.create(config);
+ }
+
+ public void save(PortalConfig config)
+ throws Exception
+ {
+ delegate.save(config);
+ }
+
+ public PortalConfig getPortalConfig(String portalName)
+ throws Exception
+ {
+ return delegate.getPortalConfig(portalName);
+ }
+
+ public PortalConfig getPortalConfig(String ownerType, String portalName)
+ throws Exception
+ {
+ return delegate.getPortalConfig(ownerType, portalName);
+ }
+
+ public void remove(PortalConfig config)
+ throws Exception
+ {
+ delegate.remove(config);
+ }
+
+ public Page getPage(String pageId)
+ throws Exception
+ {
+ return delegate.getPage(pageId);
+ }
+
+ public Page clonePage(String pageId, String clonedOwnerType, String clonedOwnerId,
String clonedName)
+ throws Exception
+ {
+ return delegate.clonePage(pageId, clonedOwnerType, clonedOwnerId, clonedName);
+ }
+
+ public void remove(Page page)
+ throws Exception
+ {
+ delegate.remove(page);
+ }
+
+ public void create(Page page)
+ throws Exception
+ {
+ delegate.create(page);
+ }
+
+ public List<ModelChange> save(Page page)
+ throws Exception
+ {
+ return delegate.save(page);
+ }
+
+ public NavigationContainer.Page getPageNavigation(NavigationKey key)
+ throws Exception
+ {
+ NavigationContainer.Page navigation = pageNavigationCache.get(key);
+ if (navigation == null)
+ {
+ navigation = delegate.getPageNavigation(key.getOwnerType(), key.getOwnerId());
+ if (navigation != null)
+ {
+ pageNavigationCache.put(key, navigation);
+ }
+ }
+ return navigation;
+ }
+
+ public NavigationContainer.Page getPageNavigation(String owner)
+ throws Exception
+ {
+ String[] chunks = Utils.split("::", owner);
+ if (chunks.length != 2)
+ {
+ throw new IllegalArgumentException("Wrong owner format should be
ownerType::ownerId was " + owner);
+ }
+
+ //
+ String ownerType = chunks[0];
+ String ownerId = chunks[1];
+
+ //
+ return getPageNavigation(ownerType, ownerId);
+ }
+
+ public NavigationContainer.Page getPageNavigation(String ownerType, String id)
+ throws Exception
+ {
+ return getPageNavigation(new NavigationKey(ownerType, id));
+ }
+
+ public void save(NavigationContainer.Page navigation)
+ throws Exception
+ {
+ OwnerKey key = new OwnerKey(navigation.getOwnerType(), navigation.getOwnerId());
+ pageNavigationCache.remove(key);
+ delegate.save(navigation);
+ }
+
+ public void create(NavigationContainer.Page navigation)
+ throws Exception
+ {
+ OwnerKey key = new OwnerKey(navigation.getOwnerType(), navigation.getOwnerId());
+ pageNavigationCache.remove(key);
+ delegate.create(navigation);
+ }
+
+ public void remove(NavigationContainer.Page navigation)
+ throws Exception
+ {
+ OwnerKey key = new OwnerKey(navigation.getOwnerType(), navigation.getOwnerId());
+ pageNavigationCache.remove(key);
+ delegate.remove(navigation);
+ }
+
+ public void save(PortletPreferences portletPreferences)
+ throws Exception
+ {
+ delegate.save(portletPreferences);
+ }
+
+ public <S> S load(ApplicationState<S> state)
+ throws Exception
+ {
+ return delegate.load(state);
+ }
+
+ public <S> ApplicationState<S> save(ApplicationState<S> state, S
preferences)
+ throws Exception
+ {
+ return delegate.save(state, preferences);
+ }
+
+ public PortletPreferences getPortletPreferences(String windowID)
+ throws Exception
+ {
+ return delegate.getPortletPreferences(windowID);
+ }
+
+ public <T> LazyPageList<T> find(Query<T> q)
+ throws Exception
+ {
+ return find(q, null);
+ }
+
+ public <T> LazyPageList<T> find(Query<T> q, Comparator<T>
sortComparator)
+ throws Exception
+ {
+ Class<T> type = q.getClassType();
+ if (type == NavigationContainer.Page.class)
+ {
+ Query<NavigationKey> query = new
Query<NavigationKey>(q.getOwnerType(), q.getOwnerId(), q.getName(), q.getTitle(),
NavigationKey.class);
+ LazyPageList<NavigationKey> result = delegate.find(query, null);
+ final List<NavigationKey> all = result.getAll();
+ return new LazyPageList<T>(new ListAccess<T>()
+ {
+ public int getSize() throws Exception
+ {
+ return all.size();
+ }
+ public T[] load(int index, int length) throws Exception,
IllegalArgumentException
+ {
+ NavigationContainer.Page[] values = new NavigationContainer.Page[length];
+ for (int i = 0;i < values.length;i++)
+ {
+ NavigationKey key = all.get(i);
+ NavigationContainer.Page nav = getPageNavigation(key);
+ }
+ return (T[])values;
+ }
+ }, result.getPageSize());
+ }
+ return delegate.find(q, sortComparator);
+ }
+
+ public Container getSharedLayout()
+ throws Exception
+ {
+ return delegate.getSharedLayout();
+ }
+}
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/DataStorage.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/DataStorage.java 2009-10-23
06:58:59 UTC (rev 409)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/DataStorage.java 2009-10-23
13:56:49 UTC (rev 410)
@@ -24,8 +24,8 @@
import org.exoplatform.portal.config.model.ApplicationState;
import org.exoplatform.portal.config.model.Container;
import org.exoplatform.portal.config.model.ModelChange;
+import org.exoplatform.portal.config.model.NavigationContainer;
import org.exoplatform.portal.config.model.Page;
-import org.exoplatform.portal.config.model.PageNavigation;
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.pom.config.POMTask;
@@ -86,15 +86,15 @@
*/
public List<ModelChange> save(Page page) throws Exception;
- public PageNavigation getPageNavigation(String fullId) throws Exception;
+ public NavigationContainer.Page getPageNavigation(String owner) throws Exception;
- public PageNavigation getPageNavigation(String ownerType, String id) throws
Exception;
+ public NavigationContainer.Page getPageNavigation(String ownerType, String id) throws
Exception;
- public void save(PageNavigation navigation) throws Exception;
+ public void save(NavigationContainer.Page navigation) throws Exception;
- public void create(PageNavigation navigation) throws Exception;
+ public void create(NavigationContainer.Page navigation) throws Exception;
- public void remove(PageNavigation navigation) throws Exception;
+ public void remove(NavigationContainer.Page navigation) throws Exception;
public void save(PortletPreferences portletPreferences) throws Exception;
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java 2009-10-23
06:58:59 UTC (rev 409)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java 2009-10-23
13:56:49 UTC (rev 410)
@@ -29,6 +29,7 @@
import org.exoplatform.portal.application.PortletPreferences;
import org.exoplatform.portal.application.PortletPreferences.PortletPreferencesSet;
import org.exoplatform.portal.config.model.Container;
+import org.exoplatform.portal.config.model.NavigationContainer;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PageNavigation;
import org.exoplatform.portal.config.model.PageNode;
@@ -398,15 +399,15 @@
xml = StringUtils.replace(xml, "@owner@", owner);
}
PageNavigation navigation = fromXML(config.getOwnerType(), owner, xml,
PageNavigation.class);
- PageNavigation currentNavigation =
pdcService_.getPageNavigation(navigation.getOwner());
+ NavigationContainer.Page currentNavigation =
pdcService_.getPageNavigation(navigation.getOwner());
if (currentNavigation == null)
{
- pdcService_.create(navigation);
+ pdcService_.create(navigation.buildNavigation());
}
else
{
- navigation.merge(currentNavigation);
- pdcService_.save(navigation);
+ navigation.merge(new PageNavigation(currentNavigation));
+ pdcService_.save(navigation.buildNavigation());
}
}
catch (JiBXException e)
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigListener.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigListener.java 2009-10-23
06:58:59 UTC (rev 409)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigListener.java 2009-10-23
13:56:49 UTC (rev 410)
@@ -22,6 +22,7 @@
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.portal.config.model.Container;
+import org.exoplatform.portal.config.model.NavigationContainer;
import org.exoplatform.portal.config.model.PageNavigation;
import org.exoplatform.portal.config.model.PageNode;
import org.exoplatform.portal.config.model.PortalConfig;
@@ -76,7 +77,7 @@
}
// Create a blank navigation if needed
- PageNavigation navigation = dataStorage.getPageNavigation(PortalConfig.USER_TYPE,
userName);
+ NavigationContainer.Page navigation =
dataStorage.getPageNavigation(PortalConfig.USER_TYPE, userName);
if (navigation == null)
{
PageNavigation pageNav = new PageNavigation();
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java 2009-10-23
06:58:59 UTC (rev 409)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java 2009-10-23
13:56:49 UTC (rev 410)
@@ -20,10 +20,12 @@
package org.exoplatform.portal.config;
import org.exoplatform.container.component.ComponentPlugin;
+import org.exoplatform.portal.cache.DataStorageCache;
import org.exoplatform.portal.config.model.Application;
import org.exoplatform.portal.config.model.Container;
import org.exoplatform.portal.config.model.ModelChange;
import org.exoplatform.portal.config.model.ModelObject;
+import org.exoplatform.portal.config.model.NavigationContainer;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PageNavigation;
import org.exoplatform.portal.config.model.PageNode;
@@ -44,7 +46,9 @@
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
/**
* Created by The eXo Platform SAS Apr 19, 2007 This service is used to load the
@@ -77,8 +81,6 @@
protected ExoCache<String, Page> pageConfigCache_;
- protected ExoCache<String, PageNavigation> pageNavigationCache_;
-
private NewPortalConfigListener newPortalConfigListener_;
private Log log = ExoLogger.getLogger("Portal:UserPortalConfigService");
@@ -86,13 +88,12 @@
public UserPortalConfigService(UserACL userACL, DataStorage storage, CacheService
cacheService,
OrganizationService orgService, ListenerService listenerService) throws Exception
{
- this.storage_ = storage;
+ this.storage_ = new DataStorageCache(cacheService, storage);
this.orgService_ = orgService;
this.listenerService = listenerService;
this.userACL_ = userACL;
this.portalConfigCache_ =
cacheService.getCacheInstance(PortalConfig.class.getName());
this.pageConfigCache_ = cacheService.getCacheInstance(Page.class.getName());
- this.pageNavigationCache_ =
cacheService.getCacheInstance(PageNavigation.class.getName());
}
/**
@@ -286,8 +287,8 @@
/**
* This method should update the PortalConfig object
*
- * @param portal
- * @throws Exception
+ * @param portal the portal
+ * @throws Exception any exception
*/
public void update(PortalConfig portal) throws Exception
{
@@ -405,8 +406,7 @@
*/
public void create(PageNavigation navigation) throws Exception
{
- storage_.create(navigation);
- pageNavigationCache_.put(navigation.getOwner(), navigation);
+ storage_.create(navigation.buildNavigation());
listenerService.broadcast(CREATE_NAVIGATION_EVENT, this, navigation);
}
@@ -420,8 +420,7 @@
*/
public void update(PageNavigation navigation) throws Exception
{
- storage_.save(navigation);
- pageNavigationCache_.select(new ExpireKeyStartWithSelector<String,
PageNavigation>(navigation.getOwner()));
+ storage_.save(navigation.buildNavigation());
listenerService.broadcast(UPDATE_NAVIGATION_EVENT, this, navigation);
}
@@ -435,16 +434,18 @@
*/
public void remove(PageNavigation navigation) throws Exception
{
- storage_.remove(navigation);
- pageNavigationCache_.remove(navigation.getOwner());
+ storage_.remove(navigation.buildNavigation());
listenerService.broadcast(REMOVE_NAVIGATION_EVENT, this, navigation);
}
public PageNavigation getPageNavigation(String ownerType, String id) throws Exception
{
- PageNavigation navigation = pageNavigationCache_.get(ownerType + "::" +
id);
+ PageNavigation navigation = null;
+ NavigationContainer.Page pageNavigation = storage_.getPageNavigation(ownerType,
id);
if (navigation == null)
- navigation = storage_.getPageNavigation(ownerType, id);
+ {
+ navigation = pageNavigation != null ? new PageNavigation(pageNavigation) :
null;
+ }
return navigation;
}
@@ -452,13 +453,13 @@
* This method creates new page from an existing page and links new page to a
* PageNode.
*
- * @param nodeName
- * @param nodeLabel
- * @param pageId
- * @param ownerType
- * @param ownerId
- * @return
- * @throws Exception
+ * @param nodeName the node name
+ * @param nodeLabel the node name
+ * @param pageId the page id
+ * @param ownerType the owner type
+ * @param ownerId the owner id
+ * @return the page node
+ * @throws Exception any exception
*/
public PageNode createNodeFromPageTemplate(String nodeName, String nodeLabel, String
pageId, String ownerType,
String ownerId) throws Exception
@@ -505,6 +506,52 @@
}
/**
+ * Load all navigation that user has edit permission.
+ *
+ * @return the navigation the user can edit
+ * @throws Exception any exception
+ */
+ public List<PageNavigation> loadEditableNavigations() throws Exception
+ {
+ Query<NavigationContainer.Page> query = new
Query<NavigationContainer.Page>(PortalConfig.GROUP_TYPE, null,
NavigationContainer.Page.class);
+ List<NavigationContainer.Page> navis = storage_.find(query, new
Comparator<NavigationContainer.Page>()
+ {
+ public int compare(NavigationContainer.Page pconfig1, NavigationContainer.Page
pconfig2)
+ {
+ return pconfig1.getOwnerId().compareTo(pconfig2.getOwnerId());
+ }
+ }).getAll();
+
+ //
+ List<PageNavigation> navigations = new ArrayList<PageNavigation>();
+ for (NavigationContainer.Page ele : navis)
+ {
+ PageNavigation nav = new PageNavigation(ele);
+ if (userACL_.hasEditPermission(nav))
+ {
+ navigations.add(nav);
+ }
+ }
+ return navigations;
+ }
+
+ /**
+ * @return
+ * @throws Exception
+ */
+ public Set<String> findGroupWithoutNavigation() throws Exception
+ {
+ Query<NavigationContainer.Page> query = new
Query<NavigationContainer.Page>(PortalConfig.GROUP_TYPE, null,
NavigationContainer.Page.class);
+ Set<String> groupIds = new HashSet<String>();
+ List<NavigationContainer.Page> navis = storage_.find(query).getAll();
+ for (NavigationContainer.Page ele : navis)
+ {
+ groupIds.add(ele.getOwnerId());
+ }
+ return groupIds;
+ }
+
+ /**
* Update the ownership recursively on the model graph.
*
* @param object the model object graph root
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/Mapper.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/Mapper.java 2009-10-23
06:58:59 UTC (rev 409)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/Mapper.java 2009-10-23
13:56:49 UTC (rev 410)
@@ -89,46 +89,45 @@
this.session = session;
}
- public PageNavigation load(Navigation src)
+ public NavigationContainer.Page load(Navigation src)
{
- return load(src, PageNavigation.class);
+ return load(src, NavigationContainer.Page.class);
}
- private <T extends PageNodeContainer> T load(Navigation src, Class<T>
type)
+ private <T extends NavigationContainer> T load(Navigation src, Class<T>
type)
{
+
+ //
+ ArrayList<NavigationContainer.Node> children = new
ArrayList<NavigationContainer.Node>(src.getChildren().size());
+ for (Navigation srcChild : src.getChildren())
+ {
+ NavigationContainer.Node dstChild = load(srcChild,
NavigationContainer.Node.class);
+ children.add(dstChild);
+ }
+
+ //
T dst;
- if (type == PageNavigation.class)
+ if (type == NavigationContainer.Page.class)
{
- PageNavigation dstNav = new PageNavigation(src.getObjectId());
Site site = src.getSite();
String ownerType = getOwnerType(site.getObjectType());
String ownerId = site.getName();
- dstNav.setOwnerId(ownerId);
- dstNav.setOwnerType(ownerType);
Attributes attrs = src.getAttributes();
- dstNav.setCreator(attrs.getValue(MappedAttributes.CREATOR));
- dstNav.setModifier(attrs.getValue(MappedAttributes.MODIFIER));
- dstNav.setDescription(attrs.getValue(MappedAttributes.DESCRIPTION));
- Integer priority = attrs.getValue(MappedAttributes.PRIORITY);
- if (priority != null)
- {
- dstNav.setPriority(priority);
- }
+ NavigationContainer.Page dstNav = new NavigationContainer.Page(
+ src.getObjectId(),
+ ownerType,
+ ownerId,
+ attrs.getValue(MappedAttributes.DESCRIPTION),
+ attrs.getValue(MappedAttributes.CREATOR),
+ attrs.getValue(MappedAttributes.MODIFIER),
+ attrs.getValue(MappedAttributes.PRIORITY, 1),
+ children);
dst = (T)dstNav;
}
- else if (type == PageNode.class)
+ else if (type == NavigationContainer.Node.class)
{
- PageNode dstNode = new PageNode(src.getObjectId());
Attributes attrs = src.getAttributes();
- dstNode.setName(src.getName());
- dstNode.setLabel(attrs.getValue(MappedAttributes.LABEL));
- dstNode.setIcon(attrs.getValue(MappedAttributes.ICON));
- dstNode.setUri(attrs.getValue(MappedAttributes.URI));
-
dstNode.setStartPublicationDate(attrs.getValue(MappedAttributes.START_PUBLICATION_DATE));
-
dstNode.setEndPublicationDate(attrs.getValue(MappedAttributes.END_PUBLICATION_DATE));
-
dstNode.setShowPublicationDate(attrs.getValue(MappedAttributes.SHOW_PUBLICATION_DATE));
- dstNode.setVisible(attrs.getValue(MappedAttributes.VISIBLE));
- dstNode.setChildren(new ArrayList<PageNode>());
+ String pageReference = null;
Link link = src.getLink();
if (link instanceof PageLink)
{
@@ -138,10 +137,23 @@
{
Site site = target.getSite();
ObjectType<? extends Site> siteType = site.getObjectType();
- String pageRef = getOwnerType(siteType) + "::" + site.getName()
+ "::" + target.getName();
- dstNode.setPageReference(pageRef);
+ pageReference = getOwnerType(siteType) + "::" + site.getName() +
"::" + target.getName();
}
}
+ NavigationContainer.Node dstNode = new NavigationContainer.Node(
+ src.getObjectId(),
+ attrs.getValue(MappedAttributes.URI),
+ attrs.getValue(MappedAttributes.LABEL),
+ attrs.getValue(MappedAttributes.ICON),
+ src.getName(),
+ attrs.getValue(MappedAttributes.START_PUBLICATION_DATE),
+ attrs.getValue(MappedAttributes.END_PUBLICATION_DATE),
+ attrs.getValue(MappedAttributes.SHOW_PUBLICATION_DATE, false),
+ attrs.getValue(MappedAttributes.VISIBLE, true),
+ pageReference,
+ children
+ );
+
dst = (T)dstNode;
}
else
@@ -150,26 +162,19 @@
}
//
- for (Navigation srcChild : src.getChildren())
- {
- PageNode dstChild = load(srcChild, PageNode.class);
- dst.getNodes().add(dstChild);
- }
-
- //
return dst;
}
- public void save(PageNavigation src, Navigation dst)
+ public void save(NavigationContainer.Page src, Navigation dst)
{
- save((PageNodeContainer)src, dst);
+ save((NavigationContainer)src, dst);
}
- private void save(PageNodeContainer src, Navigation dst)
+ private void save(NavigationContainer src, Navigation dst)
{
- if (src instanceof PageNode)
+ if (src instanceof NavigationContainer.Node)
{
- PageNode node = (PageNode)src;
+ NavigationContainer.Node node = (NavigationContainer.Node)src;
Workspace workspace = dst.getSite().getWorkspace();
String reference = node.getPageReference();
if (reference != null)
@@ -184,17 +189,17 @@
//
Attributes attrs = dst.getAttributes();
- attrs.setValue(MappedAttributes.URI, node.getUri());
+ attrs.setValue(MappedAttributes.URI, node.getURI());
attrs.setValue(MappedAttributes.LABEL, node.getLabel());
attrs.setValue(MappedAttributes.ICON, node.getIcon());
attrs.setValue(MappedAttributes.START_PUBLICATION_DATE,
node.getStartPublicationDate());
attrs.setValue(MappedAttributes.END_PUBLICATION_DATE,
node.getEndPublicationDate());
- attrs.setValue(MappedAttributes.SHOW_PUBLICATION_DATE,
node.isShowPublicationDate());
+ attrs.setValue(MappedAttributes.SHOW_PUBLICATION_DATE,
node.getShowPublicationDate());
attrs.setValue(MappedAttributes.VISIBLE, node.isVisible());
}
- else if (src instanceof PageNavigation)
+ else if (src instanceof NavigationContainer.Page)
{
- PageNavigation pageNav = (PageNavigation)src;
+ NavigationContainer.Page pageNav = (NavigationContainer.Page)src;
//
Attributes attrs = dst.getAttributes();
@@ -210,40 +215,33 @@
//
Set<String> savedSet = new HashSet<String>();
- if (src.getNodes() != null)
+ for (NavigationContainer.Node node : src.getChildren())
{
- for (PageNode node : src.getNodes())
+ String srcId = node.getStorageId();
+ Navigation dstChild;
+ if (srcId != null)
{
- String srcId = node.getStorageId();
- Navigation dstChild;
- if (srcId != null)
- {
- dstChild = session.findObjectById(ObjectType.NAVIGATION, srcId);
- }
- else
- {
- dstChild = dst.getChild(node.getName());
- if (dstChild == null)
- {
- dstChild = dst.addChild(node.getName());
- }
- srcId = dstChild.getObjectId();
- }
- save(node, dstChild);
- savedSet.add(srcId);
+ dstChild = session.findObjectById(ObjectType.NAVIGATION, srcId);
}
- for (Iterator<? extends Navigation> i = dst.getChildren().iterator();
i.hasNext();)
+ else
{
- Navigation dstChild = i.next();
- if (!savedSet.contains(dstChild.getObjectId()))
+ dstChild = dst.getChild(node.getName());
+ if (dstChild == null)
{
- i.remove();
+ dstChild = dst.addChild(node.getName());
}
+ srcId = dstChild.getObjectId();
}
+ save(node, dstChild);
+ savedSet.add(srcId);
}
- else
+ for (Iterator<? extends Navigation> i = dst.getChildren().iterator();
i.hasNext();)
{
- dst.getChildren().clear();
+ Navigation dstChild = i.next();
+ if (!savedSet.contains(dstChild.getObjectId()))
+ {
+ i.remove();
+ }
}
}
Added:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/NavigationContainer.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/NavigationContainer.java
(rev 0)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/NavigationContainer.java 2009-10-23
13:56:49 UTC (rev 410)
@@ -0,0 +1,258 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config.model;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public class NavigationContainer extends ModelObject
+{
+
+ /** . */
+ private final List<NavigationContainer.Node> children;
+
+ public NavigationContainer(String storageId, List<NavigationContainer.Node>
children)
+ {
+ super(storageId);
+
+ //
+ this.children = children;
+ }
+
+ public List<NavigationContainer.Node> getChildren()
+ {
+ return children;
+ }
+
+ public static class Node extends NavigationContainer
+ {
+
+ /** . */
+ private final String uri;
+
+ /** . */
+ private final String label;
+
+ /** . */
+ private final String icon;
+
+ /** . */
+ private final String name;
+
+ /** . */
+ private final Date startPublicationDate;
+
+ /** . */
+ private final Date endPublicationDate;
+
+ /** . */
+ private final boolean showPublicationDate;
+
+ /** . */
+ private final boolean visible;
+
+ /** . */
+ private final String pageReference;
+
+ public Node(
+ String uri,
+ String label,
+ String icon,
+ String name,
+ Date startPublicationDate,
+ Date endPublicationDate,
+ Boolean showPublicationDate,
+ Boolean visible,
+ String pageReference,
+ List<NavigationContainer.Node> children)
+ {
+ this(null, uri, label, icon, name, startPublicationDate, endPublicationDate,
showPublicationDate, visible, pageReference, children);
+ }
+
+ public Node(
+ String storageId,
+ String uri,
+ String label,
+ String icon,
+ String name,
+ Date startPublicationDate,
+ Date endPublicationDate,
+ Boolean showPublicationDate,
+ Boolean visible,
+ String pageReference,
+ List<NavigationContainer.Node> children)
+ {
+ super(storageId, children);
+
+ //
+ this.uri = uri;
+ this.label = label;
+ this.icon = icon;
+ this.name = name;
+ this.startPublicationDate = startPublicationDate;
+ this.endPublicationDate = endPublicationDate;
+ this.showPublicationDate = showPublicationDate != null ? showPublicationDate :
false;
+ this.visible = visible != null ? visible : true;
+ this.pageReference = pageReference;
+ }
+ public String getURI()
+ {
+ return uri;
+ }
+
+ public String getLabel()
+ {
+ return label;
+ }
+
+ public String getIcon()
+ {
+ return icon;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public Date getStartPublicationDate()
+ {
+ return startPublicationDate;
+ }
+
+ public Date getEndPublicationDate()
+ {
+ return endPublicationDate;
+ }
+
+ public boolean getShowPublicationDate()
+ {
+ return showPublicationDate;
+ }
+
+ public boolean isVisible()
+ {
+ return visible;
+ }
+
+ public String getPageReference()
+ {
+ return pageReference;
+ }
+ }
+
+ public static class Page extends NavigationContainer
+ {
+
+ /** . */
+ private final String ownerType;
+
+ /** . */
+ private final String ownerId;
+
+ /** . */
+ private final String description;
+
+ /** . */
+ private final String creator;
+
+ /** . */
+ private final String modifier;
+
+ /** . */
+ private final int priority;
+
+ public Page(
+ String ownerType,
+ String ownerId,
+ String description,
+ String creator,
+ String modifier,
+ Integer priority,
+ List<NavigationContainer.Node> children)
+ {
+ this(null, ownerType, ownerId, description, creator, modifier, priority,
children);
+ }
+
+ public Page(
+ String storageId,
+ String ownerType,
+ String ownerId,
+ String description,
+ String creator,
+ String modifier,
+ Integer priority,
+ List<NavigationContainer.Node> children)
+ {
+ super(storageId, children);
+
+ //
+ if (ownerType == null)
+ {
+ throw new NullPointerException("No null owner type");
+ }
+ if (ownerId == null)
+ {
+ throw new NullPointerException("No null owner id");
+ }
+
+ //
+ this.ownerType = ownerType;
+ this.ownerId = ownerId;
+ this.description = description;
+ this.creator = creator;
+ this.modifier = modifier;
+ this.priority = priority != null ? priority : 1;
+ }
+
+ public String getOwnerType()
+ {
+ return ownerType;
+ }
+
+ public String getOwnerId()
+ {
+ return ownerId;
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public String getCreator()
+ {
+ return creator;
+ }
+
+ public String getModifier()
+ {
+ return modifier;
+ }
+
+ public int getPriority()
+ {
+ return priority;
+ }
+ }
+
+
+}
Added:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/NavigationKey.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/NavigationKey.java
(rev 0)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/NavigationKey.java 2009-10-23
13:56:49 UTC (rev 410)
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config.model;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public class NavigationKey extends OwnerKey
+{
+
+ public NavigationKey(String ownerType, String ownerId)
+ {
+ super(ownerType, ownerId);
+ }
+}
Added:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/OwnerKey.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/OwnerKey.java
(rev 0)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/OwnerKey.java 2009-10-23
13:56:49 UTC (rev 410)
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config.model;
+
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public class OwnerKey implements Serializable
+{
+
+ /** . */
+ private final String ownerType;
+
+ /** . */
+ private final String ownerId;
+
+ public OwnerKey(String ownerType, String ownerId)
+ {
+ if (ownerType == null)
+ {
+ throw new NullPointerException();
+ }
+ if (ownerId == null)
+ {
+ throw new NullPointerException();
+ }
+ this.ownerType = ownerType;
+ this.ownerId = ownerId;
+ }
+
+ public String getOwnerType()
+ {
+ return ownerType;
+ }
+
+ public String getOwnerId()
+ {
+ return ownerId;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return ownerId.hashCode() ^ ownerType.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof OwnerKey)
+ {
+ OwnerKey that = (OwnerKey)obj;
+ return ownerType.equals(that.ownerType) &&
ownerId.equals(that.ownerId);
+ }
+ return false;
+ }
+}
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNavigation.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNavigation.java 2009-10-23
06:58:59 UTC (rev 409)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNavigation.java 2009-10-23
13:56:49 UTC (rev 410)
@@ -21,6 +21,7 @@
import java.util.ArrayList;
import java.util.LinkedHashMap;
+import java.util.List;
import java.util.Map;
public class PageNavigation extends PageNodeContainer
@@ -38,19 +39,44 @@
private String modifier;
- private ArrayList<PageNode> pageNodes = new ArrayList<PageNode>();
+ private ArrayList<PageNode> pageNodes;
private int priority = 1;
PageNavigation(String storageId)
{
super(storageId);
+
+ //
+ this.pageNodes = new ArrayList<PageNode>();
}
public PageNavigation()
{
+ this((String)null);
}
+ public PageNavigation(NavigationContainer.Page nav)
+ {
+ super(nav.getStorageId());
+
+ ArrayList<PageNode> children = new
ArrayList<PageNode>(nav.getChildren().size());
+ for (NavigationContainer.Node child : nav.getChildren())
+ {
+ PageNode node = new PageNode(child);
+ children.add(node);
+ }
+
+ //
+ this.ownerType = nav.getOwnerType();
+ this.ownerId = nav.getOwnerId();
+ this.description = nav.getDescription();
+ this.creator = nav.getCreator();
+ this.modifier = nav.getModifier();
+ this.priority = nav.getPriority();
+ this.pageNodes = children;
+ }
+
public int getId()
{
return getOwner().hashCode();
@@ -226,4 +252,20 @@
{
return "PageNavigation[ownerType=" + ownerType + ",ownerId=" +
ownerId + "]";
}
+
+ @Override
+ public NavigationContainer.Page buildNavigation()
+ {
+ List<NavigationContainer.Node> children = buildNavigationChildren();
+ return new NavigationContainer.Page(
+ storageId,
+ ownerType,
+ ownerId,
+ description,
+ creator,
+ modifier,
+ priority,
+ children
+ );
+ }
}
\ No newline at end of file
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNode.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNode.java 2009-10-23
06:58:59 UTC (rev 409)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNode.java 2009-10-23
13:56:49 UTC (rev 410)
@@ -29,7 +29,7 @@
public class PageNode extends PageNodeContainer
{
- private ArrayList<PageNode> children = new ArrayList<PageNode>(5);
+ private ArrayList<PageNode> children;
private String uri;
@@ -53,14 +53,42 @@
private transient boolean modifiable;
+ public PageNode(NavigationContainer.Node nav)
+ {
+ super(nav.getStorageId());
+
+ //
+ ArrayList<PageNode> children = new
ArrayList<PageNode>(nav.getChildren().size());
+ for (NavigationContainer.Node child : nav.getChildren())
+ {
+ PageNode node = new PageNode(child);
+ children.add(node);
+ }
+
+ //
+ this.uri = nav.getURI();
+ this.label = nav.getLabel();
+ this.icon = nav.getIcon();
+ this.name = nav.getName();
+ this.startPublicationDate = nav.getStartPublicationDate();
+ this.endPublicationDate = nav.getEndPublicationDate();
+ this.showPublicationDate = nav.getShowPublicationDate();
+ this.visible = nav.isVisible();
+ this.pageReference = nav.getPageReference();
+ this.children = children;
+ }
+
public PageNode(String storageId)
{
super(storageId);
+
+ //
+ this.children = new ArrayList<PageNode>();
}
public PageNode()
{
- super();
+ this((String)null);
}
public String getUri()
@@ -258,4 +286,22 @@
return newNode;
}
+ @Override
+ public NavigationContainer.Node buildNavigation()
+ {
+ List<NavigationContainer.Node> children = buildNavigationChildren();
+ return new NavigationContainer.Node(
+ storageId,
+ uri,
+ label,
+ icon,
+ name,
+ startPublicationDate,
+ endPublicationDate,
+ showPublicationDate,
+ visible,
+ pageReference,
+ children
+ );
+ }
}
\ No newline at end of file
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNodeContainer.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNodeContainer.java 2009-10-23
06:58:59 UTC (rev 409)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNodeContainer.java 2009-10-23
13:56:49 UTC (rev 410)
@@ -19,6 +19,8 @@
package org.exoplatform.portal.config.model;
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
/**
@@ -38,4 +40,27 @@
}
public abstract List<PageNode> getNodes();
+
+ protected List<NavigationContainer.Node> buildNavigationChildren()
+ {
+ List<PageNode> nodes = getNodes();
+ if (nodes != null)
+ {
+ ArrayList<NavigationContainer.Node> children = new
ArrayList<NavigationContainer.Node>();
+ for (int i = 0;i < nodes.size();i++)
+ {
+ PageNode node = nodes.get(i);
+ NavigationContainer.Node child = node.buildNavigation();
+ children.add(child);
+ }
+ return Collections.unmodifiableList(children);
+ }
+ else
+ {
+ return Collections.emptyList();
+ }
+ }
+
+ public abstract NavigationContainer buildNavigation();
+
}
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java 2009-10-23
06:58:59 UTC (rev 409)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java 2009-10-23
13:56:49 UTC (rev 410)
@@ -30,6 +30,7 @@
import org.exoplatform.portal.config.model.Container;
import org.exoplatform.portal.config.model.ModelChange;
import org.exoplatform.portal.config.model.ModelObject;
+import org.exoplatform.portal.config.model.NavigationContainer;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PageNavigation;
import org.exoplatform.portal.config.model.PersistentApplicationState;
@@ -41,11 +42,15 @@
import org.exoplatform.portal.pom.config.tasks.PortletPreferencesTask;
import org.exoplatform.portal.pom.config.tasks.PreferencesTask;
import org.exoplatform.portal.pom.config.tasks.SearchTask;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import org.jibx.runtime.BindingDirectory;
import org.jibx.runtime.IBindingFactory;
import org.jibx.runtime.IUnmarshallingContext;
import java.io.ByteArrayInputStream;
+import java.text.DecimalFormat;
+import java.text.NumberFormat;
import java.util.Comparator;
import java.util.List;
import java.util.UUID;
@@ -60,17 +65,36 @@
/** . */
private final POMSessionManager pomMgr;
+ /** . */
private ConfigurationManager confManager_;
+ /** . */
+ private final Log log = ExoLogger.getLogger(getClass());
+
public POMDataStorage(POMSessionManager pomMgr, ConfigurationManager confManager)
{
this.pomMgr = pomMgr;
confManager_ = confManager;
}
+ private static final String[] padding = {" ", " ", "
", " "};
+
public <T extends POMTask> T execute(T task) throws Exception
{
+ String s = task.toString();
+ long t0 = System.currentTimeMillis();
pomMgr.execute(task);
+ long t1 = System.currentTimeMillis();
+ String t = "" + (t1 - t0);
+ if (t.length() < 4)
+ {
+ t = padding[t.length()] + t;
+ log.info("Executed [" + t + "] " + s + "");
+ }
+ else
+ {
+ log.info("Executed in " + t + " " + s + "");
+ }
return task;
}
@@ -130,27 +154,38 @@
return execute(new PageTask.Save(page)).getChanges();
}
- public PageNavigation getPageNavigation(String fullId) throws Exception
+ public NavigationContainer.Page getPageNavigation(String owner) throws Exception
{
- return execute(new PageNavigationTask.Load(fullId)).getPageNavigation();
+ String[] chunks = Utils.split("::", owner);
+ if (chunks.length != 2)
+ {
+ throw new IllegalArgumentException("Wrong owner format should be
ownerType::ownerId was " + owner);
+ }
+
+ //
+ String ownerType = chunks[0];
+ String ownerId = chunks[1];
+
+ //
+ return getPageNavigation(ownerType, ownerId);
}
- public PageNavigation getPageNavigation(String ownerType, String id) throws Exception
+ public NavigationContainer.Page getPageNavigation(String ownerType, String id) throws
Exception
{
- return execute(new PageNavigationTask.Load(ownerType + "::" +
id)).getPageNavigation();
+ return execute(new PageNavigationTask.Load(ownerType, id)).getPageNavigation();
}
- public void save(PageNavigation navigation) throws Exception
+ public void save(NavigationContainer.Page navigation) throws Exception
{
execute(new PageNavigationTask.Save(navigation, true));
}
- public void create(PageNavigation navigation) throws Exception
+ public void create(NavigationContainer.Page navigation) throws Exception
{
execute(new PageNavigationTask.Save(navigation, false));
}
- public void remove(PageNavigation navigation) throws Exception
+ public void remove(NavigationContainer.Page navigation) throws Exception
{
execute(new PageNavigationTask.Remove(navigation));
}
@@ -206,9 +241,9 @@
{
return (LazyPageList<T>)execute(new
SearchTask.FindPage((Query<Page>)q)).getResult();
}
- else if (PageNavigation.class.equals(q.getClassType()))
+ else if (NavigationContainer.Page.class.equals(q.getClassType()))
{
- return (LazyPageList<T>)execute(new
SearchTask.FindNavigation((Query<PageNavigation>)q)).getResult();
+ return (LazyPageList<T>)execute(new
SearchTask.FindNavigation((Query<NavigationContainer.Page>)q)).getResult();
}
else if (PortletPreferences.class.equals(q.getClassType()))
{
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/DashboardTask.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/DashboardTask.java 2009-10-23
06:58:59 UTC (rev 409)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/DashboardTask.java 2009-10-23
13:56:49 UTC (rev 410)
@@ -62,6 +62,12 @@
{
return dashboard;
}
+
+ @Override
+ public String toString()
+ {
+ return "DashboardTask.Load[id=" + storageId + "]";
+ }
}
public static class Save extends DashboardTask
@@ -72,6 +78,14 @@
public Save(Dashboard dashboard)
{
+ if (dashboard == null)
+ {
+ throw new NullPointerException("No null dashboard accepted");
+ }
+ if (dashboard.getStorageId() == null)
+ {
+ throw new IllegalArgumentException("No dasbhoard with null storage id
accepted");
+ }
this.dashboard = dashboard;
}
@@ -96,5 +110,11 @@
//
mapper.saveDashboard(dashboard, container);
}
+
+ @Override
+ public String toString()
+ {
+ return "DashboardTask.Save[id=" + dashboard.getStorageId() +
"]";
+ }
}
}
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageNavigationTask.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageNavigationTask.java 2009-10-23
06:58:59 UTC (rev 409)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageNavigationTask.java 2009-10-23
13:56:49 UTC (rev 410)
@@ -19,10 +19,9 @@
package org.exoplatform.portal.pom.config.tasks;
-import static org.exoplatform.portal.pom.config.Utils.split;
+import org.exoplatform.portal.config.model.NavigationContainer;
import org.exoplatform.portal.config.model.Mapper;
-import org.exoplatform.portal.config.model.PageNavigation;
import org.exoplatform.portal.pom.config.AbstractPOMTask;
import org.exoplatform.portal.pom.config.POMSession;
import org.gatein.mop.api.workspace.Navigation;
@@ -38,9 +37,6 @@
{
/** . */
- protected final String owner;
-
- /** . */
protected final String ownerType;
/** . */
@@ -49,33 +45,32 @@
/** . */
protected final ObjectType<? extends Site> siteType;
- protected PageNavigationTask(String owner)
+ protected PageNavigationTask(NavigationContainer.Page page)
{
- String[] chunks = split("::", owner);
- if (chunks.length != 2)
- {
- throw new IllegalArgumentException("Wrong owner format should be
ownerType::ownerId was " + owner);
- }
+ this.ownerType = page.getOwnerType();
+ this.ownerId = page.getOwnerId();
+ this.siteType = Mapper.parseSiteType(ownerType);
+ }
- //
- this.ownerType = chunks[0];
- this.ownerId = chunks[1];
+ protected PageNavigationTask(String ownerType, String ownerId)
+ {
+ this.ownerType = ownerType;
+ this.ownerId = ownerId;
this.siteType = Mapper.parseSiteType(ownerType);
- this.owner = owner;
}
public static class Load extends PageNavigationTask
{
/** . */
- private PageNavigation pageNav;
+ private NavigationContainer.Page pageNav;
- public Load(String owner)
+ public Load(String ownerType, String ownerId)
{
- super(owner);
+ super(ownerType, ownerId);
}
- public PageNavigation getPageNavigation()
+ public NavigationContainer.Page getPageNavigation()
{
return pageNav;
}
@@ -95,24 +90,30 @@
}
else
{
- System.out.println("Cannot load page navigation " + owner + "
as the corresponding portal " + ownerId
+ System.out.println("Cannot load page navigation as the corresponding
portal " + ownerId
+ " with type " + siteType + " does not exist");
}
}
+
+ @Override
+ public String toString()
+ {
+ return "PageNavigation.Load[ownerType=" + ownerType +
",ownerId=" + ownerId + "]";
+ }
}
public static class Save extends PageNavigationTask
{
/** . */
- private final PageNavigation pageNav;
+ private final NavigationContainer.Page pageNav;
/** . */
private final boolean overwrite;
- public Save(PageNavigation pageNav, boolean overwrite)
+ public Save(NavigationContainer.Page pageNav, boolean overwrite)
{
- super(pageNav.getOwner());
+ super(pageNav);
//
this.pageNav = pageNav;
@@ -125,7 +126,7 @@
Site site = workspace.getSite(siteType, ownerId);
if (site == null)
{
- throw new IllegalArgumentException("Cannot insert page navigation "
+ owner
+ throw new IllegalArgumentException("Cannot insert page navigation
"
+ " as the corresponding portal " + ownerId + " with type
" + siteType + " does not exist");
}
@@ -143,14 +144,19 @@
new Mapper(session).save(pageNav, defaultNav);
}
+ @Override
+ public String toString()
+ {
+ return "PageNavigation.Save[ownerType=" + ownerType +
",ownerId=" + ownerId + "]";
+ }
}
public static class Remove extends PageNavigationTask
{
- public Remove(PageNavigation pageNav)
+ public Remove(NavigationContainer.Page pageNav)
{
- super(pageNav.getOwner());
+ super(pageNav);
}
public void run(POMSession session) throws Exception
@@ -159,7 +165,7 @@
Site site = workspace.getSite(siteType, ownerId);
if (site == null)
{
- throw new IllegalArgumentException("Cannot insert page navigation "
+ owner
+ throw new IllegalArgumentException("Cannot insert page navigation
"
+ " as the corresponding portal " + ownerId + " with type
" + siteType + " does not exist");
}
@@ -173,5 +179,11 @@
defaultNav.destroy();
}
}
+
+ @Override
+ public String toString()
+ {
+ return "PageNavigation.Remove[ownerType=" + ownerType +
",ownerId=" + ownerId + "]";
+ }
}
}
\ No newline at end of file
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageTask.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageTask.java 2009-10-23
06:58:59 UTC (rev 409)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageTask.java 2009-10-23
13:56:49 UTC (rev 410)
@@ -239,6 +239,13 @@
{
return page;
}
+
+ @Override
+ public String toString()
+ {
+ return "PageTask.Clone[srcOwnerType=" + ownerType +
",srcOwnerId=" + ownerId + "srcName," + name +
+ "dstOwnerType=" + cloneOwnerType + ",dstOwnerId=" +
cloneOwnerId + "dstName," + cloneName + "]";
+ }
}
public static class Remove extends PageTask
@@ -271,6 +278,12 @@
page.destroy();
}
}
+
+ @Override
+ public String toString()
+ {
+ return "PageTask.Remove[ownerType=" + ownerType +
",ownerId=" + ownerId + "name," + name + "]";
+ }
}
public static class Save extends PageTask
@@ -309,6 +322,12 @@
{
return changes;
}
+
+ @Override
+ public String toString()
+ {
+ return "PageTask.Save[ownerType=" + ownerType + ",ownerId="
+ ownerId + "name," + name + "]";
+ }
}
public static class Load extends PageTask
@@ -342,5 +361,11 @@
}
}
}
+
+ @Override
+ public String toString()
+ {
+ return "PageTask.Load[ownerType=" + ownerType + ",ownerId="
+ ownerId + "name," + name + "]";
+ }
}
}
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PortalConfigTask.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PortalConfigTask.java 2009-10-23
06:58:59 UTC (rev 409)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PortalConfigTask.java 2009-10-23
13:56:49 UTC (rev 410)
@@ -42,10 +42,14 @@
/** . */
protected final ObjectType<? extends Site> type;
+ /** . */
+ protected final String ownerType;
+
protected PortalConfigTask(String type, String name)
{
this.type = Mapper.parseSiteType(type);
this.name = name;
+ this.ownerType = type;
}
public static class Remove extends PortalConfigTask
@@ -69,6 +73,12 @@
site.destroy();
}
}
+
+ @Override
+ public String toString()
+ {
+ return "PortalConfig.Remove[ownerType=" + ownerType +
",ownerId=" + name + "]";
+ }
}
public static class Save extends PortalConfigTask
@@ -115,6 +125,12 @@
}
new Mapper(session).save(config, site);
}
+
+ @Override
+ public String toString()
+ {
+ return "PortalConfig.Save[ownerType=" + ownerType +
",ownerId=" + name + "]";
+ }
}
public static class Load extends PortalConfigTask
@@ -142,5 +158,11 @@
this.config = new Mapper(session).load(site);
}
}
+
+ @Override
+ public String toString()
+ {
+ return "PortalConfig.Load[ownerType=" + ownerType +
",ownerId=" + name + "]";
+ }
}
}
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PreferencesTask.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PreferencesTask.java 2009-10-23
06:58:59 UTC (rev 409)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PreferencesTask.java 2009-10-23
13:56:49 UTC (rev 410)
@@ -56,6 +56,12 @@
{
return prefs;
}
+
+ @Override
+ public String toString()
+ {
+ return "PreferencesTask.Load[state=" + state.getStorageId() +
"]";
+ }
}
public static class Save<S> extends PreferencesTask<S>
@@ -89,5 +95,11 @@
customization.setState(null);
}
}
+
+ @Override
+ public String toString()
+ {
+ return "PreferencesTask.Save[state=" + state.getStorageId() +
"]";
+ }
}
}
Modified:
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/SearchTask.java
===================================================================
---
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/SearchTask.java 2009-10-23
06:58:59 UTC (rev 409)
+++
portal/branches/performance/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/SearchTask.java 2009-10-23
13:56:49 UTC (rev 410)
@@ -24,6 +24,7 @@
import org.exoplatform.portal.application.PortletPreferences;
import org.exoplatform.portal.config.Query;
import org.exoplatform.portal.config.model.Mapper;
+import org.exoplatform.portal.config.model.NavigationContainer;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PageNavigation;
import org.exoplatform.portal.config.model.PortalConfig;
@@ -47,29 +48,6 @@
public abstract class SearchTask<T> extends AbstractPOMTask
{
- /*
- new Query<Page>(PortalConfig.GROUP_TYPE, groupId, Page.class);
- new Query<Page>(PortalConfig.GROUP_TYPE, groupId, Page.class);
- new Query<Page>(PortalConfig.USER_TYPE, userName, Page.class);
- new Query<Page>(PortalConfig.USER_TYPE, userName, Page.class);
- new Query<Page>(PortalConfig.PORTAL_TYPE, portalName, null, null, Page.class);
- new Query<Page>(null, null, null, null, Page.class);
-
- new Query<PortletPreferences>(PortalConfig.GROUP_TYPE, groupId,
PortletPreferences.class);
- new Query<PortletPreferences>(PortalConfig.GROUP_TYPE, groupId,
PortletPreferences.class);
- new Query<PortletPreferences>(PortalConfig.USER_TYPE, userName,
PortletPreferences.class);
- new Query<PortletPreferences>(PortalConfig.PORTAL_TYPE, portalName, null, null,
PortletPreferences.class);
-
- new Query<PageNavigation>(PortalConfig.GROUP_TYPE, null, PageNavigation.class);
- new Query<PageNavigation>(PortalConfig.GROUP_TYPE, null, PageNavigation.class);
- new Query<PageNavigation>(PortalConfig.GROUP_TYPE, null, PageNavigation.class);
-
- new Query<PortalConfig>(null, null, null, null, PortalConfig.class);
- new Query<PortalConfig>(null, null, null, null, PortalConfig.class);
- new Query<PortalConfig>(null, null, null, null, PortalConfig.class);
- new Query<PortalConfig>(null, null, null, null, PortalConfig.class);
- */
-
/** . */
protected final Query<T> q;
@@ -178,10 +156,10 @@
}
}
- public static class FindNavigation extends FindSiteObject<Navigation,
PageNavigation>
+ public static class FindNavigation extends FindSiteObject<Navigation,
NavigationContainer.Page>
{
- public FindNavigation(Query<PageNavigation> pageQuery)
+ public FindNavigation(Query<NavigationContainer.Page> pageQuery)
{
super(pageQuery);
}
@@ -192,12 +170,12 @@
return session.findObjects(ObjectType.NAVIGATION, siteType, q.getOwnerId(),
q.getTitle());
}
- protected PageNavigation[] createT(int length)
+ protected NavigationContainer.Page[] createT(int length)
{
- return new PageNavigation[length];
+ return new NavigationContainer.Page[length];
}
- protected PageNavigation loadT(POMSession session, Navigation w)
+ protected NavigationContainer.Page loadT(POMSession session, Navigation w)
{
return new Mapper(session).load(w);
}
Modified:
portal/branches/performance/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java
===================================================================
---
portal/branches/performance/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java 2009-10-23
06:58:59 UTC (rev 409)
+++
portal/branches/performance/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java 2009-10-23
13:56:49 UTC (rev 410)
@@ -222,7 +222,7 @@
PageNavigation pageNavi = new PageNavigation();
pageNavi.setOwnerId(testPortal);
pageNavi.setOwnerType("portal");
- storage_.create(pageNavi);
+ storage_.create(pageNavi.buildNavigation());
}
public void testNavigationSave() throws Exception
@@ -230,14 +230,13 @@
testNavigationCreate();
//
- PageNavigation pageNavi = storage_.getPageNavigation("portal",
testPortal);
- assertNotNull(pageNavi);
+ PageNavigation pageNavi = new
PageNavigation(storage_.getPageNavigation("portal", testPortal));
String newModifier = "trong.tran";
pageNavi.setModifier(newModifier);
- storage_.save(pageNavi);
+ storage_.save(pageNavi.buildNavigation());
- PageNavigation newPageNavi = storage_.getPageNavigation(pageNavi.getOwnerType(),
pageNavi.getOwnerId());
+ PageNavigation newPageNavi = new
PageNavigation(storage_.getPageNavigation(pageNavi.getOwnerType(),
pageNavi.getOwnerId()));
assertEquals(newModifier, newPageNavi.getModifier());
}
@@ -246,13 +245,12 @@
testNavigationSave();
//
- PageNavigation pageNavi = storage_.getPageNavigation("portal",
testPortal);
+ PageNavigation pageNavi = new
PageNavigation(storage_.getPageNavigation("portal", testPortal));
assertNotNull(pageNavi);
- storage_.remove(pageNavi);
+ storage_.remove(pageNavi.buildNavigation());
- pageNavi = storage_.getPageNavigation("portal", testPortal);
- // assertNull(pageNavi);
+ assertNull(storage_.getPageNavigation("portal", testPortal));
}
public void testPortletPreferencesCreate() throws Exception
Modified:
portal/branches/performance/component/portal/src/test/java/org/exoplatform/portal/config/TestLoadedPOM.java
===================================================================
---
portal/branches/performance/component/portal/src/test/java/org/exoplatform/portal/config/TestLoadedPOM.java 2009-10-23
06:58:59 UTC (rev 409)
+++
portal/branches/performance/component/portal/src/test/java/org/exoplatform/portal/config/TestLoadedPOM.java 2009-10-23
13:56:49 UTC (rev 410)
@@ -24,6 +24,7 @@
import org.exoplatform.portal.config.model.Application;
import org.exoplatform.portal.config.model.Container;
import org.exoplatform.portal.config.model.ModelObject;
+import org.exoplatform.portal.config.model.NavigationContainer;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PageNavigation;
import org.exoplatform.portal.config.model.PageNode;
@@ -80,7 +81,7 @@
public void testLegacyGroupWithNormalizedName() throws Exception
{
- PageNavigation nav =
storage.getPageNavigation("group::/platform/test/legacy");
+ PageNavigation nav = new
PageNavigation(storage.getPageNavigation("group::/platform/test/legacy"));
assertNotNull(nav);
assertEquals("/platform/test/legacy", nav.getOwnerId());
PageNode node = nav.getNodes().get(0);
@@ -100,7 +101,7 @@
public void testGroupWithNormalizedName() throws Exception
{
- PageNavigation nav =
storage.getPageNavigation("group::/platform/test/normalized");
+ PageNavigation nav = new
PageNavigation(storage.getPageNavigation("group::/platform/test/normalized"));
assertNotNull(nav);
assertEquals("/platform/test/normalized", nav.getOwnerId());
PageNode node = nav.getNodes().get(0);
@@ -121,7 +122,7 @@
public void testNavigation() throws Exception
{
- PageNavigation nav = storage.getPageNavigation("portal::test");
+ PageNavigation nav = new
PageNavigation(storage.getPageNavigation("portal::test"));
assertNotNull(nav);
//
@@ -237,11 +238,11 @@
public void testFindNavigation() throws Exception
{
- Query<PageNavigation> query = new
Query<PageNavigation>("group", null, null, null, PageNavigation.class);
- List<PageNavigation> list = storage.find(query).getAll();
+ Query<NavigationContainer.Page> query = new
Query<NavigationContainer.Page>("group", null, null, null,
NavigationContainer.Page.class);
+ List<NavigationContainer.Page> list = storage.find(query).getAll();
assertEquals("Expected 6 results instead of " + list, 6, list.size());
Set<String> names = new HashSet<String>();
- for (PageNavigation navigation : list)
+ for (NavigationContainer.Page navigation : list)
{
assertEquals("group", navigation.getOwnerType());
names.add(navigation.getOwnerId());
Modified:
portal/branches/performance/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIGroupNavigationManagement.java
===================================================================
---
portal/branches/performance/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIGroupNavigationManagement.java 2009-10-23
06:58:59 UTC (rev 409)
+++
portal/branches/performance/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIGroupNavigationManagement.java 2009-10-23
13:56:49 UTC (rev 410)
@@ -94,26 +94,8 @@
public void loadNavigations() throws Exception
{
- navigations = new ArrayList<PageNavigation>();
- UserACL userACL = getApplicationComponent(UserACL.class);
- DataStorage dataStorage = getApplicationComponent(DataStorage.class);
- // load all navigation that user has edit permission
- Query<PageNavigation> query = new
Query<PageNavigation>(PortalConfig.GROUP_TYPE, null, PageNavigation.class);
- List<PageNavigation> navis = dataStorage.find(query, new
Comparator<PageNavigation>()
- {
- public int compare(PageNavigation pconfig1, PageNavigation pconfig2)
- {
- return pconfig1.getOwnerId().compareTo(pconfig2.getOwnerId());
- }
- }).getAll();
- for (PageNavigation ele : navis)
- {
- if (userACL.hasEditPermission(ele))
- {
- navigations.add(ele);
- }
- }
-
+ UserPortalConfigService userACL =
getApplicationComponent(UserPortalConfigService.class);
+ navigations = userACL.loadEditableNavigations();
UIVirtualList virtualList = getChild(UIVirtualList.class);
virtualList.dataBind(new ObjectPageList<PageNavigation>(navigations,
navigations.size()));
}
Modified:
portal/branches/performance/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIAddGroupNavigation.java
===================================================================
---
portal/branches/performance/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIAddGroupNavigation.java 2009-10-23
06:58:59 UTC (rev 409)
+++
portal/branches/performance/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIAddGroupNavigation.java 2009-10-23
13:56:49 UTC (rev 410)
@@ -22,7 +22,6 @@
import org.exoplatform.commons.utils.ObjectPageList;
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.config.DataStorage;
-import org.exoplatform.portal.config.Query;
import org.exoplatform.portal.config.UserACL;
import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.PageNavigation;
@@ -50,6 +49,7 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import java.util.Set;
/*
* Created by The eXo Platform SAS
@@ -102,24 +102,14 @@
listGroup = dataService.getMakableNavigations(pContext.getRemoteUser());
}
- List<PageNavigation> navigations = new ArrayList<PageNavigation>();
- DataStorage dataStorage = getApplicationComponent(DataStorage.class);
- // get all group navigation that user have edit permission
- Query<PageNavigation> query = new
Query<PageNavigation>(PortalConfig.GROUP_TYPE, null, PageNavigation.class);
- // filter, only get group don't have navigation
if (listGroup == null)
{
listGroup = new ArrayList<String>();
}
- List<PageNavigation> navis = dataStorage.find(query).getAll();
- for (PageNavigation ele : navis)
- {
- if (listGroup.contains(ele.getOwnerId()))
- {
- listGroup.remove(ele.getOwnerId());
- }
- }
+ UserPortalConfigService configService =
getApplicationComponent(UserPortalConfigService.class);
+ Set<String> groupIdsWithNotNavigation =
configService.findGroupWithoutNavigation();
+ listGroup.removeAll(groupIdsWithNotNavigation);
UIVirtualList virtualList = getChild(UIVirtualList.class);
virtualList.dataBind(new ObjectPageList<String>(listGroup,
listGroup.size()));
Modified:
portal/branches/performance/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationManagement.java
===================================================================
---
portal/branches/performance/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationManagement.java 2009-10-23
06:58:59 UTC (rev 409)
+++
portal/branches/performance/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationManagement.java 2009-10-23
13:56:49 UTC (rev 410)
@@ -56,14 +56,6 @@
addChild(UINavigationNodeSelector.class, null, null);
}
- public void loadNavigation(Query<PageNavigation> query) throws Exception
- {
- DataStorage service = getApplicationComponent(DataStorage.class);
- LazyPageList navis = service.find(query);
- UINavigationNodeSelector nodeSelector = getChild(UINavigationNodeSelector.class);
- nodeSelector.initNavigations(navis.getAll());
- }
-
public void setOwner(String owner)
{
this.owner = owner;