gatein SVN: r7583 - in epp/portal/branches/EPP_5_2_Branch: wsrp-integration and 1 other directory.
by do-not-reply@jboss.org
Author: hfnukal
Date: 2011-10-02 01:00:51 -0400 (Sun, 02 Oct 2011)
New Revision: 7583
Modified:
epp/portal/branches/EPP_5_2_Branch/component/
epp/portal/branches/EPP_5_2_Branch/wsrp-integration/
Log:
JBEPP-1197 Reuse the same instance of UserPortalImpl and automatically invalidate it by listener
Property changes on: epp/portal/branches/EPP_5_2_Branch/component
___________________________________________________________________
Modified: svn:mergeinfo
- /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/component:5868
/portal/branches/branch-GTNPORTAL-1592/component:4894
/portal/branches/branch-GTNPORTAL-1643/component:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/component:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/component:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/component:5765
/portal/branches/branch-GTNPORTAL-1790/component:5871
/portal/branches/branch-GTNPORTAL-1822/component:5943,5952
/portal/branches/branch-GTNPORTAL-1832/component:6030,6063
/portal/branches/branch-GTNPORTAL-1872/component:6400,6551
/portal/branches/branch-GTNPORTAL-1921/component:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/component:6904,6915-6916
/portal/trunk/component:4876,4891,5269,5744,5822,5943,6031,6033,6168,6196,6201-6203,6205-6206,6223,6292,6323,6437,6440,6449,6452,6573,6783-6784,6912-6913,6960,7042,7061,7095,7117,7120,7125,7132-7134,7186,7239,7262,7308,7326,7331,7359,7367,7433,7452,7454,7478
+ /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/component:5868
/portal/branches/branch-GTNPORTAL-1592/component:4894
/portal/branches/branch-GTNPORTAL-1643/component:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/component:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/component:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/component:5765
/portal/branches/branch-GTNPORTAL-1790/component:5871
/portal/branches/branch-GTNPORTAL-1822/component:5943,5952
/portal/branches/branch-GTNPORTAL-1832/component:6030,6063
/portal/branches/branch-GTNPORTAL-1872/component:6400,6551
/portal/branches/branch-GTNPORTAL-1921/component:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/component:6904,6915-6916
/portal/trunk/component:4876,4891,5269,5744,5822,5943,6031,6033,6168,6196,6201-6203,6205-6206,6223,6292,6323,6437,6440,6449,6452,6573,6783-6784,6912-6913,6960,7042,7061,7095,7117,7120,7125,7132-7134,7186,7239,7262,7308,7326,7331,7359,7367,7433,7452,7454,7478,7497
Property changes on: epp/portal/branches/EPP_5_2_Branch/wsrp-integration
___________________________________________________________________
Modified: svn:mergeinfo
- /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/wsrp-integration:5868
/portal/branches/branch-GTNPORTAL-1592/wsrp-integration:4894
/portal/branches/branch-GTNPORTAL-1643/wsrp-integration:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/wsrp-integration:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/wsrp-integration:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/wsrp-integration:5765
/portal/branches/branch-GTNPORTAL-1790/wsrp-integration:5871
/portal/branches/branch-GTNPORTAL-1822/wsrp-integration:5943,5952
/portal/branches/branch-GTNPORTAL-1832/wsrp-integration:6030,6063
/portal/branches/branch-GTNPORTAL-1872/wsrp-integration:6400,6551
/portal/branches/branch-GTNPORTAL-1921/wsrp-integration:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/wsrp-integration:6904,6915-6916
/portal/branches/decoupled-webos/wsrp-integration:6214-6243
/portal/branches/gatein-management/wsrp-integration:6920-6958
/portal/branches/global-portlet-metadata/wsrp-integration:6298-6384
/portal/branches/site-describability/wsrp-integration:6171-6235
/portal/trunk/wsrp-integration:4876,4891,5269,5744,5822,5943,6168,6196,6201-6203,6205-6206,6223,6323,6437,6440,6449,6452,6573,6741,6783-6784,6912-6913,6960,7042,7061,7095,7117,7125,7132-7134,7186,7198,7239,7262,7308,7326,7331,7359,7367,7433,7452,7454,7478
+ /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/wsrp-integration:5868
/portal/branches/branch-GTNPORTAL-1592/wsrp-integration:4894
/portal/branches/branch-GTNPORTAL-1643/wsrp-integration:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/wsrp-integration:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/wsrp-integration:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/wsrp-integration:5765
/portal/branches/branch-GTNPORTAL-1790/wsrp-integration:5871
/portal/branches/branch-GTNPORTAL-1822/wsrp-integration:5943,5952
/portal/branches/branch-GTNPORTAL-1832/wsrp-integration:6030,6063
/portal/branches/branch-GTNPORTAL-1872/wsrp-integration:6400,6551
/portal/branches/branch-GTNPORTAL-1921/wsrp-integration:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/wsrp-integration:6904,6915-6916
/portal/branches/decoupled-webos/wsrp-integration:6214-6243
/portal/branches/gatein-management/wsrp-integration:6920-6958
/portal/branches/global-portlet-metadata/wsrp-integration:6298-6384
/portal/branches/site-describability/wsrp-integration:6171-6235
/portal/trunk/wsrp-integration:4876,4891,5269,5744,5822,5943,6168,6196,6201-6203,6205-6206,6223,6323,6437,6440,6449,6452,6573,6741,6783-6784,6912-6913,6960,7042,7061,7095,7117,7125,7132-7134,7186,7198,7239,7262,7308,7326,7331,7359,7367,7433,7452,7454,7478,7497
13 years, 2 months
gatein SVN: r7582 - in epp/portal/branches/EPP_5_2_Branch: component/portal/src/main/java/org and 25 other directories.
by do-not-reply@jboss.org
Author: hfnukal
Date: 2011-10-02 00:45:18 -0400 (Sun, 02 Oct 2011)
New Revision: 7582
Added:
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/main/java/org/exoplatform/web/portal/
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/main/java/org/exoplatform/web/portal/RefreshCurrentUserPortal.java
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/java/org/exoplatform/web/portal/
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/java/org/exoplatform/web/portal/TestRefreshCurrentUserPortal.java
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/configuration.xml
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/group/
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/group/platform/
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/group/platform/group.xml
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/group/platform/pages.xml
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/navigation.xml
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/pages.xml
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/portal.xml
Removed:
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/main/java/org/exoplatform/web/portal/RefreshCurrentUserPortal.java
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/java/org/exoplatform/web/portal/TestRefreshCurrentUserPortal.java
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/configuration.xml
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/group/
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/group/platform/
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/group/platform/group.xml
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/group/platform/pages.xml
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/navigation.xml
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/pages.xml
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/portal.xml
Modified:
epp/portal/branches/EPP_5_2_Branch/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfig.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/user/UserNavigation.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/user/UserPortal.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/user/UserPortalImpl.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/mop/user/SimpleUserPortalContext.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/mop/user/TestUserPortal.java
epp/portal/branches/EPP_5_2_Branch/component/web/controller/pom.xml
epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/main/java/org/exoplatform/web/application/RequestContext.java
epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIGroupNavigationManagement.java
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/BasePartialUpdateToolbar.java
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPageNavigationForm.java
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPageNodeSelector.java
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPortalNavigation.java
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java
epp/portal/branches/EPP_5_2_Branch/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletRequestContext.java
Log:
JBEPP-1197 Reuse the same instance of UserPortalImpl and automatically invalidate it by listener
Property changes on: epp/portal/branches/EPP_5_2_Branch
___________________________________________________________________
Modified: svn:mergeinfo
- /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795:5868
/portal/branches/branch-GTNPORTAL-1592:4894
/portal/branches/branch-GTNPORTAL-1643:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745:5765
/portal/branches/branch-GTNPORTAL-1790:5871
/portal/branches/branch-GTNPORTAL-1822:5943,5952
/portal/branches/branch-GTNPORTAL-1832:6030,6063
/portal/branches/branch-GTNPORTAL-1872:6400,6551
/portal/branches/branch-GTNPORTAL-1921:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963:6904,6915-6916
/portal/branches/decoupled-webos:6214-6243
/portal/branches/gatein-management:6920-6958
/portal/branches/global-portlet-metadata:6298-6384
/portal/branches/site-describability:6171-6235
/portal/trunk:4876,4891,5269,5744,5822,5943,6168,6196,6201-6203,6205-6206,6223,6323,6437,6440,6449,6452,6573,6783-6784,6912-6913,6960,7042,7061,7095,7117,7125,7132-7134,7186,7239,7262,7308,7326,7331,7359,7367,7433,7452,7454,7478
+ /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795:5868
/portal/branches/branch-GTNPORTAL-1592:4894
/portal/branches/branch-GTNPORTAL-1643:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745:5765
/portal/branches/branch-GTNPORTAL-1790:5871
/portal/branches/branch-GTNPORTAL-1822:5943,5952
/portal/branches/branch-GTNPORTAL-1832:6030,6063
/portal/branches/branch-GTNPORTAL-1872:6400,6551
/portal/branches/branch-GTNPORTAL-1921:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963:6904,6915-6916
/portal/branches/decoupled-webos:6214-6243
/portal/branches/gatein-management:6920-6958
/portal/branches/global-portlet-metadata:6298-6384
/portal/branches/site-describability:6171-6235
/portal/trunk:4876,4891,5269,5744,5822,5943,6168,6196,6201-6203,6205-6206,6223,6323,6437,6440,6449,6452,6573,6783-6784,6912-6913,6960,7042,7061,7095,7117,7125,7132-7134,7186,7239,7262,7308,7326,7331,7359,7367,7433,7452,7454,7478,7497
Property changes on: epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org
___________________________________________________________________
Modified: svn:mergeinfo
- /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/component/portal/src/main/java/org:5868
/portal/branches/branch-GTNPORTAL-1592/component/portal/src/main/java/org:4894
/portal/branches/branch-GTNPORTAL-1643/component/portal/src/main/java/org:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/component/portal/src/main/java/org:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/component/portal/src/main/java/org:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/component/portal/src/main/java/org:5765
/portal/branches/branch-GTNPORTAL-1790/component/portal/src/main/java/org:5871
/portal/branches/branch-GTNPORTAL-1822/component/portal/src/main/java/org:5943,5952
/portal/branches/branch-GTNPORTAL-1832/component/portal/src/main/java/org:6030,6063
/portal/branches/branch-GTNPORTAL-1872/component/portal/src/main/java/org:6400,6551
/portal/branches/branch-GTNPORTAL-1921/component/portal/src/main/java/org:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/component/portal/src/main/java/org:6904,6915-6916
/portal/trunk/component/portal/src/main/java/org:4876,4891,5269,5744,5822,5943,6031,6033,6168,6196,6201-6203,6205-6206,6223,6292,6323,6437,6440,6449,6452,6573,6741,6783-6784,6912-6913,6960,7042,7061,7095,7117,7120,7125,7132-7134,7186,7198,7239,7262,7308,7326,7331,7359,7367,7433,7452,7454,7478
+ /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/component/portal/src/main/java/org:5868
/portal/branches/branch-GTNPORTAL-1592/component/portal/src/main/java/org:4894
/portal/branches/branch-GTNPORTAL-1643/component/portal/src/main/java/org:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/component/portal/src/main/java/org:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/component/portal/src/main/java/org:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/component/portal/src/main/java/org:5765
/portal/branches/branch-GTNPORTAL-1790/component/portal/src/main/java/org:5871
/portal/branches/branch-GTNPORTAL-1822/component/portal/src/main/java/org:5943,5952
/portal/branches/branch-GTNPORTAL-1832/component/portal/src/main/java/org:6030,6063
/portal/branches/branch-GTNPORTAL-1872/component/portal/src/main/java/org:6400,6551
/portal/branches/branch-GTNPORTAL-1921/component/portal/src/main/java/org:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/component/portal/src/main/java/org:6904,6915-6916
/portal/trunk/component/portal/src/main/java/org:4876,4891,5269,5744,5822,5943,6031,6033,6168,6196,6201-6203,6205-6206,6223,6292,6323,6437,6440,6449,6452,6573,6741,6783-6784,6912-6913,6960,7042,7061,7095,7117,7120,7125,7132-7134,7186,7198,7239,7262,7308,7326,7331,7359,7367,7433,7452,7454,7478,7497
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfig.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfig.java 2011-10-01 22:04:26 UTC (rev 7581)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfig.java 2011-10-02 04:45:18 UTC (rev 7582)
@@ -40,6 +40,8 @@
/** . */
private UserPortalContext userPortalContext;
+ private UserPortal userPortal;
+
public UserPortalConfig()
{
this.portal = null;
@@ -60,8 +62,17 @@
public UserPortal getUserPortal()
{
- return new UserPortalImpl(service, portalName, portal, accessUser, userPortalContext);
+ return getUserPortal(false);
}
+
+ public UserPortal getUserPortal(boolean isNewlyCreated)
+ {
+ if (isNewlyCreated || userPortal == null)
+ {
+ userPortal = new UserPortalImpl(service, portalName, portal, accessUser, userPortalContext);
+ }
+ return userPortal;
+ }
public PortalConfig getPortalConfig()
{
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/user/UserNavigation.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/user/UserNavigation.java 2011-10-01 22:04:26 UTC (rev 7581)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/user/UserNavigation.java 2011-10-02 04:45:18 UTC (rev 7582)
@@ -89,4 +89,10 @@
{
return modifiable;
}
+
+ @Override
+ public String toString()
+ {
+ return "UserNavigation[key=" + navigation.getKey() + "]";
+ }
}
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/user/UserPortal.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/user/UserPortal.java 2011-10-01 22:04:26 UTC (rev 7581)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/user/UserPortal.java 2011-10-02 04:45:18 UTC (rev 7582)
@@ -65,6 +65,11 @@
UserNavigation getNavigation(SiteKey key)
throws NullPointerException, UserPortalException, NavigationServiceException;
+ /**
+ * Refresh the current user portal.
+ */
+ void refresh();
+
/**
* Load a user node from a specified user navigation with a custom scope.
* The returned node is the root node of the navigation.
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/user/UserPortalImpl.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/user/UserPortalImpl.java 2011-10-01 22:04:26 UTC (rev 7581)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/mop/user/UserPortalImpl.java 2011-10-02 04:45:18 UTC (rev 7582)
@@ -194,7 +194,12 @@
return null;
}
- public UserNode getNode(
+ public void refresh()
+ {
+ navigations = null;
+ }
+
+ public UserNode getNode(
UserNavigation userNavigation,
Scope scope,
UserNodeFilterConfig filterConfig,
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/mop/user/SimpleUserPortalContext.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/mop/user/SimpleUserPortalContext.java 2011-10-01 22:04:26 UTC (rev 7581)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/mop/user/SimpleUserPortalContext.java 2011-10-02 04:45:18 UTC (rev 7582)
@@ -31,7 +31,7 @@
*
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
*/
-class SimpleUserPortalContext implements UserPortalContext
+public class SimpleUserPortalContext implements UserPortalContext
{
/** . */
Modified: epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/mop/user/TestUserPortal.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/mop/user/TestUserPortal.java 2011-10-01 22:04:26 UTC (rev 7581)
+++ epp/portal/branches/EPP_5_2_Branch/component/portal/src/test/java/org/exoplatform/portal/mop/user/TestUserPortal.java 2011-10-02 04:45:18 UTC (rev 7582)
@@ -32,6 +32,9 @@
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.mop.SiteKey;
import org.exoplatform.portal.mop.Visibility;
+import org.exoplatform.portal.mop.navigation.NavigationContext;
+import org.exoplatform.portal.mop.navigation.NavigationServiceImpl;
+import org.exoplatform.portal.mop.navigation.NavigationState;
import org.exoplatform.portal.mop.navigation.Scope;
import org.exoplatform.portal.mop.user.UserNodeFilterConfig.Builder;
import org.exoplatform.portal.pom.config.POMDataStorage;
@@ -226,6 +229,40 @@
test.execute();
}
+ public void testRefreshNavigations()
+ {
+ UnitTest test = new UnitTest()
+ {
+ public void doExecute() throws Exception
+ {
+
+ //
+ UserPortalConfig userPortalCfg = userPortalConfigSer_.getUserPortalConfig("classic", getUserId());
+ UserPortal portal = userPortalCfg.getUserPortal();
+
+ //
+ NavigationServiceImpl service = new NavigationServiceImpl(mgr);
+ SiteKey navKey = SiteKey.group("/organization/management");
+ NavigationContext nav = new NavigationContext(navKey, new NavigationState(1));
+
+ //
+ NavigationContext got = service.loadNavigation(navKey);
+ assertEquals(null, got);
+ assertEquals(null, portal.getNavigation(navKey));
+
+ //
+ service.saveNavigation(nav);
+ assertEquals(null, portal.getNavigation(navKey));
+ portal.refresh();
+ assertNotNull(portal.getNavigation(navKey));
+
+ }
+ };
+
+ //
+ test.execute("root");
+ }
+
public void testFilterWithVisibility()
{
class Test extends UnitTest
Modified: epp/portal/branches/EPP_5_2_Branch/component/web/controller/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/controller/pom.xml 2011-10-01 22:04:26 UTC (rev 7581)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/controller/pom.xml 2011-10-02 04:45:18 UTC (rev 7582)
@@ -75,6 +75,32 @@
</dependency>
<dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.test.jcr</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.identity</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.portal</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.chromattic</groupId>
+ <artifactId>chromattic.core</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
<groupId>net.sourceforge.jregex</groupId>
<artifactId>jregex</artifactId>
<version>1.2_01</version>
Modified: epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/main/java/org/exoplatform/web/application/RequestContext.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/main/java/org/exoplatform/web/application/RequestContext.java 2011-10-01 22:04:26 UTC (rev 7581)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/main/java/org/exoplatform/web/application/RequestContext.java 2011-10-02 04:45:18 UTC (rev 7582)
@@ -19,6 +19,8 @@
package org.exoplatform.web.application;
+import org.exoplatform.portal.config.UserPortalConfig;
+import org.exoplatform.portal.mop.user.UserPortal;
import org.exoplatform.services.resources.Orientation;
import org.exoplatform.web.url.URLFactory;
import org.exoplatform.web.url.PortalURL;
@@ -191,6 +193,8 @@
return parentAppRequestContext_;
}
+ public abstract UserPortal getUserPortal();
+
@SuppressWarnings("unchecked")
public static <T extends RequestContext> T getCurrentInstance()
{
Deleted: epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/main/java/org/exoplatform/web/portal/RefreshCurrentUserPortal.java
===================================================================
--- portal/trunk/component/web/controller/src/main/java/org/exoplatform/web/portal/RefreshCurrentUserPortal.java 2011-09-23 09:45:45 UTC (rev 7497)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/main/java/org/exoplatform/web/portal/RefreshCurrentUserPortal.java 2011-10-02 04:45:18 UTC (rev 7582)
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2011 eXo Platform SAS.
- *
- * 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.web.portal;
-
-import org.exoplatform.portal.mop.SiteKey;
-import org.exoplatform.portal.mop.navigation.NavigationService;
-import org.exoplatform.portal.mop.user.UserPortal;
-import org.exoplatform.services.listener.Event;
-import org.exoplatform.services.listener.Listener;
-import org.exoplatform.web.application.RequestContext;
-
-/**
- * This listener attempts to find the {@link UserPortal} associated with the current request
- * and invalidate it when the navigation service emits an event for a navigation modification.
- *
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- */
-public class RefreshCurrentUserPortal extends Listener<NavigationService, SiteKey>
-{
-
- @Override
- public void onEvent(Event<NavigationService, SiteKey> event) throws Exception
- {
- RequestContext ctx = RequestContext.getCurrentInstance();
- if (ctx != null)
- {
- UserPortal userPortal = ctx.getUserPortal();
- if (userPortal != null)
- {
- userPortal.refresh();
- }
- }
- }
-}
Copied: epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/main/java/org/exoplatform/web/portal/RefreshCurrentUserPortal.java (from rev 7497, portal/trunk/component/web/controller/src/main/java/org/exoplatform/web/portal/RefreshCurrentUserPortal.java)
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/main/java/org/exoplatform/web/portal/RefreshCurrentUserPortal.java (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/main/java/org/exoplatform/web/portal/RefreshCurrentUserPortal.java 2011-10-02 04:45:18 UTC (rev 7582)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2011 eXo Platform SAS.
+ *
+ * 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.web.portal;
+
+import org.exoplatform.portal.mop.SiteKey;
+import org.exoplatform.portal.mop.navigation.NavigationService;
+import org.exoplatform.portal.mop.user.UserPortal;
+import org.exoplatform.services.listener.Event;
+import org.exoplatform.services.listener.Listener;
+import org.exoplatform.web.application.RequestContext;
+
+/**
+ * This listener attempts to find the {@link UserPortal} associated with the current request
+ * and invalidate it when the navigation service emits an event for a navigation modification.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+public class RefreshCurrentUserPortal extends Listener<NavigationService, SiteKey>
+{
+
+ @Override
+ public void onEvent(Event<NavigationService, SiteKey> event) throws Exception
+ {
+ RequestContext ctx = RequestContext.getCurrentInstance();
+ if (ctx != null)
+ {
+ UserPortal userPortal = ctx.getUserPortal();
+ if (userPortal != null)
+ {
+ userPortal.refresh();
+ }
+ }
+ }
+}
Deleted: epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/java/org/exoplatform/web/portal/TestRefreshCurrentUserPortal.java
===================================================================
--- portal/trunk/component/web/controller/src/test/java/org/exoplatform/web/portal/TestRefreshCurrentUserPortal.java 2011-09-23 09:45:45 UTC (rev 7497)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/java/org/exoplatform/web/portal/TestRefreshCurrentUserPortal.java 2011-10-02 04:45:18 UTC (rev 7582)
@@ -1,183 +0,0 @@
-/*
- * Copyright (C) 2011 eXo Platform SAS.
- *
- * 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.web.portal;
-
-import org.exoplatform.component.test.ConfigurationUnit;
-import org.exoplatform.component.test.ConfiguredBy;
-import org.exoplatform.component.test.ContainerScope;
-import org.exoplatform.portal.AbstractPortalTest;
-import org.exoplatform.portal.config.DataStorage;
-import org.exoplatform.portal.config.UserPortalConfig;
-import org.exoplatform.portal.config.UserPortalConfigService;
-import org.exoplatform.portal.config.model.PortalConfig;
-import org.exoplatform.portal.mop.SiteKey;
-import org.exoplatform.portal.mop.navigation.NavigationContext;
-import org.exoplatform.portal.mop.navigation.NavigationService;
-import org.exoplatform.portal.mop.navigation.NavigationState;
-import org.exoplatform.portal.mop.navigation.NodeContext;
-import org.exoplatform.portal.mop.navigation.NodeModel;
-import org.exoplatform.portal.mop.navigation.Scope;
-import org.exoplatform.portal.mop.user.SimpleUserPortalContext;
-import org.exoplatform.portal.mop.user.UserNavigation;
-import org.exoplatform.portal.mop.user.UserPortal;
-import org.exoplatform.services.resources.Orientation;
-import org.exoplatform.web.application.RequestContext;
-import org.exoplatform.web.application.URLBuilder;
-import org.exoplatform.web.url.PortalURL;
-import org.exoplatform.web.url.ResourceType;
-import org.exoplatform.web.url.URLFactory;
-
-import java.util.List;
-import java.util.Locale;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- */
-@ConfiguredBy({
- @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.test.jcr-configuration.xml"),
- @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.identity-configuration.xml"),
- @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.portal-configuration.xml"),
- @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "org/exoplatform/web/portal/configuration.xml")
-})
-public class TestRefreshCurrentUserPortal extends AbstractPortalTest
-{
-
- /** . */
- private RequestContext requestContext;
-
- /** . */
- private UserPortal userPortal;
-
- @Override
- protected void setUp() throws Exception
- {
- begin();
-
- UserPortalConfigService upcs = (UserPortalConfigService)getContainer().getComponentInstanceOfType(UserPortalConfigService.class);
- UserPortalConfig upc = upcs.getUserPortalConfig("classic", "root", new SimpleUserPortalContext(Locale.ENGLISH));
- final UserPortal userPortal = upc.getUserPortal();
-
- //
- RequestContext requestContext = new RequestContext(null)
- {
- @Override
- public URLFactory getURLFactory()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public <R, U extends PortalURL<R, U>> U newURL(ResourceType<R, U> resourceType, URLFactory urlFactory)
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public Orientation getOrientation()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String getRequestParameter(String name)
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String[] getRequestParameterValues(String name)
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public URLBuilder<?> getURLBuilder()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean useAjax()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public UserPortal getUserPortal()
- {
- return userPortal;
- }
- };
-
- //
- this.userPortal = userPortal;
- this.requestContext = requestContext;
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- end();
- }
-
- public void testCreate() throws Exception
- {
- List<UserNavigation> navs = userPortal.getNavigations();
- assertEquals(2, navs.size());
- RequestContext.setCurrentInstance(requestContext);
- NavigationService ns = (NavigationService)getContainer().getComponentInstanceOfType(NavigationService.class);
- ns.saveNavigation(new NavigationContext(SiteKey.group("/platform"), new NavigationState(1)));
- navs = userPortal.getNavigations();
- assertEquals(3, navs.size());
- RequestContext.setCurrentInstance(null);
- }
-
- public void testUpdate() throws Exception
- {
- List<UserNavigation> navs = userPortal.getNavigations();
- assertEquals(2, navs.size());
- NavigationService ns = (NavigationService)getContainer().getComponentInstanceOfType(NavigationService.class);
- NavigationContext nav = new NavigationContext(SiteKey.group("/platform"), new NavigationState(1));
- ns.saveNavigation(nav);
- navs = userPortal.getNavigations();
- assertEquals(2, navs.size());
- RequestContext.setCurrentInstance(requestContext);
- NodeContext root = ns.loadNode(NodeModel.SELF_MODEL, nav, Scope.ALL, null);
- root.add(null, "foo");
- ns.saveNode(root, null);
- navs = userPortal.getNavigations();
- assertEquals(3, navs.size());
- RequestContext.setCurrentInstance(null);
- }
-
- public void testDestroy() throws Exception
- {
- NavigationService ns = (NavigationService)getContainer().getComponentInstanceOfType(NavigationService.class);
- NavigationContext nav = new NavigationContext(SiteKey.group("/platform"), new NavigationState(1));
- ns.saveNavigation(nav);
- List<UserNavigation> navs = userPortal.getNavigations();
- assertEquals(3, navs.size());
- RequestContext.setCurrentInstance(requestContext);
- ns.destroyNavigation(nav);
- navs = userPortal.getNavigations();
- assertEquals(2, navs.size());
- RequestContext.setCurrentInstance(null);
- }
-}
Copied: epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/java/org/exoplatform/web/portal/TestRefreshCurrentUserPortal.java (from rev 7497, portal/trunk/component/web/controller/src/test/java/org/exoplatform/web/portal/TestRefreshCurrentUserPortal.java)
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/java/org/exoplatform/web/portal/TestRefreshCurrentUserPortal.java (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/java/org/exoplatform/web/portal/TestRefreshCurrentUserPortal.java 2011-10-02 04:45:18 UTC (rev 7582)
@@ -0,0 +1,183 @@
+/*
+ * Copyright (C) 2011 eXo Platform SAS.
+ *
+ * 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.web.portal;
+
+import org.exoplatform.component.test.ConfigurationUnit;
+import org.exoplatform.component.test.ConfiguredBy;
+import org.exoplatform.component.test.ContainerScope;
+import org.exoplatform.portal.AbstractPortalTest;
+import org.exoplatform.portal.config.DataStorage;
+import org.exoplatform.portal.config.UserPortalConfig;
+import org.exoplatform.portal.config.UserPortalConfigService;
+import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.portal.mop.SiteKey;
+import org.exoplatform.portal.mop.navigation.NavigationContext;
+import org.exoplatform.portal.mop.navigation.NavigationService;
+import org.exoplatform.portal.mop.navigation.NavigationState;
+import org.exoplatform.portal.mop.navigation.NodeContext;
+import org.exoplatform.portal.mop.navigation.NodeModel;
+import org.exoplatform.portal.mop.navigation.Scope;
+import org.exoplatform.portal.mop.user.SimpleUserPortalContext;
+import org.exoplatform.portal.mop.user.UserNavigation;
+import org.exoplatform.portal.mop.user.UserPortal;
+import org.exoplatform.services.resources.Orientation;
+import org.exoplatform.web.application.RequestContext;
+import org.exoplatform.web.application.URLBuilder;
+import org.exoplatform.web.url.PortalURL;
+import org.exoplatform.web.url.ResourceType;
+import org.exoplatform.web.url.URLFactory;
+
+import java.util.List;
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ */
+@ConfiguredBy({
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.test.jcr-configuration.xml"),
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.identity-configuration.xml"),
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/exo.portal.component.portal-configuration.xml"),
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "org/exoplatform/web/portal/configuration.xml")
+})
+public class TestRefreshCurrentUserPortal extends AbstractPortalTest
+{
+
+ /** . */
+ private RequestContext requestContext;
+
+ /** . */
+ private UserPortal userPortal;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ begin();
+
+ UserPortalConfigService upcs = (UserPortalConfigService)getContainer().getComponentInstanceOfType(UserPortalConfigService.class);
+ UserPortalConfig upc = upcs.getUserPortalConfig("classic", "root", new SimpleUserPortalContext(Locale.ENGLISH));
+ final UserPortal userPortal = upc.getUserPortal();
+
+ //
+ RequestContext requestContext = new RequestContext(null)
+ {
+ @Override
+ public URLFactory getURLFactory()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public <R, U extends PortalURL<R, U>> U newURL(ResourceType<R, U> resourceType, URLFactory urlFactory)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Orientation getOrientation()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getRequestParameter(String name)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String[] getRequestParameterValues(String name)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public URLBuilder<?> getURLBuilder()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean useAjax()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public UserPortal getUserPortal()
+ {
+ return userPortal;
+ }
+ };
+
+ //
+ this.userPortal = userPortal;
+ this.requestContext = requestContext;
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ end();
+ }
+
+ public void testCreate() throws Exception
+ {
+ List<UserNavigation> navs = userPortal.getNavigations();
+ assertEquals(2, navs.size());
+ RequestContext.setCurrentInstance(requestContext);
+ NavigationService ns = (NavigationService)getContainer().getComponentInstanceOfType(NavigationService.class);
+ ns.saveNavigation(new NavigationContext(SiteKey.group("/platform"), new NavigationState(1)));
+ navs = userPortal.getNavigations();
+ assertEquals(3, navs.size());
+ RequestContext.setCurrentInstance(null);
+ }
+
+ public void testUpdate() throws Exception
+ {
+ List<UserNavigation> navs = userPortal.getNavigations();
+ assertEquals(2, navs.size());
+ NavigationService ns = (NavigationService)getContainer().getComponentInstanceOfType(NavigationService.class);
+ NavigationContext nav = new NavigationContext(SiteKey.group("/platform"), new NavigationState(1));
+ ns.saveNavigation(nav);
+ navs = userPortal.getNavigations();
+ assertEquals(2, navs.size());
+ RequestContext.setCurrentInstance(requestContext);
+ NodeContext root = ns.loadNode(NodeModel.SELF_MODEL, nav, Scope.ALL, null);
+ root.add(null, "foo");
+ ns.saveNode(root, null);
+ navs = userPortal.getNavigations();
+ assertEquals(3, navs.size());
+ RequestContext.setCurrentInstance(null);
+ }
+
+ public void testDestroy() throws Exception
+ {
+ NavigationService ns = (NavigationService)getContainer().getComponentInstanceOfType(NavigationService.class);
+ NavigationContext nav = new NavigationContext(SiteKey.group("/platform"), new NavigationState(1));
+ ns.saveNavigation(nav);
+ List<UserNavigation> navs = userPortal.getNavigations();
+ assertEquals(3, navs.size());
+ RequestContext.setCurrentInstance(requestContext);
+ ns.destroyNavigation(nav);
+ navs = userPortal.getNavigations();
+ assertEquals(2, navs.size());
+ RequestContext.setCurrentInstance(null);
+ }
+}
Deleted: epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/configuration.xml
===================================================================
--- portal/trunk/component/web/controller/src/test/resources/org/exoplatform/web/portal/configuration.xml 2011-09-23 09:45:45 UTC (rev 7497)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/configuration.xml 2011-10-02 04:45:18 UTC (rev 7582)
@@ -1,162 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- ~ Copyright (C) 2011 eXo Platform SAS.
- ~
- ~ 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.
- -->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
- xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
-
- <external-component-plugins>
- <target-component>org.exoplatform.portal.config.UserPortalConfigService</target-component>
- <component-plugin>
- <name>new.portal.config.user.listener</name>
- <set-method>initListener</set-method>
- <type>org.exoplatform.portal.config.NewPortalConfigListener</type>
- <init-params>
- <value-param>
- <name>default.portal</name>
- <value>classic</value>
- </value-param>
- <value-param>
- <name>initializing.failure.ignore</name>
- <value>true</value>
- </value-param>
- <object-param>
- <name>portal.configuration</name>
- <object type="org.exoplatform.portal.config.NewPortalConfig">
- <field name="predefinedOwner">
- <collection type="java.util.HashSet">
- <value>
- <string>classic</string>
- </value>
- </collection>
- </field>
- <field name="ownerType">
- <string>portal</string>
- </field>
- <field name="templateLocation">
- <string>classpath:/org/exoplatform/web/portal</string>
- </field>
- </object>
- </object-param>
- <object-param>
- <name>group.configuration</name>
- <object type="org.exoplatform.portal.config.NewPortalConfig">
- <field name="predefinedOwner">
- <collection type="java.util.HashSet">
- <value>
- <string>/platform</string>
- </value>
- </collection>
- </field>
- <field name="ownerType">
- <string>group</string>
- </field>
- <field name="templateLocation">
- <string>classpath:/org/exoplatform/web/portal</string>
- </field>
- </object>
- </object-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
-
- <external-component-plugins>
- <target-component>org.exoplatform.services.organization.OrganizationService</target-component>
- <component-plugin>
- <name>init.service.listener</name>
- <set-method>addListenerPlugin</set-method>
- <type>org.exoplatform.services.organization.OrganizationDatabaseInitializer</type>
- <init-params>
- <value-param>
- <name>checkDatabaseAlgorithm</name>
- <value>entry</value>
- </value-param>
- <value-param>
- <name>printInformation</name>
- <value>true</value>
- </value-param>
- <object-param>
- <name>configuration</name>
- <object type="org.exoplatform.services.organization.OrganizationConfig">
- <field name="membershipType">
- <collection type="java.util.ArrayList">
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
- <field name="type"><string>member</string></field>
- <field name="description"><string>member membership type</string></field>
- </object>
- </value>
- </collection>
- </field>
-
- <field name="group">
- <collection type="java.util.ArrayList">
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>platform</string></field>
- <field name="parentId"><string></string></field>
- <field name="description"><string>the /platform group</string></field>
- <field name="label"><string>Platform</string></field>
- </object>
- </value>
- </collection>
- </field>
-
- <field name="user">
- <collection type="java.util.ArrayList">
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$User">
- <field name="userName"><string>root</string></field>
- <field name="password"><string>gtn</string></field>
- <field name="firstName"><string>Root</string></field>
- <field name="lastName"><string>Root</string></field>
- <field name="email"><string>root@localhost</string></field>
- <field name="groups"><string>member:/platform</string></field>
- </object>
- </value>
- </collection>
- </field>
- </object>
- </object-param>
- </init-params>
- </component-plugin>
-
- </external-component-plugins>
-
- <external-component-plugins>
- <target-component>org.exoplatform.services.listener.ListenerService</target-component>
- <component-plugin>
- <name>org.exoplatform.portal.mop.navigation.navigation_created</name>
- <set-method>addListener</set-method>
- <type>org.exoplatform.web.portal.RefreshCurrentUserPortal</type>
- </component-plugin>
- <component-plugin>
- <name>org.exoplatform.portal.mop.navigation.navigation_updated</name>
- <set-method>addListener</set-method>
- <type>org.exoplatform.web.portal.RefreshCurrentUserPortal</type>
- </component-plugin>
- <component-plugin>
- <name>org.exoplatform.portal.mop.navigation.navigation_destroyed</name>
- <set-method>addListener</set-method>
- <type>org.exoplatform.web.portal.RefreshCurrentUserPortal</type>
- </component-plugin>
- </external-component-plugins>
-
-</configuration>
Copied: epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/configuration.xml (from rev 7497, portal/trunk/component/web/controller/src/test/resources/org/exoplatform/web/portal/configuration.xml)
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/configuration.xml (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/configuration.xml 2011-10-02 04:45:18 UTC (rev 7582)
@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 eXo Platform SAS.
+ ~
+ ~ 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.
+ -->
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.portal.config.UserPortalConfigService</target-component>
+ <component-plugin>
+ <name>new.portal.config.user.listener</name>
+ <set-method>initListener</set-method>
+ <type>org.exoplatform.portal.config.NewPortalConfigListener</type>
+ <init-params>
+ <value-param>
+ <name>default.portal</name>
+ <value>classic</value>
+ </value-param>
+ <value-param>
+ <name>initializing.failure.ignore</name>
+ <value>true</value>
+ </value-param>
+ <object-param>
+ <name>portal.configuration</name>
+ <object type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+ <value>
+ <string>classic</string>
+ </value>
+ </collection>
+ </field>
+ <field name="ownerType">
+ <string>portal</string>
+ </field>
+ <field name="templateLocation">
+ <string>classpath:/org/exoplatform/web/portal</string>
+ </field>
+ </object>
+ </object-param>
+ <object-param>
+ <name>group.configuration</name>
+ <object type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+ <value>
+ <string>/platform</string>
+ </value>
+ </collection>
+ </field>
+ <field name="ownerType">
+ <string>group</string>
+ </field>
+ <field name="templateLocation">
+ <string>classpath:/org/exoplatform/web/portal</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.organization.OrganizationService</target-component>
+ <component-plugin>
+ <name>init.service.listener</name>
+ <set-method>addListenerPlugin</set-method>
+ <type>org.exoplatform.services.organization.OrganizationDatabaseInitializer</type>
+ <init-params>
+ <value-param>
+ <name>checkDatabaseAlgorithm</name>
+ <value>entry</value>
+ </value-param>
+ <value-param>
+ <name>printInformation</name>
+ <value>true</value>
+ </value-param>
+ <object-param>
+ <name>configuration</name>
+ <object type="org.exoplatform.services.organization.OrganizationConfig">
+ <field name="membershipType">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
+ <field name="type"><string>member</string></field>
+ <field name="description"><string>member membership type</string></field>
+ </object>
+ </value>
+ </collection>
+ </field>
+
+ <field name="group">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>platform</string></field>
+ <field name="parentId"><string></string></field>
+ <field name="description"><string>the /platform group</string></field>
+ <field name="label"><string>Platform</string></field>
+ </object>
+ </value>
+ </collection>
+ </field>
+
+ <field name="user">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field name="userName"><string>root</string></field>
+ <field name="password"><string>gtn</string></field>
+ <field name="firstName"><string>Root</string></field>
+ <field name="lastName"><string>Root</string></field>
+ <field name="email"><string>root@localhost</string></field>
+ <field name="groups"><string>member:/platform</string></field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+
+ </external-component-plugins>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.listener.ListenerService</target-component>
+ <component-plugin>
+ <name>org.exoplatform.portal.mop.navigation.navigation_created</name>
+ <set-method>addListener</set-method>
+ <type>org.exoplatform.web.portal.RefreshCurrentUserPortal</type>
+ </component-plugin>
+ <component-plugin>
+ <name>org.exoplatform.portal.mop.navigation.navigation_updated</name>
+ <set-method>addListener</set-method>
+ <type>org.exoplatform.web.portal.RefreshCurrentUserPortal</type>
+ </component-plugin>
+ <component-plugin>
+ <name>org.exoplatform.portal.mop.navigation.navigation_destroyed</name>
+ <set-method>addListener</set-method>
+ <type>org.exoplatform.web.portal.RefreshCurrentUserPortal</type>
+ </component-plugin>
+ </external-component-plugins>
+
+</configuration>
Deleted: epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/group/platform/group.xml
===================================================================
--- portal/trunk/component/web/controller/src/test/resources/org/exoplatform/web/portal/group/platform/group.xml 2011-09-23 09:45:45 UTC (rev 7497)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/group/platform/group.xml 2011-10-02 04:45:18 UTC (rev 7582)
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- ~ Copyright (C) 2011 eXo Platform SAS.
- ~
- ~ 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.
- -->
-
-<portal-config>
- <portal-name>platform</portal-name>
- <locale>en</locale>
- <access-permissions>Everyone</access-permissions>
- <label>Foo</label>
- <description>This is platform portal for testing</description>
- <portal-layout>
- </portal-layout>
-</portal-config>
Copied: epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/group/platform/group.xml (from rev 7497, portal/trunk/component/web/controller/src/test/resources/org/exoplatform/web/portal/group/platform/group.xml)
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/group/platform/group.xml (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/group/platform/group.xml 2011-10-02 04:45:18 UTC (rev 7582)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 eXo Platform SAS.
+ ~
+ ~ 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.
+ -->
+
+<portal-config>
+ <portal-name>platform</portal-name>
+ <locale>en</locale>
+ <access-permissions>Everyone</access-permissions>
+ <label>Foo</label>
+ <description>This is platform portal for testing</description>
+ <portal-layout>
+ </portal-layout>
+</portal-config>
Deleted: epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/group/platform/pages.xml
===================================================================
--- portal/trunk/component/web/controller/src/test/resources/org/exoplatform/web/portal/group/platform/pages.xml 2011-09-23 09:45:45 UTC (rev 7497)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/group/platform/pages.xml 2011-10-02 04:45:18 UTC (rev 7582)
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- ~ Copyright (C) 2011 eXo Platform SAS.
- ~
- ~ 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.
- -->
-
-<page-set>
-</page-set>
Copied: epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/group/platform/pages.xml (from rev 7497, portal/trunk/component/web/controller/src/test/resources/org/exoplatform/web/portal/group/platform/pages.xml)
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/group/platform/pages.xml (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/group/platform/pages.xml 2011-10-02 04:45:18 UTC (rev 7582)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 eXo Platform SAS.
+ ~
+ ~ 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.
+ -->
+
+<page-set>
+</page-set>
Deleted: epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/navigation.xml
===================================================================
--- portal/trunk/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/navigation.xml 2011-09-23 09:45:45 UTC (rev 7497)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/navigation.xml 2011-10-02 04:45:18 UTC (rev 7582)
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Copyright (C) 2011 eXo Platform SAS.
- ~
- ~ 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.
- -->
-
-<node-navigation>
-</node-navigation>
Copied: epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/navigation.xml (from rev 7497, portal/trunk/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/navigation.xml)
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/navigation.xml (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/navigation.xml 2011-10-02 04:45:18 UTC (rev 7582)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright (C) 2011 eXo Platform SAS.
+ ~
+ ~ 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.
+ -->
+
+<node-navigation>
+</node-navigation>
Deleted: epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/pages.xml
===================================================================
--- portal/trunk/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/pages.xml 2011-09-23 09:45:45 UTC (rev 7497)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/pages.xml 2011-10-02 04:45:18 UTC (rev 7582)
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- ~ Copyright (C) 2011 eXo Platform SAS.
- ~
- ~ 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.
- -->
-
-<page-set>
-</page-set>
Copied: epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/pages.xml (from rev 7497, portal/trunk/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/pages.xml)
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/pages.xml (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/pages.xml 2011-10-02 04:45:18 UTC (rev 7582)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 eXo Platform SAS.
+ ~
+ ~ 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.
+ -->
+
+<page-set>
+</page-set>
Deleted: epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/portal.xml
===================================================================
--- portal/trunk/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/portal.xml 2011-09-23 09:45:45 UTC (rev 7497)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/portal.xml 2011-10-02 04:45:18 UTC (rev 7582)
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- ~ Copyright (C) 2011 eXo Platform SAS.
- ~
- ~ 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.
- -->
-
-<portal-config>
- <portal-name>classic</portal-name>
- <locale>en</locale>
- <access-permissions>Everyone</access-permissions>
- <edit-permission>*:/platform/administrators</edit-permission>
- <label>Classic</label>
- <description>This is classic portal for testing</description>
- <portal-layout>
- </portal-layout>
-</portal-config>
Copied: epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/portal.xml (from rev 7497, portal/trunk/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/portal.xml)
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/portal.xml (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/controller/src/test/resources/org/exoplatform/web/portal/portal/classic/portal.xml 2011-10-02 04:45:18 UTC (rev 7582)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ Copyright (C) 2011 eXo Platform SAS.
+ ~
+ ~ 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.
+ -->
+
+<portal-config>
+ <portal-name>classic</portal-name>
+ <locale>en</locale>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <label>Classic</label>
+ <description>This is classic portal for testing</description>
+ <portal-layout>
+ </portal-layout>
+</portal-config>
Modified: epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java 2011-10-01 22:04:26 UTC (rev 7581)
+++ epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java 2011-10-02 04:45:18 UTC (rev 7582)
@@ -182,8 +182,8 @@
private UserPortal getUserPortal()
{
- UIPortalApplication uiApp = Util.getUIPortalApplication();
- return uiApp.getUserPortalConfig().getUserPortal();
+ PortalRequestContext prc = Util.getPortalRequestContext();
+ return prc.getUserPortalConfig().getUserPortal();
}
/**
Modified: epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIGroupNavigationManagement.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIGroupNavigationManagement.java 2011-10-01 22:04:26 UTC (rev 7581)
+++ epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIGroupNavigationManagement.java 2011-10-02 04:45:18 UTC (rev 7582)
@@ -97,7 +97,7 @@
public void loadNavigations() throws Exception
{
- UserPortal userPortal = Util.getUIPortalApplication().getUserPortalConfig().getUserPortal();
+ UserPortal userPortal = Util.getPortalRequestContext().getUserPortalConfig().getUserPortal();
List<UserNavigation> allNavs = userPortal.getNavigations();
List<UserNavigation> groupNav = new ArrayList<UserNavigation>();
@@ -154,7 +154,7 @@
{
public void execute(Event<UIGroupNavigationManagement> event) throws Exception
{
- UserPortal userPortal = Util.getUIPortalApplication().getUserPortalConfig().getUserPortal();
+ UserPortal userPortal = Util.getPortalRequestContext().getUserPortalConfig().getUserPortal();
UIGroupNavigationManagement uicomp = event.getSource();
WebuiRequestContext context = event.getRequestContext();
UIApplication uiApplication = context.getUIApplication();
@@ -192,7 +192,7 @@
@Override
protected void doEdit(UserNavigation nav, Event<UIGroupNavigationManagement> event) throws Exception
{
- UserPortal userPortal = Util.getUIPortalApplication().getUserPortalConfig().getUserPortal();
+ UserPortal userPortal = Util.getPortalRequestContext().getUserPortalConfig().getUserPortal();
UIGroupNavigationManagement uicomp = event.getSource();
SiteKey siteKey = nav.getKey();
Modified: epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/BasePartialUpdateToolbar.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/BasePartialUpdateToolbar.java 2011-10-01 22:04:26 UTC (rev 7581)
+++ epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/BasePartialUpdateToolbar.java 2011-10-02 04:45:18 UTC (rev 7582)
@@ -28,6 +28,7 @@
import javax.portlet.ResourceRequest;
import javax.portlet.ResourceURL;
+import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.mop.SiteKey;
import org.exoplatform.portal.mop.navigation.GenericScope;
import org.exoplatform.portal.mop.navigation.NodeChange;
@@ -193,8 +194,8 @@
protected UserPortal getUserPortal()
{
- UIPortalApplication uiApp = Util.getUIPortalApplication();
- return uiApp.getUserPortalConfig().getUserPortal();
+ PortalRequestContext prc = Util.getPortalRequestContext();
+ return prc.getUserPortalConfig().getUserPortal();
}
protected UserNode getSelectedNode() throws Exception
Modified: epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml 2011-10-01 22:04:26 UTC (rev 7581)
+++ epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml 2011-10-02 04:45:18 UTC (rev 7582)
@@ -476,4 +476,23 @@
</component-plugin>
</external-component-plugins>
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.listener.ListenerService</target-component>
+ <component-plugin>
+ <name>org.exoplatform.portal.mop.navigation.navigation_created</name>
+ <set-method>addListener</set-method>
+ <type>org.exoplatform.web.portal.RefreshCurrentUserPortal</type>
+ </component-plugin>
+ <component-plugin>
+ <name>org.exoplatform.portal.mop.navigation.navigation_updated</name>
+ <set-method>addListener</set-method>
+ <type>org.exoplatform.web.portal.RefreshCurrentUserPortal</type>
+ </component-plugin>
+ <component-plugin>
+ <name>org.exoplatform.portal.mop.navigation.navigation_destroyed</name>
+ <set-method>addListener</set-method>
+ <type>org.exoplatform.web.portal.RefreshCurrentUserPortal</type>
+ </component-plugin>
+ </external-component-plugins>
+
</configuration>
Modified: epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java 2011-10-01 22:04:26 UTC (rev 7581)
+++ epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java 2011-10-02 04:45:18 UTC (rev 7582)
@@ -33,6 +33,7 @@
import org.exoplatform.portal.mop.SiteType;
import org.exoplatform.portal.mop.user.UserNavigation;
import org.exoplatform.portal.mop.user.UserNode;
+import org.exoplatform.portal.mop.user.UserPortal;
import org.exoplatform.portal.mop.user.UserPortalContext;
import org.exoplatform.web.url.navigation.NodeURL;
import org.exoplatform.web.url.navigation.NavigationResource;
@@ -264,6 +265,19 @@
return url;
}
+ public UserPortal getUserPortal()
+ {
+ UserPortalConfig upc = getUserPortalConfig();
+ if (upc != null)
+ {
+ return upc.getUserPortal();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
public UserPortalConfig getUserPortalConfig()
{
if (userPortalConfig == null)
Modified: epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPageNavigationForm.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPageNavigationForm.java 2011-10-01 22:04:26 UTC (rev 7581)
+++ epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPageNavigationForm.java 2011-10-02 04:45:18 UTC (rev 7582)
@@ -147,7 +147,7 @@
// Check existed
PortalRequestContext prContext = Util.getPortalRequestContext();
- UserPortal userPortal = Util.getUIPortalApplication().getUserPortalConfig().getUserPortal();
+ UserPortal userPortal = prContext.getUserPortalConfig().getUserPortal();
userNav = userPortal.getNavigation(userNav.getKey());
Modified: epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPageNodeSelector.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPageNodeSelector.java 2011-10-01 22:04:26 UTC (rev 7581)
+++ epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPageNodeSelector.java 2011-10-02 04:45:18 UTC (rev 7582)
@@ -55,7 +55,7 @@
uiTree.setBeanIconField("icon");
uiTree.setBeanChildCountField("childrenCount");
- userPortal = Util.getUIPortalApplication().getUserPortalConfig().getUserPortal();
+ userPortal = Util.getPortalRequestContext().getUserPortalConfig().getUserPortal();
}
public void configure(UserNode node) throws Exception
Modified: epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPortalNavigation.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPortalNavigation.java 2011-10-01 22:04:26 UTC (rev 7581)
+++ epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPortalNavigation.java 2011-10-02 04:45:18 UTC (rev 7582)
@@ -19,11 +19,6 @@
package org.exoplatform.portal.webui.navigation;
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.mop.SiteType;
import org.exoplatform.portal.mop.Visibility;
import org.exoplatform.portal.mop.navigation.NodeChange;
@@ -33,16 +28,17 @@
import org.exoplatform.portal.mop.user.UserNode;
import org.exoplatform.portal.mop.user.UserNodeFilterConfig;
import org.exoplatform.portal.mop.user.UserPortal;
-import org.exoplatform.portal.webui.portal.PageNodeEvent;
import org.exoplatform.portal.webui.portal.UIPortal;
import org.exoplatform.portal.webui.util.Util;
-import org.exoplatform.portal.webui.workspace.UIPortalApplication;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
/**
* Created by The eXo Platform SARL Author : Dang Van Minh minhdv81(a)yahoo.com
@@ -134,7 +130,7 @@
}
else
{
- UserPortal userPortal = Util.getUIPortalApplication().getUserPortalConfig().getUserPortal();
+ UserPortal userPortal = Util.getPortalRequestContext().getUserPortalConfig().getUserPortal();
List<UserNavigation> navigations = userPortal.getNavigations();
for (UserNavigation userNav : navigations)
{
@@ -157,7 +153,7 @@
{
treeNode_ = new TreeNode();
- UserPortal userPortal = Util.getUIPortalApplication().getUserPortalConfig().getUserPortal();
+ UserPortal userPortal = Util.getPortalRequestContext().getUserPortalConfig().getUserPortal();
List<UserNavigation> listNavigations = userPortal.getNavigations();
List<UserNode> childNodes = new LinkedList<UserNode>();
@@ -186,7 +182,7 @@
public UserNode resolvePath(String path) throws Exception
{
WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
- UserPortal userPortal = Util.getUIPortalApplication().getUserPortalConfig().getUserPortal();
+ UserPortal userPortal = Util.getPortalRequestContext().getUserPortalConfig().getUserPortal();
UserNode node;
if (context.getRemoteUser() != null)
@@ -212,7 +208,7 @@
{
return null;
}
- UserPortal userPortal = Util.getUIPortalApplication().getUserPortalConfig().getUserPortal();
+ UserPortal userPortal = Util.getPortalRequestContext().getUserPortalConfig().getUserPortal();
NodeChangeQueue<UserNode> queue = new NodeChangeQueue<UserNode>();
userPortal.updateNode(node, navigationScope, queue);
for (NodeChange<UserNode> change : queue)
@@ -300,7 +296,7 @@
private UserNode getCurrentNavigation() throws Exception
{
- UserPortal userPortal = Util.getUIPortalApplication().getUserPortalConfig().getUserPortal();
+ UserPortal userPortal = Util.getPortalRequestContext().getUserPortalConfig().getUserPortal();
UserNavigation userNavigation = Util.getUIPortal().getUserNavigation();
try
{
Modified: epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java 2011-10-01 22:04:26 UTC (rev 7581)
+++ epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageActionListener.java 2011-10-02 04:45:18 UTC (rev 7582)
@@ -59,10 +59,10 @@
{
public void execute(Event<UIPortalApplication> event) throws Exception
{
+ PortalRequestContext pcontext = PortalRequestContext.getCurrentInstance();
+ UserPortal userPortal = pcontext.getUserPortalConfig().getUserPortal();
UIPortalApplication uiPortalApp = event.getSource();
- UserPortal userPortal = uiPortalApp.getUserPortalConfig().getUserPortal();
UIPortal showedUIPortal = uiPortalApp.getCurrentSite();
- PortalRequestContext pcontext = PortalRequestContext.getCurrentInstance();
UserNodeFilterConfig.Builder builder = UserNodeFilterConfig.builder();
builder.withReadCheck();
@@ -144,14 +144,14 @@
DataStorage storageService = uiPortalApp.getApplicationComponent(DataStorage.class);
PortalConfig associatedPortalConfig = storageService.getPortalConfig(targetNav.getKey().getTypeName(), targetNav.getKey().getName());
- UserPortalConfig userPortalConfig = uiPortalApp.getUserPortalConfig();
+ UserPortalConfig userPortalConfig = pcontext.getUserPortalConfig();
//Update layout-related data on UserPortalConfig
userPortalConfig.setPortalConfig(associatedPortalConfig);
}
else
{
- showedUIPortal = buildUIPortal(targetNav.getKey(), uiPortalApp, uiPortalApp.getUserPortalConfig());
+ showedUIPortal = buildUIPortal(targetNav.getKey(), uiPortalApp, pcontext.getUserPortalConfig());
if(showedUIPortal == null)
{
return;
Modified: epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java 2011-10-01 22:04:26 UTC (rev 7581)
+++ epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java 2011-10-02 04:45:18 UTC (rev 7582)
@@ -341,8 +341,8 @@
*/
private void removePageNode(Page page, Event<UIPageBrowser> event) throws Exception
{
- UIPortalApplication portalApplication = Util.getUIPortalApplication();
- UserPortal userPortal = portalApplication.getUserPortalConfig().getUserPortal();
+ PortalRequestContext prc = Util.getPortalRequestContext();
+ UserPortal userPortal = prc.getUserPortalConfig().getUserPortal();
UserNavigation userNav = userPortal.getNavigation(SiteKey.user(event.getRequestContext().getRemoteUser()));
UserNode rootNode = userPortal.getNode(userNav, Scope.CHILDREN, null, null);
Modified: epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java 2011-10-01 22:04:26 UTC (rev 7581)
+++ epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java 2011-10-02 04:45:18 UTC (rev 7582)
@@ -111,7 +111,7 @@
DataStorage dataService = getApplicationComponent(DataStorage.class);
dataService.create(page);
- UserPortal userPortal = Util.getUIPortalApplication().getUserPortalConfig().getUserPortal();
+ UserPortal userPortal = Util.getPortalRequestContext().getUserPortalConfig().getUserPortal();
userPortal.saveNode(selectedNode, null);
DescriptionService descriptionService = getApplicationComponent(DescriptionService.class);
Modified: epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java 2011-10-01 22:04:26 UTC (rev 7581)
+++ epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java 2011-10-02 04:45:18 UTC (rev 7582)
@@ -170,8 +170,8 @@
{
if (navPath == null)
{
- UIPortalApplication uiApp = Util.getUIPortalApplication();
- navPath = uiApp.getUserPortalConfig().getUserPortal().getDefaultPath(null);
+ PortalRequestContext prc = Util.getPortalRequestContext();
+ navPath = prc.getUserPortalConfig().getUserPortal().getDefaultPath(null);
}
return navPath;
}
Modified: epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2011-10-01 22:04:26 UTC (rev 7581)
+++ epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2011-10-02 04:45:18 UTC (rev 7582)
@@ -212,7 +212,7 @@
//caught in the ApplicationLifecycle
rebuildUIPortal(uiPortalApp, editPortal, dataStorage);
}
- uiPortalApp.getUserPortalConfig().setPortalConfig(portalConfig);
+ prContext.getUserPortalConfig().setPortalConfig(portalConfig);
PortalConfig pConfig = dataStorage.getPortalConfig(portalName);
if (pConfig != null)
{
@@ -254,7 +254,7 @@
private void rebuildUIPortal(UIPortalApplication uiPortalApp, UIPortal uiPortal, DataStorage storage) throws Exception
{
PortalConfig portalConfig = storage.getPortalConfig(uiPortal.getSiteType().getName(), uiPortal.getName());
- UserPortalConfig userPortalConfig = uiPortalApp.getUserPortalConfig();
+ UserPortalConfig userPortalConfig = Util.getPortalRequestContext().getUserPortalConfig();
userPortalConfig.setPortalConfig(portalConfig);
uiPortal.getChildren().clear();
PortalDataMapper.toUIPortal(uiPortal, userPortalConfig.getPortalConfig());
@@ -479,10 +479,10 @@
storage.getPortalConfig(uiPortal.getSiteKey().getTypeName(), uiPortal.getSiteKey().getName());
if (pConfig != null)
{
- uiPortalApp.getUserPortalConfig().setPortalConfig(pConfig);
+ prContext.getUserPortalConfig().setPortalConfig(pConfig);
}
uiPortal.getChildren().clear();
- PortalDataMapper.toUIPortal(uiPortal, uiPortalApp.getUserPortalConfig().getPortalConfig());
+ PortalDataMapper.toUIPortal(uiPortal, prContext.getUserPortalConfig().getPortalConfig());
//Update the cache of UIPortal from UIPortalApplication
uiPortalApp.putCachedUIPortal(uiPortal);
Modified: epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java 2011-10-01 22:04:26 UTC (rev 7581)
+++ epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java 2011-10-02 04:45:18 UTC (rev 7582)
@@ -332,7 +332,7 @@
UserPortalConfigService service = uiForm.getApplicationComponent(UserPortalConfigService.class);
if (prContext.getPortalOwner().equals(uiForm.getPortalOwner()))
{
- uiPortalApp.setUserPortalConfig(service.getUserPortalConfig(uiForm.getPortalOwner(), prContext.getRemoteUser(), PortalRequestContext.USER_PORTAL_CONTEXT));
+ prContext.setUserPortalConfig(service.getUserPortalConfig(uiForm.getPortalOwner(), prContext.getRemoteUser(), PortalRequestContext.USER_PORTAL_CONTEXT));
uiPortalApp.reloadPortalProperties();
}
Modified: epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java 2011-10-01 22:04:26 UTC (rev 7581)
+++ epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java 2011-10-02 04:45:18 UTC (rev 7582)
@@ -169,7 +169,7 @@
private UserNode resolveNode(UserNode selectedNode, UserNodeFilterConfig filterConfig) throws Exception
{
UserNavigation currNav = selectedNode.getNavigation();
- UserPortal userPortal = Util.getUIPortalApplication().getUserPortalConfig().getUserPortal();
+ UserPortal userPortal = Util.getPortalRequestContext().getUserPortalConfig().getUserPortal();
if (currNav.getKey().getType().equals(SiteType.USER))
{
return userPortal.getNode(currNav, Scope.CHILDREN, filterConfig, null);
Modified: epp/portal/branches/EPP_5_2_Branch/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletRequestContext.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletRequestContext.java 2011-10-01 22:04:26 UTC (rev 7581)
+++ epp/portal/branches/EPP_5_2_Branch/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletRequestContext.java 2011-10-02 04:45:18 UTC (rev 7582)
@@ -20,6 +20,7 @@
package org.exoplatform.webui.application.portlet;
import org.exoplatform.commons.utils.WriterPrinter;
+import org.exoplatform.portal.mop.user.UserPortal;
import org.exoplatform.services.resources.Orientation;
import org.exoplatform.web.application.RequestContext;
import org.exoplatform.web.application.URLBuilder;
@@ -211,6 +212,12 @@
((ActionResponse)response_).sendRedirect(url);
}
+ @Override
+ public UserPortal getUserPortal()
+ {
+ return getParentAppRequestContext().getUserPortal();
+ }
+
public boolean hasProcessAction()
{
return hasProcessAction_;
13 years, 2 months
gatein SVN: r7581 - epp/portal/branches/EPP_5_2_Branch.
by do-not-reply@jboss.org
Author: bdaw
Date: 2011-10-01 18:04:26 -0400 (Sat, 01 Oct 2011)
New Revision: 7581
Modified:
epp/portal/branches/EPP_5_2_Branch/pom.xml
Log:
JBEPP-1188 Cluster profile: Attempt to replicate non-serializable class PicketlinkIDMServiceImpl
Modified: epp/portal/branches/EPP_5_2_Branch/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/pom.xml 2011-10-01 16:25:55 UTC (rev 7580)
+++ epp/portal/branches/EPP_5_2_Branch/pom.xml 2011-10-01 22:04:26 UTC (rev 7581)
@@ -52,7 +52,7 @@
<org.gatein.dep.version>1.1.0-Beta06</org.gatein.dep.version>
<org.gatein.wci.version>2.1.0-Beta06</org.gatein.wci.version>
<org.gatein.pc.version>2.3.0-Beta06</org.gatein.pc.version>
- <org.picketlink.idm>1.3.0.Alpha04</org.picketlink.idm>
+ <org.picketlink.idm>1.3.0.Alpha06</org.picketlink.idm>
<org.gatein.wsrp.version>2.1.0-Beta06</org.gatein.wsrp.version>
<org.gatein.mop.version>1.1.0-Beta05</org.gatein.mop.version>
<org.gatein.mgmt.version>1.0.0-Beta03</org.gatein.mgmt.version>
13 years, 2 months
gatein SVN: r7580 - epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/application.
by do-not-reply@jboss.org
Author: hfnukal
Date: 2011-10-01 12:25:55 -0400 (Sat, 01 Oct 2011)
New Revision: 7580
Modified:
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/application/ResourceRequestFilter.java
Log:
JBEPP-1222 CSS rejected by the browser
Modified: epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/application/ResourceRequestFilter.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/application/ResourceRequestFilter.java 2011-10-01 16:23:56 UTC (rev 7579)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/application/ResourceRequestFilter.java 2011-10-01 16:25:55 UTC (rev 7580)
@@ -95,6 +95,8 @@
return;
}
+ response.setContentType("text/css; charset=UTF-8");
+
final OutputStream out = response.getOutputStream();
final BinaryOutput output = new BinaryOutput()
{
13 years, 2 months
gatein SVN: r7579 - epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component.
by do-not-reply@jboss.org
Author: hfnukal
Date: 2011-10-01 12:23:56 -0400 (Sat, 01 Oct 2011)
New Revision: 7579
Modified:
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UINavigationNodeSelector.java
Log:
JBEPP-716 Add Node button always create new node on the top level
Modified: epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UINavigationNodeSelector.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UINavigationNodeSelector.java 2011-10-01 16:14:30 UTC (rev 7578)
+++ epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UINavigationNodeSelector.java 2011-10-01 16:23:56 UTC (rev 7579)
@@ -394,7 +394,11 @@
TreeNode node;
if (ParameterValidation.isNullOrEmpty(nodeID))
{
- node = uiNodeSelector.getRootNode();
+ node = uiNodeSelector.getSelectedNode();
+ if(node == null)
+ {
+ node = uiNodeSelector.getRootNode();
+ }
}
else
{
13 years, 2 months
gatein SVN: r7578 - in epp/portal/branches/EPP_5_2_Branch: component and 7 other directories.
by do-not-reply@jboss.org
Author: hfnukal
Date: 2011-10-01 12:14:30 -0400 (Sat, 01 Oct 2011)
New Revision: 7578
Added:
epp/portal/branches/EPP_5_2_Branch/component/web/server/src/main/java/org/exoplatform/upload/MimeTypeUploadPlugin.java
epp/portal/branches/EPP_5_2_Branch/examples/portal/war/src/main/webapp/WEB-INF/conf/mimetype/
epp/portal/branches/EPP_5_2_Branch/examples/portal/war/src/main/webapp/WEB-INF/conf/mimetype/mimetypes.properties
Removed:
epp/portal/branches/EPP_5_2_Branch/examples/portal/war/src/main/webapp/WEB-INF/conf/mimetype/mimetypes.properties
Modified:
epp/portal/branches/EPP_5_2_Branch/
epp/portal/branches/EPP_5_2_Branch/component/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/
epp/portal/branches/EPP_5_2_Branch/component/web/server/src/main/java/org/exoplatform/upload/UploadService.java
epp/portal/branches/EPP_5_2_Branch/examples/portal/war/src/main/webapp/WEB-INF/conf/sample-portal/web/web-inf-extension-configuration.xml
epp/portal/branches/EPP_5_2_Branch/testsuite/webuibasedsamples/src/main/webapp/WEB-INF/web.xml
epp/portal/branches/EPP_5_2_Branch/wsrp-integration/
Log:
JBEPP-1196 Mime Type definition for file uploading
Property changes on: epp/portal/branches/EPP_5_2_Branch
___________________________________________________________________
Modified: svn:mergeinfo
- /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795:5868
/portal/branches/branch-GTNPORTAL-1592:4894
/portal/branches/branch-GTNPORTAL-1643:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745:5765
/portal/branches/branch-GTNPORTAL-1790:5871
/portal/branches/branch-GTNPORTAL-1822:5943,5952
/portal/branches/branch-GTNPORTAL-1832:6030,6063
/portal/branches/branch-GTNPORTAL-1872:6400,6551
/portal/branches/branch-GTNPORTAL-1921:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963:6904,6915-6916
/portal/branches/decoupled-webos:6214-6243
/portal/branches/gatein-management:6920-6958
/portal/branches/global-portlet-metadata:6298-6384
/portal/branches/site-describability:6171-6235
/portal/trunk:4876,4891,5269,5744,5822,5943,6168,6196,6201-6203,6205-6206,6223,6323,6437,6440,6449,6452,6573,6783-6784,6912-6913,6960,7042,7061,7095,7117,7125,7132-7134,7186,7239,7262,7308,7326,7331,7359,7367,7433,7454
+ /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795:5868
/portal/branches/branch-GTNPORTAL-1592:4894
/portal/branches/branch-GTNPORTAL-1643:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745:5765
/portal/branches/branch-GTNPORTAL-1790:5871
/portal/branches/branch-GTNPORTAL-1822:5943,5952
/portal/branches/branch-GTNPORTAL-1832:6030,6063
/portal/branches/branch-GTNPORTAL-1872:6400,6551
/portal/branches/branch-GTNPORTAL-1921:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963:6904,6915-6916
/portal/branches/decoupled-webos:6214-6243
/portal/branches/gatein-management:6920-6958
/portal/branches/global-portlet-metadata:6298-6384
/portal/branches/site-describability:6171-6235
/portal/trunk:4876,4891,5269,5744,5822,5943,6168,6196,6201-6203,6205-6206,6223,6323,6437,6440,6449,6452,6573,6783-6784,6912-6913,6960,7042,7061,7095,7117,7125,7132-7134,7186,7239,7262,7308,7326,7331,7359,7367,7433,7452,7454,7478
Property changes on: epp/portal/branches/EPP_5_2_Branch/component
___________________________________________________________________
Modified: svn:mergeinfo
- /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/component:5868
/portal/branches/branch-GTNPORTAL-1592/component:4894
/portal/branches/branch-GTNPORTAL-1643/component:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/component:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/component:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/component:5765
/portal/branches/branch-GTNPORTAL-1790/component:5871
/portal/branches/branch-GTNPORTAL-1822/component:5943,5952
/portal/branches/branch-GTNPORTAL-1832/component:6030,6063
/portal/branches/branch-GTNPORTAL-1872/component:6400,6551
/portal/branches/branch-GTNPORTAL-1921/component:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/component:6904,6915-6916
/portal/trunk/component:4876,4891,5269,5744,5822,5943,6031,6033,6168,6196,6201-6203,6205-6206,6223,6292,6323,6437,6440,6449,6452,6573,6783-6784,6912-6913,6960,7042,7061,7095,7117,7120,7125,7132-7134,7186,7239,7262,7308,7326,7331,7359,7367,7433,7454
+ /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/component:5868
/portal/branches/branch-GTNPORTAL-1592/component:4894
/portal/branches/branch-GTNPORTAL-1643/component:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/component:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/component:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/component:5765
/portal/branches/branch-GTNPORTAL-1790/component:5871
/portal/branches/branch-GTNPORTAL-1822/component:5943,5952
/portal/branches/branch-GTNPORTAL-1832/component:6030,6063
/portal/branches/branch-GTNPORTAL-1872/component:6400,6551
/portal/branches/branch-GTNPORTAL-1921/component:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/component:6904,6915-6916
/portal/trunk/component:4876,4891,5269,5744,5822,5943,6031,6033,6168,6196,6201-6203,6205-6206,6223,6292,6323,6437,6440,6449,6452,6573,6783-6784,6912-6913,6960,7042,7061,7095,7117,7120,7125,7132-7134,7186,7239,7262,7308,7326,7331,7359,7367,7433,7452,7454,7478
Property changes on: epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org
___________________________________________________________________
Modified: svn:mergeinfo
- /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/component/portal/src/main/java/org:5868
/portal/branches/branch-GTNPORTAL-1592/component/portal/src/main/java/org:4894
/portal/branches/branch-GTNPORTAL-1643/component/portal/src/main/java/org:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/component/portal/src/main/java/org:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/component/portal/src/main/java/org:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/component/portal/src/main/java/org:5765
/portal/branches/branch-GTNPORTAL-1790/component/portal/src/main/java/org:5871
/portal/branches/branch-GTNPORTAL-1822/component/portal/src/main/java/org:5943,5952
/portal/branches/branch-GTNPORTAL-1832/component/portal/src/main/java/org:6030,6063
/portal/branches/branch-GTNPORTAL-1872/component/portal/src/main/java/org:6400,6551
/portal/branches/branch-GTNPORTAL-1921/component/portal/src/main/java/org:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/component/portal/src/main/java/org:6904,6915-6916
/portal/trunk/component/portal/src/main/java/org:4876,4891,5269,5744,5822,5943,6031,6033,6168,6196,6201-6203,6205-6206,6223,6292,6323,6437,6440,6449,6452,6573,6741,6783-6784,6912-6913,6960,7042,7061,7095,7117,7120,7125,7132-7134,7186,7198,7239,7262,7308,7326,7331,7359,7367,7433,7454
+ /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/component/portal/src/main/java/org:5868
/portal/branches/branch-GTNPORTAL-1592/component/portal/src/main/java/org:4894
/portal/branches/branch-GTNPORTAL-1643/component/portal/src/main/java/org:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/component/portal/src/main/java/org:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/component/portal/src/main/java/org:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/component/portal/src/main/java/org:5765
/portal/branches/branch-GTNPORTAL-1790/component/portal/src/main/java/org:5871
/portal/branches/branch-GTNPORTAL-1822/component/portal/src/main/java/org:5943,5952
/portal/branches/branch-GTNPORTAL-1832/component/portal/src/main/java/org:6030,6063
/portal/branches/branch-GTNPORTAL-1872/component/portal/src/main/java/org:6400,6551
/portal/branches/branch-GTNPORTAL-1921/component/portal/src/main/java/org:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/component/portal/src/main/java/org:6904,6915-6916
/portal/trunk/component/portal/src/main/java/org:4876,4891,5269,5744,5822,5943,6031,6033,6168,6196,6201-6203,6205-6206,6223,6292,6323,6437,6440,6449,6452,6573,6741,6783-6784,6912-6913,6960,7042,7061,7095,7117,7120,7125,7132-7134,7186,7198,7239,7262,7308,7326,7331,7359,7367,7433,7452,7454,7478
Copied: epp/portal/branches/EPP_5_2_Branch/component/web/server/src/main/java/org/exoplatform/upload/MimeTypeUploadPlugin.java (from rev 7478, portal/trunk/component/web/server/src/main/java/org/exoplatform/upload/MimeTypeUploadPlugin.java)
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/server/src/main/java/org/exoplatform/upload/MimeTypeUploadPlugin.java (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/server/src/main/java/org/exoplatform/upload/MimeTypeUploadPlugin.java 2011-10-01 16:14:30 UTC (rev 7578)
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2003-2011 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.upload;
+
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Properties;
+
+import org.exoplatform.container.component.BaseComponentPlugin;
+import org.exoplatform.container.configuration.ConfigurationManager;
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.container.xml.ValueParam;
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
+
+/**
+ * Created by The eXo Platform SAS
+ * Author : Nguyen Thanh Hai
+ * haint(a)exoplatform.com
+ * Jun 29, 2011
+ */
+public class MimeTypeUploadPlugin extends BaseComponentPlugin
+{
+ final private static Logger log = LoggerFactory.getLogger(MimeTypeUploadPlugin.class);
+ final private static String MIMETYPE_PATH = "mimetype-path" ;
+ final private static String DEFAULT_MIMETYPE = "mimetype-default";
+
+ private Properties mimeTypes = new Properties();
+ private String mimetypeDefault ;
+
+ public MimeTypeUploadPlugin(InitParams initParams, ConfigurationManager configurationService) throws Exception
+ {
+ ValueParam param = initParams.getValueParam(MIMETYPE_PATH) ;
+ URL filePath = configurationService.getURL(param.getValue());
+ URLConnection connection = filePath.openConnection() ;
+ mimeTypes.load(connection.getInputStream()) ;
+
+ param = initParams.getValueParam(DEFAULT_MIMETYPE) ;
+ if(param != null) mimetypeDefault = param.getValue() ;
+ }
+
+ public String getMimeType(String fileName)
+ {
+ if(fileName.indexOf('.') == -1) return mimetypeDefault ;
+ String ext = fileName.substring(fileName.lastIndexOf('.') + 1);
+ String mimeType = mimeTypes.getProperty(ext.toLowerCase(), mimetypeDefault);
+ if (mimeType == null || mimeType.length() == 0) return null ;
+ return mimeType;
+ }
+}
Modified: epp/portal/branches/EPP_5_2_Branch/component/web/server/src/main/java/org/exoplatform/upload/UploadService.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/server/src/main/java/org/exoplatform/upload/UploadService.java 2011-09-30 20:55:57 UTC (rev 7577)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/server/src/main/java/org/exoplatform/upload/UploadService.java 2011-10-01 16:14:30 UTC (rev 7578)
@@ -20,6 +20,9 @@
package org.exoplatform.upload;
import java.io.File;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
@@ -44,6 +47,8 @@
{
/** . */
private static final Logger log = LoggerFactory.getLogger(UploadService.class);
+
+ private List<MimeTypeUploadPlugin> plugins ;
private Map<String, UploadResource> uploadResources = new LinkedHashMap<String, UploadResource>();
@@ -52,7 +57,7 @@
private int defaultUploadLimitMB_;
private Map<String, Integer> uploadLimitsMB_ = new LinkedHashMap<String, Integer>();
-
+
public static String UPLOAD_RESOURCES_STACK = "uploadResourcesStack";
public UploadService(PortalContainerInfo pinfo, InitParams params) throws Exception
@@ -67,7 +72,12 @@
if (!uploadDir.exists())
uploadDir.mkdirs();
}
-
+
+ public void register(MimeTypeUploadPlugin plugin) {
+ if(plugins == null) plugins = new ArrayList<MimeTypeUploadPlugin>() ;
+ plugins.add(plugin) ;
+ }
+
/**
* Create UploadResource for HttpServletRequest
*
@@ -115,6 +125,12 @@
upResource.setFileName(fileName);
upResource.setMimeType(fileItem.getContentType());
+ if(plugins != null)
+ for(MimeTypeUploadPlugin plugin : plugins)
+ {
+ String mimeType = plugin.getMimeType(fileName) ;
+ if(mimeType != null) upResource.setMimeType(mimeType) ;
+ }
upResource.setStoreLocation(storeLocation);
upResource.setStatus(UploadResource.UPLOADED_STATUS);
}
@@ -271,4 +287,6 @@
}
return false;
}
+
+
}
Deleted: epp/portal/branches/EPP_5_2_Branch/examples/portal/war/src/main/webapp/WEB-INF/conf/mimetype/mimetypes.properties
===================================================================
--- portal/trunk/examples/portal/war/src/main/webapp/WEB-INF/conf/mimetype/mimetypes.properties 2011-09-22 03:16:42 UTC (rev 7478)
+++ epp/portal/branches/EPP_5_2_Branch/examples/portal/war/src/main/webapp/WEB-INF/conf/mimetype/mimetypes.properties 2011-10-01 16:14:30 UTC (rev 7578)
@@ -1,156 +0,0 @@
-ai=application/postscript
-aif=audio/x-aiff
-aifc=audio/x-aiff
-aiff=audio/x-aiff
-any=text/any
-asc=text/plain
-au=audio/basic
-avi=video/x-msvideo
-bcpio=application/x-bcpio
-bin=application/octet-stream
-bz2=application/x-bzip2
-cdf=application/x-netcdf
-class=application/octet-stream
-cpio=application/x-cpio
-cpt=application/mac-compactpro
-cq=application/cq-durboser
-csh=application/x-csh
-css=text/css
-dcr=application/x-director
-dir=application/x-director
-dms=application/octet-stream
-doc=application/msword
-dvi=application/x-dvi
-dxr=application/x-director
-ecma=text/qhtml
-eps=application/postscript
-esp=text/qhtml
-etx=text/x-setext
-exe=application/octet-stream
-ez=application/andrew-inset
-gif=image/gif
-gtar=application/x-gtar
-gz=application/x-gzip
-hdf=application/x-hdf
-hqx=application/mac-binhex40
-htm=text/html
-html=text/html
-ice=x-conference/x-cooltalk
-ief=image/ief
-iges=model/iges
-igs=model/iges
-jpeg=image/jpeg
-jpe=image/jpeg
-jpg=image/jpeg
-bmp=image/bmp
-js=application/x-javascript
-kar=audio/midi
-latex=application/x-latex
-lha=application/octet-stream
-lzh=application/octet-stream
-man=application/x-troff-man
-me=application/x-troff-me
-mesh=model/mesh
-mid=audio/midi
-midi=audio/midi
-mif=application/vnd=mif
-mov=video/quicktime
-m4v=video/x-m4v
-m4a=audio/x-m4a
-movie=video/x-sgi-movie
-mp2=audio/mp2
-mp3=audio/mp3
-mpe=video/mpe
-mp4=video/mp4
-mpeg=video/mpeg
-mpg=video/mpeg
-mpg=video/mpg
-mpga=audio/mpga
-ms=application/x-troff-ms
-msh=model/mesh
-nc=application/x-netcdf
-oda=application/oda
-pbm=image/x-portable-bitmap
-pdb=chemical/x-pdb
-pdf=application/pdf
-pgm=image/x-portable-graymap
-pgn=application/x-chess-pgn
-png=image/png
-pnm=image/x-portable-anymap
-ppm=image/x-portable-pixmap
-ppt=application/ppt
-properties=text/plain
-ps=application/postscript
-qhtml=text/qhtml
-qt=video/quicktime
-ra=audio/x-realaudio
-ram=audio/x-pn-realaudio
-rm=audio/x-pn-realaudio
-ras=image/x-cmu-raster
-rgb=image/x-rgb
-roff=application/x-troff
-rpm=application/x-rpm
-rtf=application/rtf
-sgm=text/sgml
-sgml=text/sgml
-sh=application/x-sh
-shar=application/x-shar
-silo=model/mesh
-sit=application/x-stuffit
-skd=application/x-koan
-skm=application/x-koan
-skp=application/x-koan
-skt=application/x-koan
-smi=application/smil
-smil=application/smil
-snd=audio/basic
-spl=application/x-futuresplash
-src=application/x-wais-source
-sv4cpio=application/x-sv4cpio
-sv4crc=application/x-sv4crc
-swf=application/x-shockwave-flash
-t=application/x-troff
-tar=application/x-tar
-tcl=application/x-tcl
-tex=application/x-tex
-texi=application/x-texinfo
-texinfo=application/x-texinfo
-tgz=application/x-gzip
-tif=image/tiff
-tiff=image/tiff
-tr=application/x-troff
-tsv=text/tab-separated-values
-txt=text/plain
-odt=application/vnd.oasis.opendocument.text
-ods=application/vnd.oasis.opendocument.spreadsheet
-odp=application/vnd.oasis.opendocument.presentation
-odb=application/vnd.oasis.opendocument.database
-ustar=application/x-ustar
-vcd=application/x-cdlink
-vm=text/plain
-vrml=model/vrml
-wav=audio/x-wav
-wrl=model/vrml
-xbm=image/x-xbitmap
-xls=application/xls
-xml=text/xml
-xpdl=text/xml
-xpm=image/x-xpixmap
-xwd=image/x-xwindowdump
-xyz=chemical/x-pdb
-zip=application/zip
-rar=application/rar
-msg=application/vnd.ms-outlook
-flv=video/x-flv
-docx=application/vnd.openxmlformats-officedocument.wordprocessingml.document
-wpd=application/wordperfect
-wiki=text/x-wiki
-sxc=application/vnd.sun.xml.calc
-xlsx=application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
-csv=text/csv
-tsv=text/tab-separated-values
-sxi=application/vnd.sun.xml.impress
-pptx=application/vnd.openxmlformats-officedocument.presentationml.presentation
-odg=application/vnd.oasis.opendocument.graphics
-svg=image/svg+xml
-sxw=application/vnd.sun.xml.writer
\ No newline at end of file
Copied: epp/portal/branches/EPP_5_2_Branch/examples/portal/war/src/main/webapp/WEB-INF/conf/mimetype/mimetypes.properties (from rev 7478, portal/trunk/examples/portal/war/src/main/webapp/WEB-INF/conf/mimetype/mimetypes.properties)
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/examples/portal/war/src/main/webapp/WEB-INF/conf/mimetype/mimetypes.properties (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/examples/portal/war/src/main/webapp/WEB-INF/conf/mimetype/mimetypes.properties 2011-10-01 16:14:30 UTC (rev 7578)
@@ -0,0 +1,156 @@
+ai=application/postscript
+aif=audio/x-aiff
+aifc=audio/x-aiff
+aiff=audio/x-aiff
+any=text/any
+asc=text/plain
+au=audio/basic
+avi=video/x-msvideo
+bcpio=application/x-bcpio
+bin=application/octet-stream
+bz2=application/x-bzip2
+cdf=application/x-netcdf
+class=application/octet-stream
+cpio=application/x-cpio
+cpt=application/mac-compactpro
+cq=application/cq-durboser
+csh=application/x-csh
+css=text/css
+dcr=application/x-director
+dir=application/x-director
+dms=application/octet-stream
+doc=application/msword
+dvi=application/x-dvi
+dxr=application/x-director
+ecma=text/qhtml
+eps=application/postscript
+esp=text/qhtml
+etx=text/x-setext
+exe=application/octet-stream
+ez=application/andrew-inset
+gif=image/gif
+gtar=application/x-gtar
+gz=application/x-gzip
+hdf=application/x-hdf
+hqx=application/mac-binhex40
+htm=text/html
+html=text/html
+ice=x-conference/x-cooltalk
+ief=image/ief
+iges=model/iges
+igs=model/iges
+jpeg=image/jpeg
+jpe=image/jpeg
+jpg=image/jpeg
+bmp=image/bmp
+js=application/x-javascript
+kar=audio/midi
+latex=application/x-latex
+lha=application/octet-stream
+lzh=application/octet-stream
+man=application/x-troff-man
+me=application/x-troff-me
+mesh=model/mesh
+mid=audio/midi
+midi=audio/midi
+mif=application/vnd=mif
+mov=video/quicktime
+m4v=video/x-m4v
+m4a=audio/x-m4a
+movie=video/x-sgi-movie
+mp2=audio/mp2
+mp3=audio/mp3
+mpe=video/mpe
+mp4=video/mp4
+mpeg=video/mpeg
+mpg=video/mpeg
+mpg=video/mpg
+mpga=audio/mpga
+ms=application/x-troff-ms
+msh=model/mesh
+nc=application/x-netcdf
+oda=application/oda
+pbm=image/x-portable-bitmap
+pdb=chemical/x-pdb
+pdf=application/pdf
+pgm=image/x-portable-graymap
+pgn=application/x-chess-pgn
+png=image/png
+pnm=image/x-portable-anymap
+ppm=image/x-portable-pixmap
+ppt=application/ppt
+properties=text/plain
+ps=application/postscript
+qhtml=text/qhtml
+qt=video/quicktime
+ra=audio/x-realaudio
+ram=audio/x-pn-realaudio
+rm=audio/x-pn-realaudio
+ras=image/x-cmu-raster
+rgb=image/x-rgb
+roff=application/x-troff
+rpm=application/x-rpm
+rtf=application/rtf
+sgm=text/sgml
+sgml=text/sgml
+sh=application/x-sh
+shar=application/x-shar
+silo=model/mesh
+sit=application/x-stuffit
+skd=application/x-koan
+skm=application/x-koan
+skp=application/x-koan
+skt=application/x-koan
+smi=application/smil
+smil=application/smil
+snd=audio/basic
+spl=application/x-futuresplash
+src=application/x-wais-source
+sv4cpio=application/x-sv4cpio
+sv4crc=application/x-sv4crc
+swf=application/x-shockwave-flash
+t=application/x-troff
+tar=application/x-tar
+tcl=application/x-tcl
+tex=application/x-tex
+texi=application/x-texinfo
+texinfo=application/x-texinfo
+tgz=application/x-gzip
+tif=image/tiff
+tiff=image/tiff
+tr=application/x-troff
+tsv=text/tab-separated-values
+txt=text/plain
+odt=application/vnd.oasis.opendocument.text
+ods=application/vnd.oasis.opendocument.spreadsheet
+odp=application/vnd.oasis.opendocument.presentation
+odb=application/vnd.oasis.opendocument.database
+ustar=application/x-ustar
+vcd=application/x-cdlink
+vm=text/plain
+vrml=model/vrml
+wav=audio/x-wav
+wrl=model/vrml
+xbm=image/x-xbitmap
+xls=application/xls
+xml=text/xml
+xpdl=text/xml
+xpm=image/x-xpixmap
+xwd=image/x-xwindowdump
+xyz=chemical/x-pdb
+zip=application/zip
+rar=application/rar
+msg=application/vnd.ms-outlook
+flv=video/x-flv
+docx=application/vnd.openxmlformats-officedocument.wordprocessingml.document
+wpd=application/wordperfect
+wiki=text/x-wiki
+sxc=application/vnd.sun.xml.calc
+xlsx=application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
+csv=text/csv
+tsv=text/tab-separated-values
+sxi=application/vnd.sun.xml.impress
+pptx=application/vnd.openxmlformats-officedocument.presentationml.presentation
+odg=application/vnd.oasis.opendocument.graphics
+svg=image/svg+xml
+sxw=application/vnd.sun.xml.writer
\ No newline at end of file
Modified: epp/portal/branches/EPP_5_2_Branch/examples/portal/war/src/main/webapp/WEB-INF/conf/sample-portal/web/web-inf-extension-configuration.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/examples/portal/war/src/main/webapp/WEB-INF/conf/sample-portal/web/web-inf-extension-configuration.xml 2011-09-30 20:55:57 UTC (rev 7577)
+++ epp/portal/branches/EPP_5_2_Branch/examples/portal/war/src/main/webapp/WEB-INF/conf/sample-portal/web/web-inf-extension-configuration.xml 2011-10-01 16:14:30 UTC (rev 7578)
@@ -88,4 +88,22 @@
</init-params>
</component-plugin>
</external-component-plugins>
+ <external-component-plugins>
+ <target-component>org.exoplatform.upload.UploadService</target-component>
+ <component-plugin>
+ <name>MIME type Plugins for UploadService</name>
+ <set-method>register</set-method>
+ <type>org.exoplatform.upload.MimeTypeUploadPlugin</type>
+ <init-params>
+ <value-param>
+ <name>mimetype-path</name>
+ <value>war:/conf/mimetype/mimetypes.properties</value>
+ </value-param>
+ <value-param>
+ <name>mimetype-default</name>
+ <value>application/octet-stream</value>
+ </value-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
</configuration>
\ No newline at end of file
Modified: epp/portal/branches/EPP_5_2_Branch/testsuite/webuibasedsamples/src/main/webapp/WEB-INF/web.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/testsuite/webuibasedsamples/src/main/webapp/WEB-INF/web.xml 2011-09-30 20:55:57 UTC (rev 7577)
+++ epp/portal/branches/EPP_5_2_Branch/testsuite/webuibasedsamples/src/main/webapp/WEB-INF/web.xml 2011-10-01 16:14:30 UTC (rev 7578)
@@ -28,11 +28,12 @@
<servlet>
<servlet-name>GateInServlet</servlet-name>
<servlet-class>org.gatein.wci.api.GateInServlet</servlet-class>
+ <load-on-startup>0</load-on-startup>
</servlet>
+
<servlet-mapping>
<servlet-name>GateInServlet</servlet-name>
<url-pattern>/gateinservlet</url-pattern>
- <load-on-startup>0</load-on-startup>
</servlet-mapping>
<security-role>
Property changes on: epp/portal/branches/EPP_5_2_Branch/wsrp-integration
___________________________________________________________________
Modified: svn:mergeinfo
- /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/wsrp-integration:5868
/portal/branches/branch-GTNPORTAL-1592/wsrp-integration:4894
/portal/branches/branch-GTNPORTAL-1643/wsrp-integration:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/wsrp-integration:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/wsrp-integration:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/wsrp-integration:5765
/portal/branches/branch-GTNPORTAL-1790/wsrp-integration:5871
/portal/branches/branch-GTNPORTAL-1822/wsrp-integration:5943,5952
/portal/branches/branch-GTNPORTAL-1832/wsrp-integration:6030,6063
/portal/branches/branch-GTNPORTAL-1872/wsrp-integration:6400,6551
/portal/branches/branch-GTNPORTAL-1921/wsrp-integration:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/wsrp-integration:6904,6915-6916
/portal/branches/decoupled-webos/wsrp-integration:6214-6243
/portal/branches/gatein-management/wsrp-integration:6920-6958
/portal/branches/global-portlet-metadata/wsrp-integration:6298-6384
/portal/branches/site-describability/wsrp-integration:6171-6235
/portal/trunk/wsrp-integration:4876,4891,5269,5744,5822,5943,6168,6196,6201-6203,6205-6206,6223,6323,6437,6440,6449,6452,6573,6741,6783-6784,6912-6913,6960,7042,7061,7095,7117,7125,7132-7134,7186,7198,7239,7262,7308,7326,7331,7359,7367,7433,7454
+ /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/wsrp-integration:5868
/portal/branches/branch-GTNPORTAL-1592/wsrp-integration:4894
/portal/branches/branch-GTNPORTAL-1643/wsrp-integration:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/wsrp-integration:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/wsrp-integration:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/wsrp-integration:5765
/portal/branches/branch-GTNPORTAL-1790/wsrp-integration:5871
/portal/branches/branch-GTNPORTAL-1822/wsrp-integration:5943,5952
/portal/branches/branch-GTNPORTAL-1832/wsrp-integration:6030,6063
/portal/branches/branch-GTNPORTAL-1872/wsrp-integration:6400,6551
/portal/branches/branch-GTNPORTAL-1921/wsrp-integration:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/wsrp-integration:6904,6915-6916
/portal/branches/decoupled-webos/wsrp-integration:6214-6243
/portal/branches/gatein-management/wsrp-integration:6920-6958
/portal/branches/global-portlet-metadata/wsrp-integration:6298-6384
/portal/branches/site-describability/wsrp-integration:6171-6235
/portal/trunk/wsrp-integration:4876,4891,5269,5744,5822,5943,6168,6196,6201-6203,6205-6206,6223,6323,6437,6440,6449,6452,6573,6741,6783-6784,6912-6913,6960,7042,7061,7095,7117,7125,7132-7134,7186,7198,7239,7262,7308,7326,7331,7359,7367,7433,7452,7454,7478
13 years, 2 months