Author: theute
Date: 2011-07-18 05:59:38 -0400 (Mon, 18 Jul 2011)
New Revision: 6877
Added:
epp/portal/branches/EPP_5_1_Branch/component/portal/src/main/java/org/exoplatform/portal/config/ConstantUserNavigationsDataStorageImpl.java
Modified:
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml
Log:
JBEPP-1010
Optional DataStorage Implementation optimized when user dashboards aren't used
Added:
epp/portal/branches/EPP_5_1_Branch/component/portal/src/main/java/org/exoplatform/portal/config/ConstantUserNavigationsDataStorageImpl.java
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/component/portal/src/main/java/org/exoplatform/portal/config/ConstantUserNavigationsDataStorageImpl.java
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/component/portal/src/main/java/org/exoplatform/portal/config/ConstantUserNavigationsDataStorageImpl.java 2011-07-18
09:59:38 UTC (rev 6877)
@@ -0,0 +1,67 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2011, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software 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 *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.exoplatform.portal.config;
+
+import org.exoplatform.portal.config.DataStorageImpl;
+import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.portal.pom.data.ModelDataStorage;
+import org.exoplatform.services.listener.ListenerService;
+
+/**
+ * This implementation can make performance improvement for concurrent login of many
users.
+ * But it can be used only with disabled dashboard. Dashboard can't work correctly
with this implementation!!!
+ *
+ * @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
+ * @version $Revision$
+ */
+public class ConstantUserNavigationsDataStorageImpl extends DataStorageImpl
+{
+
+ public ConstantUserNavigationsDataStorageImpl(ModelDataStorage delegate,
ListenerService listenerServ)
+ {
+ super(delegate, listenerServ);
+ }
+
+ /**
+ * return constant Navigation if required owner type is "user" and don't
try to load it from mop. This navigation does not have any navigation nodes.
+ *
+ */
+ public PageNavigation getPageNavigation(String ownerType, String id) throws Exception
+ {
+ if (PortalConfig.USER_TYPE.equals(ownerType))
+ {
+ PageNavigation nav = new PageNavigation();
+ nav.setOwnerType(ownerType);
+ nav.setOwnerId(id);
+ nav.setPriority(3);
+ return nav;
+ }
+ else
+ {
+ return super.getPageNavigation(ownerType, id);
+ }
+ }
+
+}
+
Modified:
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml 2011-07-17
16:33:30 UTC (rev 6876)
+++
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml 2011-07-18
09:59:38 UTC (rev 6877)
@@ -38,6 +38,10 @@
<component>
<key>org.exoplatform.portal.config.DataStorage</key>
<type>org.exoplatform.portal.config.DataStorageImpl</type>
+ <!--
+ Optimization when the dashboards aren't used: You can replace the
implementation by:
+
<type>org.exoplatform.portal.config.ConstantUserNavigationsDataStorageImpl</type>
+ -->
</component>
<component>