JBoss Portal SVN: r13609 - in branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests: src/org/jboss/portal/test/selenium and 1 other directory.
by portal-commits@lists.jboss.org
Author: mposolda(a)redhat.com
Date: 2009-07-28 18:28:07 -0400 (Tue, 28 Jul 2009)
New Revision: 13609
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/build.xml
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java
Log:
Refactoring for selenium https test.
Modified: branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/build.xml
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/build.xml 2009-07-28 14:57:57 UTC (rev 13608)
+++ branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/build.xml 2009-07-28 22:28:07 UTC (rev 13609)
@@ -39,7 +39,7 @@
<!-- Default properties for single-test-without-dependencies -->
<property name="suite.test.name" value="Ant test" />
- <property name="browserURL" value="http://localhost:8080/portal/" />
+ <property name="browser.url" value="http://localhost:8080/portal/" />
<path id="jboss.test.classpath">
<pathelement path="${jboss.test.jar}" />
@@ -114,6 +114,13 @@
</target>
<target name="run-src">
+ <!-- Only one call is performed -->
+ <antcall target="run-src-without-ssl" />
+ <antcall target="run-src-with-ssl" />
+ </target>
+
+ <!-- RUNNING SELENIUM SERVER FOR NORMAL TESTING -->
+ <target name="run-src-without-ssl" unless="https.flag">
<echo message="Starting Selenium Remote Control" />
<java jar="${selsrv.dir}/selenium-server.jar" fork="true" spawn="true">
<arg value="-multiWindow" />
@@ -126,15 +133,18 @@
<arg value="-debug" />
<arg value="-userExtensions" />
<arg value="${selsrv.dir}/user-extensions.js" />
- </java>
+ </java>
<sleep seconds="20" />
</target>
- <target name="run-src-with-ssl">
- <echo message="Starting Selenium Remote Control with usage of HTTPS" />
+ <!-- RUNNING SELENIUM SERVER FOR HTTPS TESTING -->
+ <target name="run-src-with-ssl" if="https.flag">
+ <echo message="Starting Selenium Remote Control for testing with HTTPS" />
<java jar="${selsrv.dir}/selenium-server.jar" fork="true" spawn="true">
<arg value="-trustAllSSLCertificates" />
<arg value="-multiWindow" />
+ <arg value="-timeout" />
+ <arg value="320000" />
<arg value="-port" />
<arg value="44444" />
<arg value="-log" />
@@ -143,10 +153,10 @@
<arg value="-firefoxProfileTemplate" />
<arg value="${selsrv.dir}/https-testing/localhost/SSLFirefoxProfile" />
<arg value="-userExtensions" />
- <arg value="${selsrv.dir}/user-extensions.js" />
+ <arg value="${selsrv.dir}/user-extensions.js" />
</java>
<sleep seconds="20" />
- </target>
+ </target>
<target name="stop-src">
<get taskname="selenium-shutdown" src="http://localhost:44444/selenium-server/driver/?cmd=shutDown" dest="result.txt" ignoreerrors="true" />
@@ -206,8 +216,6 @@
</target>
<target name="selenium-suite" depends="init, compile, run-src, copyApps, create-test-files">
- <echo message="Runing TestNG" />
-
<mkdir dir="test-output" />
<mkdir dir="debug" />
<testng classpathref="test.cp" sourcedir="${test.src.dir}" outputdir="${testng.output.dir}" suitename="SeleniumSuite">
@@ -215,6 +223,7 @@
<xmlfileset dir="." includes="${user.suite}" />
<sysproperty key="browser" value="${browser}" />
+ <sysproperty key="browser.url" value="${browser.url}" />
<sysproperty key="screenshot" value="${screenshot}" />
<sysproperty key="debug" value="${debug}" />
<sysproperty key="workspace" value="${workspace}" />
@@ -238,6 +247,7 @@
<xmlfileset dir="." includes="${test.suite}" />
<sysproperty key="browser" value="${browser}" />
+ <sysproperty key="browser.url" value="${browser.url}" />
<sysproperty key="screenshot" value="${screenshot}" />
<sysproperty key="debug" value="${debug}" />
<sysproperty key="workspace" value="${workspace}" />
@@ -261,6 +271,7 @@
<classfileset dir="${test.build.dir}" includes="${testname}" />
<sysproperty key="browser" value="${browser}" />
+ <sysproperty key="browser.url" value="${browser.url}" />
<sysproperty key="screenshot" value="${screenshot}" />
<sysproperty key="debug" value="${debug}" />
<sysproperty key="workspace" value="${workspace}" />
@@ -283,7 +294,7 @@
<classfileset dir="${test.build.dir}" includes="${testname}" />
<sysproperty key="browser" value="${browser}" />
- <sysproperty key="browserURL" value="${browserURL}" />
+ <sysproperty key="browser.url" value="${browser.url}" />
<sysproperty key="screenshot" value="${screenshot}" />
<sysproperty key="debug" value="${debug}" />
<sysproperty key="workspace" value="${workspace}" />
@@ -305,6 +316,7 @@
<xmlfileset dir="." includes="${test.suite}" />
<sysproperty key="browser" value="${browser}" />
+ <sysproperty key="browser.url" value="${browser.url}" />
<sysproperty key="screenshot" value="${screenshot}" />
<sysproperty key="debug" value="${debug}" />
<sysproperty key="workspace" value="${workspace}" />
@@ -328,6 +340,7 @@
<xmlfileset dir="." includes="${test.cms.suite}" />
<sysproperty key="browser" value="${browser}" />
+ <sysproperty key="browser.url" value="${browser.url}" />
<sysproperty key="screenshot" value="${screenshot}" />
<sysproperty key="debug" value="${debug}" />
<sysproperty key="workspace" value="${workspace}" />
@@ -352,6 +365,7 @@
<xmlfileset dir="." includes="${usecase.suite}" />
<sysproperty key="browser" value="${browser}" />
+ <sysproperty key="browser.url" value="${browser.url}" />
<sysproperty key="screenshot" value="${screenshot}" />
<sysproperty key="debug" value="${debug}" />
<sysproperty key="workspace" value="${workspace}" />
Modified: branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2009-07-28 14:57:57 UTC (rev 13608)
+++ branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2009-07-28 22:28:07 UTC (rev 13609)
@@ -76,7 +76,7 @@
ELEM_TIMEOUT = Integer.valueOf(getMess("selenium.timeout.elem", String.valueOf(ELEM_TIMEOUT+"")));
String browser = System.getProperty("browser");
- String browserURL = System.getProperty("browserURL");
+ String browserURL = System.getProperty("browser.url");
if ((browserURL == null) || ("".equals(browserURL))) {
browserURL = "http://localhost:8080/portal/";
}
16 years, 9 months
JBoss Portal SVN: r13608 - in jbossexo/branches: security-integration-sandbox and 91 other directories.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2009-07-28 10:57:57 -0400 (Tue, 28 Jul 2009)
New Revision: 13608
Added:
jbossexo/branches/security-integration-sandbox/
jbossexo/branches/security-integration-sandbox/portal/
jbossexo/branches/security-integration-sandbox/portal/trunk/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/.classpath
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/.project
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/.settings/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/.settings/org.eclipse.jdt.core.prefs
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/pom.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/conf/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/conf/configuration.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/conf/portal/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/conf/portal/configuration.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/conf/portal/model-nodetypes.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/application/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/application/PortletPreferences.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/application/Preference.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/application/ResourceBundleDelegateImpl.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/application/UserGadgetStorage.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/application/jcr/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/application/jcr/PortletPreferencesPersisterImpl.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/application/jcr/UserGadgetStorageImpl.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/DataStorage.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/GroupPortalConfigListener.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfig.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/PageTemplateConfig.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/PortalACLPlugin.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/Query.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/RemoveGroupPortalConfigListener.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/RemoveUserPortalConfigListener.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserACL.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserACLMetaData.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfig.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigListener.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/jcr/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/jcr/DataMapper.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/jcr/DataStorageImpl.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/jcr/DataStorageListAccess.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/jcr/JCRDataStorageListAccess.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/Application.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/Container.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/Page.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageBody.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNavigation.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNode.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PortalConfig.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PortalProperties.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/Properties.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/JibxArraySerialize.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/JibxPropertiesMapper.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/layout/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/layout/PortalLayoutService.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/layout/jcr/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/layout/jcr/DataMapper.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/layout/jcr/PortalLayoutServiceImpl.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/portlet/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/portlet/LogPortletExceptionListener.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/portlet/PortletExceptionHandleService.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/portlet/PortletExceptionListener.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/portlet/jcr/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/Codec.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/CompositeResourceResolver.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/CompositeSkin.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/MainResourceResolver.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/RenderingException.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/Resource.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/ResourceRenderer.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/ResourceResolver.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SimpleResourceContext.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SimpleSkin.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/Skin.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SkinConfig.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SkinKey.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SkinService.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SkinURL.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/widget/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/widget/jcr/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/resources/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/resources/binding.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/common-configuration.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/database-configuration.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/jcr-configuration.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/model-nodetypes.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/repository-configuration.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/container.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/containers/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/containers/four-columns/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/containers/four-columns/container.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/containers/one-column/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/containers/one-column/container.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/containers/three-columns/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/containers/three-columns/container.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/containers/two-columns/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/containers/two-columns/container.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/dashboard/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/dashboard/page.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/dashboard/portlet-preferences.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/empty/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/empty/page.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/empty/portlet-preferences.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/one-row-two-columns/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/one-row-two-columns/page.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/one-row-two-columns/portlet-preferences.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-columns/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-columns/page.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-columns/portlet-preferences.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-rows-two-columns/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-rows-two-columns/page.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-rows-two-columns/portlet-preferences.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-rows/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-rows/page.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-rows/portlet-preferences.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-tabs/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-tabs/page.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-tabs/portlet-preferences.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-columns-one-row/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-columns-one-row/page.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-columns-one-row/portlet-preferences.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-columns/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-columns/page.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-columns/portlet-preferences.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-rows/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-rows/page.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-rows/portlet-preferences.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-tabs/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-tabs/page.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-tabs/portlet-preferences.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/test-configuration.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestJIBXXmlMapping.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/UserPortalServiceTestBase.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/AbstractTestSharedPageACL.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/AbstractTestUserACL.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestCreatePortalACL.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestGroupNavACL.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestGroupPageACL.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestPortalConfigACL.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestPortalNavACL.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestPortalPageACL.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestUserNavACL.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestUserPageACL.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/jboss/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/jboss/OwnerType.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/jboss/TestJBossAuthzIntegration.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/jboss/TestOwnerTypeRules.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/jboss/TestPageNavSecurityRules.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/jboss/TestPageSecurityRules.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/jboss/TestPortalConfigSecurityRules.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/layout/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/layout/TestPortalLayoutService.java
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/organization/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/organization/management/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/organization/management/executive-board/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/organization/management/executive-board/navigation.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/organization/management/executive-board/pages.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/organization/management/executive-board/portlet-preferences.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/administrators/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/administrators/navigation.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/administrators/pages.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/administrators/portlet-preferences.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/guests/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/guests/navigation.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/guests/pages.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/guests/portlet-preferences.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/users/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/users/navigation.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/users/pages.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/users/portlet-preferences.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/classic/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/classic/navigation.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/classic/pages.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/classic/portal.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/classic/portlet-preferences.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/template/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/template/classic/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/template/classic/navigation.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/template/classic/pages.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/template/classic/portal.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/template/classic/portlet-preferences.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/container.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/containers/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/containers/four-columns/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/containers/four-columns/container.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/containers/one-column/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/containers/one-column/container.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/containers/three-columns/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/containers/three-columns/container.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/containers/two-columns/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/containers/two-columns/container.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/dashboard/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/dashboard/page.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/dashboard/portlet-preferences.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/empty/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/empty/page.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/empty/portlet-preferences.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/one-row-two-columns/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/one-row-two-columns/page.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/one-row-two-columns/portlet-preferences.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-columns/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-columns/page.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-columns/portlet-preferences.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-rows-two-columns/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-rows-two-columns/page.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-rows-two-columns/portlet-preferences.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-rows/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-rows/page.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-rows/portlet-preferences.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-tabs/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-tabs/page.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-tabs/portlet-preferences.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-columns-one-row/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-columns-one-row/page.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-columns-one-row/portlet-preferences.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-columns/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-columns/page.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-columns/portlet-preferences.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-rows/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-rows/page.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-rows/portlet-preferences.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-tabs/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-tabs/page.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-tabs/portlet-preferences.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/demo/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/demo/navigation.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/demo/pages.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/john/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/john/navigation.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/john/pages.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/marry/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/marry/navigation.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/marry/pages.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/root/
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/root/navigation.xml
jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/root/pages.xml
Log:
security integration sandbox
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/.classpath
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/.classpath (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/.classpath 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**/*.java" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/javax/activation/activation/1.1/activation-1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/javax/ccpp/ccpp/1.0/ccpp-1.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/javax/resource/connector-api/1.5/connector-api-1.5.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/javax/ejb/ejb/2.1/ejb-2.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/javax/jcr/jcr/1.0/jcr-1.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/javax/faces/jsf-api/1.2/jsf-api-1.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/javax/servlet/jsp-api/2.0/jsp-api-2.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/javax/ws/rs/jsr311-api/1.0/jsr311-api-1.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/javax/mail/mail/1.4/mail-1.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/javax/portlet/portlet-api/2.0/portlet-api-2.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/javax/xml/stream/stax-api/1.0/stax-api-1.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/jboss/security/authz/agent/trunk-SNAPSHOT/agent-trunk-SNAPSHOT.jar" sourcepath="M2_REPO_EXO/org/jboss/security/authz/agent/trunk-SNAPSHOT/agent-trunk-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/apache/ant/ant/1.7.0/ant-1.7.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/apache/ant/ant-launcher/1.7.0/ant-launcher-1.7.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/antlr/antlr/2.7.6rc1/antlr-2.7.6rc1.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/aopalliance/aopalliance/1.0/aopalliance-1.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/asm/asm/1.5.3/asm-1.5.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/bcel/bcel/5.1/bcel-5.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/bouncycastle/bcmail-jdk14/136/bcmail-jdk14-136.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/bouncycastle/bcprov-jdk14/136/bcprov-jdk14-136.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/c3p0/c3p0/0.9.1.2/c3p0-0.9.1.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/caja/caja/r3375/caja-r3375.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/objectweb/carol/carol/2.0.5/carol-2.0.5.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/cglib/cglib/2.1_3/cglib-2.1_3.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/jboss/security/authz/common-api/trunk-SNAPSHOT/common-api-trunk-SNAPSHOT.jar" sourcepath="M2_REPO_EXO/org/jboss/security/authz/common-api/trunk-SNAPSHOT/common-api-trunk-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/commons-beanutils/commons-beanutils-core/1.7.0/commons-beanutils-core-1.7.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/commons-betwixt/commons-betwixt/0.8/commons-betwixt-0.8.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/commons-chain/commons-chain/1.0/commons-chain-1.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/commons-codec/commons-codec/1.2/commons-codec-1.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/commons-collections/commons-collections/3.1/commons-collections-3.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/commons-dbcp/commons-dbcp/1.2.1/commons-dbcp-1.2.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/commons-digester/commons-digester/1.6/commons-digester-1.6.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/commons-fileupload/commons-fileupload/1.0/commons-fileupload-1.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/commons-io/commons-io/1.4/commons-io-1.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/commons-lang/commons-lang/2.4/commons-lang-2.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/commons-pool/commons-pool/1.2/commons-pool-1.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/concurrent/concurrent/1.3.4/concurrent-1.3.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/jboss/security/authz/core-components-api/trunk-SNAPSHOT/core-components-api-trunk-SNAPSHOT.jar" sourcepath="M2_REPO_EXO/org/jboss/security/authz/core-components-api/trunk-SNAPSHOT/core-components-api-trunk-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/wutka-dtdparser/dtdparser121/1.2.1/dtdparser121-1.2.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/ehcache/ehcache/1.1/ehcache-1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/net/sf/ehcache/ehcache/1.6.0/ehcache-1.6.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/exoplatform/core/exo.core.component.database/2.2.2/exo.core.component.database-2.2.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/exoplatform/core/exo.core.component.document/2.2.2/exo.core.component.document-2.2.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/exoplatform/core/exo.core.component.organization.api/2.2.2/exo.core.component.organization.api-2.2.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/exoplatform/core/exo.core.component.organization.jdbc/2.2.2/exo.core.component.organization.jdbc-2.2.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/exoplatform/core/exo.core.component.script.groovy/2.2.2/exo.core.component.script.groovy-2.2.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/exoplatform/core/exo.core.component.security.core/2.2.2/exo.core.component.security.core-2.2.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/exoplatform/core/exo.core.component.xml-processing/2.2.2/exo.core.component.xml-processing-2.2.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/exoplatform/jcr/exo.jcr.component.core/1.11.2/exo.jcr.component.core-1.11.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/exoplatform/jcr/exo.jcr.component.ext/1.11.2/exo.jcr.component.ext-1.11.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/exoplatform/kernel/exo.kernel.commons/2.1.2/exo.kernel.commons-2.1.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/exoplatform/kernel/exo.kernel.component.cache/2.1.2/exo.kernel.component.cache-2.1.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/exoplatform/kernel/exo.kernel.component.command/2.1.2/exo.kernel.component.command-2.1.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/exoplatform/kernel/exo.kernel.component.common/2.1.2/exo.kernel.component.common-2.1.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/exoplatform/kernel/exo.kernel.component.remote/2.1.2/exo.kernel.component.remote-2.1.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/exoplatform/kernel/exo.kernel.container/2.1.2/exo.kernel.container-2.1.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/exoplatform/portletcontainer/exo.pc.component.common/2.1.2-SNAPSHOT/exo.pc.component.common-2.1.2-SNAPSHOT.jar" sourcepath="M2_REPO_EXO/org/exoplatform/portletcontainer/exo.pc.component.common/2.1.2-SNAPSHOT/exo.pc.component.common-2.1.2-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/exoplatform/portletcontainer/exo.pc.component.core/2.1.2-SNAPSHOT/exo.pc.component.core-2.1.2-SNAPSHOT.jar" sourcepath="M2_REPO_EXO/org/exoplatform/portletcontainer/exo.pc.component.core/2.1.2-SNAPSHOT/exo.pc.component.core-2.1.2-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/exoplatform/portletcontainer/exo.pc.component.plugins.pc/2.1.2-SNAPSHOT/exo.pc.component.plugins.pc-2.1.2-SNAPSHOT.jar" sourcepath="M2_REPO_EXO/org/exoplatform/portletcontainer/exo.pc.component.plugins.pc/2.1.2-SNAPSHOT/exo.pc.component.plugins.pc-2.1.2-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/exoplatform/portal/exo.portal.component.scripting/2.6-SNAPSHOT/exo.portal.component.scripting-2.6-SNAPSHOT.jar" sourcepath="M2_REPO_EXO/org/exoplatform/portal/exo.portal.component.scripting/2.6-SNAPSHOT/exo.portal.component.scripting-2.6-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/exoplatform/portal/exo.portal.component.web/2.6-SNAPSHOT/exo.portal.component.web-2.6-SNAPSHOT.jar" sourcepath="M2_REPO_EXO/org/exoplatform/portal/exo.portal.component.web/2.6-SNAPSHOT/exo.portal.component.web-2.6-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/exoplatform/portal/exo.portal.component.xml-parser/2.6-SNAPSHOT/exo.portal.component.xml-parser-2.6-SNAPSHOT.jar" sourcepath="M2_REPO_EXO/org/exoplatform/portal/exo.portal.component.xml-parser/2.6-SNAPSHOT/exo.portal.component.xml-parser-2.6-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/exoplatform/tool/exo.tool.framework.junit/1.0.0/exo.tool.framework.junit-1.0.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/exoplatform/ws/exo.ws.commons/2.0.2/exo.ws.commons-2.0.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/exoplatform/ws/exo.ws.frameworks.json/2.0.2/exo.ws.frameworks.json-2.0.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/exoplatform/ws/exo.ws.rest.core/2.0.2/exo.ws.rest.core-2.0.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/exoplatform/ws/exo.ws.rest.ext/2.0.2/exo.ws.rest.ext-2.0.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/net/sf/ezmorph/ezmorph/1.0.4/ezmorph-1.0.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/fontbox/fontbox/0.1.0/fontbox-0.1.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/com/google/collections/google-collections/1.0-rc2/google-collections-1.0-rc2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/codehaus/groovy/groovy-all/1.5.7/groovy-all-1.5.7.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/com/google/code/guice/guice/2.0/guice-2.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/hibernate/hibernate/3.1.2/hibernate-3.1.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/howl/howl-logger/0.1.11/howl-logger-0.1.11.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/hsqldb/hsqldb/1.8.0.7/hsqldb-1.8.0.7.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/nu/validator/htmlparser/htmlparser/1.0.7/htmlparser-1.0.7.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/htmlparser/htmlparser/1.6/htmlparser-1.6.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/com/ibm/icu/icu4j/3.8/icu4j-3.8.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/com/lowagie/itext/2.1.0/itext-2.1.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/sun-jaxb/jaxb-api/2.1.4/jaxb-api-2.1.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/com/sun/xml/bind/jaxb-impl/2.1.7/jaxb-impl-2.1.7.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/jboss/jboss-common-core/2.2.9.GA/jboss-common-core-2.2.9.GA.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/jboss/microcontainer/jboss-dependency/2.0.2.GA/jboss-dependency-2.0.2.GA.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/jboss/microcontainer/jboss-kernel/2.0.2.GA/jboss-kernel-2.0.2.GA.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/jboss/jboss-mdr/2.0.1.GA/jboss-mdr-2.0.1.GA.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/jboss/jboss-reflect/2.0.2.GA/jboss-reflect-2.0.2.GA.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/jboss/jbossxb/2.0.0.GA/jbossxb-2.0.0.GA.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/jdom/jdom/1.0/jdom-1.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/jempbox/jempbox/0.2.0/jempbox-0.2.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/jgroups/jgroups/2.5.2/jgroups-2.5.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/jibx/jibx-bind/1.1.6a/jibx-bind-1.1.6a.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/jibx/jibx-extras/1.1.6a/jibx-extras-1.1.6a.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/jibx/jibx-run/1.1.6a/jibx-run-1.1.6a.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/jline/jline/0.9.94/jline-0.9.94.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/jmock/jmock/1.0.1/jmock-1.0.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/joda-time/joda-time/1.6/joda-time-1.6.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/jotm/jotm/2.0.10/jotm-2.0.10.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/jotm/jotm_jrmp_stubs/2.0.10/jotm_jrmp_stubs-2.0.10.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/rhino/js/1.6R5/js-1.6R5.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/json/json/20070829/json-20070829.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/net/sf/json-lib/json-lib/2.2.2/json-lib-2.2.2-jdk15.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/caja/json_simple/r1/json_simple-r1.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/jtidy/jtidy/4aug2000r7-dev/jtidy-4aug2000r7-dev.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/de/odysseus/juel/juel-api/2.1.2/juel-api-2.1.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/de/odysseus/juel/juel-impl/2.1.2/juel-impl-2.1.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/junit/junit/3.8.2/junit-3.8.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/log4j/log4j/1.2.14/log4j-1.2.14.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/apache/lucene/lucene-core/2.2.0/lucene-core-2.2.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/apache/lucene/lucene-memory/2.2.0/lucene-memory-2.2.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/apache/lucene/lucene-spellchecker/2.2.0/lucene-spellchecker-2.2.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/net/sourceforge/nekohtml/nekohtml/1.9.12/nekohtml-1.9.12.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/net/oauth/core/oauth/20090531/oauth-20090531.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/net/oauth/core/oauth-consumer/20090531/oauth-consumer-20090531.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/net/oauth/core/oauth-httpclient3/20090531/oauth-httpclient3-20090531.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/pdfbox/pdfbox/0.7.3/pdfbox-0.7.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/picocontainer/picocontainer/1.1/picocontainer-1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/apache/poi/poi/3.0.2-FINAL/poi-3.0.2-FINAL.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/apache/poi/poi-scratchpad/3.0.2-FINAL/poi-scratchpad-3.0.2-FINAL.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/jboss/security/authz/policy-server/trunk-SNAPSHOT/policy-server-trunk-SNAPSHOT.jar" sourcepath="M2_REPO_EXO/org/jboss/security/authz/policy-server/trunk-SNAPSHOT/policy-server-trunk-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/quartz/quartz/1.5.0-RC2/quartz-1.5.0-RC2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/rome/rome/0.9/rome-0.9.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/apache/sanselan/sanselan/0.97-incubator/sanselan-0.97-incubator.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/apache/shindig/shindig-common/SNAPSHOT-r790473/shindig-common-SNAPSHOT-r790473.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/apache/shindig/shindig-gadgets/SNAPSHOT-r790473/shindig-gadgets-SNAPSHOT-r790473.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/com/sun/xml/stream/sjsxp/1.0/sjsxp-1.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/slf4j/slf4j-api/1.5.6/slf4j-api-1.5.6.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/slf4j/slf4j-log4j12/1.5.6/slf4j-log4j12-1.5.6.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/slf4j/slf4j-simple/1.5.6/slf4j-simple-1.5.6.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/stax/stax-api/1.0/stax-api-1.0.jar"/>
+ <classpathentry kind="lib" path="/home/soshah/projects/jboss-portal/exo/trunk/jdk1.5/lib/tools.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/org/apache/ws/commons/ws-commons-util/1.0.1/ws-commons-util-1.0.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/com/experlog/xapool/1.5.0/xapool-1.5.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/xdoclet/xdoclet/1.2.3/xdoclet-1.2.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/xdoclet/xdoclet-hibernate-module/1.2.3/xdoclet-hibernate-module-1.2.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/xdoclet/xdoclet-xdoclet-module/1.2/xdoclet-xdoclet-module-1.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/xerces/xerces/2.0.2/xerces-2.0.2.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/apache-xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/xdoclet/xjavadoc/1.0.3/xjavadoc-1.0.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/apache-xerces/xml-apis/2.9.1/xml-apis-2.9.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/xml-apis/xml-apis/1.3.04/xml-apis-1.3.04.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/xml-resolver/xml-resolver/1.1/xml-resolver-1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/xpp3/xpp3/1.1.3.4.O/xpp3-1.1.3.4.O.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO_EXO/xstream/xstream/1.0.2/xstream-1.0.2.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="eclipse-bin"/>
+</classpath>
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/.project
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/.project (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/.project 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,13 @@
+<projectDescription>
+ <name>exo.portal.component.portal</name>
+ <comment>eXo Portal Data</comment>
+ <projects/>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/.settings/org.eclipse.jdt.core.prefs 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,5 @@
+#Fri Jul 24 22:40:23 CDT 2009
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/pom.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/pom.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/pom.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,227 @@
+<project>
+ <parent>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>config</artifactId>
+ <version>2.6-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>exo.portal.component.portal</artifactId>
+ <packaging>jar</packaging>
+ <name>eXo Portal Data</name>
+ <url>http://www.exoplatform.org</url>
+ <description>eXo Portal Data</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.exoplatform.core</groupId>
+ <artifactId>exo.core.component.organization.jdbc</artifactId>
+ <version>${org.exoplatform.core.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>exo.jcr.component.ext</artifactId>
+ <version>${org.exoplatform.jcr.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.exoplatform.portletcontainer</groupId>
+ <artifactId>exo.pc.component.plugins.pc</artifactId>
+ <version>${org.exoplatform.pc.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.web</artifactId>
+ <version>2.6-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Add JBoss Authz dependencies here -->
+ <dependency>
+ <groupId>org.jboss.security.authz</groupId>
+ <artifactId>common-api</artifactId>
+ <version>trunk-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.security.authz</groupId>
+ <artifactId>core-components-api</artifactId>
+ <version>trunk-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.security.authz</groupId>
+ <artifactId>agent</artifactId>
+ <version>trunk-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.security.authz</groupId>
+ <artifactId>policy-server</artifactId>
+ <version>trunk-SNAPSHOT</version>
+ </dependency>
+ <!-- sun jaxb -->
+ <dependency>
+ <groupId>sun-jaxb</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.1.4</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>sun-jaxb</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.1.4</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>sun-jaxb</groupId>
+ <artifactId>jaxb-xjc</artifactId>
+ <version>2.1.4</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- sun jaf -->
+ <dependency>
+ <groupId>sun-jaf</groupId>
+ <artifactId>activation</artifactId>
+ <version>1.1</version>
+ </dependency>
+
+ <!-- jboss xacml -->
+ <dependency>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jboss-xacml</artifactId>
+ <version>2.0.3-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jboss-sunxacml</artifactId>
+ <version>2.0.3-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ <!-- Drools -->
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-core</artifactId>
+ <version>4.0.7</version>
+ <scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-compiler</artifactId>
+ <version>4.0.7</version>
+ <scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.mvel</groupId>
+ <artifactId>mvel</artifactId>
+ <version>1.3.1-java1.4</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.antlr</groupId>
+ <artifactId>antlr-runtime</artifactId>
+ <version>3.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-kernel</artifactId>
+ <version>2.0.2.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-dependency</artifactId>
+ <version>2.0.2.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-reflect</artifactId>
+ <version>2.0.2.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ <version>2.2.9.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-mdr</artifactId>
+ <version>2.0.1.GA</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jibx</groupId>
+ <artifactId>maven-jibx-plugin</artifactId>
+ <version>1.1.6a</version>
+ <configuration>
+ <directory>src/main/resources</directory>
+ <includes>
+ <includes>binding.xml</includes>
+ </includes>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>bind</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!-- TODO: remove this -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <repositories>
+ <repository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <layout>default</layout>
+ <url>http://repository.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshots Repository</name>
+ <layout>default</layout>
+ <url>http://snapshots.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </repository>
+ </repositories>
+</project>
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/conf/configuration.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/conf/configuration.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/conf/configuration.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<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">
+ <component>
+ <type>org.exoplatform.portal.skin.SkinService</type>
+ </component>
+
+</configuration>
Property changes on: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/conf/configuration.xml
___________________________________________________________________
Name: svn:executable
+
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/conf/portal/configuration.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/conf/portal/configuration.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/conf/portal/configuration.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<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">
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.registry.RegistryService</type>
+ <init-params>
+ <properties-param>
+ <name>locations</name>
+ <property name="repository" value="system"/>
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.portletcontainer.persistence.PortletPreferencesPersister</key>
+ <type>org.exoplatform.portal.application.jcr.PortletPreferencesPersisterImpl</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.portal.config.DataStorage</key>
+ <type>org.exoplatform.portal.config.jcr.DataStorageImpl</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.portal.application.UserGadgetStorage</key>
+ <type>org.exoplatform.portal.application.jcr.UserGadgetStorageImpl</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.portal.layout.PortalLayoutService</key>
+ <type>org.exoplatform.portal.layout.jcr.PortalLayoutServiceImpl</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.portal.config.UserACL</key>
+ <type>org.exoplatform.portal.config.UserACL</type>
+ <init-params>
+ <value-param>
+ <name>super.user</name>
+ <description>administrator</description>
+ <value>root</value>
+ </value-param>
+ <value-param>
+ <name>guests.group</name>
+ <description>guests group</description>
+ <value>/platform/guests</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.portletcontainer.bundle.ResourceBundleDelegate</key>
+ <type>org.exoplatform.portal.application.ResourceBundleDelegateImpl</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.portal.config.UserPortalConfigService</key>
+ <type>org.exoplatform.portal.config.UserPortalConfigService</type>
+ <init-params>
+ <value-param>
+ <name>default.user</name>
+ <description>If user configs are null, user configs will load configs from this default user</description>
+ <value>site</value>
+ </value-param>
+ <value-param>
+ <name>templateLocation</name>
+ <value>war:/conf/users</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.exoplatform.portal.portlet.PortletExceptionHandleService</type>
+ <component-plugins>
+ <component-plugin>
+ <name>init.service.listener</name>
+ <set-method>initListener</set-method>
+ <type>org.exoplatform.portal.portlet.LogPortletExceptionListener</type>
+ </component-plugin>
+ </component-plugins>
+ </component>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.jcr.RepositoryService</target-component>
+ <component-plugin>
+ <name>add.nodeType</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
+ <init-params>
+ <values-param>
+ <name>autoCreatedInNewRepository</name>
+ <value>jar:/conf/portal/model-nodetypes.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.organization.OrganizationService</target-component>
+
+ <component-plugin>
+ <name>user.portal.config.listener</name>
+ <set-method>addListenerPlugin</set-method>
+ <type>org.exoplatform.portal.config.UserPortalConfigListener</type>
+ </component-plugin>
+
+ <component-plugin>
+ <name>group.portal.config.listener</name>
+ <set-method>addListenerPlugin</set-method>
+ <type>org.exoplatform.portal.config.GroupPortalConfigListener</type>
+ </component-plugin>
+
+ </external-component-plugins>
+</configuration>
+
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/conf/portal/model-nodetypes.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/conf/portal/model-nodetypes.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/conf/portal/model-nodetypes.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,15 @@
+<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
+ xmlns:jcr="http://www.jcp.org/jcr/1.0">
+
+ <nodeType name="exo:gadget" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:unstructured</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <!--propertyDefinition name="data" requiredType="Binary" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition-->
+ </propertyDefinitions>
+ </nodeType>
+
+</nodeTypes>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/application/PortletPreferences.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/application/PortletPreferences.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/application/PortletPreferences.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.application;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.exoplatform.services.portletcontainer.pci.model.ExoPortletPreferences;
+/**
+ * Jun 9, 2004
+ * @author: Tuan Nguyen
+ * @email: tuan08(a)users.sourceforge.net
+ * @version: $Id: ExoPortletPreferences.java,v 1.1 2004/07/13 02:31:13 tuan08 Exp $
+ */
+public class PortletPreferences {
+
+ private String windowId;
+ private String ownerType;
+ private String ownerId;
+
+ private String preferencesValidator ;
+
+ private ArrayList<Preference> preferences ;
+
+ public PortletPreferences() { }
+
+ public PortletPreferences(ExoPortletPreferences prefs) {
+ preferencesValidator = prefs.getPreferencesValidator() ;
+ if(prefs.size() < 1) return;
+ preferences = new ArrayList<Preference>(prefs.size() + 2) ;
+ Iterator i = prefs.values().iterator() ;
+ while(i.hasNext()) {
+ org.exoplatform.services.portletcontainer.pci.model.Preference pref =
+ (org.exoplatform.services.portletcontainer.pci.model.Preference )i.next() ;
+ Preference tmp = new Preference() ;
+
+ tmp.setName(pref.getName()) ;
+ tmp.setReadOnly(pref.isReadOnly()) ;
+ List values = pref.getValues() ;
+ if(values == null) continue;
+ for(int j = 0; j < values.size(); j++) {
+ if(values.get(j) == null) continue;
+ tmp.addValue((String)values.get(j)) ;
+ }
+ preferences.add(tmp) ;
+ }
+ }
+
+ public String getWindowId() { return windowId ; }
+ public void setWindowId(String s) { windowId = s ;}
+
+ public String getPreferencesValidator() { return preferencesValidator; }
+ public void setPreferencesValidator(String validator) { preferencesValidator = validator; }
+
+ public ArrayList<Preference> getPreferences() { return preferences ; }
+ public void setPreferences(ArrayList<Preference> l) { preferences = l ; }
+
+ public String getOwnerId() { return ownerId; }
+ public void setOwnerId(String ownerId) { this.ownerId = ownerId; }
+
+ public String getOwnerType() { return ownerType; }
+ public void setOwnerType(String ownerType) { this.ownerType = ownerType; }
+
+ public ExoPortletPreferences toExoPortletPreferences() {
+ ExoPortletPreferences prefs = new ExoPortletPreferences() ;
+ prefs.setPreferencesValidator(preferencesValidator) ;
+ if(preferences == null) return prefs;
+ for(int i = 0 ; i < preferences.size(); i++) {
+ Preference pref = preferences.get(i) ;
+ org.exoplatform.services.portletcontainer.pci.model.Preference tmp =
+ new org.exoplatform.services.portletcontainer.pci.model.Preference() ;
+ tmp.setName(pref.getName()) ;
+ tmp.setReadOnly(pref.isReadOnly()) ;
+ List values = pref.getValues() ;
+ if(values != null) {
+ for(int j = 0; j < values.size(); j++) {
+ tmp.addValue((String)values.get(j)) ;
+ }
+ }
+ prefs.addPreference(tmp) ;
+ }
+ return prefs ;
+ }
+
+ static public class PortletPreferencesSet {
+ private ArrayList<PortletPreferences> portlets ;
+
+ public ArrayList<PortletPreferences> getPortlets() { return portlets ; }
+ public void setPortlets(ArrayList<PortletPreferences> list) { portlets = list ; }
+ }
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/application/Preference.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/application/Preference.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/application/Preference.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.application;
+
+import java.util.ArrayList;
+import java.util.List;
+/**
+ * Created by The eXo Platform SARL
+ * Author : Mestrallet Benjamin
+ * benjmestrallet(a)users.sourceforge.net
+ * Date: Jul 27, 2003
+ * Time: 9:21:41 PM
+ */
+public class Preference {
+
+ private String name;
+ private ArrayList<String> values = new ArrayList<String>(3);
+ private boolean readOnly = false;
+
+ public Preference () {
+ }
+
+ public String getName() { return name; }
+ public void setName(String name) { this.name = name; }
+
+
+ public List getValues() { return values; }
+ public void setValues(ArrayList<String> values) { this.values = values; }
+ public void addValue(String value) { values.add(value) ;}
+
+ public boolean isReadOnly() { return readOnly; }
+ public void setReadOnly(boolean b) { readOnly = b ; }
+
+}
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/application/ResourceBundleDelegateImpl.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/application/ResourceBundleDelegateImpl.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/application/ResourceBundleDelegateImpl.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.application ;
+
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+import org.exoplatform.services.portletcontainer.bundle.ResourceBundleDelegate;
+import org.exoplatform.services.resources.ResourceBundleService;
+
+/**
+ * @author Benjamin Mestrallet
+ * benjamin.mestrallet(a)exoplatform.com
+ */
+public class ResourceBundleDelegateImpl implements ResourceBundleDelegate {
+
+ private ResourceBundleService resourceBundleService;
+
+ public ResourceBundleDelegateImpl(ResourceBundleService resourceBundleService) {
+ this.resourceBundleService = resourceBundleService;
+ }
+
+ public ResourceBundle lookupBundle(String portletBundleName, Locale locale){
+ String[] portalBundles = resourceBundleService.getSharedResourceBundleNames();
+ String[] bundles = new String[portalBundles.length + 1] ;
+ for(int i = 0; i < portalBundles.length; i++) {
+ bundles[i] = portalBundles[i] ;
+ }
+ bundles[portalBundles.length] = portletBundleName ;
+ return resourceBundleService.getResourceBundle(bundles, locale);
+ }
+
+}
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/application/UserGadgetStorage.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/application/UserGadgetStorage.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/application/UserGadgetStorage.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.application;
+
+import java.util.Set;
+import java.util.Map;
+
+/**
+ * Created by The eXo Platform SARL
+ * Author : Nhu Dinh Thuan
+ * nhudinhthuan(a)exoplatform.com
+ * Aug 8, 2007
+ */
+public interface UserGadgetStorage {
+
+ public void save(String userName, String gadgetType, String instanceId, String key, String value) throws Exception ;
+
+ public void save(String userName, String gadgetType, String instanceId, Map<String, String> values) throws Exception ;
+
+ public String get(String userName, String gadgetType, String instanceId, String key) throws Exception ;
+
+ public Map<String, String> get(String userName, String gadgetType, String instanceId) throws Exception ;
+
+ public Map<String,String> get(String userName, String gadgetType, String instanceId, Set<String> key) throws Exception ;
+
+ public void delete(String userName, String gadgetType, String instanceId) throws Exception ;
+
+ public void delete(String userName, String gadgetType, String instanceId, Set<String> keys) throws Exception ;
+
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/application/jcr/PortletPreferencesPersisterImpl.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/application/jcr/PortletPreferencesPersisterImpl.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/application/jcr/PortletPreferencesPersisterImpl.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.application.jcr;
+
+import org.exoplatform.portal.application.PortletPreferences;
+import org.exoplatform.portal.config.DataStorage;
+import org.exoplatform.services.portletcontainer.pci.ExoWindowID;
+import org.exoplatform.services.portletcontainer.pci.WindowID;
+import org.exoplatform.services.portletcontainer.pci.model.ExoPortletPreferences;
+import org.exoplatform.services.portletcontainer.persistence.PortletPreferencesPersister;
+/**
+ * Jul 16, 2004
+ * @author: Tuan Nguyen
+ * @email: tuan08(a)users.sourceforge.net
+ * @version: $Id: PortletPreferencesPersisterImpl.java,v 1.4 2004/08/11 02:22:16 tuan08 Exp $
+ */
+public class PortletPreferencesPersisterImpl implements PortletPreferencesPersister {
+
+ private DataStorage dataStorage_;
+
+ public PortletPreferencesPersisterImpl(DataStorage dataStorage) {
+ dataStorage_ = dataStorage;
+ }
+
+ public ExoPortletPreferences getPortletPreferences(WindowID windowID) throws Exception {
+ PortletPreferences portletPreferences = dataStorage_.getPortletPreferences(windowID);
+ return portletPreferences == null ? null : portletPreferences.toExoPortletPreferences();
+ }
+
+ public void savePortletPreferences(WindowID windowID, ExoPortletPreferences exoPref) throws Exception {
+ PortletPreferences portletPreferences = new PortletPreferences(exoPref);
+ ExoWindowID exoWindowID = (ExoWindowID) windowID;
+ portletPreferences.setWindowId(exoWindowID.getPersistenceId());
+ String owner = windowID.getOwner();
+ String [] components = owner.split("#");
+ if(components.length < 2) throw new Exception("WindowId is invalid "+windowID);
+ portletPreferences.setOwnerType(components[0]);
+ portletPreferences.setOwnerId(components[1]);
+ dataStorage_.save(portletPreferences);
+ }
+
+}
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/application/jcr/UserGadgetStorageImpl.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/application/jcr/UserGadgetStorageImpl.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/application/jcr/UserGadgetStorageImpl.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,166 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.application.jcr;
+
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.PropertyIterator;
+import javax.jcr.Property;
+
+import org.exoplatform.portal.application.UserGadgetStorage;
+import org.exoplatform.services.jcr.ext.common.SessionProvider;
+import org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator;
+
+import java.util.Set;
+import java.util.Map;
+import java.util.HashMap;
+
+public class UserGadgetStorageImpl implements UserGadgetStorage {
+
+ public static final String GADGETS_REGISTRY_NODE = "gadgets";
+ public static final String DATA = "data";
+ public static final String GADGET_NODE_TYPE = "exo:gadget";
+ private NodeHierarchyCreator nodeCreator ;
+
+ public UserGadgetStorageImpl(NodeHierarchyCreator creator) throws Exception{
+ nodeCreator = creator ;
+ }
+
+ private Node createGadgetInstanceNode(SessionProvider sessionProvider, String userName, String gadgetType, String instanceId) throws Exception{
+ Node userApplicationsNode = nodeCreator.getUserApplicationNode(sessionProvider, userName) ;
+ Node gadgetsApp = getNode(userApplicationsNode, GADGETS_REGISTRY_NODE, null) ;
+ Node gadgetsTypeNode = getNode(gadgetsApp, gadgetType, null);
+ Node node = getNode(gadgetsTypeNode, instanceId, GADGET_NODE_TYPE);
+ userApplicationsNode.save();
+ return node;
+ }
+
+ public void save(String userName, String gadgetType, String instanceId, String key, String value) throws Exception{
+ SessionProvider sessionProvider = SessionProvider.createSystemProvider() ;
+ Node gadgetNode = createGadgetInstanceNode(sessionProvider, userName, gadgetType, instanceId);
+
+ gadgetNode.setProperty(key, value);
+ gadgetNode.save();
+ sessionProvider.close() ;
+ }
+
+ public void save(String userName, String gadgetType, String instanceId, Map<String, String> values) throws Exception{
+ SessionProvider sessionProvider = SessionProvider.createSystemProvider();
+
+ Node gadgetNode = getGadgetNode(sessionProvider, userName, gadgetType, instanceId);
+ if(gadgetNode == null)
+ gadgetNode = createGadgetInstanceNode(sessionProvider, userName, gadgetType, instanceId);
+
+ for (String key : values.keySet()) {
+ gadgetNode.setProperty(key, values.get(key));
+ }
+ gadgetNode.save();
+ sessionProvider.close();
+ }
+
+ public String get(String userName, String gadgetType, String instanceId, String key) throws Exception {
+ SessionProvider sessionProvider = SessionProvider.createSystemProvider() ;
+ Node gadgetNode = getGadgetNode(sessionProvider, userName, gadgetType, instanceId);
+ if(gadgetNode == null ) {
+ sessionProvider.close() ;
+ return null;
+ }
+
+ String value = null;
+ if(gadgetNode.hasProperty(key)) value = gadgetNode.getProperty(key).getString();
+ sessionProvider.close() ;
+ return value;
+ }
+
+ public Map<String, String> get(String userName, String gadgetType, String instanceId) throws Exception {
+ return get(userName, gadgetType, instanceId, (Set<String>)null);
+ }
+
+ public Map<String, String> get(String userName, String gadgetType, String instanceId, Set<String> keys) throws Exception {
+ SessionProvider sessionProvider = SessionProvider.createSystemProvider() ;
+ Node gadgetNode = getGadgetNode(sessionProvider, userName, gadgetType, instanceId);
+ if(gadgetNode == null ) {
+ sessionProvider.close() ;
+ return null;
+ }
+ Map<String, String> res = new HashMap<String, String>();
+
+ if (keys == null) {
+ PropertyIterator it = gadgetNode.getProperties();
+ while (it.hasNext()) {
+ Property prop = it.nextProperty();
+ res.put(prop.getName(), prop.getString());
+ }
+ }
+ else {
+ for (String key : keys) {
+ if(gadgetNode.hasProperty(key))
+ res.put(key, gadgetNode.getProperty(key).getString());
+ }
+ }
+ sessionProvider.close() ;
+ return res;
+ }
+
+ public void delete(String userName, String gadgetType, String instanceId) throws Exception {
+ SessionProvider sessionProvider = SessionProvider.createSystemProvider() ;
+ Node gadgetNode = getGadgetNode(sessionProvider, userName, gadgetType, instanceId);
+ if(gadgetNode == null ) {
+ sessionProvider.close() ;
+ return;
+ }
+ Node parentNode = gadgetNode.getParent();
+ gadgetNode.remove() ;
+ parentNode.save();
+ sessionProvider.close() ;
+ }
+
+ public void delete(String userName, String gadgetType, String instanceId, Set<String> keys) throws Exception {
+ SessionProvider sessionProvider = SessionProvider.createSystemProvider() ;
+ Node gadgetNode = getGadgetNode(sessionProvider, userName, gadgetType, instanceId);
+ if(gadgetNode == null ) {
+ sessionProvider.close() ;
+ return;
+ }
+
+ for (String key : keys) {
+ if (gadgetNode.hasProperty(key))
+ gadgetNode.getProperty(key).remove();
+ }
+
+ gadgetNode.save();
+ sessionProvider.close() ;
+ }
+
+ private Node getNode(Node parent, String name, String nodeType) throws Exception {
+ if(parent.hasNode(name)){
+ return parent.getNode(name);
+ }
+ Node node = null;
+ if(nodeType == null) node= parent.addNode(name);
+ else node = parent.addNode(name, nodeType);
+ parent.save();
+ return node;
+ }
+
+ private Node getGadgetNode(SessionProvider sessionProvider, String userName, String gadgetType, String instanceId) throws Exception {
+ Node userAppsNode = nodeCreator.getUserApplicationNode(sessionProvider, userName) ;
+ String instancePath = GADGETS_REGISTRY_NODE + "/" + gadgetType + "/" + instanceId ;
+ if(userAppsNode.hasNode(instancePath)) return userAppsNode.getNode(instancePath) ;
+ return null;
+ }
+}
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/DataStorage.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/DataStorage.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/DataStorage.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,144 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config;
+
+import java.util.Comparator;
+
+import org.exoplatform.commons.utils.LazyPageList;
+import org.exoplatform.portal.application.PortletPreferences;
+import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.services.portletcontainer.pci.WindowID;
+
+/**
+ * Created by The eXo Platform SAS
+ * Apr 19, 2007
+ *
+ * This interface is used to load the PortalConfig, Page config and Navigation config from the
+ * database
+ */
+public interface DataStorage {
+
+ /**
+ * This method should create the PortalConfig object
+ * @param config
+ * @throws Exception
+ */
+ public void create(PortalConfig config) throws Exception;
+
+ /**
+ * This method should update the PortalConfig object
+ * @param config
+ * @throws Exception
+ */
+ public void save(PortalConfig config) throws Exception;
+
+ /**
+ * This method should load the PortalConfig object from db according to the portalName
+ * @param portalName
+ * @return
+ * @throws Exception
+ */
+ public PortalConfig getPortalConfig(String portalName) throws Exception ;
+
+ /**
+ * This method should remove the PortalConfig , all the Page that belong to the portal and the
+ * PageNavigation of the portal from the database
+ * @param config
+ * @throws Exception
+ */
+ public void remove(PortalConfig config) throws Exception;
+
+ /**
+ * This method should load the Page object from the database according to the pageId
+ * @param accessUser
+ * @return
+ * @throws Exception
+ */
+ public Page getPage(String pageId) throws Exception ;
+
+ /**
+ * This method should remove the page object from the database
+ * @param config
+ * @throws Exception
+ */
+ public void remove(Page page) throws Exception ;
+
+ /**
+ * This method should create or udate the given page object
+ * @param page
+ * @throws Exception
+ */
+ public void create(Page page) throws Exception ;
+
+ /**
+ * This method should create or udate the given page object
+ * @param page
+ * @throws Exception
+ */
+ public void save(Page page) throws Exception ;
+
+ /**
+ * This method should load the PageNavigation object from the database according to the pageId
+ * @param id
+ * @return
+ * @throws Exception
+ */
+ public PageNavigation getPageNavigation(String fullId) throws Exception ;
+
+ /**
+ * This method should load the PageNavigation object from the database according to the ownerType
+ * and id
+ * @param ownerType
+ * @param id
+ * @return
+ * @throws Exception
+ */
+ public PageNavigation getPageNavigation(String ownerType, String id) throws Exception ;
+
+ /**
+ * This method should update the navigation object in the database
+ * @param navigation
+ * @throws Exception
+ */
+ public void save(PageNavigation navigation) throws Exception ;
+
+ /**
+ * This method should create the navigation object in the database
+ * @param navigation
+ * @throws Exception
+ */
+ public void create(PageNavigation navigation) throws Exception ;
+
+ /**
+ * This method should remove the navigation object from the database
+ * @param navigation
+ * @throws Exception
+ */
+ public void remove(PageNavigation navigation) throws Exception ;
+
+ public void save(PortletPreferences portletPreferences) throws Exception;
+
+ public PortletPreferences getPortletPreferences(WindowID windowID) throws Exception;
+
+ public void remove(PortletPreferences portletPreferences) throws Exception ;
+
+ public LazyPageList find(Query<?> q) throws Exception ;
+
+ public LazyPageList find(Query<?> q, Comparator<?> sortComparator) throws Exception ;
+}
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/GroupPortalConfigListener.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/GroupPortalConfigListener.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/GroupPortalConfigListener.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.exoplatform.commons.utils.LazyPageList;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.portal.application.PortletPreferences;
+import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.services.organization.Group;
+import org.exoplatform.services.organization.GroupEventListener;
+
+/**
+ * Created by The eXo Platform SARL
+ * Author : Nhu Dinh Thuan
+ * nhudinhthuan(a)exoplatform.com
+ * May 29, 2007
+ */
+public class GroupPortalConfigListener extends GroupEventListener {
+ public void preDelete(Group group) throws Exception {
+ ExoContainer container = ExoContainerContext.getCurrentContainer();
+ UserPortalConfigService portalConfigService =
+ (UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class) ;
+ DataStorage dataStorage = (DataStorage)container.getComponentInstanceOfType(DataStorage.class) ;
+ String groupId = group.getId().trim();
+ if(groupId.charAt(0)=='/') groupId = groupId.substring(1);
+ Query<Page> pageQuery = new Query<Page>(PortalConfig.GROUP_TYPE, groupId, Page.class) ;
+ LazyPageList pageList = dataStorage.find(pageQuery) ;
+
+ int i = 1 ;
+ while(i <= pageList.getAvailablePage()) {
+ List<?> list = pageList.getPage(i) ;
+ Iterator<?> iterator = list.iterator() ;
+ while(iterator.hasNext()){
+ portalConfigService.remove((Page)iterator.next() ) ;
+ }
+ i++ ;
+ }
+
+ Query<PortletPreferences> portletPrefQuery =
+ new Query<PortletPreferences>(PortalConfig.GROUP_TYPE, groupId, PortletPreferences.class) ;
+ pageList = dataStorage.find(portletPrefQuery) ;
+ i = 1 ;
+ while(i <= pageList.getAvailablePage()) {
+ List<?> list = pageList.getPage(i) ;
+ Iterator<?> iterator = list.iterator() ;
+ while(iterator.hasNext()) dataStorage.remove((PortletPreferences)iterator.next()) ;
+ i++ ;
+ }
+
+ PageNavigation navigation = dataStorage.getPageNavigation(PortalConfig.GROUP_TYPE, groupId) ;
+ if (navigation != null) portalConfigService.remove(navigation) ;
+ }
+
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfig.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfig.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfig.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config;
+
+import java.util.HashSet;
+
+/**
+ * Author : Nhu Dinh Thuan
+ * nhudinhthuan(a)yahoo.com
+ * May 23, 2006
+ */
+public class NewPortalConfig {
+
+ private HashSet<String> predefinedOwner = new HashSet<String>(5);
+ private String ownerType;
+ private String templateOwner ;
+ private String templateLocation ;
+
+ public HashSet<String> getPredefinedOwner() { return predefinedOwner; }
+ public void setPredefinedOwner(HashSet<String> s) { this.predefinedOwner = s; }
+
+ public String getTemplateLocation() { return templateLocation; }
+ public void setTemplateLocation(String s) { this.templateLocation = s; }
+
+ public String getTemplateOwner() { return templateOwner;}
+ public void setTemplateOwner(String s) { this.templateOwner = s; }
+
+ public boolean isPredefinedOwner(String user) { return predefinedOwner.contains(user) ; }
+
+ public String getOwnerType() { return ownerType; }
+ public void setOwnerType(String ownerType) { this.ownerType = ownerType; }
+
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,238 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.commons.lang.StringUtils;
+import org.exoplatform.commons.utils.IOUtil;
+import org.exoplatform.container.component.BaseComponentPlugin;
+import org.exoplatform.container.configuration.ConfigurationManager;
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.container.xml.ObjectParameter;
+import org.exoplatform.container.xml.ValueParam;
+import org.exoplatform.portal.application.PortletPreferences;
+import org.exoplatform.portal.application.PortletPreferences.PortletPreferencesSet;
+import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.portal.config.model.Page.PageSet;
+import org.jibx.runtime.BindingDirectory;
+import org.jibx.runtime.IBindingFactory;
+import org.jibx.runtime.IUnmarshallingContext;
+
+/**
+ * Created by The eXo Platform SARL Author : Tuan Nguyen
+ * tuan08(a)users.sourceforge.net May 22, 2006
+ */
+
+public class NewPortalConfigListener extends BaseComponentPlugin {
+
+ private ConfigurationManager cmanager_;
+
+ private DataStorage pdcService_;
+
+ private List<?> configs;
+
+ private PageTemplateConfig pageTemplateConfig_;
+
+ private String defaultPortal;
+
+ public NewPortalConfigListener(DataStorage pdcService,
+ ConfigurationManager cmanager,
+ InitParams params) throws Exception {
+ cmanager_ = cmanager;
+ pdcService_ = pdcService;
+
+ ObjectParameter objectParam = params.getObjectParam("page.templates");
+ if (objectParam != null)
+ pageTemplateConfig_ = (PageTemplateConfig) objectParam.getObject();
+
+ defaultPortal = "classic";
+ ValueParam valueParam = params.getValueParam("default.portal");
+ if (valueParam != null)
+ defaultPortal = valueParam.getValue();
+ if (defaultPortal == null || defaultPortal.trim().length() == 0)
+ defaultPortal = "classic";
+ configs = params.getObjectParamValues(NewPortalConfig.class);
+ }
+
+ public void run() throws Exception {
+ if (isInitedDB(defaultPortal))
+ return;
+ for (Object ele : configs) {
+ NewPortalConfig portalConfig = (NewPortalConfig) ele;
+ if (portalConfig.getOwnerType().equals("user")) {
+ initUserTypeDB(portalConfig);
+ } else if (portalConfig.getOwnerType().equals(PortalConfig.GROUP_TYPE)) {
+ initGroupTypeDB(portalConfig);
+ } else {
+ initPortalTypeDB(portalConfig);
+ }
+ portalConfig.getPredefinedOwner().clear();
+ }
+ }
+
+ NewPortalConfig getPortalConfig(String ownerType) {
+ for (Object object : configs) {
+ NewPortalConfig portalConfig = (NewPortalConfig) object;
+ if (portalConfig.getOwnerType().equals(ownerType))
+ return portalConfig;
+ }
+ return null;
+ }
+
+ private boolean isInitedDB(String user) throws Exception {
+ PortalConfig pconfig = pdcService_.getPortalConfig(user);
+ return pconfig != null;
+ }
+
+ public void initUserTypeDB(NewPortalConfig config) throws Exception {
+ HashSet<String> owners = config.getPredefinedOwner();
+ Iterator<String> iter = owners.iterator();
+ while (iter.hasNext()) {
+ String owner = iter.next();
+ createPage(config, owner);
+ createPageNavigation(config, owner);
+ }
+ }
+
+ public void initGroupTypeDB(NewPortalConfig config) throws Exception {
+ HashSet<String> owners = config.getPredefinedOwner();
+ Iterator<String> iter = owners.iterator();
+ while (iter.hasNext()) {
+ String owner = iter.next();
+ createPage(config, owner);
+ createPageNavigation(config, owner);
+ createPortletPreferences(config, owner);
+ }
+ }
+
+ public void initPortalTypeDB(NewPortalConfig config) throws Exception {
+ HashSet<String> owners = config.getPredefinedOwner();
+ Iterator<String> iter = owners.iterator();
+ while (iter.hasNext()) {
+ String owner = iter.next();
+ createPortalConfig(config, owner);
+ createPage(config, owner);
+ createPageNavigation(config, owner);
+ createPortletPreferences(config, owner);
+ }
+ }
+
+ private void createPortalConfig(NewPortalConfig config, String owner) throws Exception {
+ String xml = null;
+ if (config.getTemplateOwner() == null || config.getTemplateOwner().trim().length() < 1) {
+ xml = getDefaultConfig(config, owner, "portal");
+ } else {
+ xml = getTemplateConfig(config, owner, "portal");
+ }
+ PortalConfig pconfig = fromXML(xml, PortalConfig.class);
+ pdcService_.create(pconfig);
+ }
+
+ private void createPage(NewPortalConfig config, String owner) throws Exception {
+ String xml = null;
+ if (config.getTemplateOwner() == null || config.getTemplateOwner().trim().length() < 1) {
+ xml = getDefaultConfig(config, owner, "pages");
+ } else {
+ xml = getTemplateConfig(config, owner, "pages");
+ }
+ PageSet pageSet = fromXML(xml, PageSet.class);
+ ArrayList<Page> list = pageSet.getPages();
+ for (Page page : list) {
+ pdcService_.create(page);
+ }
+ }
+
+ private void createPageNavigation(NewPortalConfig config, String owner) throws Exception {
+ String xml = null;
+ if (config.getTemplateOwner() == null || config.getTemplateOwner().trim().length() < 1) {
+ xml = getDefaultConfig(config, owner, "navigation");
+ } else {
+ xml = getTemplateConfig(config, owner, "navigation");
+ }
+ PageNavigation navigation = fromXML(xml, PageNavigation.class);
+ if (pdcService_.getPageNavigation(navigation.getOwner()) == null) {
+ pdcService_.create(navigation);
+ } else {
+ pdcService_.save(navigation);
+ }
+ }
+
+ private void createPortletPreferences(NewPortalConfig config, String owner) throws Exception {
+ String xml = null;
+ if (config.getTemplateOwner() == null || config.getTemplateOwner().trim().length() < 1) {
+ xml = getDefaultConfig(config, owner, "portlet-preferences");
+ } else {
+ xml = getTemplateConfig(config, owner, "portlet-preferences");
+ }
+ PortletPreferencesSet portletSet = fromXML(xml, PortletPreferencesSet.class);
+ ArrayList<PortletPreferences> list = portletSet.getPortlets();
+ for (PortletPreferences portlet : list) {
+ pdcService_.save(portlet);
+ }
+ }
+
+ private String getDefaultConfig(NewPortalConfig portalConfig, String owner, String dataType) throws Exception {
+ String ownerType = portalConfig.getOwnerType();
+ String path = "/" + ownerType + "/" + owner + "/" + dataType + ".xml";
+ String location = portalConfig.getTemplateLocation();
+ return IOUtil.getStreamContentAsString(cmanager_.getInputStream(location + path));
+ }
+
+ private String getTemplateConfig(NewPortalConfig portalConfig, String owner, String dataType) throws Exception {
+ String ownerType = portalConfig.getOwnerType();
+ String templateLoc = portalConfig.getTemplateLocation();
+ String path = "/" + ownerType + "/template/" + portalConfig.getTemplateOwner() + "/" + dataType
+ + ".xml";
+ InputStream is = cmanager_.getInputStream(templateLoc + path);
+ String template = IOUtil.getStreamContentAsString(is);
+ return StringUtils.replace(template, "@owner@", owner);
+ }
+
+ public Page createPageFromTemplate(String temp) throws Exception {
+ return fromXML(getTemplateConfig(temp, "page"), Page.class);
+ }
+
+ public PortletPreferencesSet createPortletPreferencesFromTemplate(String temp) throws Exception {
+ return fromXML(getTemplateConfig(temp, "portlet-preferences"), PortletPreferencesSet.class);
+ }
+
+ private String getTemplateConfig(String name, String dataType) throws Exception {
+ String path = pageTemplateConfig_.getLocation() + "/" + name + "/" + dataType + ".xml";
+ InputStream is = cmanager_.getInputStream(path);
+ return IOUtil.getStreamContentAsString(is);
+ }
+
+ private <T> T fromXML(String xml, Class<T> clazz) throws Exception {
+ ByteArrayInputStream is = new ByteArrayInputStream(xml.getBytes("UTF-8"));
+ IBindingFactory bfact = BindingDirectory.getFactory(clazz);
+ IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
+ return clazz.cast(uctx.unmarshalDocument(is, "UTF-8"));
+ }
+
+ String getDefaultPortal() {
+ return defaultPortal;
+ }
+
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/PageTemplateConfig.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/PageTemplateConfig.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/PageTemplateConfig.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2003-2008 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config;
+
+import java.util.List;
+
+/**
+ * Created by The eXo Platform SAS
+ * Author : Pham Thanh Tung
+ * thanhtungty(a)gmail.com
+ * Mar 3, 2008
+ */
+public class PageTemplateConfig {
+
+ String location ;
+ List<String> templates ;
+
+ /**
+ * @return the location
+ */
+ public String getLocation() {
+ return location;
+ }
+
+ /**
+ * @param location the location to set
+ */
+ public void setLocation(String location) {
+ this.location = location;
+ }
+
+ /**
+ * @return the templates
+ */
+ public List<String> getTemplates() {
+ return templates;
+ }
+
+ /**
+ * @param templates the templates to set
+ */
+ public void setTemplates(List<String> templates) {
+ this.templates = templates;
+ }
+
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/PortalACLPlugin.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/PortalACLPlugin.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/PortalACLPlugin.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2003-2008 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config;
+
+import java.util.List;
+
+import org.exoplatform.container.component.BaseComponentPlugin;
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.container.xml.ValueParam;
+import org.exoplatform.container.xml.ValuesParam;
+
+/**
+ * Created by The eXo Platform SAS
+ * Author : Hoa Pham
+ * hoa.phamvu(a)exoplatform.com
+ * Nov 19, 2008
+ */
+public class PortalACLPlugin extends BaseComponentPlugin {
+ private List<String> portalCreationRoles = null;
+ private String superUser;
+
+ public PortalACLPlugin(InitParams initParams) {
+ ValuesParam roles2 = initParams.getValuesParam("portal.creation.roles");
+ if(roles2 != null) {
+ portalCreationRoles = roles2.getValues();
+ }
+ ValueParam role3 = initParams.getValueParam("super.user");
+ if(role3 != null) {
+ superUser = role3.getValue();
+ }
+ }
+
+ public List<String> getPortalCreationRoles() {
+ return portalCreationRoles;
+ }
+
+ public String getSuperUser() {
+ return superUser;
+ }
+
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/Query.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/Query.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/Query.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config;
+
+/**
+ * Created by The eXo Platform SARL .
+ * Author : Tuan Nguyen
+ * tuan08(a)users.sourceforge.net
+ * Date: Jun 14, 2003
+ * Time: 1:12:22 PM
+ */
+public class Query <T> {
+
+ private String ownerType_ ;
+ private String ownerId_ ;
+ private String name_;
+ private String title_;
+ private Class<T> classType_;
+
+ public Query(String ownerType, String ownerId, Class<T> clazz) {
+ ownerType_ = ownerType ;
+ ownerId_ = ownerId;
+ classType_ = clazz;
+ }
+
+ public Query(String ownerType, String ownerId, String name, String title, Class<T> clazz) {
+ ownerType_ = ownerType ;
+ ownerId_ = ownerId;
+ classType_ = clazz;
+ name_ = name;
+ title_ = title ;
+ }
+
+
+ public String getOwnerType() { return ownerType_ ; }
+ public void setOwnerType(String s) { ownerType_ = s ; }
+
+ public String getOwnerId() { return ownerId_ ; }
+ public void setOwnerId(String s) { ownerId_ = s ; }
+
+ public Class<T> getClassType() { return classType_ ; }
+ public void setClassType(Class<T> clazz) { classType_ = clazz; }
+
+ public String getName() { return name_; }
+ public void setName(String name_) { this.name_ = name_; }
+
+ public String getTitle() { return title_; }
+ public void setTitle(String title_) {this.title_ = title_; }
+
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/RemoveGroupPortalConfigListener.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/RemoveGroupPortalConfigListener.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/RemoveGroupPortalConfigListener.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.exoplatform.commons.utils.LazyPageList;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.portal.application.PortletPreferences;
+import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.services.listener.Event;
+import org.exoplatform.services.listener.Listener;
+import org.exoplatform.services.organization.Group;
+import org.exoplatform.services.organization.jdbc.GroupDAOImpl;
+
+/**
+ * Created by The eXo Platform SARL
+ * Author : Tung.Pham
+ * tung.pham(a)exoplatform.com
+ * Jul 31, 2007
+ */
+public class RemoveGroupPortalConfigListener extends Listener<GroupDAOImpl, Group> {
+
+ @Override
+ public void onEvent(Event<GroupDAOImpl, Group> event) throws Exception {
+ Group group = event.getData() ;
+ ExoContainer container = ExoContainerContext.getCurrentContainer();
+ UserPortalConfigService portalConfigService =
+ (UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class) ;
+ DataStorage dataStorage = (DataStorage)container.getComponentInstanceOfType(DataStorage.class) ;
+ String groupId = group.getId().substring(1) ;
+ Query<Page> pageQuery = new Query<Page>(PortalConfig.GROUP_TYPE, groupId, Page.class) ;
+ LazyPageList pageList = dataStorage.find(pageQuery) ;
+ int i = 1 ;
+ while(i <= pageList.getAvailablePage()) {
+ List<?> list = pageList.getPage(i) ;
+ Iterator<?> iterator = list.iterator() ;
+ while(iterator.hasNext()) portalConfigService.remove((Page)iterator.next()) ;
+ i++ ;
+ }
+
+ Query<PortletPreferences> portletPrefQuery =
+ new Query<PortletPreferences>(PortalConfig.GROUP_TYPE, groupId, PortletPreferences.class) ;
+ pageList = dataStorage.find(portletPrefQuery) ;
+ i = 1 ;
+ while(i <= pageList.getAvailablePage()) {
+ List<?> list = pageList.getPage(i) ;
+ Iterator<?> iterator = list.iterator() ;
+ while(iterator.hasNext()) dataStorage.remove((PortletPreferences)iterator.next()) ;
+ i++ ;
+ }
+
+ PageNavigation navigation = dataStorage.getPageNavigation(PortalConfig.GROUP_TYPE, groupId) ;
+ if (navigation != null) portalConfigService.remove(navigation) ;
+ }
+
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/RemoveUserPortalConfigListener.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/RemoveUserPortalConfigListener.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/RemoveUserPortalConfigListener.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.exoplatform.commons.utils.LazyPageList;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.portal.application.PortletPreferences;
+import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.services.listener.Event;
+import org.exoplatform.services.listener.Listener;
+import org.exoplatform.services.organization.User;
+import org.exoplatform.services.organization.jdbc.UserDAOImpl;
+
+/**
+ * Created by The eXo Platform SARL
+ * Author : Tung.Pham
+ * tung.pham(a)exoplatform.com
+ * Aug 1, 2007
+ */
+public class RemoveUserPortalConfigListener extends Listener<UserDAOImpl, User> {
+
+ @Override
+ public void onEvent(Event<UserDAOImpl, User> event) throws Exception {
+ User user = event.getData() ;
+ ExoContainer container = ExoContainerContext.getCurrentContainer();
+ UserPortalConfigService portalConfigService =
+ (UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class) ;
+ DataStorage dataStorage = (DataStorage)container.getComponentInstanceOfType(DataStorage.class) ;
+ String userName = user.getUserName() ;
+
+ Query<Page> query = new Query<Page>(PortalConfig.USER_TYPE, userName, Page.class) ;
+ LazyPageList pageList = dataStorage.find(query) ;
+ pageList.setPageSize(10) ;
+ int i = 1;
+ while(i <= pageList.getAvailablePage()) {
+ List<?> list = pageList.getPage(i) ;
+ Iterator<?> iterator = list.iterator() ;
+ while(iterator.hasNext()) portalConfigService.remove((Page) iterator.next()) ;
+ i++;
+ }
+
+ Query<PortletPreferences> portletPrefQuery =
+ new Query<PortletPreferences>(PortalConfig.USER_TYPE, userName, PortletPreferences.class) ;
+ pageList = dataStorage.find(portletPrefQuery) ;
+ i = 1 ;
+ while(i <= pageList.getAvailablePage()) {
+ List<?> list = pageList.getPage(i) ;
+ Iterator<?> iterator = list.iterator() ;
+ while(iterator.hasNext()) dataStorage.remove((PortletPreferences)iterator.next()) ;
+ i++ ;
+ }
+
+ PageNavigation navigation = dataStorage.getPageNavigation(PortalConfig.USER_TYPE, userName) ;
+ if (navigation != null) portalConfigService.remove(navigation) ;
+ }
+
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserACL.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserACL.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserACL.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,510 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+import org.exoplatform.services.log.Log;
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.container.xml.ValueParam;
+import org.exoplatform.container.xml.ValuesParam;
+import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.security.ConversationState;
+import org.exoplatform.services.security.Identity;
+import org.exoplatform.services.security.MembershipEntry;
+
+/**
+ * Jun 27, 2006
+ */
+public class UserACL {
+ public final static String EVERYONE = "Everyone";
+
+ protected static Log log = ExoLogger.getLogger("organization:UserACL");
+
+ private final Collection<MembershipEntry> NO_MEMBERSHIP = Collections.emptyList();
+
+ private final Collection<String> NO_ROLES = Collections.emptyList();
+
+ private final Identity guest = new Identity(null,
+ NO_MEMBERSHIP,
+ NO_ROLES);
+
+ private String superUser_;
+
+ private String guestGroup_;
+
+ private List<String> portalCreatorGroups_;
+
+ private String navigationCreatorMembershipType_;
+
+ private List<String> mandatoryGroups_;
+
+ private PortalACLPlugin portalACLPlugin;
+
+ private String adminGroups;
+
+ private String adminMSType;
+
+ @SuppressWarnings("unchecked")
+ public UserACL(InitParams params) {
+ UserACLMetaData md = new UserACLMetaData();
+ ValueParam superUserParam = params.getValueParam("super.user");
+ if (superUserParam != null)
+ md.setSuperUser(superUserParam.getValue());
+ ValueParam guestGroupParam = params.getValueParam("guests.group");
+ if (guestGroupParam != null)
+ md.setGuestsGroups(guestGroupParam.getValue());
+ ValueParam navCretorParam = params.getValueParam("navigation.creator.membership.type");
+ if (navCretorParam != null)
+ md.setNavigationCreatorMembershipType(navCretorParam.getValue());
+ ValueParam portalCretorGroupsParam = params.getValueParam("portal.creator.groups");
+ if (portalCretorGroupsParam != null)
+ md.setPortalCreateGroups(portalCretorGroupsParam.getValue());
+ ValuesParam mandatoryGroupsParam = params.getValuesParam("mandatory.groups");
+ if (mandatoryGroupsParam != null)
+ mandatoryGroups_ = mandatoryGroupsParam.getValues();
+ else
+ mandatoryGroups_ = new ArrayList<String>();
+
+ // tam.nguyen get admin group value
+ ValueParam adminGroupsParam = params.getValueParam("portal.administrator.groups");
+ if (adminGroupsParam != null)
+ setAdminGroups(adminGroupsParam.getValue());
+
+ // tam.nguyen get administrator member type
+ ValueParam adminMSTypeParam = params.getValueParam("portal.administrator.mstype");
+ if (adminMSTypeParam != null)
+ setAdminMSType(adminMSTypeParam.getValue());
+
+ init(md);
+ }
+
+ public UserACL(UserACLMetaData md) {
+ if (md == null) {
+ throw new NullPointerException("No meta data provided");
+ }
+ init(md);
+ }
+
+ private void init(UserACLMetaData md) {
+ if (md.getSuperUser() != null)
+ superUser_ = md.getSuperUser();
+ if (superUser_ == null || superUser_.trim().length() == 0)
+ superUser_ = "root";
+
+ if (md.getGuestsGroups() != null)
+ guestGroup_ = md.getGuestsGroups();
+ if (guestGroup_ == null || guestGroup_.trim().length() < 1)
+ guestGroup_ = "/platform/guests";
+
+ if (md.getNavigationCreatorMembershipType() != null)
+ navigationCreatorMembershipType_ = md.getNavigationCreatorMembershipType();
+ if (navigationCreatorMembershipType_ == null
+ || navigationCreatorMembershipType_.trim().length() == 0)
+ navigationCreatorMembershipType_ = "owner";
+
+ String allGroups = "";
+ if (md.getPortalCreateGroups() != null)
+ allGroups = md.getPortalCreateGroups();
+ portalCreatorGroups_ = defragmentPermission(allGroups);
+ }
+
+ // TODO: unnecessary to keep potalACLPlugin
+ public void addPortalACLPlugin(PortalACLPlugin plugin) {
+ this.portalACLPlugin = plugin;
+ String superUser = portalACLPlugin.getSuperUser();
+ if (superUser != null) {
+ log.info("Overidden SuperUser by PortalACLPlugin");
+ superUser_ = superUser;
+ }
+ List<String> portalCreationRoles = portalACLPlugin.getPortalCreationRoles();
+ if (portalCreationRoles != null) {
+ log.info("Overidden PortalCreatorGroup by PortalACLPlugin");
+ portalCreatorGroups_ = portalCreationRoles;
+ }
+ }
+
+ public String getMakableMT() {
+ return navigationCreatorMembershipType_;
+ }
+
+ public List<String> getPortalCreatorGroups() {
+ return portalCreatorGroups_;
+ }
+
+ public String getSuperUser() {
+ return superUser_;
+ }
+
+ public String getGuestsGroup() {
+ return guestGroup_;
+ }
+
+ public List<String> getMandatoryGroups() {
+ return mandatoryGroups_;
+ }
+
+ public void setAdminGroups(String adminGroups) {
+ this.adminGroups = adminGroups;
+ }
+
+ public String getAdminGroups() {
+ return adminGroups;
+ }
+
+ public void setAdminMSType(String adminMSType) {
+ this.adminMSType = adminMSType;
+ }
+
+ public String getAdminMSType() {
+ return adminMSType;
+ }
+
+ protected boolean findMembershipByUserAndGroupAndType(String groupId, String membership) throws Exception {
+ ConversationState conv = ConversationState.getCurrent();
+ Identity id = null;
+ if (conv != null)
+ id = conv.getIdentity();
+
+ if (id == null) {
+ return false;
+ }
+
+ return id.isMemberOf(groupId, membership);
+ }
+
+ public boolean hasPermission(PortalConfig pconfig) {
+ return hasPermission(getIdentity(), pconfig);
+ }
+
+ /**
+ *@deprecated use hasPermission(PortalConfig pconfig) instead of it.
+ **/
+ public boolean hasPermission(PortalConfig pconfig, String remoteUser) {
+ return hasPermission(getIdentity(remoteUser), pconfig);
+ }
+
+ public boolean hasEditPermission(PortalConfig pconfig) {
+ return hasEditPermission(getIdentity(), pconfig);
+ }
+
+ /**
+ *@deprecated use hasEditPermission(PortalConfig pconfig) instead of it.
+ */
+ public boolean hasEditPermission(PortalConfig pconfig, String remoteUser) {
+ return hasEditPermission(getIdentity(remoteUser), pconfig);
+ }
+
+ public boolean hasCreatePortalPermission() {
+ return hasCreatePortalPermission(getIdentity());
+ }
+
+ /**
+ *@deprecated use hasCreatePortalPermission() instead of it.
+ */
+ public boolean hasCreatePortalPermission(String remoteUser) {
+ return hasCreatePortalPermission(getIdentity(remoteUser));
+ }
+
+ public boolean hasEditPermission(PageNavigation pageNav) {
+ return hasEditPermission(getIdentity(), pageNav);
+ }
+
+ /**
+ *@deprecated use hasEditPermission(PageNavigation pageNav) instead of it.
+ */
+ public boolean hasEditPermission(PageNavigation pageNav, String remoteUser) {
+ return hasEditPermission(getIdentity(remoteUser), pageNav);
+ }
+
+ public boolean hasPermission(Page page) {
+ return hasPermission(getIdentity(), page);
+ }
+
+ /**
+ *@deprecated use hasPermission(Page page) instead of it.
+ */
+ public boolean hasPermission(Page page, String remoteUser) {
+ return hasPermission(getIdentity(remoteUser), page);
+ }
+
+ public boolean hasEditPermission(Page page) {
+ return hasEditPermission(getIdentity(), page);
+ }
+
+ /**
+ *@deprecated use hasEditPermission(Page page) instead of it.
+ */
+ public boolean hasEditPermission(Page page, String remoteUser) {
+ return hasEditPermission(getIdentity(remoteUser), page);
+ }
+
+ public boolean hasPermission(String expPerm) {
+ return hasPermission(getIdentity(), expPerm);
+ }
+
+ /**
+ *@deprecated use hasPermission(String expPerm) instead of it.
+ */
+ public boolean hasPermission(String expPerm, String remoteUser) {
+ return hasPermission(getIdentity(remoteUser), expPerm);
+ }
+
+ // --------------------------------------------------------------------------//
+ // Utility Methods //
+ // --------------------------------------------------------------------------//
+
+ private boolean hasPermission(Identity identity, PortalConfig pconfig) {
+ if (hasPermission(identity, pconfig.getEditPermission())) {
+ pconfig.setModifiable(true);
+ return true;
+ }
+ pconfig.setModifiable(false);
+ String[] accessPerms = (pconfig.getAccessPermissions());
+ for (String per : accessPerms) {
+ if (hasPermission(identity, per))
+ return true;
+ }
+ return false;
+ }
+
+ private boolean hasEditPermission(Identity identity, PortalConfig pconfig) {
+ if (superUser_.equals(identity.getUserId()))
+ return true;
+ return hasPermission(identity, pconfig.getEditPermission());
+ }
+
+ private boolean hasCreatePortalPermission(Identity identity) {
+ if (superUser_.equals(identity.getUserId()))
+ return true;
+ if (portalCreatorGroups_ == null || portalCreatorGroups_.size() < 1)
+ return false;
+ for (String ele : portalCreatorGroups_) {
+ if (hasPermission(identity, ele))
+ return true;
+ }
+ return false;
+ }
+
+ private boolean hasEditPermission(Identity identity, PageNavigation pageNav) {
+ if (superUser_.equals(identity.getUserId())) {
+ pageNav.setModifiable(true);
+ return true;
+ }
+ String ownerType = pageNav.getOwnerType();
+ if (PortalConfig.GROUP_TYPE.equals(ownerType)) {
+ String expPerm = navigationCreatorMembershipType_ + ":/" + pageNav.getOwnerId();
+ return hasPermission(identity, expPerm);
+ } else if (PortalConfig.USER_TYPE.equals(ownerType)) {
+ return pageNav.getOwnerId().equals(identity.getUserId());
+ }
+ return false;
+ }
+
+ private boolean hasPermission(Identity identity, Page page) {
+ if (PortalConfig.USER_TYPE.equals(page.getOwnerType())) {
+ if (page.getOwnerId().equals(identity.getUserId())) {
+ page.setModifiable(true);
+ return true;
+ }
+ return false;
+ }
+ if (superUser_.equals(identity.getUserId())) {
+ page.setModifiable(true);
+ return true;
+ }
+ if (hasEditPermission(identity, page)) {
+ page.setModifiable(true);
+ return true;
+ }
+ page.setModifiable(false);
+ String[] accessPerms = page.getAccessPermissions();
+ for (String per : accessPerms) {
+ if (hasPermission(identity, per))
+ return true;
+ }
+ return false;
+ }
+
+ private boolean hasEditPermission(Identity identity, Page page) {
+ if (PortalConfig.USER_TYPE.equals(page.getOwnerType())) {
+ if (page.getOwnerId().equals(identity.getUserId())) {
+ page.setModifiable(true);
+ return true;
+ }
+ return false;
+ }
+ if (hasPermission(identity, page.getEditPermission())) {
+ page.setModifiable(true);
+ return true;
+ }
+ page.setModifiable(false);
+ return false;
+ }
+
+ private Identity getIdentity() {
+ ConversationState conv = ConversationState.getCurrent();
+ if (conv == null) {
+ return guest;
+ }
+
+ Identity id = conv.getIdentity();
+ if (id == null) {
+ return guest;
+ }
+
+ return id;
+ }
+
+ /**
+ * @deprecated use getIdentity() instead of it
+ **/
+ private Identity getIdentity(String remoteUser) {
+ ConversationState conv = ConversationState.getCurrent();
+ if (conv == null) {
+ return guest;
+ }
+
+ //
+ Identity id = conv.getIdentity();
+ if (id == null) {
+ if (remoteUser != null) {
+ throw new AssertionError("There should be no on going remote user (" + remoteUser + ")");
+ }
+ return guest;
+ }
+
+ //
+ if (remoteUser.endsWith(id.getUserId())) {
+ return id;
+ } else {
+ throw new AssertionError("The remote user value " + remoteUser
+ + " is not equals to the on going identity " + id.getUserId());
+ }
+ }
+
+ private boolean hasPermission(Identity identity, String expPerm) {
+ String currentUser = identity.getUserId();
+ if (superUser_.equals(currentUser))
+ return true;
+ if (expPerm == null)
+ return false;
+ if (EVERYONE.equals(expPerm))
+ return true;
+ Permission permission = new Permission();
+ permission.setPermissionExpression(expPerm);
+ String groupId = permission.getGroupId();
+ if (currentUser == null && groupId.equals(guestGroup_))
+ return true;
+ if (identity == null) {
+ return false;
+ }
+ String membership = permission.getMembership();
+ return identity.isMemberOf(groupId, membership);
+ }
+
+ private List<String> defragmentPermission(String permission) {
+ List<String> result = new ArrayList<String>();
+ if (permission != null) {
+ if (permission.contains(",")) {
+ String[] groups = permission.split(",");
+ for (String group : groups) {
+ result.add(group.trim());
+ }
+ } else {
+ result.add(permission);
+ }
+ }
+ return result;
+ }
+
+ static public class Permission {
+
+ private String name_;
+
+ private String groupId_ = "";
+
+ private String membership_ = "";
+
+ private String expression;
+
+ private boolean selected_ = false;
+
+ public void setPermissionExpression(String exp) {
+ if (exp == null || exp.length() == 0)
+ return;
+ String[] temp = exp.split(":");
+ if (temp.length < 2)
+ return;
+ expression = exp;
+ membership_ = temp[0].trim();
+ groupId_ = temp[1].trim();
+ }
+
+ public String getGroupId() {
+ return groupId_;
+ }
+
+ public void setGroupId(String groupId) {
+ groupId_ = groupId;
+ }
+
+ public String getName() {
+ return name_;
+ }
+
+ public void setName(String name) {
+ name_ = name;
+ }
+
+ public String getValue() {
+ if (membership_.length() == 0 || groupId_.length() == 0)
+ return null;
+ return membership_ + ":" + groupId_;
+ }
+
+ public String getMembership() {
+ return membership_;
+ }
+
+ public void setMembership(String membership) {
+ membership_ = membership;
+ }
+
+ public boolean isSelected() {
+ return selected_;
+ }
+
+ public void setSelected(boolean selected) {
+ selected_ = selected;
+ }
+
+ public String getExpression() {
+ return expression;
+ }
+
+ public void setExpression(String expression) {
+ this.expression = expression;
+ }
+ }
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserACLMetaData.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserACLMetaData.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserACLMetaData.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config;
+
+/**
+ * A metadata class to describe security configuration.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class UserACLMetaData {
+
+ /** . */
+ private String superUser;
+
+ /** . */
+ private String guestsGroups;
+
+ /** . */
+ private String navigationCreatorMembershipType;
+
+ /** . */
+ private String portalCreateGroups;
+
+ public String getSuperUser() {
+ return superUser;
+ }
+
+ public void setSuperUser(String superUser) {
+ this.superUser = superUser;
+ }
+
+ public String getGuestsGroups() {
+ return guestsGroups;
+ }
+
+ public void setGuestsGroups(String guestsGroups) {
+ this.guestsGroups = guestsGroups;
+ }
+
+ public String getNavigationCreatorMembershipType() {
+ return navigationCreatorMembershipType;
+ }
+
+ public void setNavigationCreatorMembershipType(String navigationCreatorMembershipType) {
+ this.navigationCreatorMembershipType = navigationCreatorMembershipType;
+ }
+
+ public String getPortalCreateGroups() {
+ return portalCreateGroups;
+ }
+
+ public void setPortalCreateGroups(String portalCreateGroups) {
+ this.portalCreateGroups = portalCreateGroups;
+ }
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfig.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfig.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfig.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.config.model.PortalConfig;
+
+public class UserPortalConfig {
+
+ private PortalConfig portal ;
+
+ private List<PageNavigation> navigations ;
+
+ public UserPortalConfig(){
+
+ }
+
+ public UserPortalConfig(PortalConfig portal, List<PageNavigation> navigations){
+ this.portal = portal;
+ this.navigations = navigations;
+ }
+
+ public PortalConfig getPortalConfig() { return portal ; }
+ public void setPortal(PortalConfig portal) { this.portal = portal ; }
+
+ public void setNavigations(List<PageNavigation> navs) { navigations = navs ; }
+ public List<PageNavigation> getNavigations() { return navigations ; }
+
+ public void addNavigation(PageNavigation nav) {
+ if(navigations == null) navigations = new ArrayList<PageNavigation>() ;
+ if(nav == null) return;
+ navigations.add(nav) ;
+ }
+}
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigListener.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigListener.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigListener.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.exoplatform.commons.utils.PageList;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.portal.application.PortletPreferences;
+import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.config.model.PageNode;
+import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.services.jcr.ext.registry.RegistryService;
+import org.exoplatform.services.organization.User;
+import org.exoplatform.services.organization.UserEventListener;
+
+/**
+ * Created by The eXo Platform SAS May 29, 2007
+ */
+public class UserPortalConfigListener extends UserEventListener {
+
+ public void preDelete(User user) throws Exception {
+ ExoContainer container = ExoContainerContext.getCurrentContainer();
+ UserPortalConfigService portalConfigService = (UserPortalConfigService) container.getComponentInstanceOfType(UserPortalConfigService.class);
+ DataStorage dataStorage = (DataStorage) container.getComponentInstanceOfType(DataStorage.class);
+ String userName = user.getUserName();
+
+ Query<Page> query = new Query<Page>(PortalConfig.USER_TYPE, userName, Page.class);
+ PageList pageList = dataStorage.find(query);
+ pageList.setPageSize(10);
+ int i = 1;
+ while (i <= pageList.getAvailablePage()) {
+ List<?> list = pageList.getPage(i);
+ Iterator<?> iterator = list.iterator();
+ while (iterator.hasNext())
+ portalConfigService.remove((Page) iterator.next());
+ i++;
+ }
+
+ Query<PortletPreferences> portletPrefQuery = new Query<PortletPreferences>(PortalConfig.USER_TYPE,
+ userName,
+ PortletPreferences.class);
+ pageList = dataStorage.find(portletPrefQuery);
+ i = 1;
+ while (i <= pageList.getAvailablePage()) {
+ List<?> list = pageList.getPage(i);
+ Iterator<?> iterator = list.iterator();
+ while (iterator.hasNext())
+ dataStorage.remove((PortletPreferences) iterator.next());
+ i++;
+ }
+
+ PageNavigation navigation = dataStorage.getPageNavigation(PortalConfig.USER_TYPE, userName);
+ if (navigation != null)
+ portalConfigService.remove(navigation);
+ }
+
+ public void preSave(User user, boolean isNew) throws Exception {
+ ExoContainer container = ExoContainerContext.getCurrentContainer();
+ /*
+ * TODO Call start method on RegistryService to allow ecm, ultimate can run
+ * with JDK6. This is uncommon behavior. We need find other way to fix it I
+ * hope that this issues will be fixed when we use the lastest version of
+ * PicoContainer Comment by Hoa Pham.
+ */
+ RegistryService registryService = (RegistryService) container.getComponentInstanceOfType(RegistryService.class);
+ registryService.start();
+ UserPortalConfigService portalConfigService = (UserPortalConfigService) container.getComponentInstanceOfType(UserPortalConfigService.class);
+ DataStorage dataStorage = (DataStorage) container.getComponentInstanceOfType(DataStorage.class);
+ String userName = user.getUserName();
+ PageNavigation navigation = dataStorage.getPageNavigation(PortalConfig.USER_TYPE, userName);
+ if (navigation != null)
+ return;
+ PageNavigation pageNav = new PageNavigation();
+ pageNav.setOwnerType(PortalConfig.USER_TYPE);
+ pageNav.setOwnerId(userName);
+ pageNav.setPriority(5);
+ pageNav.setNodes(new ArrayList<PageNode>());
+ portalConfigService.create(pageNav);
+ }
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,559 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map.Entry;
+
+import org.exoplatform.commons.utils.LazyPageList;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.container.component.ComponentPlugin;
+import org.exoplatform.portal.application.PortletPreferences;
+import org.exoplatform.portal.config.model.Application;
+import org.exoplatform.portal.config.model.Container;
+import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.config.model.PageNode;
+import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.services.cache.CacheService;
+import org.exoplatform.services.cache.ExoCache;
+import org.exoplatform.services.cache.ExpireKeyStartWithSelector;
+import org.exoplatform.services.listener.ListenerService;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.exoplatform.services.organization.Group;
+import org.exoplatform.services.organization.OrganizationService;
+import org.exoplatform.services.portletcontainer.PortletContainerService;
+import org.exoplatform.services.portletcontainer.pci.ExoWindowID;
+import org.exoplatform.services.portletcontainer.pci.Input;
+import org.picocontainer.Startable;
+
+/**
+ * Created by The eXo Platform SAS Apr 19, 2007 This service is used to load the
+ * PortalConfig, Page config and Navigation config for a given user.
+ */
+public class UserPortalConfigService implements Startable {
+
+ public final static String CREATE_PAGE_EVENT = "UserPortalConfigService.page.onCreate".intern();
+
+ public final static String REMOVE_PAGE_EVENT = "UserPortalConfigService.page.onRemove".intern();
+
+ public final static String UPDATE_PAGE_EVENT = "UserPortalConfigService.page.onUpdate".intern();
+
+ public final static String CREATE_NAVIGATION_EVENT = "UserPortalConfigService.navigation.onCreate".intern();
+
+ public final static String REMOVE_NAVIGATION_EVENT = "UserPortalConfigService.navigation.onRemove".intern();
+
+ public final static String UPDATE_NAVIGATION_EVENT = "UserPortalConfigService.navigation.onUpdate".intern();
+
+ private DataStorage storage_;
+
+ private UserACL userACL_;
+
+ private OrganizationService orgService_;
+
+ private ListenerService listenerService;
+
+ protected ExoCache<String, PortalConfig> portalConfigCache_;
+
+ protected ExoCache<String, Page> pageConfigCache_;
+
+ protected ExoCache<String, PageNavigation> pageNavigationCache_;
+
+ private NewPortalConfigListener newPortalConfigListener_;
+
+ private Log log = ExoLogger.getLogger("Portal:UserPortalConfigService");
+
+ /**
+ *The constructor should create the DataStorage object and broadcast
+ * "the UserPortalConfigService.onInit" event
+ */
+ public UserPortalConfigService(UserACL userACL,
+ DataStorage storage,
+ CacheService cacheService,
+ OrganizationService orgService,
+ ListenerService listenerService) throws Exception {
+ storage_ = storage;
+ orgService_ = orgService;
+ this.listenerService = listenerService;
+ userACL_ = userACL;
+
+ portalConfigCache_ = cacheService.getCacheInstance(PortalConfig.class.getName());
+ pageConfigCache_ = cacheService.getCacheInstance(Page.class.getName());
+ pageNavigationCache_ = cacheService.getCacheInstance(PageNavigation.class.getName());
+ }
+
+ /**
+ * This method should load the PortalConfig object according to the
+ * portalName, set the view and edit permission according to the accessUser,
+ * load Naviagtion of the portal according to the portalName, find all the
+ * navigation of the groups that the user is belong to
+ *
+ * @param userName
+ * @return a UserPortalConfig object that contain the PortalConfig and a list
+ * of the PageNavigation objects
+ */
+ public UserPortalConfig getUserPortalConfig(String portalName, String accessUser) throws Exception {
+ PortalConfig portal = portalConfigCache_.get(portalName);
+ if (portal == null) {
+ portal = storage_.getPortalConfig(portalName);
+ if (portal != null)
+ portalConfigCache_.put(portalName, portal);
+ }
+ if (portal == null || !userACL_.hasPermission(portal))
+ return null;
+
+ List<PageNavigation> navigations = new ArrayList<PageNavigation>();
+ PageNavigation navigation = getPageNavigation(PortalConfig.PORTAL_TYPE, portalName);
+ if (navigation != null) {
+ navigation.setModifiable(userACL_.hasPermission(portal.getEditPermission()));
+ navigations.add(navigation);
+ }
+
+ if (accessUser == null) {
+ navigation = getPageNavigation(PortalConfig.GROUP_TYPE, userACL_.getGuestsGroup());
+ if (navigation != null)
+ navigations.add(navigation);
+ } else {
+ navigation = getPageNavigation(PortalConfig.USER_TYPE, accessUser);
+ if (navigation != null) {
+ navigation.setModifiable(true);
+ navigations.add(navigation);
+ }
+
+ Collection<?> groups = null;
+ if (userACL_.getSuperUser().equals(accessUser))
+ groups = orgService_.getGroupHandler().getAllGroups();
+ else
+ groups = orgService_.getGroupHandler().findGroupsOfUser(accessUser);
+ Iterator<?> iterator = groups.iterator();
+ while (iterator.hasNext()) {
+ Group m = (Group) iterator.next();
+ String groupId = m.getId().trim();
+ navigation = getPageNavigation(PortalConfig.GROUP_TYPE, groupId);
+ if (navigation == null)
+ continue;
+ navigation.setModifiable(userACL_.hasEditPermission(navigation));
+ navigations.add(navigation);
+ }
+ }
+ Collections.sort(navigations, new Comparator<PageNavigation>() {
+ public int compare(PageNavigation nav1, PageNavigation nav2) {
+ return nav1.getPriority() - nav2.getPriority();
+ }
+ });
+
+ return new UserPortalConfig(portal, navigations);
+ }
+
+ public List<String> getMakableNavigations(String remoteUser) throws Exception {
+ List<String> list = new ArrayList<String>();
+ Collection<?> groups = null;
+ if (remoteUser.equals(userACL_.getSuperUser()))
+ groups = orgService_.getGroupHandler().getAllGroups();
+ else
+ groups = orgService_.getGroupHandler().findGroupByMembership(remoteUser,
+ userACL_.getMakableMT());
+ if (groups != null) {
+ Iterator<?> iterator = groups.iterator();
+ while (iterator.hasNext()) {
+ Group m = (Group) iterator.next();
+ String groupId = m.getId().trim();
+ if (groupId.charAt(0) == '/')
+ groupId = groupId.substring(1);
+ list.add(groupId);
+ }
+ }
+ return list;
+ }
+
+ /**
+ * This method should create a the portal config, pages and nRavigation
+ * according to the template name
+ *
+ * @param portalName
+ * @param template
+ * @return
+ * @throws Exception
+ */
+ public void createUserPortalConfig(String portalName, String template) throws Exception {
+ NewPortalConfig portalConfig = newPortalConfigListener_.getPortalConfig(PortalConfig.PORTAL_TYPE);
+ portalConfig.setTemplateOwner(template);
+ portalConfig.getPredefinedOwner().clear();
+ portalConfig.getPredefinedOwner().add(portalName);
+ newPortalConfigListener_.initPortalTypeDB(portalConfig);
+ }
+
+ /**
+ * This method should remove the PortalConfig, Page and PageNavigation that
+ * belong to the portal in the database. The method should broadcast the event
+ * UserPortalConfigService.portal.onRemove
+ *
+ * @param config
+ * @throws Exception
+ */
+ public void removeUserPortalConfig(String portalName) throws Exception {
+ Query<Page> query = new Query<Page>(PortalConfig.PORTAL_TYPE, portalName, null, null, Page.class);
+ LazyPageList pageList = storage_.find(query);
+
+ List<?> listPage = pageList.getAll();
+ int lenPage = listPage.size()-1;
+ while (lenPage >= 0) {
+ Page page = (Page) listPage.get(lenPage);
+ remove(page);
+ lenPage--;
+ }
+
+ PageNavigation navigation = storage_.getPageNavigation(PortalConfig.PORTAL_TYPE, portalName);
+ if (navigation != null)
+ remove(navigation);
+
+ Query<PortletPreferences> portletPrefQuery = new Query<PortletPreferences>(PortalConfig.PORTAL_TYPE,
+ portalName,
+ null,
+ null,
+ PortletPreferences.class);
+ pageList = storage_.find(portletPrefQuery);
+ List<?> list = pageList.getAll();
+ int len = list.size()-1;
+ while (len >= 0) {
+ PortletPreferences portletPreferences = (PortletPreferences) list.get(len);
+ storage_.remove(portletPreferences);
+ len--;
+ }
+// pageList.setPageSize(10);
+// i = 1;
+// while (i <= pageList.getAvailablePage()) {
+// List<?> list = pageList.getPage(i);
+// int len = list.size()-1;
+// while (len >= 0) {
+// PortletPreferences portletPreferences = (PortletPreferences) list.get(len);
+// storage_.remove(portletPreferences);
+// len--;
+// }
+// i++;
+// }
+
+ PortalConfig config = storage_.getPortalConfig(portalName);
+ portalConfigCache_.remove(config.getName());
+ if (config != null)
+ storage_.remove(config);
+ }
+
+ /**
+ * This method should update the PortalConfig object
+ *
+ * @param portal
+ * @throws Exception
+ */
+ public void update(PortalConfig portal) throws Exception {
+ storage_.save(portal);
+ portalConfigCache_.select(new ExpireKeyStartWithSelector<String, PortalConfig>(portal.getName()));
+ }
+
+ //****************************************************************************
+ // **********************
+
+ /**
+ * this method will load the page according to the pageId
+ *
+ * @param pageId
+ * @return
+ * @throws Exception
+ */
+
+ public Page getPage(String pageId) throws Exception {
+ Page page = (Page) pageConfigCache_.get(pageId);
+ if (page == null)
+ page = storage_.getPage(pageId);
+ return page;
+ }
+
+ /**
+ * This method should load the page according to the pageId, set view and edit
+ * permission for the Page object according to the accessUser.
+ *
+ * @param accessUser
+ * @return
+ * @throws Exception
+ */
+ public Page getPage(String pageId, String accessUser) throws Exception {
+ Page page = getPage(pageId);
+ pageConfigCache_.put(pageId, page);
+ if (page == null || !userACL_.hasPermission(page))
+ return null;
+ return page;
+ }
+
+ /**
+ * This method should remove the page object in the database and broadcast the
+ * event UserPortalConfigService.page.onRemove
+ *
+ * @param config
+ * @throws Exception
+ */
+ public void remove(Page page) throws Exception {
+ storage_.remove(page);
+ pageConfigCache_.remove(page.getPageId());
+ listenerService.broadcast(REMOVE_PAGE_EVENT, this, page);
+ }
+
+ /**
+ * This method should create the given page object
+ *
+ * @param page
+ * @throws Exception
+ */
+ public void create(Page page) throws Exception {
+ storage_.create(page);
+ pageConfigCache_.put(page.getPageId(), page);
+ listenerService.broadcast(CREATE_PAGE_EVENT, this, page);
+ }
+
+ /**
+ * This method should update the given page object
+ *
+ * @param page
+ * @throws Exception
+ */
+ public void update(Page page) throws Exception {
+ storage_.save(page);
+ pageConfigCache_.select(new ExpireKeyStartWithSelector<String, Page>(page.getPageId()));
+ listenerService.broadcast(UPDATE_PAGE_EVENT, this, page);
+ }
+
+ //****************************************************************************
+ // **********************
+
+ public void create(PageNavigation navigation) throws Exception {
+ storage_.create(navigation);
+ pageNavigationCache_.put(navigation.getOwner(), navigation);
+ listenerService.broadcast(CREATE_NAVIGATION_EVENT, this, navigation);
+ }
+
+ /**
+ * This method should create or update the navigation object in the database
+ *
+ * @param navigation
+ * @throws Exception
+ */
+ public void update(PageNavigation navigation) throws Exception {
+ storage_.save(navigation);
+ pageNavigationCache_.select(new ExpireKeyStartWithSelector<String, PageNavigation>(navigation.getOwner()));
+ listenerService.broadcast(UPDATE_NAVIGATION_EVENT, this, navigation);
+ }
+
+ /**
+ * This method should remove the navigation object from the database
+ *
+ * @param navigation
+ * @throws Exception
+ */
+ public void remove(PageNavigation navigation) throws Exception {
+ storage_.remove(navigation);
+ pageNavigationCache_.remove(navigation.getOwner());
+ listenerService.broadcast(REMOVE_NAVIGATION_EVENT, this, navigation);
+ }
+
+ public PageNavigation getPageNavigation(String ownerType, String id) throws Exception {
+ PageNavigation navigation = pageNavigationCache_.get(ownerType + "::" + id);
+ if (navigation == null)
+ navigation = storage_.getPageNavigation(ownerType, id);
+ return navigation;
+ }
+
+ /**
+ * This method creates new page from an existing page and links new page to a
+ * PageNode
+ *
+ * @return PageNode
+ * @throws Exception
+ */
+ public PageNode createNodeFromPageTemplate(String nodeName,
+ String nodeLabel,
+ String pageId,
+ String ownerType,
+ String ownerId,
+ javax.portlet.PortletPreferences portletPreferences) throws Exception {
+
+ Page page = renewPage(pageId, nodeName, ownerType, ownerId, portletPreferences);
+ PageNode pageNode = new PageNode();
+ if (nodeLabel == null || nodeLabel.trim().length() < 1)
+ nodeLabel = nodeName;
+ pageNode.setName(nodeName);
+ pageNode.setLabel(nodeLabel);
+ pageNode.setPageReference(page.getPageId());
+ return pageNode;
+ }
+
+ public Page renewPage(String pageId,
+ String pageName,
+ String ownerType,
+ String ownerId,
+ javax.portlet.PortletPreferences portletPreferences) throws Exception {
+
+ Page page = storage_.getPage(pageId);
+ page.setName(pageName);
+ page.setPageId(ownerType + "::" + ownerId + "::" + pageName);
+ List<Application> apps = new ArrayList<Application>();
+ getApplications(apps, page);
+ for (Application ele : apps) {
+ String appType = ele.getApplicationType();
+ if (appType == null
+ || org.exoplatform.web.application.Application.EXO_PORTLET_TYPE.equals(appType)) {
+ javax.portlet.PortletPreferences mergedPreferences = getPreferences(ele);
+ if (portletPreferences != null) {
+ addPreferrences(mergedPreferences, portletPreferences);
+ }
+ renewInstanceId(ele, ownerType, ownerId);
+ setPreferences(ele, mergedPreferences);
+ } else {
+ renewInstanceId(ele, ownerType, ownerId);
+ }
+ }
+ create(page);
+ return page;
+ }
+
+ private void getApplications(List<Application> apps, Object component) {
+ if (component instanceof Application) {
+ apps.add((Application) component);
+ } else if (component instanceof Container) {
+ Container container = (Container) component;
+ List<Object> children = container.getChildren();
+ if (children != null)
+ for (Object ele : children)
+ getApplications(apps, ele);
+ }
+ }
+
+ private void addPreferrences(javax.portlet.PortletPreferences to,
+ javax.portlet.PortletPreferences from) throws Exception {
+ Iterator<Entry<String, String[]>> itr = from.getMap().entrySet().iterator();
+ while (itr.hasNext()) {
+ Entry<String, String[]> entry = itr.next();
+ to.setValues(entry.getKey(), entry.getValue());
+ }
+ }
+
+ private javax.portlet.PortletPreferences getPreferences(Application app) throws Exception {
+ ExoWindowID windowID = new ExoWindowID(app.getInstanceId());
+ Input input = new Input();
+ input.setInternalWindowID(windowID);
+ ExoContainer container = ExoContainerContext.getCurrentContainer();
+ PortletContainerService pcServ = (PortletContainerService) container.getComponentInstanceOfType(PortletContainerService.class);
+ return pcServ.getPortletPreferences(input);
+ }
+
+ private void setPreferences(Application portlet,
+ javax.portlet.PortletPreferences portletPreferences) throws Exception {
+ ExoWindowID windowID = new ExoWindowID(portlet.getInstanceId());
+ Input input = new Input();
+ input.setInternalWindowID(windowID);
+ ExoContainer container = ExoContainerContext.getCurrentContainer();
+ PortletContainerService pcServ = (PortletContainerService) container.getComponentInstanceOfType(PortletContainerService.class);
+ pcServ.setPortletPreferences(input, portletPreferences);
+ }
+
+ private void renewInstanceId(Application app, String ownerType, String ownerId) {
+ ExoWindowID newExoWindowID = new ExoWindowID(app.getInstanceId());
+ newExoWindowID.setOwner(ownerType + "#" + ownerId);
+ newExoWindowID.setUniqueID(String.valueOf(newExoWindowID.hashCode()));
+ app.setInstanceId(newExoWindowID.generatePersistenceId());
+ }
+
+ public Page createPageTemplate(String temp, String ownerType, String ownerId) throws Exception {
+ Page page = newPortalConfigListener_.createPageFromTemplate(temp);
+ page.setOwnerType(ownerType);
+ page.setOwnerId(ownerId);
+ List<Application> apps = new ArrayList<Application>(3);
+ getApplications(apps, page);
+ if (!apps.isEmpty()) {
+ for (Application ele : apps) {
+ makeInstanceId(ele, ownerType, ownerId);
+ }
+ createPortletPreferences(apps, temp);
+ }
+ return page;
+ }
+
+ private void makeInstanceId(Application app, String ownerType, String ownerId) {
+ StringBuilder builder = new StringBuilder(20);
+ builder.append(ownerType + "#" + ownerId + ":").append(app.getInstanceId()).append("/"
+ + builder.hashCode());
+ app.setInstanceId(builder.toString());
+ }
+
+ private void createPortletPreferences(List<Application> apps, String temp) throws Exception {
+ List<PortletPreferences> preferencesSet = newPortalConfigListener_.createPortletPreferencesFromTemplate(temp)
+ .getPortlets();
+ if (preferencesSet == null || preferencesSet.size() < 1)
+ return;
+ for (Application ele : apps) {
+ String appType = ele.getApplicationType();
+ if (appType == null
+ || org.exoplatform.web.application.Application.EXO_PORTLET_TYPE.equals(appType)) {
+ savePortletPreferences(ele, preferencesSet);
+ }
+ }
+ }
+
+ private void savePortletPreferences(Application app, List<PortletPreferences> preferencesSet) throws Exception {
+ ExoWindowID windowID = new ExoWindowID(app.getInstanceId());
+ String tmp = "/" + windowID.getPortletApplicationName() + "/" + windowID.getPortletName();
+ for (PortletPreferences preferences : preferencesSet) {
+ if (tmp.equals(preferences.getWindowId())) {
+ String[] fragments = windowID.getOwner().split("#");
+ preferences.setOwnerType(fragments[0]);
+ preferences.setOwnerId(fragments[1]);
+ preferences.setWindowId(windowID.getPersistenceId());
+ storage_.save(preferences);
+ break;
+ }
+ }
+ }
+
+ public void initListener(ComponentPlugin listener) {
+ if (listener instanceof NewPortalConfigListener) {
+ newPortalConfigListener_ = (NewPortalConfigListener) listener;
+ }
+ }
+
+ public void start() {
+ try {
+ if (newPortalConfigListener_ == null)
+ return;
+ newPortalConfigListener_.run();
+ } catch (Exception e) {
+ log.error(e);
+ }
+ }
+
+ public void stop() {
+ }
+
+ public String getDefaultPortal() {
+ return newPortalConfigListener_.getDefaultPortal();
+ }
+
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/jcr/DataMapper.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/jcr/DataMapper.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/jcr/DataMapper.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,183 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config.jcr;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+
+import org.exoplatform.portal.application.PortletPreferences;
+import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.config.model.PortalConfig;
+import org.jibx.runtime.BindingDirectory;
+import org.jibx.runtime.IBindingFactory;
+import org.jibx.runtime.IMarshallingContext;
+import org.jibx.runtime.IUnmarshallingContext;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * Created by The eXo Platform SARL
+ * Author : Tung Pham
+ * thanhtungty(a)gmail.com
+ * Nov 14, 2007
+ */
+public class DataMapper {
+
+ final static private String DATA_ELEMENT = "data" ;
+
+ final static public String EXO_REGISTRYENTRY_NT = "exo:registryEntry" ;
+ final static public String TYPE = "jcr:primaryType" ;
+ final static public String EXO_ID = "exo:id" ;
+ final static public String EXO_NAME = "exo:name" ;
+ final static public String EXO_OWNER_TYPE = "exo:ownerType" ;
+ final static public String EXO_OWNER_ID = "exo:ownerId" ;
+ final static public String EXO_DATA_TYPE = "exo:dataType" ;
+ final static public String EXO_TITLE = "exo:title" ;
+
+ public void map(Document doc, PortalConfig portal) throws Exception {
+ Element root = doc.getDocumentElement() ;
+ prepareXmlNamespace(root) ;
+ root.setAttribute(TYPE, EXO_REGISTRYENTRY_NT) ;
+ root.setAttribute(EXO_ID, portal.getName()) ;
+ root.setAttribute(EXO_NAME, portal.getName()) ;
+ root.setAttribute(EXO_TITLE, portal.getTitle()) ;
+ root.setAttribute(EXO_OWNER_TYPE, PortalConfig.PORTAL_TYPE);
+ root.setAttribute(EXO_OWNER_ID, "portalConfig");
+ root.setAttribute(EXO_DATA_TYPE, portal.getClass().getSimpleName()) ;
+ setDataValue(doc, DATA_ELEMENT, toXML(portal)) ;
+ }
+
+ public PortalConfig toPortalConfig(Document doc) throws Exception {
+ String data = getDataValue(doc, DATA_ELEMENT) ;
+ return fromXML(data, PortalConfig.class) ;
+ }
+
+ public void map(Document doc, Page page) throws Exception {
+ Element root = doc.getDocumentElement() ;
+ prepareXmlNamespace(root) ;
+ root.setAttribute(TYPE, EXO_REGISTRYENTRY_NT) ;
+ root.setAttribute(EXO_ID, page.getPageId()) ;
+ root.setAttribute(EXO_NAME, page.getName()) ;
+ root.setAttribute(EXO_TITLE, page.getTitle()) ;
+ root.setAttribute(EXO_OWNER_TYPE, page.getOwnerType());
+ root.setAttribute(EXO_OWNER_ID, page.getOwnerId());
+ root.setAttribute(EXO_DATA_TYPE, page.getClass().getSimpleName()) ;
+ setDataValue(doc, DATA_ELEMENT, toXML(page)) ;
+ }
+
+ public Page toPageConfig(Document doc) throws Exception {
+ String data = getDataValue(doc, DATA_ELEMENT) ;
+ return fromXML(data, Page.class) ;
+ }
+
+ public void map(Document doc, PageNavigation navigation) throws Exception {
+ Element root = doc.getDocumentElement() ;
+ prepareXmlNamespace(root) ;
+ root.setAttribute(TYPE, EXO_REGISTRYENTRY_NT) ;
+ root.setAttribute(EXO_ID, navigation.getOwner()) ;
+ root.setAttribute(EXO_NAME, navigation.getOwner()) ;
+ root.setAttribute(EXO_OWNER_TYPE, navigation.getOwnerType());
+ root.setAttribute(EXO_OWNER_ID, navigation.getOwnerId());
+ root.setAttribute(EXO_DATA_TYPE, navigation.getClass().getSimpleName()) ;
+ setDataValue(doc, DATA_ELEMENT, toXML(navigation)) ;
+ }
+
+ public PageNavigation toPageNavigation(Document doc) throws Exception {
+ String data = getDataValue(doc, DATA_ELEMENT) ;
+ return fromXML(data, PageNavigation.class) ;
+ }
+
+ public void map(Document doc, PortletPreferences portletPreferences) throws Exception {
+ Element root = doc.getDocumentElement() ;
+ prepareXmlNamespace(root) ;
+ String id = portletPreferences.getWindowId().replace('/', '_').replace(':', '_').replace('#', '_') ;
+ root.setAttribute(TYPE, EXO_REGISTRYENTRY_NT) ;
+ root.setAttribute(EXO_ID, id) ;
+ root.setAttribute(EXO_NAME, id) ;
+ root.setAttribute(EXO_OWNER_TYPE, portletPreferences.getOwnerType());
+ root.setAttribute(EXO_OWNER_ID, portletPreferences.getOwnerId());
+ root.setAttribute(EXO_DATA_TYPE, portletPreferences.getClass().getSimpleName()) ;
+ setDataValue(doc, DATA_ELEMENT, toXML(portletPreferences)) ;
+ }
+
+ public PortletPreferences toPortletPreferences(Document doc) throws Exception {
+ String data = getDataValue(doc, DATA_ELEMENT) ;
+ return fromXML(data, PortletPreferences.class) ;
+ }
+
+ public <T> T fromDocument(Document doc, Class<T> clazz) throws Exception {
+ String data = getDataValue(doc, DATA_ELEMENT) ;
+ return fromXML(data, clazz) ;
+ }
+
+ //------------------------------Util function-----------------------------------//
+
+ private void prepareXmlNamespace(Element element) {
+ setXmlNameSpace(element, "xmlns:exo", "http://www.exoplatform.com/jcr/exo/1.0") ;
+ setXmlNameSpace(element, "xmlns:jcr", "http://www.jcp.org/jcr/1.0") ;
+ }
+
+ private void setXmlNameSpace(Element element, String key, String value) {
+ String xmlns = element.getAttribute(key) ;
+ if(xmlns == null || xmlns.trim().length() < 1) {
+ element.setAttribute(key, value) ;
+ }
+ }
+
+ private void setDataValue(Document doc, String name, String value) {
+ Node dataElement = createDataElement(doc, name) ;
+ Node child ;
+ while((child = dataElement.getFirstChild()) != null) {
+ dataElement.removeChild(child) ;
+ }
+ Node data = doc.createCDATASection(value);
+ dataElement.appendChild(data) ;
+ }
+
+ private String getDataValue(Document doc, String name) {
+ Node dataElement = createDataElement(doc, name) ;
+ return dataElement.getFirstChild().getNodeValue() ;
+ }
+
+ private Element createDataElement(Document doc, String name) {
+ Element ele = (Element) doc.getElementsByTagName(name).item(0) ;
+ if(ele == null) {
+ ele = doc.createElement(name) ;
+ doc.getDocumentElement().appendChild(ele) ;
+ }
+ return ele ;
+ }
+
+ private String toXML(Object object) throws Exception {
+ ByteArrayOutputStream os = new ByteArrayOutputStream() ;
+ IBindingFactory bfact = BindingDirectory.getFactory(object.getClass()) ;
+ IMarshallingContext mctx = bfact.createMarshallingContext() ;
+ mctx.setIndent(2);
+ mctx.marshalDocument(object, "UTF-8", null, os) ;
+ return new String(os.toByteArray(), "UTF-8");
+ }
+
+ private <T> T fromXML(String xml, Class<T> clazz) throws Exception {
+ ByteArrayInputStream is = new ByteArrayInputStream(xml.getBytes("UTF-8")) ;
+ IBindingFactory bfact = BindingDirectory.getFactory(clazz) ;
+ IUnmarshallingContext uctx = bfact.createUnmarshallingContext() ;
+ return clazz.cast(uctx.unmarshalDocument(is, null));
+ }
+
+}
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/jcr/DataStorageImpl.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/jcr/DataStorageImpl.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/jcr/DataStorageImpl.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,368 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config.jcr;
+
+import java.util.Comparator;
+import java.util.List;
+
+import javax.jcr.PathNotFoundException;
+
+import org.exoplatform.commons.utils.LazyPageList;
+import org.exoplatform.portal.application.PortletPreferences;
+import org.exoplatform.portal.config.DataStorage;
+import org.exoplatform.portal.config.Query;
+import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.services.jcr.ext.common.SessionProvider;
+import org.exoplatform.services.jcr.ext.registry.RegistryEntry;
+import org.exoplatform.services.jcr.ext.registry.RegistryService;
+import org.exoplatform.services.listener.ListenerService;
+import org.exoplatform.services.portletcontainer.pci.ExoWindowID;
+import org.exoplatform.services.portletcontainer.pci.WindowID;
+import org.picocontainer.Startable;
+
+/**
+ * Created by The eXo Platform SARL
+ * Author : Tung Pham
+ * thanhtungty(a)gmail.com
+ * Nov 14, 2007
+ */
+public class DataStorageImpl implements DataStorage, Startable {
+
+ public final static String CREATE_PORTAL_EVENT = "UserPortalConfigService.portal.event.createPortal".intern();
+ public final static String REMOVE_PORTAL_EVENT = "UserPortalConfigService.portal.event.removePortal".intern();
+ public final static String UPDATE_PORTAL_EVENT = "UserPortalConfigService.portal.event.updatePortal".intern();
+
+ final private static String PORTAL_DATA = "MainPortalData" ;
+ final private static String USER_DATA = "UserPortalData";
+ final private static String GROUP_DATA = "SharedPortalData";
+
+ final private static String PORTAL_CONFIG_FILE_NAME = "portal-xml" ;
+ final private static String NAVIGATION_CONFIG_FILE_NAME = "navigation-xml" ;
+ final private static String GADGETS_CONFIG_FILE_NAME = "gadgets-xml" ; //TODO: dang.tung
+ final private static String PAGE_SET_NODE = "pages" ;
+ final private static String PORTLET_PREFERENCES_SET_NODE = "portletPreferences" ;
+
+ private RegistryService regService_ ;
+ private DataMapper mapper_ = new DataMapper() ;
+ private ListenerService listenerService;
+
+ public DataStorageImpl(RegistryService service,ListenerService listenerService) throws Exception {
+ regService_ = service ;
+ this.listenerService = listenerService;
+ }
+
+ public PortalConfig getPortalConfig(String portalName) throws Exception {
+ String portalPath = getApplicationRegistryPath(PortalConfig.PORTAL_TYPE, portalName)
+ + "/" + PORTAL_CONFIG_FILE_NAME;
+ SessionProvider sessionProvider = SessionProvider.createSystemProvider() ;
+ RegistryEntry portalEntry ;
+ try {
+ portalEntry = regService_.getEntry(sessionProvider, portalPath) ;
+ } catch (PathNotFoundException ie) {
+ return null ;
+ } finally {
+ sessionProvider.close() ;
+ }
+ PortalConfig config = mapper_.toPortalConfig(portalEntry.getDocument()) ;
+ return config ;
+ }
+
+ public void create(PortalConfig config) throws Exception {
+ String portalAppPath = getApplicationRegistryPath(PortalConfig.PORTAL_TYPE, config.getName()) ;
+ SessionProvider sessionProvider = SessionProvider.createSystemProvider() ;
+ try {
+ RegistryEntry portalEntry = new RegistryEntry(PORTAL_CONFIG_FILE_NAME) ;
+ mapper_.map(portalEntry.getDocument(), config) ;
+ regService_.createEntry(sessionProvider, portalAppPath, portalEntry) ;
+ //Broadcase event should be on UserPortalConfigService
+ /**
+ * Broadcast event should be on UserPortalConfigService
+ * but in current implement, portal use 2 component to create new portal:
+ * UserPortalConfigservice create/update/remove new portal from web ui
+ * NewPortalConfigListener create new portal from config to create some predefined portal from
+ * xml configuration.
+ * this implement prevent us broadcast the event in UserPortalConfigService level.
+ *
+ * */
+ listenerService.broadcast(CREATE_PORTAL_EVENT,this,config);
+ }
+ finally {
+ sessionProvider.close() ;
+ }
+ }
+
+ public void save(PortalConfig config) throws Exception {
+ String portalAppPath = getApplicationRegistryPath(PortalConfig.PORTAL_TYPE, config.getName()) ;
+ SessionProvider sessionProvider = SessionProvider.createSystemProvider() ;
+ try {
+ RegistryEntry portalEntry = regService_.getEntry(sessionProvider, portalAppPath + "/" + PORTAL_CONFIG_FILE_NAME) ;
+ mapper_.map(portalEntry.getDocument(), config) ;
+ regService_.recreateEntry(sessionProvider, portalAppPath, portalEntry) ;
+ listenerService.broadcast(UPDATE_PORTAL_EVENT,this,config);
+ }
+ finally {
+ sessionProvider.close() ;
+ }
+ }
+
+ public void remove(PortalConfig config) throws Exception {
+ String portalPath = getApplicationRegistryPath(PortalConfig.PORTAL_TYPE, config.getName())
+ + "/" + PORTAL_CONFIG_FILE_NAME;
+ SessionProvider sessionProvider = SessionProvider.createSystemProvider() ;
+ try {
+ regService_.removeEntry(sessionProvider, portalPath) ;
+ listenerService.broadcast(REMOVE_PORTAL_EVENT,this,config);
+ }
+ finally {
+ sessionProvider.close() ;
+ }
+ }
+
+ public Page getPage(String pageId) throws Exception {
+ String[] fragments = pageId.split("::") ;
+ if(fragments.length < 3) {
+ throw new Exception("Invalid PageId: " + "[" + pageId + "]") ;
+ }
+ String pagePath = getApplicationRegistryPath(fragments[0], fragments[1])
+ + "/" + PAGE_SET_NODE + "/" + fragments[2] ;
+ SessionProvider sessionProvider = SessionProvider.createSystemProvider() ;
+ RegistryEntry pageEntry ;
+ try {
+ pageEntry = regService_.getEntry(sessionProvider, pagePath) ;
+ } catch (PathNotFoundException ie) {
+ return null ;
+ } finally {
+ sessionProvider.close() ;
+ }
+ Page page = mapper_.toPageConfig(pageEntry.getDocument()) ;
+ return page ;
+ }
+
+ public void create(Page page) throws Exception {
+ String[] fragments = page.getPageId().split("::") ;
+ String pageSetPath = getApplicationRegistryPath(fragments[0], fragments[1])
+ + "/" + PAGE_SET_NODE ;
+ SessionProvider sessionProvider = SessionProvider.createSystemProvider() ;
+ try {
+ RegistryEntry pageEntry = new RegistryEntry(page.getName()) ;
+ mapper_.map(pageEntry.getDocument(), page) ;
+ regService_.createEntry(sessionProvider, pageSetPath, pageEntry) ;
+ }
+ finally {
+ sessionProvider.close() ;
+ }
+ }
+
+
+ public void save(Page page) throws Exception {
+ String[] fragments = page.getPageId().split("::") ;
+ String pageSetPath = getApplicationRegistryPath(fragments[0], fragments[1]) + "/" + PAGE_SET_NODE ;
+ SessionProvider sessionProvider = SessionProvider.createSystemProvider() ;
+ try {
+ RegistryEntry pageEntry = regService_.getEntry(sessionProvider, pageSetPath + "/" + page.getName()) ;
+ mapper_.map(pageEntry.getDocument(), page) ;
+ regService_.recreateEntry(sessionProvider, pageSetPath, pageEntry) ;
+ }
+ finally {
+ sessionProvider.close() ;
+ }
+ }
+
+ public void remove(Page page) throws Exception {
+ String[] fragments = page.getPageId().split("::") ;
+ String pagePath = getApplicationRegistryPath(fragments[0], fragments[1])
+ + "/" + PAGE_SET_NODE + "/" + page.getName() ;
+ SessionProvider sessionProvider = SessionProvider.createSystemProvider() ;
+ try {
+ regService_.removeEntry(sessionProvider, pagePath) ;
+ }
+ finally {
+ sessionProvider.close() ;
+ }
+ }
+
+ public PageNavigation getPageNavigation(String fullId) throws Exception {
+ String[] fragments = fullId.split("::") ;
+ if(fragments.length < 2) {
+ throw new Exception("Invalid PageNavigation Id: " + "[" + fullId + "]") ;
+ }
+ return getPageNavigation(fragments[0], fragments[1]) ;
+ }
+
+ public PageNavigation getPageNavigation(String ownerType, String id) throws Exception {
+ String navigationPath = getApplicationRegistryPath(ownerType, id)
+ + "/" + NAVIGATION_CONFIG_FILE_NAME ;
+ SessionProvider sessionProvider = SessionProvider.createSystemProvider() ;
+ RegistryEntry navigationEntry ;
+ try {
+ navigationEntry = regService_.getEntry(sessionProvider, navigationPath) ;
+ } catch (PathNotFoundException ie) {
+ return null ;
+ } finally {
+ sessionProvider.close() ;
+ }
+ PageNavigation navigation = mapper_.toPageNavigation(navigationEntry.getDocument()) ;
+ return navigation ;
+ }
+
+ public void create(PageNavigation navigation) throws Exception {
+ String appRegPath = getApplicationRegistryPath(navigation.getOwnerType(), navigation.getOwnerId()) ;
+ SessionProvider sessionProvider = SessionProvider.createSystemProvider() ;
+ try {
+ RegistryEntry NavigationEntry = new RegistryEntry(NAVIGATION_CONFIG_FILE_NAME) ;
+ mapper_.map(NavigationEntry.getDocument(), navigation) ;
+ regService_.createEntry(sessionProvider, appRegPath, NavigationEntry) ;
+ }
+ finally {
+ sessionProvider.close() ;
+ }
+ }
+
+ public void save(PageNavigation navigation) throws Exception {
+ String appRegPath = getApplicationRegistryPath(navigation.getOwnerType(), navigation.getOwnerId()) ;
+ SessionProvider sessionProvider = SessionProvider.createSystemProvider() ;
+ RegistryEntry navigationEntry = regService_.getEntry(sessionProvider, appRegPath + "/" + NAVIGATION_CONFIG_FILE_NAME ) ;
+ mapper_.map(navigationEntry.getDocument(), navigation) ;
+ regService_.recreateEntry(sessionProvider, appRegPath, navigationEntry) ;
+ sessionProvider.close() ;
+ }
+
+ public void remove(PageNavigation navigation) throws Exception {
+ String navigationPath = getApplicationRegistryPath(navigation.getOwnerType(), navigation.getOwnerId())
+ + "/" + NAVIGATION_CONFIG_FILE_NAME ;
+ SessionProvider sessionProvider = SessionProvider.createSystemProvider() ;
+ try {
+ regService_.removeEntry(sessionProvider, navigationPath) ;
+ }
+ finally {
+ sessionProvider.close() ;;
+ }
+ }
+
+ public PortletPreferences getPortletPreferences(WindowID windowID) throws Exception {
+ String[] fragments = windowID.getOwner().split("#") ;
+ if(fragments.length < 2) {
+ throw new Exception("Invalid WindowID: " + "[" + windowID + "]");
+ }
+ ExoWindowID exoWindowID = (ExoWindowID) windowID ;
+ String name = exoWindowID.getPersistenceId().replace('/', '_').replace(':', '_').replace('#', '_') ;
+ String portletPreferencesPath = getApplicationRegistryPath(fragments[0], fragments[1])
+ + "/" + PORTLET_PREFERENCES_SET_NODE
+ + "/" + name ;
+ SessionProvider sessionProvider = SessionProvider.createSystemProvider() ;
+ RegistryEntry portletPreferencesEntry ;
+ try {
+ portletPreferencesEntry = regService_.getEntry(sessionProvider, portletPreferencesPath) ;
+ } catch (PathNotFoundException ie) {
+ return null ;
+ } finally {
+ sessionProvider.close() ;
+ }
+ PortletPreferences portletPreferences = mapper_.toPortletPreferences(portletPreferencesEntry.getDocument()) ;
+ return portletPreferences ;
+ }
+
+ public void save(PortletPreferences portletPreferences) throws Exception {
+ List<?> preferences = portletPreferences.getPreferences();
+ if (preferences == null || preferences.isEmpty()) {
+ return;
+ }
+ String name = portletPreferences.getWindowId().replace('/', '_').replace(':', '_').replace('#', '_') ;
+ String portletPreferencesSet = getApplicationRegistryPath(portletPreferences.getOwnerType(), portletPreferences.getOwnerId())
+ + "/" + PORTLET_PREFERENCES_SET_NODE ;
+ SessionProvider sessionProvider = SessionProvider.createSystemProvider() ;
+ RegistryEntry entry ;
+ try {
+ entry = regService_.getEntry(sessionProvider, portletPreferencesSet + "/" + name) ;
+ mapper_.map(entry.getDocument(), portletPreferences) ;
+ regService_.recreateEntry(sessionProvider, portletPreferencesSet, entry) ;
+ } catch (PathNotFoundException ie) {
+ entry = new RegistryEntry(name) ;
+ mapper_.map(entry.getDocument(), portletPreferences) ;
+ regService_.createEntry(sessionProvider, portletPreferencesSet, entry) ;
+ } finally {
+ sessionProvider.close() ;
+ }
+ }
+
+ public void remove(PortletPreferences portletPreferences) throws Exception {
+ String name = portletPreferences.getWindowId().replace('/', '_').replace(':', '_').replace('#', '_') ;
+ String portletPreferencesPath = getApplicationRegistryPath(portletPreferences.getOwnerType(), portletPreferences.getOwnerId())
+ + "/" + PORTLET_PREFERENCES_SET_NODE
+ + "/" + name ;
+ SessionProvider sessionProvider = SessionProvider.createSystemProvider() ;
+ try {
+ regService_.removeEntry(sessionProvider, portletPreferencesPath) ;
+ }
+ finally {
+ sessionProvider.close() ;
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public LazyPageList find(Query q) throws Exception {
+ return find(q, null);
+ }
+
+ @SuppressWarnings("unchecked")
+ public LazyPageList find(Query q, Comparator sortComparator) throws Exception {
+ return new LazyPageList(new JCRDataStorageListAccess(regService_, q, sortComparator), 10);
+ }
+
+ public void start() {}
+
+ public void stop() {}
+
+ private void generateLikeScript(StringBuilder sql, String name, String value){
+ if(value == null || value.length() < 1) return ;
+ if(sql.indexOf(" where") < 0) sql.append(" where "); else sql.append(" and ");
+ value = value.replace('*', '%') ;
+ value = value.replace('?', '_');
+ sql.append(name).append(" like '").append(value).append("'");
+ }
+
+ private void generateContainScript(StringBuilder sql, String name, String value){
+
+ if(value == null || value.length() < 1) return ;
+
+ if(value.indexOf("*")<0){
+ if(value.charAt(0)!='*') value = "*"+value ;
+ if(value.charAt(value.length()-1)!='*') value += "*" ;
+ }
+ value = value.replace('?', '_') ;
+
+ if(sql.indexOf(" where") < 0) sql.append(" where "); else sql.append(" and ");
+ sql.append("contains(").append(name).append(", '").append(value).append("')");
+ }
+
+ private String getApplicationRegistryPath(String ownerType, String ownerId) {
+ String path = "" ;
+ if(PortalConfig.PORTAL_TYPE.equals(ownerType)) {
+ path = RegistryService.EXO_APPLICATIONS + "/" + PORTAL_DATA + "/" + ownerId;
+ } else if(PortalConfig.USER_TYPE.equals(ownerType)) {
+ path = RegistryService.EXO_USERS + "/" + ownerId + "/" + USER_DATA;
+ } else if(PortalConfig.GROUP_TYPE.equals(ownerType)) {
+ if(ownerId.charAt(0) != '/') ownerId = "/" + ownerId ;
+ path = RegistryService.EXO_GROUPS + ownerId + "/" + GROUP_DATA ;
+ }
+
+ return path ;
+ }
+
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/jcr/DataStorageListAccess.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/jcr/DataStorageListAccess.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/jcr/DataStorageListAccess.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,66 @@
+
+package org.exoplatform.portal.config.jcr;
+
+import javax.jcr.Session;
+
+import org.exoplatform.commons.utils.ListAccess;
+import org.exoplatform.services.jcr.ext.common.SessionProvider;
+import org.exoplatform.services.jcr.ext.registry.RegistryService;
+
+/*
+ * Copyright (C) 2003-2009 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/>.
+ */
+
+/*
+ * Created by The eXo Platform SAS
+ * Author : tam.nguyen
+ * tamndrok(a)gmail.com
+ * May 28, 2009
+ */
+public abstract class DataStorageListAccess implements ListAccess<Object> {
+
+ /**
+ * The RegistryService.
+ */
+ protected RegistryService service;
+
+ /**
+ * RegistryService constructor.
+ *
+ * @param service
+ * The RegistryService
+ */
+ public DataStorageListAccess(RegistryService service) {
+ this.service = service;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public abstract Object[] load(int index, int length) throws Exception ;
+
+ /**
+ * Determine the count of available users.
+ *
+ * @param session
+ * The current session
+ * @return list size
+ * @throws Exception
+ * if any error occurs
+ */
+ public abstract int getSize() throws Exception;
+
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/jcr/JCRDataStorageListAccess.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/jcr/JCRDataStorageListAccess.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/jcr/JCRDataStorageListAccess.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,208 @@
+/*
+ * Copyright (C) 2003-2009 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config.jcr;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.Session;
+import javax.jcr.query.QueryManager;
+import javax.jcr.query.QueryResult;
+
+import org.exoplatform.portal.config.Query;
+import org.exoplatform.services.jcr.ext.common.SessionProvider;
+import org.exoplatform.services.jcr.ext.registry.RegistryEntry;
+import org.exoplatform.services.jcr.ext.registry.RegistryService;
+import org.exoplatform.services.jcr.impl.core.query.QueryImpl;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * @author <a href="mailto:anatoliy.bazko@exoplatform.com.ua">Anatoliy Bazko</a>
+ * @version $Id: UserByQueryJCRUserListAccess.java 111 2008-11-11 11:11:11Z $
+ */
+public class JCRDataStorageListAccess extends DataStorageListAccess {
+
+ /**
+ * The query.
+ */
+ private Query q;
+
+ private Comparator sortComparator;
+
+ private DataMapper mapper_ = new DataMapper();
+
+ /**
+ * JCRUserListAccess constructor.
+ *
+ * @param service The JCROrganizationService
+ */
+ public JCRDataStorageListAccess(RegistryService service, Query query, Comparator sortComparator) {
+ super(service);
+ this.q = query;
+ this.sortComparator = sortComparator;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getSize() throws Exception {
+ int count = 0;
+ SessionProvider sessionProvider = SessionProvider.createSystemProvider();
+ StringBuilder builder = new StringBuilder("select * from " + DataMapper.EXO_REGISTRYENTRY_NT);
+ String registryNodePath = service.getRegistry(sessionProvider).getNode().getPath();
+ generateLikeScript(builder, "jcr:path", registryNodePath + "/%");
+ generateLikeScript(builder, DataMapper.EXO_DATA_TYPE, q.getClassType().getSimpleName());
+ generateContainScript(builder, DataMapper.EXO_OWNER_TYPE, q.getOwnerType());
+ generateContainScript(builder, DataMapper.EXO_OWNER_ID, q.getOwnerId());
+ generateContainScript(builder, DataMapper.EXO_NAME, q.getName());
+ generateContainScript(builder, DataMapper.EXO_TITLE, q.getTitle());
+ Session session = service.getRegistry(sessionProvider).getNode().getSession();
+ try {
+ QueryManager queryManager = session.getWorkspace().getQueryManager();
+ javax.jcr.query.Query query = queryManager.createQuery(builder.toString(), "sql");
+ QueryResult result = query.execute();
+ ArrayList<Object> list = new ArrayList<Object>();
+ NodeIterator itr = result.getNodes();
+
+ while(itr.hasNext()) {
+ Node node = itr.nextNode() ;
+ count++;
+ }
+ return count;
+ } finally {
+ sessionProvider.close();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object[] load(int index, int length) throws Exception {
+ if (index < 0)
+ throw new IllegalArgumentException("Illegal index: index must be a positive number");
+
+ if (length < 0)
+ throw new IllegalArgumentException("Illegal length: length must be a positive number");
+
+ SessionProvider sessionProvider = SessionProvider.createSystemProvider();
+ StringBuilder builder = new StringBuilder("select * from " + DataMapper.EXO_REGISTRYENTRY_NT);
+ String registryNodePath = service.getRegistry(sessionProvider).getNode().getPath();
+ generateLikeScript(builder, "jcr:path", registryNodePath + "/%");
+ generateLikeScript(builder, DataMapper.EXO_DATA_TYPE, q.getClassType().getSimpleName());
+ generateContainScript(builder, DataMapper.EXO_OWNER_TYPE, q.getOwnerType());
+ generateContainScript(builder, DataMapper.EXO_OWNER_ID, q.getOwnerId());
+ generateContainScript(builder, DataMapper.EXO_NAME, q.getName());
+ generateContainScript(builder, DataMapper.EXO_TITLE, q.getTitle());
+ Session session = service.getRegistry(sessionProvider).getNode().getSession();
+ try {
+ QueryManager queryManager = session.getWorkspace().getQueryManager();
+ javax.jcr.query.Query query = queryManager.createQuery(builder.toString(), "sql");
+ ((QueryImpl) query).setLimit(length);
+ ((QueryImpl) query).setOffset(index);
+ QueryResult result = query.execute();
+ ArrayList<Object> list = new ArrayList<Object>();
+ NodeIterator itr = result.getNodes();
+
+ while(itr.hasNext()) {
+// if (!itr.hasNext())
+// throw new IllegalArgumentException("Illegal index or length: sum of the index and the length cannot be greater than the list size");
+
+ Node uNode = itr.nextNode();
+
+ //if (p++ >= index) {
+ String entryPath = uNode.getPath().substring(registryNodePath.length() + 1);
+ RegistryEntry entry = service.getEntry(sessionProvider, entryPath);
+ list.add(mapper_.fromDocument(entry.getDocument(), q.getClassType()));
+ //counter++;
+ //}
+ }
+ if (sortComparator != null)
+ Collections.sort(list, sortComparator);
+ return list.toArray();
+ } finally {
+ sessionProvider.close();
+ }
+ }
+
+ /**
+ * isNameLike.
+ *
+ * @param userName
+ * @param queryName
+ * @return
+ */
+ private boolean isNameLike(String userName, String queryName) {
+ boolean startWith = false;
+ boolean endWith = false;
+
+ if (queryName.startsWith("*")) {
+ startWith = true;
+ queryName = queryName.substring(1);
+ }
+
+ if (queryName.endsWith("*")) {
+ endWith = true;
+ queryName = queryName.substring(0, queryName.length() - 1);
+ }
+
+ if (startWith && endWith) {
+ return userName.indexOf(queryName) != -1;
+ } else if (startWith) {
+ return userName.startsWith(queryName);
+ } else if (endWith) {
+ return userName.endsWith(queryName);
+ } else {
+ return userName.equals(queryName);
+ }
+ }
+
+ private void generateLikeScript(StringBuilder sql, String name, String value) {
+ if (value == null || value.length() < 1)
+ return;
+ if (sql.indexOf(" where") < 0)
+ sql.append(" where ");
+ else
+ sql.append(" and ");
+ value = value.replace('*', '%');
+ value = value.replace('?', '_');
+ sql.append(name).append(" like '").append(value).append("'");
+ }
+
+ private void generateContainScript(StringBuilder sql, String name, String value) {
+
+ if (value == null || value.length() < 1)
+ return;
+
+ if (value.indexOf("*") < 0) {
+ if (value.charAt(0) != '*')
+ value = "*" + value;
+ if (value.charAt(value.length() - 1) != '*')
+ value += "*";
+ }
+ value = value.replace('?', '_');
+
+ if (sql.indexOf(" where") < 0)
+ sql.append(" where ");
+ else
+ sql.append(" and ");
+ sql.append("contains(").append(name).append(", '").append(value).append("')");
+ }
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/Application.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/Application.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/Application.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config.model;
+
+
+/**
+ * May 13, 2004
+ * @author: Tuan Nguyen
+ * @email: tuan08(a)users.sourceforge.net
+ * @version: $Id: Portlet.java,v 1.7 2004/09/30 01:00:05 tuan08 Exp $
+ **/
+public class Application {
+
+ private String id;
+ private String instanceId ;
+ private String applicationType = org.exoplatform.web.application.Application.EXO_PORTLET_TYPE;
+ private String title;
+
+ private String icon ;
+ private String description;
+
+ private boolean showInfoBar = true ;
+ private boolean showApplicationState = true ;
+ private boolean showApplicationMode = true ;
+ private String theme;
+ private String width ;
+ private String height ;
+ private Properties properties;
+
+ private String[] accessPermissions ;
+
+ private transient boolean isModifiable ;
+
+ public Application(){
+ }
+
+ public String getWidth() { return width ; }
+ public void setWidth(String s) { width = s ;}
+
+ public String getHeight() { return height ; }
+ public void setHeight(String s) { height = s ;}
+
+ public String getId() { return id ;}
+ public void setId(String value) { id = value ; }
+
+ public String[] getAccessPermissions() { return accessPermissions; }
+ public void setAccessPermissions(String[] accessPermissions) {
+ this.accessPermissions = accessPermissions;
+ }
+
+ public boolean isModifiable() { return isModifiable ; }
+ public void setModifiable(boolean modifiable) { isModifiable = modifiable ; }
+
+ public String getInstanceId() { return instanceId ; }
+ public void setInstanceId(String value) { instanceId = value ;}
+
+ public boolean getShowInfoBar() { return showInfoBar ; }
+ public void setShowInfoBar(Boolean b) { showInfoBar = b ; }
+
+ public boolean getShowApplicationState() { return showApplicationState ; }
+ public void setShowApplicationState(Boolean b) { showApplicationState = b ; }
+
+ public boolean getShowApplicationMode() { return showApplicationMode ; }
+ public void setShowApplicationMode(Boolean b) { showApplicationMode = b ; }
+
+ public String getIcon() { return icon ; }
+ public void setIcon(String value) { icon = value ; }
+
+ public String getApplicationType() { return applicationType; }
+ public void setApplicationType(String applicationId) { this.applicationType = applicationId; }
+
+ public String getDescription() { return description ; }
+ public void setDescription(String des) { description = des ; }
+
+ public String getTitle() { return title ; }
+ public void setTitle(String value) { title = value ; }
+
+ public Properties getProperties() {
+ if(properties == null) properties = new Properties();
+ return properties;
+ }
+ public void setProperties(Properties properties) { this.properties = properties; }
+
+ public String getTheme() { return theme; }
+ public void setTheme(String theme) { this.theme = theme; }
+
+}
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/Container.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/Container.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/Container.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config.model;
+
+import java.util.ArrayList;
+/**
+ * May 13, 2004
+ * @author: Tuan Nguyen
+ * @email: tuan08(a)users.sourceforge.net
+ * @version: $Id: Container.java,v 1.8 2004/11/03 01:23:55 tuan08 Exp $
+ **/
+public class Container {
+
+ protected String id ;
+
+ protected String name ;
+ protected String icon;
+ protected String decorator ;
+ protected String template;
+
+ protected String factoryId;
+
+ protected String title;
+ protected String description;
+
+ protected String width;
+ protected String height;
+
+ private String[] accessPermissions ;
+
+ protected ArrayList<Object> children ;
+
+ public Container() {
+ children = new ArrayList<Object>();
+ }
+
+ public String getId() { return id ;}
+ public void setId(String s) { id = s ; }
+
+ public String getName() { return name ; }
+ public void setName(String s) { name = s ; }
+
+ public String getIcon() { return icon; }
+ public void setIcon(String icon) { this.icon = icon; }
+
+ public ArrayList<Object> getChildren() { return children ; }
+ public void setChildren(ArrayList<Object> children) { this.children = children; }
+
+ public String getHeight() { return height; }
+ public void setHeight(String height) { this.height = height; }
+
+ public String getWidth() { return width; }
+ public void setWidth(String width) { this.width = width; }
+
+ public String getDecorator() { return decorator ; }
+ public void setDecorator(String s) { decorator = s ; }
+
+ public String getDescription() { return description ; }
+ public void setDescription(String des) { description = des ; }
+
+ public String getTitle() { return title; }
+ public void setTitle(String title) { this.title = title; }
+
+ public String getFactoryId() { return factoryId; }
+ public void setFactoryId(String factoryId) { this.factoryId = factoryId; }
+
+ public String getTemplate() { return template; }
+ public void setTemplate(String template) { this.template = template; }
+
+ public String[] getAccessPermissions() { return accessPermissions; }
+ public void setAccessPermissions(String[] accessPermissions) {
+ this.accessPermissions = accessPermissions;
+ }
+
+}
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/Page.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/Page.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/Page.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config.model;
+
+import java.util.ArrayList;
+
+/**
+ * May 13, 2004
+ **/
+public class Page extends Container {
+
+ final static public String DESKTOP_PAGE = "Desktop";
+ final static public String DEFAULT_PAGE = "Default";
+
+ private String pageId;
+
+ private String ownerType;
+ private String ownerId;
+
+ private String[] accessPermissions ;
+
+ private String editPermission;
+
+ private boolean showMaxWindow = false ;
+
+ private String creator ;
+ private String modifier ;
+
+ private transient boolean modifiable ;
+
+ public Page() {
+ }
+
+ public String getOwnerId() { return ownerId; }
+ public void setOwnerId(String ownerId) {
+ this.ownerId = ownerId;
+ }
+
+ public String getOwnerType() { return ownerType; }
+ public void setOwnerType(String ownerType) {
+ this.ownerType = ownerType;
+ }
+
+ public String[] getAccessPermissions() { return accessPermissions ; }
+ public void setAccessPermissions(String[] s) { accessPermissions = s; }
+
+ public String getEditPermission() { return editPermission; }
+ public void setEditPermission(String editPermission) { this.editPermission = editPermission; }
+
+ public boolean isShowMaxWindow() { return showMaxWindow; }
+ public void setShowMaxWindow(Boolean showMaxWindow) {
+ this.showMaxWindow = showMaxWindow.booleanValue();
+ }
+
+ public String getPageId() {
+ if(pageId == null) pageId = ownerType +"::"+ownerId+"::"+name;
+ return pageId;
+ }
+
+ public void setPageId(String pageId) {
+ this.pageId = pageId;
+ }
+
+ public boolean isModifiable() { return modifiable ; }
+ public void setModifiable(boolean b) { modifiable = b ; }
+
+ public String getCreator() { return creator ; }
+ public void setCreator(String s) { creator = s ; }
+
+ public String getModifier() { return modifier ; }
+ public void setModifier(String s) { modifier = s ; }
+
+ static public class PageSet {
+ private ArrayList<Page> pages ;
+ public PageSet() { pages = new ArrayList<Page>(); }
+ public ArrayList<Page> getPages() { return pages ; }
+ public void setPages(ArrayList<Page> list) { pages = list ; }
+ }
+
+}
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageBody.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageBody.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageBody.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config.model;
+
+/**
+ * Created by The eXo Platform SAS
+ * Apr 25, 2007
+ */
+public class PageBody {
+
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNavigation.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNavigation.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNavigation.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config.model;
+
+import java.util.ArrayList;
+
+public class PageNavigation {
+ private String ownerType;
+ private String ownerId;
+ private String description ;
+ private transient boolean modifiable ;
+ private String creator ;
+ private String modifier ;
+ private ArrayList<PageNode> pageNodes = new ArrayList<PageNode>();
+ private int priority = 1 ;
+
+ public int getId() { return getOwner().hashCode(); }
+
+ public String getOwnerId() { return ownerId; }
+ public void setOwnerId(String ownerId) { this.ownerId = ownerId; }
+
+ public String getOwnerType() { return ownerType; }
+ public void setOwnerType(String ownerType) { this.ownerType = ownerType; }
+
+ public boolean isModifiable(){ return modifiable; }
+ public void setModifiable(boolean b) { modifiable = b ; }
+
+ public void setDescription(String des){ description = des; }
+ public String getDescription(){ return description; }
+
+ public int getPriority() { return priority ; }
+ public void setPriority(int i) { priority = i ; }
+
+ public String getCreator() { return creator ; }
+ public void setCreator(String s) { creator = s ; }
+
+ public String getModifier() { return modifier ; }
+ public void setModifier(String s) { modifier = s ; }
+
+ public String getOwner() { return ownerType +"::"+ownerId; }
+
+ public void addNode(PageNode node) {
+ if(pageNodes == null) pageNodes = new ArrayList<PageNode>();
+ pageNodes.add(node);
+ }
+
+ public ArrayList<PageNode> getNodes(){ return pageNodes; }
+ public void setNodes(ArrayList<PageNode> nodes) { pageNodes = nodes; }
+
+ public PageNode getNode(String name) {
+ for(PageNode node : pageNodes){
+ if(node.getName().equals(name)) return node;
+ }
+ return null;
+ }
+
+ public PageNavigation clone() {
+ PageNavigation newNav = new PageNavigation();
+ newNav.setOwnerId(ownerId);
+ newNav.setOwnerType(ownerType);
+ newNav.setPriority(priority);
+// newNav.setAccessPermissions(accessPermissions);
+// newNav.setEditPermission(editPermission);
+ newNav.setModifiable(modifiable);
+// newNav.setDescription(description);
+ newNav.setCreator(creator);
+ newNav.setModifier(modifier);
+
+ if(pageNodes == null || pageNodes.size() < 1) return newNav;
+ for(PageNode ele : pageNodes) {
+ newNav.getNodes().add(ele.clone());
+ }
+ return newNav;
+ }
+
+}
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNode.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNode.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNode.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config.model;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.ResourceBundle;
+
+import org.exoplatform.commons.utils.ExpressionUtil;
+
+public class PageNode {
+
+ private ArrayList<PageNode> children = new ArrayList<PageNode>(5) ;
+ private String uri ;
+ private String label ;
+ private String icon ;
+ private String name;
+ private String resolvedLabel ;
+ private Date startPublicationDate ;
+ private Date endPublicationDate ;
+ private boolean showPublicationDate = false ;
+
+ private boolean visible = true ;
+ private String pageReference ;
+
+ private transient boolean modifiable ;
+
+ public PageNode() { }
+
+ public String getUri() { return uri ; }
+ public void setUri(String s) { uri = s ; }
+
+ public String getLabel() { return label ; }
+ public void setLabel(String s) {
+ label = s ;
+ resolvedLabel = s ;
+ }
+
+ public String getIcon() { return icon ; }
+ public void setIcon(String s) { icon = s ; }
+
+ public String getPageReference() { return pageReference ;}
+ public void setPageReference(String s) { pageReference = s ;}
+
+ public String getName() { return name; }
+ public void setName(String name) { this.name = name; }
+
+ public String getResolvedLabel() { return resolvedLabel ;}
+ public void setResolvedLabel(String res) { resolvedLabel = res ;}
+ public void setResolvedLabel(ResourceBundle res) {
+ resolvedLabel = ExpressionUtil.getExpressionValue(res, label) ;
+ if(resolvedLabel == null) resolvedLabel = getName() ;
+ }
+
+ public List<PageNode> getChildren() { return children ; }
+ public void setChildren(ArrayList<PageNode> list) { children = list ; }
+
+ public boolean isModifiable() { return modifiable ; }
+ public void setModifiable(boolean b) { modifiable = b ; }
+
+ public Date getStartPublicationDate() { return startPublicationDate ; }
+ public void setStartPublicationDate(Date startDate) { startPublicationDate = startDate ; }
+
+ public Date getEndPublicationDate() { return endPublicationDate ; }
+ public void setEndPublicationDate(Date endDate) { endPublicationDate = endDate ; }
+
+ public boolean isDisplay() {
+ if(visible && showPublicationDate) {
+ return isInPublicationDate() ;
+ }
+ return visible ;
+ }
+
+ public boolean isVisible() {
+ return visible ;
+ }
+
+ public boolean getVisible() { return visible; }
+ public void setVisible(Boolean b) { visible = b.booleanValue() ; }
+
+ private boolean isInPublicationDate() {
+ if(startPublicationDate != null && endPublicationDate != null) {
+ Date currentDate = new Date() ;
+ if(currentDate.compareTo(startPublicationDate) >= 0 &&
+ currentDate.compareTo(endPublicationDate) <= 0) return true ;
+ } else if(startPublicationDate == null && endPublicationDate == null) return true ;
+ return false ;
+ }
+
+ public void setShowPublicationDate(Boolean show) { showPublicationDate = show.booleanValue() ; }
+ public boolean isShowPublicationDate() { return showPublicationDate ; }
+
+ public PageNode getChild(String name) {
+ if(children == null) return null;
+ for(PageNode node : children){
+ if(node.getName().equals(name)) return node;
+ }
+ return null;
+ }
+
+ public PageNode clone() {
+ PageNode newNode = new PageNode() ;
+ newNode.setUri(uri);
+ newNode.setLabel(label);
+ newNode.setIcon(icon);
+ newNode.setName(name);
+ newNode.setResolvedLabel(resolvedLabel) ;
+ newNode.setPageReference(pageReference);
+ newNode.setModifiable(modifiable);
+ newNode.setShowPublicationDate(showPublicationDate) ;
+ newNode.setStartPublicationDate(startPublicationDate) ;
+ newNode.setEndPublicationDate(endPublicationDate) ;
+ newNode.setVisible(visible) ;
+ if(children == null || children.size() < 1) return newNode;
+ for(PageNode ele : children) {
+ newNode.getChildren().add(ele.clone());
+ }
+ return newNode;
+ }
+
+}
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PortalConfig.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PortalConfig.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PortalConfig.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config.model;
+
+import java.util.ArrayList;
+
+/**
+ * May 13, 2004
+ * @author: Tuan Nguyen
+ * @email: tuan08(a)users.sourceforge.net
+ * @version: $Id: PortalConfig.java,v 1.7 2004/08/06 03:02:29 tuan08 Exp $
+ **/
+public class PortalConfig {
+
+ final public static String USER_TYPE = "user";
+ final public static String GROUP_TYPE = "group";
+ final public static String PORTAL_TYPE = "portal";
+
+ private String name ;
+
+ private String locale ;
+
+ private String[] accessPermissions ;
+ private String editPermission;
+
+ private Properties properties ;
+
+ private String skin;
+ private String title;
+
+ private Container portalLayout;
+
+ private String creator ;
+ private String modifier ;
+
+ private transient boolean modifiable ;
+
+ public PortalConfig() {
+ portalLayout = new Container();
+ }
+
+ public String getName() { return name ; }
+ public void setName(String s) { name = s ; }
+
+ public String getLocale() { return locale ; }
+ public void setLocale(String s) { locale = s ; }
+
+ public String [] getAccessPermissions() { return accessPermissions ; }
+ public void setAccessPermissions(String[] s) { accessPermissions = s ; }
+
+ public String getEditPermission() { return editPermission; }
+ public void setEditPermission(String editPermission) { this.editPermission = editPermission; }
+
+ public String getSkin() {
+ if(skin == null || skin.length() < 1) return "Default";
+ return skin;
+ }
+ public void setSkin(String s ) { skin = s; }
+
+ public Container getPortalLayout() { return portalLayout; }
+ public void setPortalLayout(Container container) { portalLayout = container; }
+
+ public boolean isModifiable() { return modifiable ; }
+ public void setModifiable(boolean b) { modifiable = b ; }
+
+// public String getFactoryId() {
+// return factoryId;
+// }
+// public void setFactoryId(String factoryId) { this.factoryId = factoryId; }
+
+ public String getCreator() { return creator ; }
+ public void setCreator(String s) { creator = s ; }
+
+ public String getModifier() { return modifier ; }
+ public void setModifier(String s) { modifier = s ; }
+
+ public String getTitle() { return title ; }
+ public void setTitle(String value) { title = value ; }
+
+ public Properties getProperties() { return properties ; }
+ public void setProperties(Properties props) { properties = props; }
+
+ public String getProperty(String name) {
+ if(name == null) throw new NullPointerException() ;
+ if(properties == null || !properties.containsKey(name)) return null;
+ return properties.get(name) ;
+ }
+
+ public String getProperty(String name, String defaultValue) {
+ String value = getProperty(name) ;
+ if(value != null) return value ;
+ return defaultValue ;
+ }
+
+ public void setProperty(String name, String value) {
+ if(name == null || properties == null) throw new NullPointerException() ;
+ if(value == null) properties.remove(name) ;
+ else properties.setProperty(name, value) ;
+ }
+
+ public void removeProperty(String name) {
+ if(name == null || properties == null) throw new NullPointerException() ;
+ properties.remove(name) ;
+ }
+
+ public String getSessionAlive() {
+ return getProperty(PortalProperties.SESSION_ALIVE, PortalProperties.SESSION_ON_DEMAND) ;
+ }
+ public void setSessionAlive(String type) {
+ setProperty(PortalProperties.SESSION_ALIVE, type) ;
+ }
+ static public class PortalConfigSet {
+ private ArrayList<PortalConfig> portalConfigs ;
+
+ public ArrayList<PortalConfig> getPortalConfigs() { return portalConfigs ; }
+ public void setPortalConfigs(ArrayList<PortalConfig> list) { portalConfigs = list ; }
+ }
+
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PortalProperties.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PortalProperties.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PortalProperties.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2003-2009 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config.model;
+
+/**
+ * Created by The eXo Platform SAS Author : eXoPlatform exo(a)exoplatform.com Jun
+ * 17, 2009
+ */
+public class PortalProperties {
+
+ final public static String SESSION_ALIVE = "sessionAlive";
+
+ final public static String SESSION_ON_DEMAND = "onDemand";
+
+ final public static String SESSION_ALWAYS = "always";
+
+ final public static String SESSION_NEVER = "never";
+
+ final public static String GADGET_SERVER = "gadgetServer";
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/Properties.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/Properties.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/Properties.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config.model;
+
+import java.util.HashMap;
+
+/**
+ * Created by The eXo Platform SARL
+ * Author : Nhu Dinh Thuan
+ * nhudinhthuan(a)exoplatform.com
+ * Jun 2, 2007
+ */
+@SuppressWarnings("serial")
+public class Properties extends HashMap<String, String> {
+
+ public Properties() {
+ super(10);
+ }
+
+ public Properties(int size) {
+ super(size);
+ }
+
+ public int getIntValue(String key) {
+ String value = super.get(key);
+ if(value == null || value.trim().length() < 1) return -1;
+ return Integer.valueOf(value.trim());
+ }
+
+ public double getDoubleValue(String key) {
+ String value = super.get(key);
+ if(value == null || value.trim().length() < 1) return -1.0;
+ return Double.valueOf(value.trim());
+ }
+
+ public void put(String key, int value) {
+ super.put(key, String.valueOf(value));
+ }
+
+ public void put(String key, double value) {
+ super.put(key, String.valueOf(value));
+ }
+
+ public String setProperty(String key, String value) {
+ return put(key, value);
+ }
+
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/JibxArraySerialize.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/JibxArraySerialize.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/JibxArraySerialize.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config.serialize;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by The eXo Platform SARL
+ * Author : Nhu Dinh Thuan
+ * nhudinhthuan(a)exoplatform.com
+ * Jun 2, 2007
+ */
+public class JibxArraySerialize {
+
+ public static String serializeStringArray(String[] values) {
+ StringBuilder builder = new StringBuilder();
+ for (int i = 0; i < values.length; i++) {
+ if (i > 0) builder.append(';');
+ builder.append(values[i]);
+ }
+ return builder.toString();
+ }
+
+ public static String[] deserializeStringArray(String text) {
+ if (text == null || text.trim().length() < 1) return new String[0];
+ text = text.trim();
+ List<String> list = new ArrayList<String>(5);
+ String [] components = text.split(";");
+ for(String ele : components) {
+ ele = ele.trim();
+ if(ele.length() < 1) continue;
+ list.add(ele);
+ }
+ String [] values = new String[list.size()];
+ list.toArray(values);
+ return values;
+ }
+
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/JibxPropertiesMapper.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/JibxPropertiesMapper.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/JibxPropertiesMapper.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,112 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config.serialize;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.exoplatform.portal.config.model.Properties;
+import org.jibx.runtime.IAliasable;
+import org.jibx.runtime.IMarshaller;
+import org.jibx.runtime.IMarshallingContext;
+import org.jibx.runtime.IUnmarshaller;
+import org.jibx.runtime.IUnmarshallingContext;
+import org.jibx.runtime.JiBXException;
+import org.jibx.runtime.impl.MarshallingContext;
+import org.jibx.runtime.impl.UnmarshallingContext;
+/**
+ * Created by The eXo Platform SARL
+ * Author : Nhu Dinh Thuan
+ * nhudinhthuan(a)exoplatform.com
+ * Jun 2, 2007
+ */
+public class JibxPropertiesMapper implements IMarshaller, IUnmarshaller, IAliasable {
+
+ private static final String SIZE_ATTRIBUTE_NAME = "size";
+ private static final String ENTRY_ELEMENT_NAME = "entry";
+ private static final String KEY_ATTRIBUTE_NAME = "key";
+ private static final int DEFAULT_SIZE = 10;
+
+ private String marshalURI;
+ private int marshallIndex;
+ private String marshallName;
+
+ public JibxPropertiesMapper() {
+ marshalURI = null;
+ marshallIndex = 0;
+ marshallName = "properties";
+ }
+
+ public JibxPropertiesMapper(String uri, int index, String name) {
+ marshalURI = uri;
+ marshallIndex = index;
+ marshallName = name;
+ }
+
+ @SuppressWarnings("unused")
+ public boolean isExtension(int index) { return false; }
+
+ public void marshal(Object obj, IMarshallingContext ictx) throws JiBXException {
+ if (!(obj instanceof Properties)) throw new JiBXException("Invalid object type for marshaller");
+ if (!(ictx instanceof MarshallingContext)) throw new JiBXException("Invalid object type for marshaller");
+
+ MarshallingContext ctx = (MarshallingContext)ictx;
+ Properties map = (Properties)obj;
+ MarshallingContext mContext = ctx.startTagAttributes(marshallIndex, marshallName);
+ mContext.attribute(marshallIndex, SIZE_ATTRIBUTE_NAME, map.size()).closeStartContent();
+
+ Iterator<Map.Entry<String, String>> iter = map.entrySet().iterator();
+ while (iter.hasNext()) {
+ Map.Entry<String, String> entry = iter.next();
+ String key = entry.getKey().toString();
+ String value = entry.getValue().toString();
+ if(key == null || value == null) continue;
+ ctx.startTagAttributes(marshallIndex, ENTRY_ELEMENT_NAME);
+ ctx.attribute(marshallIndex, KEY_ATTRIBUTE_NAME, key);
+ ctx.closeStartContent();
+ ctx.content(value);
+ ctx.endTag(marshallIndex, ENTRY_ELEMENT_NAME);
+ }
+
+ ctx.endTag(marshallIndex, marshallName);
+ }
+
+ public boolean isPresent(IUnmarshallingContext ctx) throws JiBXException {
+ return ctx.isAt(marshalURI, marshallName);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object unmarshal(Object obj, IUnmarshallingContext ictx) throws JiBXException {
+ UnmarshallingContext ctx = (UnmarshallingContext)ictx;
+ if (!ctx.isAt(marshalURI, marshallName)) ctx.throwStartTagNameError(marshalURI, marshallName);
+
+ int size = ctx.attributeInt(marshalURI, SIZE_ATTRIBUTE_NAME, DEFAULT_SIZE);
+ Properties map = (Properties)obj;
+ if (map == null) map = new Properties(size);
+
+ ctx.parsePastStartTag(marshalURI, marshallName);
+ while (ctx.isAt(marshalURI, ENTRY_ELEMENT_NAME)) {
+ Object key = ctx.attributeText(marshalURI, KEY_ATTRIBUTE_NAME, null);
+ ctx.next();
+ Object value = ctx.getText();
+ map.put(key.toString(), value.toString());
+ ctx.parsePastEndTag(marshalURI, ENTRY_ELEMENT_NAME);
+ }
+ ctx.parsePastEndTag(marshalURI, marshallName);
+ return map;
+ }
+}
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/layout/PortalLayoutService.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/layout/PortalLayoutService.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/layout/PortalLayoutService.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,105 @@
+/*
+ * Copyright (C) 2003-2008 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.layout;
+
+import org.exoplatform.portal.config.model.Container;
+
+/**
+ * The <code>PortalLayoutService</code> is used to save
+ * and load the layout of components.
+ * In eXo Portal, components are arranged in containers
+ * and a list of containers is a layout.
+ * <p>
+ * Created by The eXo Platform SAS<br />
+ * Jun 25, 2008<br />
+ * </p>
+ */
+public interface PortalLayoutService {
+
+ /**
+ * Creates new container object in the database.
+ * If container is existing, it will throw exception.
+ * @param container the container that is created.
+ * @throws Exception
+ */
+ public void create(Container container) throws Exception ;
+
+ /**
+ * Creates new container object in the database.
+ * If container is existing, it will throw exception.
+ * @param container the container that is created.
+ * @param userId of the user owner of this container.
+ * @throws Exception
+ */
+ public void create(Container container, String userId) throws Exception ;
+
+
+ public void create(String id, String template, String userId) throws Exception ;
+
+ /**
+ * Updates the container object in the database.
+ * If the container does not exist, it will throw exception.
+ * @param container the container that is updated.
+ * @throws Exception
+ */
+ public void save(Container container) throws Exception ;
+
+
+ /**
+ * Updates the container object in the database.
+ * If the container does not exist, it will throw exception.
+ * @param container the container that is updated.
+ * @param userId of the user owner of this container.
+ * @throws Exception
+ */
+ public void save(Container container, String userId) throws Exception ;
+
+ /**
+ * Removes the container from database.
+ * @param container the container object that is removed.
+ * @param userId of the user owner of this container.
+ * @throws Exception
+ */
+ public void remove(Container container) throws Exception ;
+
+ /**
+ * Removes the container from database.
+ * @param container the container object that is removed.
+ * @param userId of the user owner of this container.
+ * @throws Exception
+ */
+ public void remove(Container container, String userId) throws Exception ;
+
+ /**
+ * Gets the container in the database by id.
+ * @param id the id of container.
+ * @return the container or null if not found.
+ * @throws Exception
+ */
+ public Container getContainer(String id) throws Exception ;
+
+
+ /**
+ * Gets the container in the database by id.
+ * @param id the id of container.
+ * @param userId of the user owner of this container.
+ * @return the container or null if not found.
+ * @throws Exception
+ */
+ public Container getContainer(String id, String userId) throws Exception ;
+
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/layout/jcr/DataMapper.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/layout/jcr/DataMapper.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/layout/jcr/DataMapper.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,116 @@
+/*
+ * Copyright (C) 2003-2008 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.layout.jcr;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+
+import org.exoplatform.portal.config.model.Container;
+import org.jibx.runtime.BindingDirectory;
+import org.jibx.runtime.IBindingFactory;
+import org.jibx.runtime.IMarshallingContext;
+import org.jibx.runtime.IUnmarshallingContext;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * Created by The eXo Platform SAS
+ * Author : Pham Thanh Tung
+ * thanhtungty(a)gmail.com
+ * Jun 25, 2008
+ */
+public class DataMapper {
+
+ final static String EXO_REGISTRYENTRY_NT = "exo:registryEntry" ;
+ final static String PRIMARY_TYPE = "jcr:primaryType" ;
+
+ final static String EXO_DATA_TYPE = "exo:dataType" ;
+ final static String EXO_CONTAINER_ID = "exo:containerId" ;
+ final static String EXO_CONTAINER_NAME = "exo:containerName" ;
+ final static private String DATA_ELEMENT = "data" ;
+
+ public void map(Document doc, Container container) throws Exception {
+ Element root = doc.getDocumentElement() ;
+ prepareXmlNamespace(root) ;
+ root.setAttribute(PRIMARY_TYPE, EXO_REGISTRYENTRY_NT) ;
+ root.setAttribute(EXO_DATA_TYPE, container.getClass().getSimpleName()) ;
+ root.setAttribute(EXO_CONTAINER_ID, container.getId()) ;
+ root.setAttribute(EXO_CONTAINER_NAME, container.getName()) ;
+ setDataValue(doc, DATA_ELEMENT, toXML(container)) ;
+ }
+
+ public Container toContainer(Document doc) throws Exception {
+ String data = getDataValue(doc, DATA_ELEMENT) ;
+ return fromXML(data, Container.class) ;
+ }
+
+ //------------------------------Util function-----------------------------------//
+
+ private void prepareXmlNamespace(Element element) {
+ setXmlNameSpace(element, "xmlns:exo", "http://www.exoplatform.com/jcr/exo/1.0") ;
+ setXmlNameSpace(element, "xmlns:jcr", "http://www.jcp.org/jcr/1.0") ;
+ }
+
+ private void setXmlNameSpace(Element element, String key, String value) {
+ String xmlns = element.getAttribute(key) ;
+ if(xmlns == null || xmlns.trim().length() < 1) {
+ element.setAttribute(key, value) ;
+ }
+ }
+
+ private void setDataValue(Document doc, String name, String value) {
+ Node dataElement = createDataElement(doc, name) ;
+ Node child ;
+ while((child = dataElement.getFirstChild()) != null) {
+ dataElement.removeChild(child) ;
+ }
+ Node data = doc.createCDATASection(value);
+ dataElement.appendChild(data) ;
+ }
+
+ private String getDataValue(Document doc, String name) {
+ Node dataElement = createDataElement(doc, name) ;
+ return dataElement.getFirstChild().getNodeValue() ;
+ }
+
+ private Element createDataElement(Document doc, String name) {
+ Element ele = (Element) doc.getElementsByTagName(name).item(0) ;
+ if(ele == null) {
+ ele = doc.createElement(name) ;
+ doc.getDocumentElement().appendChild(ele) ;
+ }
+ return ele ;
+ }
+
+ private String toXML(Object object) throws Exception {
+ ByteArrayOutputStream os = new ByteArrayOutputStream() ;
+ IBindingFactory bfact = BindingDirectory.getFactory(object.getClass()) ;
+ IMarshallingContext mctx = bfact.createMarshallingContext() ;
+ mctx.setIndent(2);
+ mctx.marshalDocument(object, "UTF-8", null, os) ;
+ return new String(os.toByteArray(), "UTF-8");
+ }
+
+ private <T> T fromXML(String xml, Class<T> clazz) throws Exception {
+ ByteArrayInputStream is = new ByteArrayInputStream(xml.getBytes("UTF-8")) ;
+ IBindingFactory bfact = BindingDirectory.getFactory(clazz) ;
+ IUnmarshallingContext uctx = bfact.createUnmarshallingContext() ;
+ return clazz.cast(uctx.unmarshalDocument(is, null));
+ }
+
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/layout/jcr/PortalLayoutServiceImpl.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/layout/jcr/PortalLayoutServiceImpl.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/layout/jcr/PortalLayoutServiceImpl.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,203 @@
+/*
+ * Copyright (C) 2003-2008 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.layout.jcr;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.jcr.PathNotFoundException;
+
+import org.exoplatform.commons.utils.IOUtil;
+import org.exoplatform.container.configuration.ConfigurationManager;
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.container.xml.ValueParam;
+import org.exoplatform.portal.config.model.Application;
+import org.exoplatform.portal.config.model.Container;
+import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.portal.layout.PortalLayoutService;
+import org.exoplatform.services.jcr.ext.common.SessionProvider;
+import org.exoplatform.services.jcr.ext.registry.RegistryEntry;
+import org.exoplatform.services.jcr.ext.registry.RegistryService;
+import org.jibx.runtime.BindingDirectory;
+import org.jibx.runtime.IBindingFactory;
+import org.jibx.runtime.IUnmarshallingContext;
+
+/**
+ * Created by The eXo Platform SAS
+ * Author : Pham Thanh Tung
+ * thanhtungty(a)gmail.com
+ * Jun 25, 2008
+ */
+public class PortalLayoutServiceImpl implements PortalLayoutService {
+
+ final static public String APP_PATH = RegistryService.EXO_APPLICATIONS + "/Dashboard";
+ final static public String SHARED_PATH = "shared";
+ final static public String USERS_PATH = "users";
+
+ private RegistryService regService_ ;
+ private DataMapper mapper_ = new DataMapper () ;
+ ConfigurationManager confManager_;
+ private String tempLocation_;
+
+ public PortalLayoutServiceImpl(InitParams params, RegistryService service,
+ ConfigurationManager confManager) throws Exception {
+ ValueParam locationParam = params.getValueParam("template.location");
+ if(locationParam != null) tempLocation_ = locationParam.getValue();
+ confManager_ = confManager;
+ regService_ = service ;
+ }
+
+ public void create(Container container) throws Exception {
+ create(container, null);
+ }
+
+ public void create(Container container, String userId) throws Exception {
+ SessionProvider sessionProvider = SessionProvider.createSystemProvider();
+ RegistryEntry entry = new RegistryEntry(container.getId());
+ mapper_.map(entry.getDocument(), container);
+ String path;
+ if(userId == null)
+ path = getSharedPath();
+ else
+ path = getUserPath(userId);
+ regService_.createEntry(sessionProvider, path, entry);
+ sessionProvider.close();
+ }
+
+ public void create(String id, String template, String userId) throws Exception {
+ Container container = getContainerFromTemplate(template, PortalConfig.USER_TYPE, userId);
+ container.setId(id);
+ create(container, userId);
+ }
+
+ public Container getContainer(String id) throws Exception {
+ return getContainer(id, null);
+ }
+
+ public Container getContainer(String id, String userId) throws Exception {
+ SessionProvider sessionProvider = SessionProvider.createSystemProvider() ;
+ String path = getPath(id, userId);
+ RegistryEntry entry ;
+ try {
+ entry = regService_.getEntry(sessionProvider, path) ;
+ } catch (PathNotFoundException pnfe) {
+ sessionProvider.close() ;
+ return null ;
+ }
+ Container container = mapper_.toContainer(entry.getDocument()) ;
+ sessionProvider.close() ;
+ return container ;
+ }
+
+ public void remove(Container container) throws Exception {
+ remove(container, null);
+ }
+
+ public void remove(Container container, String userId) throws Exception {
+ SessionProvider sessionProvider = SessionProvider.createSystemProvider() ;
+
+ String path = getPath(container.getId(), userId);
+ regService_.removeEntry(sessionProvider, path) ;
+ sessionProvider.close() ;
+ }
+
+ public void save(Container container) throws Exception {
+ save(container, null);
+ }
+
+ public void save(Container container, String userId) throws Exception {
+ SessionProvider sessionProvider = SessionProvider.createSystemProvider() ;
+
+ String path = getPath(container.getId(), userId);
+
+ String parentPath;
+ if(userId == null)
+ parentPath = getSharedPath();
+ else
+ parentPath = getUserPath(userId);
+
+ RegistryEntry entry = regService_.getEntry(sessionProvider, path);
+ mapper_.map(entry.getDocument(), container) ;
+ regService_.recreateEntry(sessionProvider, parentPath, entry) ;
+ sessionProvider.close() ;
+ }
+
+ private String getPath(String containerId, String userId) {
+ String path;
+ if(userId == null)
+ path = getSharedPath() + "/" + containerId;
+ else {
+ path = getUserPath(userId) + "/" + containerId;
+ }
+ return path;
+ }
+
+ private String getSharedPath() {
+ return APP_PATH + "/" + SHARED_PATH;
+ }
+
+ private String getUserPath(String userId) {
+ return APP_PATH + "/" + USERS_PATH + "/" + userId;
+ }
+
+ private Container getContainerFromTemplate(String temp, String ownerType, String ownerId) throws Exception {
+ Container container = fromXML(getTemplateConfig(temp), Container.class);
+ List<Application> apps = new ArrayList<Application>(3) ;
+ getApplications(apps, container) ;
+ if(!apps.isEmpty()) {
+ for(Application ele : apps){
+ makeInstanceId(ele, ownerType, ownerId) ;
+ }
+ }
+ return container;
+ }
+
+ private String getTemplateConfig(String name) throws Exception {
+ if(tempLocation_ == null || tempLocation_.trim().length() < 1) {
+ throw new Exception("The 'template.location' parameter is expected.");
+ }
+ String path = tempLocation_ + "/" + name + "/container.xml";
+ InputStream is = confManager_.getInputStream(path);
+ return IOUtil.getStreamContentAsString(is);
+ }
+
+ private void getApplications(List<Application> apps, Object component) {
+ if(component instanceof Application) {
+ apps.add((Application) component) ;
+ } else if(component instanceof Container) {
+ Container container = (Container) component ;
+ List<Object> children = container.getChildren() ;
+ if(children != null) for(Object ele : children) getApplications(apps, ele) ;
+ }
+ }
+
+ private void makeInstanceId(Application app, String ownerType, String ownerId) {
+ StringBuilder builder = new StringBuilder(20) ;
+ builder.append(ownerType + "#" + ownerId + ":").append(app.getInstanceId()).append("/" + builder.hashCode()) ;
+ app.setInstanceId(builder.toString()) ;
+ }
+
+ private <T> T fromXML(String xml, Class<T> clazz) throws Exception {
+ ByteArrayInputStream is = new ByteArrayInputStream(xml.getBytes("UTF-8")) ;
+ IBindingFactory bfact = BindingDirectory.getFactory(clazz) ;
+ IUnmarshallingContext uctx = bfact.createUnmarshallingContext() ;
+ return clazz.cast(uctx.unmarshalDocument(is, "UTF-8"));
+ }
+
+}
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/portlet/LogPortletExceptionListener.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/portlet/LogPortletExceptionListener.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/portlet/LogPortletExceptionListener.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2003-2009 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.portlet;
+
+import org.exoplatform.services.log.Log;
+import org.exoplatform.container.component.BaseComponentPlugin;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.portletcontainer.PortletContainerException;
+import org.exoplatform.commons.utils.ExceptionUtil;
+
+/**
+ * Created by The eXo Platform SAS
+ * Author : eXoPlatform
+ * exo(a)exoplatform.com
+ * Apr 29, 2009
+ */
+public class LogPortletExceptionListener extends BaseComponentPlugin implements PortletExceptionListener {
+
+ protected static Log log = ExoLogger.getLogger("portal:UIPortletLifecycle");
+
+ public void handle(PortletContainerException e) {
+ log.error("The portlet could not be loaded. Check if properly deployed.", ExceptionUtil.getRootCause(e));
+
+ }
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/portlet/PortletExceptionHandleService.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/portlet/PortletExceptionHandleService.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/portlet/PortletExceptionHandleService.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,26 @@
+package org.exoplatform.portal.portlet;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.exoplatform.container.component.ComponentPlugin;
+import org.exoplatform.services.portletcontainer.PortletContainerException;
+
+public class PortletExceptionHandleService {
+
+ private List<PortletExceptionListener> listeners;
+
+ public void initListener(ComponentPlugin listener) throws Exception {
+ if(listener instanceof PortletExceptionListener) {
+ if(listeners == null ) listeners = new ArrayList<PortletExceptionListener>();
+ listeners.add((PortletExceptionListener) listener);
+ }
+
+ }
+
+ public void handle(PortletContainerException ex) {
+ for (PortletExceptionListener listener : listeners) {
+ listener.handle(ex);
+ }
+ }
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/portlet/PortletExceptionListener.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/portlet/PortletExceptionListener.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/portlet/PortletExceptionListener.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,7 @@
+package org.exoplatform.portal.portlet;
+
+import org.exoplatform.services.portletcontainer.PortletContainerException;
+
+public interface PortletExceptionListener {
+ public void handle(PortletContainerException e);
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/Codec.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/Codec.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/Codec.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.skin;
+
+import org.exoplatform.commons.utils.CharEncoder;
+import org.exoplatform.commons.utils.CharsetCharEncoder;
+
+import java.net.URLDecoder;
+import java.io.UnsupportedEncodingException;
+import java.io.IOException;
+
+/**
+ * A codec for names. It is a modified version of the percent encoding algorithm that translates
+ * underscores to their percent counterpart and slash to underscores. Therefore slash chars are
+ * never seen as the %2F string as it can cause some issues on tomcat when it is used in an URI.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+class Codec {
+
+ private Codec() {
+ }
+
+ private static final char[][] table = new char[256][];
+
+ static {
+ char[] a = "0123456789ABCDEF".toCharArray();
+ for (int b = 0;b < 256;b++) {
+ int b1 = (b & 0xF0) >> 4;
+ int b2 = b & 0x0F;
+ table[b] = new char[]{a[b1],a[b2]};
+ }
+ }
+
+
+ public static String decode(String s) {
+ try {
+ s = s.replace("_", "%2F");
+ return URLDecoder.decode(s, "UTF8");
+ }
+ catch (UnsupportedEncodingException e) {
+ throw new Error(e);
+ }
+ }
+
+ public static void encode(Appendable appendable, String s) throws IOException {
+ for (int i = 0; i < s.length(); i++) {
+ char c = s.charAt(i);
+ if (Character.isLetter(c)) {
+ appendable.append(c);
+ } else {
+ switch (c) {
+ case 'A':
+ case '.':
+ case '-':
+ case '*':
+ appendable.append(c);
+ break;
+ case ' ':
+ appendable.append('+');
+ break;
+ case '/':
+ appendable.append('_');
+ break;
+ default:
+ CharEncoder encoder = CharsetCharEncoder.getUTF8();
+ byte[] bytes = encoder.encode(c);
+ appendable.append('%');
+ for (byte b : bytes) {
+ for (char cc : table[b]) {
+ appendable.append(cc);
+ }
+ }
+ }
+ }
+ }
+ }
+
+}
Property changes on: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/Codec.java
___________________________________________________________________
Name: svn:executable
+
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/CompositeResourceResolver.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/CompositeResourceResolver.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/CompositeResourceResolver.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.skin;
+
+import java.io.Reader;
+import java.io.StringReader;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+class CompositeResourceResolver implements ResourceResolver {
+
+ /** . */
+ private final Map<SkinKey, SkinConfig> skins;
+
+ public CompositeResourceResolver(Map<SkinKey, SkinConfig> skins) {
+ this.skins = skins;
+ }
+
+ public Resource resolve(String path) {
+ if (path.startsWith("/portal/resource/") && path.endsWith(".css")) {
+ final StringBuffer sb = new StringBuffer();
+ String encoded = path.substring("/portal/resource/".length());
+ String blah[] = encoded.split("/");
+ int len = (blah.length >> 1) << 1;
+ for (int i = 0; i < len; i += 2) {
+ String name = Codec.decode(blah[i]);
+ String module = Codec.decode(blah[i + 1]);
+ SkinKey key = new SkinKey(module, name);
+ SkinConfig skin = skins.get(key);
+ if (skin != null) {
+ sb.append("@import url(").append(skin.getCSSPath()).append(");").append("\n");
+ }
+ }
+ return new Resource(path) {
+ @Override
+ public Reader read() {
+ return new StringReader(sb.toString());
+ }
+ };
+ } else {
+ return null;
+ }
+ }
+}
Property changes on: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/CompositeResourceResolver.java
___________________________________________________________________
Name: svn:executable
+
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/CompositeSkin.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/CompositeSkin.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/CompositeSkin.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.skin;
+
+import org.exoplatform.services.resources.Orientation;
+import org.exoplatform.commons.utils.PropertyManager;
+
+import java.util.Collection;
+import java.util.TreeMap;
+import java.io.IOException;
+
+/**
+ * A composite skin.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+class CompositeSkin implements Skin {
+
+ /** . */
+ private final SkinService service;
+
+ /** . */
+ private final String id;
+
+ /** . */
+ private final String urlPrefix;
+
+ CompositeSkin(SkinService service, Collection<SkinConfig> skins) {
+ TreeMap<String, SkinConfig> urlSkins = new TreeMap<String, SkinConfig>();
+ for (SkinConfig skin : skins) {
+ urlSkins.put(skin.getCSSPath(), skin);
+ }
+
+ //
+ final StringBuilder builder = new StringBuilder();
+ builder.append("/portal/resource");
+
+ //
+ final StringBuilder id = new StringBuilder();
+
+ //
+ try {
+ for (SkinConfig cfg : urlSkins.values()) {
+ StringBuilder encodedName = new StringBuilder();
+ Codec.encode(encodedName, cfg.getName());
+ StringBuilder encodedModule = new StringBuilder();
+ Codec.encode(encodedModule, cfg.getModule());
+
+ //
+ id.append(encodedName).append(encodedModule);
+ builder.append("/").append(encodedName).append("/").append(encodedModule);
+ }
+ }
+ catch (IOException e) {
+ throw new Error(e);
+ }
+
+ //
+ this.service = service;
+ this.id = id.toString();
+ this.urlPrefix = builder.toString();
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public SkinURL createURL() {
+ return new SkinURL() {
+
+ Orientation orientation;
+
+ public void setOrientation(Orientation orientation) {
+ this.orientation = orientation;
+ }
+
+ @Override
+ public String toString() {
+ return urlPrefix +
+ "/" + (PropertyManager.isDevelopping() ? "style" : service.id) +
+ service.getSuffix(orientation);
+ }
+ };
+ }
+}
Property changes on: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/CompositeSkin.java
___________________________________________________________________
Name: svn:executable
+
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/MainResourceResolver.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/MainResourceResolver.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/MainResourceResolver.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.skin;
+
+import javax.servlet.ServletContext;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+class MainResourceResolver implements ResourceResolver {
+
+ final Map<String, SimpleResourceContext> contexts;
+ final CopyOnWriteArrayList<ResourceResolver> resolvers;
+ final Map<SkinKey, SkinConfig> skins;
+
+ public MainResourceResolver(Map<SkinKey, SkinConfig> skins) {
+ this.skins = skins;
+ this.contexts = new HashMap<String, SimpleResourceContext>();
+ this.resolvers = new CopyOnWriteArrayList<ResourceResolver>();
+
+ //
+ resolvers.add(new CompositeResourceResolver(skins));
+ }
+
+ SimpleResourceContext registerContext(ServletContext servletContext) {
+ String key = "/" + servletContext.getServletContextName();
+ SimpleResourceContext ctx = contexts.get(key);
+ if (ctx == null) {
+ ctx = new SimpleResourceContext(key, servletContext);
+ contexts.put(ctx.getContextPath(), ctx);
+ }
+ return ctx;
+ }
+
+ public Resource resolve(String path) {
+ for (ResourceResolver resolver : resolvers) {
+ Resource res = resolver.resolve(path);
+ if (res != null) {
+ return res;
+ }
+ }
+
+ //
+ int i1 = path.indexOf("/", 2);
+ String targetedContextPath = path.substring(0, i1);
+ SimpleResourceContext context = contexts.get(targetedContextPath);
+ return context.getResource(path.substring(i1));
+ }
+}
Property changes on: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/MainResourceResolver.java
___________________________________________________________________
Name: svn:executable
+
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/RenderingException.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/RenderingException.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/RenderingException.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.skin;
+
+/**
+ * Signal an exception during rendering.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class RenderingException extends Exception {
+
+ public RenderingException() {
+ }
+
+ public RenderingException(String message) {
+ super(message);
+ }
+
+ public RenderingException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public RenderingException(Throwable cause) {
+ super(cause);
+ }
+}
Property changes on: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/RenderingException.java
___________________________________________________________________
Name: svn:executable
+
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/Resource.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/Resource.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/Resource.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.skin;
+
+import java.io.Reader;
+import java.io.IOException;
+
+/**
+ * Represents a resource.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public abstract class Resource {
+
+ private final String contextPath;
+ private final String parentPath;
+ private final String fileName;
+
+ public Resource(String path) {
+ int index = path.indexOf("/", 2);
+ String relativeCSSPath = path.substring(index);
+ int index2 = relativeCSSPath.lastIndexOf("/") + 1;
+
+ //
+ this.contextPath = path.substring(0, index);
+ this.parentPath = relativeCSSPath.substring(0, index2);
+ this.fileName = relativeCSSPath.substring(index2);
+ }
+
+ public Resource(String contextPath, String parentPath, String fileName) {
+ this.contextPath = contextPath;
+ this.parentPath = parentPath;
+ this.fileName = fileName;
+ }
+
+ public final String getPath() {
+ return getContextPath() + getParentPath() + getFileName();
+ }
+
+ public final String getContextPath() {
+ return contextPath;
+ }
+
+ public final String getParentPath() {
+ return parentPath;
+ }
+
+ public final String getFileName() {
+ return fileName;
+ }
+
+ public final String getResourcePath() {
+ return getParentPath() + getFileName();
+ }
+
+ public abstract Reader read() throws IOException;
+}
Property changes on: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/Resource.java
___________________________________________________________________
Name: svn:executable
+
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/ResourceRenderer.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/ResourceRenderer.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/ResourceRenderer.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.skin;
+
+/**
+ * An interface defining the renderer contract for a resource.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public interface ResourceRenderer {
+
+ /**
+ * Returns an appendable for the performing the rendering of the resource.
+ *
+ * @return the appendable
+ */
+ Appendable getAppendable();
+
+ /**
+ * Instruct the renderer about the expiration time in seconds. A non positive value
+ * means that no caching should be performed. The expiration value is relative to the
+ * date of the request.
+ *
+ * @param seconds the value in seconds
+ */
+ void setExpiration(long seconds);
+
+}
Property changes on: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/ResourceRenderer.java
___________________________________________________________________
Name: svn:executable
+
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/ResourceResolver.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/ResourceResolver.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/ResourceResolver.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.skin;
+
+/**
+ * A resource resolver for char based resources.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public interface ResourceResolver {
+
+ /**
+ * Returns a reader for the provided path or null if the resource cannot be resolved.
+ *
+ * @param path the path
+ * @return a reader
+ */
+ Resource resolve(String path);
+
+}
Property changes on: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/ResourceResolver.java
___________________________________________________________________
Name: svn:executable
+
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SimpleResourceContext.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SimpleResourceContext.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SimpleResourceContext.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.skin;
+
+import javax.servlet.ServletContext;
+import java.io.Reader;
+import java.io.InputStreamReader;
+import java.io.IOException;
+import java.net.URL;
+import java.net.MalformedURLException;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+class SimpleResourceContext {
+
+ private final String contextPath;
+
+ private final ServletContext context;
+
+ public SimpleResourceContext(String contextPath, ServletContext context) {
+ this.contextPath = contextPath;
+ this.context = context;
+ }
+
+ public Resource getResource(String path) {
+ int i2 = path.lastIndexOf("/") + 1;
+ String targetedParentPath = path.substring(0, i2);
+ String targetedFileName = path.substring(i2);
+ try {
+ final URL url = context.getResource(path);
+ if (url != null) {
+ return new Resource(contextPath, targetedParentPath, targetedFileName) {
+ @Override
+ public Reader read() throws IOException {
+ return new InputStreamReader(url.openStream());
+ }
+ };
+ }
+ }
+ catch (MalformedURLException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public String getContextPath() {
+ return contextPath;
+ }
+}
Property changes on: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SimpleResourceContext.java
___________________________________________________________________
Name: svn:executable
+
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SimpleSkin.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SimpleSkin.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SimpleSkin.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.skin;
+
+import org.exoplatform.services.resources.Orientation;
+
+/**
+ * An implementation of the skin config.
+ *
+ * Created by The eXo Platform SAS
+ * Jan 19, 2007
+ */
+class SimpleSkin implements SkinConfig {
+
+ private final SkinService service_;
+ private final String module_ ;
+ private final String name_;
+ private final String cssPath_ ;
+ private final String id_ ;
+
+ public SimpleSkin(SkinService service, String module, String name, String cssPath) {
+ service_ = service;
+ module_ = module;
+ name_ = name;
+ cssPath_ = cssPath;
+ id_ = module.replace('/', '_') ;
+ }
+
+ public String getId() { return id_ ; }
+ public String getModule(){ return module_; }
+ public String getCSSPath(){ return cssPath_; }
+ public String getName() { return name_; }
+
+ public SkinURL createURL() {
+ return new SkinURL() {
+
+ Orientation orientation = null;
+
+ public void setOrientation(Orientation orientation) {
+ this.orientation = orientation;
+ }
+
+ @Override
+ public String toString() {
+ return cssPath_.replaceAll("\\.css$", service_.getSuffix(orientation));
+ }
+ };
+ }
+}
\ No newline at end of file
Property changes on: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SimpleSkin.java
___________________________________________________________________
Name: svn:executable
+
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/Skin.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/Skin.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/Skin.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.skin;
+
+/**
+ * A skin.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public interface Skin {
+
+ /**
+ * Returns the skin id.
+ *
+ * @return the skin id
+ */
+ String getId();
+
+ /**
+ * Creates and return a skin URL.
+ *
+ * @return the skin URL
+ */
+ SkinURL createURL();
+
+}
Property changes on: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/Skin.java
___________________________________________________________________
Name: svn:executable
+
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SkinConfig.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SkinConfig.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SkinConfig.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.skin;
+
+/**
+ * Extends a skin with additional information.
+ *
+ * Created by The eXo Platform SAS
+ * Jan 19, 2007
+ */
+public interface SkinConfig extends Skin {
+
+ /**
+ * Returns the skin name
+ *
+ * @return the skin name
+ */
+ String getName();
+
+ /**
+ * Returns the skin module.
+ *
+ * @return the module
+ */
+ String getModule();
+
+ /**
+ * Returns the css path.
+ *
+ * @return the css path
+ */
+ String getCSSPath();
+
+}
\ No newline at end of file
Property changes on: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SkinConfig.java
___________________________________________________________________
Name: svn:executable
+
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SkinKey.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SkinKey.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SkinKey.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.skin;
+
+/**
+ * A key for skin config lookup.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+class SkinKey {
+
+ private final String module;
+ private final String name;
+ private final int hashCode;
+
+ /**
+ * Creates a new skin key.
+ *
+ * @param module the skin base
+ * @param name the skin name
+ * @throws IllegalArgumentException if any argument is null
+ */
+ public SkinKey(String module, String name) throws IllegalArgumentException {
+ if (module == null) {
+ throw new IllegalArgumentException("No null base accepted");
+ }
+ if (name == null) {
+ throw new IllegalArgumentException("No null skin name accepted");
+ }
+
+ //
+ this.module = module;
+ this.name = name;
+ this.hashCode = module.hashCode() * 41 + name.hashCode();
+ }
+
+ public String getModule() {
+ return module;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public int hashCode() {
+ return hashCode;
+ }
+
+ public boolean equals(Object obj) {
+ if (obj == null) {
+ return false;
+ }
+ if (obj == this) {
+ return true;
+ }
+ if (obj instanceof SkinKey) {
+ SkinKey that = (SkinKey)obj;
+ return that.module.equals(module) && that.name.equals(name);
+ }
+ return false;
+ }
+
+ public String toString() {
+ return "SkinKey[base=" + module + ",name=" + name + "]";
+ }
+}
Property changes on: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SkinKey.java
___________________________________________________________________
Name: svn:executable
+
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SkinService.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SkinService.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SkinService.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,451 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.skin;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.Reader;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EnumMap;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.servlet.ServletContext;
+
+import org.exoplatform.services.log.Log;
+import org.exoplatform.commons.utils.PropertyManager;
+import org.exoplatform.commons.utils.Safe;
+import org.exoplatform.management.annotations.Managed;
+import org.exoplatform.management.annotations.ManagedDescription;
+import org.exoplatform.management.annotations.ManagedName;
+import org.exoplatform.management.jmx.annotations.NameTemplate;
+import org.exoplatform.management.jmx.annotations.Property;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.resources.Orientation;
+
+@Managed
+@NameTemplate({
+ @Property(key = "view", value = "portal"),
+ @Property(key = "service", value = "management"),
+ @Property(key="type", value="skin")
+})
+@ManagedDescription("Skin service")
+public class SkinService {
+
+ protected static Log log = ExoLogger.getLogger("portal.SkinService");
+
+ private static final Map<Orientation, String> suffixMap = new EnumMap<Orientation, String>(Orientation.class);
+
+ static
+ {
+ suffixMap.put(Orientation.LT, "-lt.css");
+ suffixMap.put(Orientation.RT, "-rt.css");
+ suffixMap.put(Orientation.TL, "-lt.css");
+ suffixMap.put(Orientation.TR, "-lt.css");
+ }
+
+ private static final String LEFT_P = "\\(";
+ private static final String RIGHT_P = "\\)";
+
+ /** Immutable and therefore thread safe. */
+ private static final Pattern IMPORT_PATTERN = Pattern.compile("(@import\\s+" + "url" + LEFT_P + "['\"]?" + ")([^'\"]+.css)(" + "['\"]?" + RIGHT_P + "\\s*;)");
+
+ /** Immutable and therefore thread safe. */
+ private static final Pattern BACKGROUND_PATTERN = Pattern.compile("(background.*:.*url" + LEFT_P + "['\"]?" + ")([^'\"]+)(" + "['\"]?" + RIGHT_P + ".*;)");
+
+ /** Immutable and therefore thread safe. */
+ private static final Pattern LT = Pattern.compile("/\\*\\s*orientation=lt\\s*\\*/");
+
+ /** Immutable and therefore thread safe. */
+ private static final Pattern RT = Pattern.compile("/\\*\\s*orientation=rt\\s*\\*/");
+
+ /** One month caching. */
+ private static final int ONE_MONTH = 2592000;
+
+ /** One hour caching. */
+ private static final int ONE_HOUR = 3600;
+
+ private final Map<SkinKey, SkinConfig> portalSkins_ ;
+ private final Map<SkinKey, SkinConfig> skinConfigs_;
+ private final HashSet<String> availableSkins_;
+ private final Map<String, String> ltCache;
+ private final Map<String, String> rtCache;
+ private final Map<String, Set<String>> portletThemes_;
+ private final MainResourceResolver mainResolver;
+
+ /**
+ * An id used for caching request. The id life cycle is the same than the class instance because
+ * we consider css will change until server is restarted. Of course this only applies for the
+ * developing mode set to false.
+ */
+ final String id = Long.toString(System.currentTimeMillis());
+
+ public SkinService() {
+ portalSkins_ = new LinkedHashMap<SkinKey, SkinConfig>() ;
+ skinConfigs_ = new LinkedHashMap<SkinKey, SkinConfig>(20);
+ availableSkins_ = new HashSet<String>(5);
+ ltCache = new ConcurrentHashMap<String, String>();
+ rtCache = new ConcurrentHashMap<String, String>();
+ portletThemes_ = new HashMap<String, Set<String>>();
+ mainResolver = new MainResourceResolver(skinConfigs_);
+ }
+
+ public void addCategoryTheme(String categoryName) {
+ if (!portletThemes_.containsKey(categoryName))
+ portletThemes_.put(categoryName, new HashSet<String>());
+ }
+
+ public void addPortalSkin(String module, String skinName, String cssPath, ServletContext scontext) {
+ addPortalSkin(module, skinName, cssPath, scontext, false) ;
+ }
+
+ /**
+ * Register the stylesheet for a portal Skin.
+ *
+ * @param module skin module identifier
+ * @param skinName skin name
+ * @param cssPath path uri to the css file. This is relative to the root context, use leading '/'
+ * @param scontext the webapp's {@link javax.servlet.ServletContext}
+ * @param overwrite if any previous skin should be replaced by that one
+ */
+ public void addPortalSkin(String module, String skinName, String cssPath,
+ ServletContext scontext, boolean overwrite) {
+
+ // Triggers a put if absent
+ mainResolver.registerContext(scontext);
+
+ availableSkins_.add(skinName) ;
+ SkinKey key = new SkinKey(module, skinName);
+ SkinConfig skinConfig = portalSkins_.get(key);
+ if (skinConfig == null || overwrite) {
+ skinConfig = new SimpleSkin(this, module, skinName, cssPath) ;
+ portalSkins_.put(key, skinConfig);
+ }
+ }
+
+ public void addPortalSkin(String module, String skinName, String cssPath, String cssData) {
+ SkinKey key = new SkinKey(module, skinName);
+ SkinConfig skinConfig = portalSkins_.get(key);
+ if (skinConfig == null) {
+ portalSkins_.put(key, new SimpleSkin(this, module, skinName, cssPath));
+ }
+ ltCache.put(cssPath, cssData);
+ rtCache.put(cssPath, cssData);
+ }
+
+ public void addSkin(
+ String module,
+ String skinName,
+ String cssPath,
+ ServletContext scontext) {
+ addSkin(module, skinName, cssPath, scontext, false);
+ }
+
+ /**
+ * Merge several skins into one single skin.
+ *
+ * @param skins the skins to merge
+ * @return the merged skin
+ */
+ public Skin merge(Collection<SkinConfig> skins) {
+ return new CompositeSkin(this, skins);
+ }
+
+ /**
+ * Add a resource resolver to plug external resolvers.
+ *
+ * @param resolver a resolver to add
+ */
+ public void addResourceResolver(ResourceResolver resolver) {
+ mainResolver.resolvers.addIfAbsent(resolver);
+ }
+
+ public void addSkin(String module, String skinName, String cssPath, ServletContext scontext, boolean overwrite) {
+
+ // Triggers a put if absent
+ mainResolver.registerContext(scontext);
+
+ availableSkins_.add(skinName);
+ SkinKey key = new SkinKey(module, skinName);
+ SkinConfig skinConfig = skinConfigs_.get(key);
+ if (skinConfig == null || overwrite) {
+ skinConfig = new SimpleSkin(this, module, skinName, cssPath);
+ skinConfigs_.put(key, skinConfig);
+ }
+ }
+
+ public void addSkin(String module, String skinName, String cssPath, String cssData) {
+ availableSkins_.add(skinName);
+ SkinKey key = new SkinKey(module, skinName);
+ SkinConfig skinConfig = skinConfigs_.get(key);
+ if (skinConfig == null) {
+ skinConfigs_.put(key, new SimpleSkin(this, module, skinName, cssPath));
+ }
+ ltCache.put(cssPath, cssData);
+ rtCache.put(cssPath, cssData);
+ }
+
+
+ public void addTheme(String categoryName, List<String> themesName) {
+ if (!portletThemes_.containsKey(categoryName))
+ portletThemes_.put(categoryName, new HashSet<String>());
+ Set<String> catThemes = portletThemes_.get(categoryName);
+ for (String theme : themesName)
+ catThemes.add(theme);
+ }
+
+ /**
+ * Get names of all the currently registered skins.
+ *
+ * @return an unmodifiable Set of the currently registered skins
+ */
+ public Set<String> getAvailableSkinNames() {
+ return availableSkins_;
+ }
+
+ /**
+ * Return the CSS content of the file specified by the given URI.
+ *
+ * @param cssPath path of the css to find
+ * @return the css
+ */
+ public String getCSS(String cssPath) {
+ try {
+ final StringBuilder sb = new StringBuilder();
+ renderCSS(new ResourceRenderer() {
+ public Appendable getAppendable() {
+ return sb;
+ }
+ public void setExpiration(long seconds) {
+
+ }
+ }, cssPath);
+ return sb.toString();
+ }
+ catch (IOException e) {
+ log.error("Error while rendering css " + cssPath, e);
+ return null;
+ }
+ catch (RenderingException e) {
+ log.error("Error while rendering css " + cssPath, e);
+ return null;
+ }
+ }
+
+ public void renderCSS(ResourceRenderer renderer, String path) throws RenderingException, IOException {
+ Orientation orientation = Orientation.LT;
+ if (path.endsWith("-lt.css")) {
+ path = path.substring(0, path.length() - "-lt.css".length()) + ".css";
+ } else if (path.endsWith("-rt.css")) {
+ path = path.substring(0, path.length() - "-rt.css".length()) + ".css";
+ orientation = Orientation.RT;
+ }
+
+ // Try cache first
+ if (!PropertyManager.isDevelopping()) {
+
+ if (path.startsWith("/portal/resource")) {
+ renderer.setExpiration(ONE_MONTH);
+ } else {
+ renderer.setExpiration(ONE_HOUR);
+ }
+
+ //
+ Map<String, String> cache = orientation == Orientation.LT ? ltCache : rtCache;
+ String css = cache.get(path);
+ if (css == null) {
+ StringBuilder sb = new StringBuilder();
+ processCSS(sb, path, orientation, true);
+ css = sb.toString();
+ cache.put(path, css);
+ }
+ renderer.getAppendable().append(css);
+ } else {
+ processCSS(renderer.getAppendable(), path, orientation, false);
+ }
+ }
+
+ public String getMergedCSS(String cssPath) {
+ return ltCache.get(cssPath);
+ }
+
+ public Collection<SkinConfig> getPortalSkins(String skinName) {
+ Set<SkinKey> keys = portalSkins_.keySet();
+ Collection<SkinConfig> portalSkins = new ArrayList<SkinConfig>() ;
+ for(SkinKey key : keys) {
+ if(key.getName().equals(skinName)) portalSkins.add(portalSkins_.get(key)) ;
+ }
+ return portalSkins ;
+ }
+
+ public Map<String, Set<String>> getPortletThemes() {
+ return portletThemes_;
+ }
+
+ public SkinConfig getSkin(String module, String skinName) {
+ SkinConfig config = skinConfigs_.get(new SkinKey(module, skinName)) ;
+ if(config == null) skinConfigs_.get(new SkinKey(module, "Default")) ;
+ return config;
+ }
+
+ public void invalidatePortalSkinCache(String portalName, String skinName) {
+ SkinKey key = new SkinKey(portalName, skinName);
+ skinConfigs_.remove(key);
+ }
+
+ public void remove(String module, String skinName) throws Exception {
+ SkinKey key;
+ if (skinName.length() == 0)
+ key = new SkinKey(module, "Default");
+ else
+ key = new SkinKey(module, skinName);
+ skinConfigs_.remove(key);
+ }
+
+ public int size() {
+ return skinConfigs_.size();
+ }
+
+ private void processCSS(Appendable appendable, String cssPath, Orientation orientation, boolean merge) throws RenderingException, IOException {
+ Resource skin = mainResolver.resolve(cssPath);
+ processCSSRecursively(appendable, merge, skin, orientation);
+ }
+
+ private void processCSSRecursively(
+ Appendable appendable,
+ boolean merge,
+ Resource skin,
+ Orientation orientation) throws RenderingException, IOException {
+
+ // The root URL for the entry
+ String basePath = skin.getContextPath() + skin.getParentPath();
+
+ //
+ String line = "";
+ Reader tmp = skin.read();
+ if (tmp == null) {
+ throw new RenderingException("No skin resolved for path " + skin.getResourcePath());
+ }
+ BufferedReader reader = new BufferedReader(tmp);
+ try {
+ while ((line = reader.readLine()) != null) {
+ Matcher matcher = IMPORT_PATTERN.matcher(line);
+ if (matcher.find()) {
+ String includedPath = matcher.group(2);
+ if(includedPath.startsWith("/")) {
+ if(merge) {
+ Resource ssskin = mainResolver.resolve(includedPath);
+ processCSSRecursively(appendable, merge, ssskin, orientation);
+ } else {
+ appendable.append(matcher.group(1)).
+ append(includedPath.substring(0, includedPath.length() - ".css".length())).
+ append(getSuffix(orientation)).
+ append(matcher.group(3)).
+ append("\n");
+ }
+ } else {
+ if(merge) {
+ String path = skin.getContextPath() + skin.getParentPath() + includedPath;
+ Resource ssskin = mainResolver.resolve(path);
+ processCSSRecursively(appendable, merge, ssskin, orientation);
+ } else {
+ appendable.append(matcher.group(1));
+ appendable.append(basePath);
+ appendable.append(includedPath.substring(0, includedPath.length() - ".css".length()));
+ appendable.append(getSuffix(orientation));
+ appendable.append(matcher.group(3));
+ }
+ }
+ } else {
+ if (orientation == null || wantInclude(line, orientation)) {
+ append(line, basePath, appendable);
+ }
+ }
+ }
+ } finally {
+ Safe.close(reader);
+ }
+ }
+
+ /**
+ * Filter what if it's annotated with the alternative orientation.
+ *
+ * @param line the line to include
+ * @param orientation the orientation
+ * @return true if the line is included
+ */
+ private boolean wantInclude(String line, Orientation orientation) {
+ Pattern orientationPattern = orientation == Orientation.LT ? RT : LT;
+ Matcher matcher2 = orientationPattern.matcher(line);
+ return !matcher2.find();
+ }
+
+ private void append(String line, String basePath, Appendable appendable) throws IOException {
+ // Rewrite background url pattern
+ Matcher matcher = BACKGROUND_PATTERN.matcher(line);
+ if (matcher.find() && !matcher.group(2).startsWith("\"/") && !matcher.group(2).startsWith("'/") && !matcher.group(2).startsWith("/")) {
+ appendable.append(matcher.group(1)).append(basePath).append(matcher.group(2)).append(matcher.group(3)).append('\n');
+ } else {
+ appendable.append(line).append('\n');
+ }
+ }
+
+ String getSuffix(Orientation orientation) {
+ if (orientation == null) {
+ orientation = Orientation.LT;
+ }
+ return suffixMap.get(orientation);
+ }
+
+ @Managed
+ @ManagedDescription ("The list of registered skins identifiers")
+ public String[] getSkinList() {
+ // get all available skin
+ List<String> availableSkin = new ArrayList<String>() ;
+ for(String skin : availableSkins_) {
+ availableSkin.add(skin) ;
+ }
+ // sort skin name asc
+ Collections.sort(availableSkin);
+
+ return availableSkin.toArray(new String[availableSkin.size()]);
+ }
+
+ @Managed
+ @ManagedDescription ("Reload all skins")
+ public void reloadSkins() {
+ // remove all ltCache, rtCache
+ ltCache.clear();
+ rtCache.clear();
+ }
+
+ @Managed
+ @ManagedDescription ("Reload a specified skin")
+ public void reloadSkin(@ManagedDescription("The skin id") @ManagedName("skinId") String skinId) {
+ ltCache.remove(skinId);
+ rtCache.remove(skinId);
+ }
+}
\ No newline at end of file
Property changes on: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SkinService.java
___________________________________________________________________
Name: svn:executable
+
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SkinURL.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SkinURL.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SkinURL.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.skin;
+
+import org.exoplatform.services.resources.Orientation;
+
+/**
+ * The URL of a skin.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public interface SkinURL {
+
+ /**
+ * Sets the orientation on the skin URL.
+ *
+ * @param orientation the orientation
+ */
+ void setOrientation(Orientation orientation);
+
+ /**
+ * This method is used to compute the path of a CSS.
+ *
+ * @return the CSS path, containing the orientation suffix.
+ */
+ String toString();
+}
Property changes on: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/java/org/exoplatform/portal/skin/SkinURL.java
___________________________________________________________________
Name: svn:executable
+
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/resources/binding.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/resources/binding.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/main/resources/binding.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,134 @@
+<binding>
+ <format type="java.lang.String[]"
+ serializer="org.exoplatform.portal.config.serialize.JibxArraySerialize.serializeStringArray"
+ deserializer="org.exoplatform.portal.config.serialize.JibxArraySerialize.deserializeStringArray"/>
+
+ <mapping class="org.exoplatform.portal.config.model.Properties" name="properties"
+ marshaller="org.exoplatform.portal.config.serialize.JibxPropertiesMapper"
+ unmarshaller="org.exoplatform.portal.config.serialize.JibxPropertiesMapper"/>
+
+ <mapping name="application" label="application" class="org.exoplatform.portal.config.model.Application">
+ <value name="instance-id" field="instanceId"/>
+ <value name="id" usage="optional" field="id" style="attribute"/>
+ <value name="application-type" field="applicationType" usage="optional"/>
+ <value name="theme" usage="optional" field="theme"/>
+ <value name="title" usage="optional" field="title"/>
+ <value name="access-permissions" field="accessPermissions" usage="optional"/>
+ <value name="show-info-bar" field="showInfoBar" usage="optional" />
+ <value name="show-application-state" field="showApplicationState" usage="optional" />
+ <value name="show-application-mode" field="showApplicationMode" usage="optional" />
+ <value name="description" field="description" usage="optional"/>
+ <value name="icon" field="icon" usage="optional"/>
+ <value name="width" usage="optional" field="width" />
+ <value name="height" usage="optional" field="height" />
+ <structure field="properties" usage="optional"/>
+ </mapping>
+
+ <mapping name="page-body" label="pageBody" class="org.exoplatform.portal.config.model.PageBody">
+ </mapping>
+
+ <mapping name="container" label="container" class="org.exoplatform.portal.config.model.Container">
+ <value name="id" usage="optional" field="id" style="attribute"/>
+ <value name="name" usage="optional" field="name"/>
+ <value name="title" field="title" usage="optional"/>
+ <value name="icon" field="icon" usage="optional"/>
+ <value name="template" field="template" usage="optional" style="attribute"/>
+ <value name="access-permissions" field="accessPermissions" usage="optional"/>
+ <value name="factory-id" field="factoryId" usage="optional"/>
+ <value name="decorator" field="decorator" usage="optional" style="attribute"/>
+ <value name="description" field="description" usage="optional"/>
+ <value name="width" usage="optional" field="width" style="attribute" />
+ <value name="height" usage="optional" field="height" style="attribute"/>
+ <collection field="children" ordered="false">
+ <structure map-as="org.exoplatform.portal.config.model.Container" usage="optional"/>
+ <structure map-as="org.exoplatform.portal.config.model.Application" usage="optional"/>
+ <structure map-as="org.exoplatform.portal.config.model.PageBody" usage="optional"/>
+ </collection>
+ </mapping>
+
+ <mapping name="page" label="page" class="org.exoplatform.portal.config.model.Page">
+ <value name="page-id" field="pageId" usage="optional"/>
+ <value name="owner-type" field="ownerType"/>
+ <value name="owner-id" field="ownerId"/>
+ <value name="name" field="name"/>
+ <value name="title" field="title" usage="optional"/>
+ <value name="factory-id" field="factoryId" usage="optional"/>
+ <value name="access-permissions" field="accessPermissions" usage="optional"/>
+ <value name="edit-permission" field="editPermission" usage="optional"/>
+ <value name="show-max-window" field="showMaxWindow" usage="optional"/>
+ <value name="creator" field="creator" usage="optional"/>
+ <value name="modifier" field="modifier" usage="optional"/>
+ <collection field="children" ordered="false">
+ <structure map-as="org.exoplatform.portal.config.model.Container" usage="optional"/>
+ <structure map-as="org.exoplatform.portal.config.model.Application" usage="optional"/>
+ <structure map-as="org.exoplatform.portal.config.model.PageBody" usage="optional"/>
+ </collection>
+ </mapping>
+
+ <mapping name="node" label="node" class="org.exoplatform.portal.config.model.PageNode">
+ <value name="uri" field="uri"/>
+ <value name="name" field="name"/>
+ <value name="label" field="label" usage="optional" set-method="setLabel"/>
+ <value name="icon" field="icon" usage="optional"/>
+ <value name="start-publication-date" field="startPublicationDate" usage="optional"/>
+ <value name="end-publication-date" field="endPublicationDate" usage="optional"/>
+ <value name="show-publication-date" field="showPublicationDate" usage="optional"/>
+ <value name="visible" field="visible" usage="optional" default="true"/>
+ <value name="page-reference" field="pageReference" usage="optional"/>
+ <collection field="children" usage="optional" item-type="org.exoplatform.portal.config.model.PageNode"/>
+ </mapping>
+
+ <mapping name="portal-config" class="org.exoplatform.portal.config.model.PortalConfig" ordered="false">
+ <value name="portal-name" field="name"/>
+ <value name="locale" field="locale"/>
+ <!--<value name="factory-id" field="factoryId" usage="optional"/>-->
+ <value name="access-permissions" field="accessPermissions" usage="optional"/>
+ <value name="edit-permission" field="editPermission" usage="optional"/>
+ <value name="skin" field="skin" usage="optional"/>
+ <value name="title" field="title" usage="optional"/>
+ <value name="creator" field="creator" usage="optional"/>
+ <value name="modifier" field="modifier" usage="optional"/>
+ <structure field="properties" usage="optional"/>
+ <structure name="portal-layout" using="container" field="portalLayout" usage="optional"/>
+ </mapping>
+
+ <mapping name="page-set" class="org.exoplatform.portal.config.model.Page$PageSet">
+ <collection field="pages" item-type="org.exoplatform.portal.config.model.Page"/>
+ </mapping>
+
+ <mapping name="node-navigation" class="org.exoplatform.portal.config.model.PageNavigation">
+ <value name="owner-type" field="ownerType"/>
+ <value name="owner-id" field="ownerId"/>
+ <value name="priority" field="priority" usage="optional"/>
+ <value name="creator" field="creator" usage="optional"/>
+ <value name="modifier" field="modifier" usage="optional"/>
+ <value name="description" field="description" usage="optional"/>
+ <collection name="page-nodes" field="pageNodes" usage="optional"
+ item-type="org.exoplatform.portal.config.model.PageNode"/>
+ </mapping>
+
+
+ <mapping name="portlet-preferences-set"
+ class="org.exoplatform.portal.application.PortletPreferences$PortletPreferencesSet">
+ <collection field="portlets"
+ item-type="org.exoplatform.portal.application.PortletPreferences"/>
+ </mapping>
+
+ <mapping class="org.exoplatform.portal.application.Preference" name="preference" label="preference">
+ <value name="name" field="name" usage="optional"/>
+ <collection field="values" item-type="java.lang.String">
+ <value name="value" style="element"/>
+ </collection>
+ <value name="read-only" field="readOnly" usage="optional"/>
+ </mapping>
+
+ <mapping class="org.exoplatform.portal.application.PortletPreferences"
+ name="portlet-preferences" label="portlet-preferences">
+ <value name="owner-type" field="ownerType"/>
+ <value name="owner-id" field="ownerId"/>
+ <value name="window-id" field="windowId"/>
+ <collection field="preferences"
+ item-type="org.exoplatform.portal.application.Preference"/>
+ <value name="preferences-validator" field="preferencesValidator" usage="optional"/>
+ </mapping>
+</binding>
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/common-configuration.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/common-configuration.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/common-configuration.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<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">
+ <component>
+ <key>org.exoplatform.services.cache.CacheService</key>
+ <jmx-name>cache:type=CacheService</jmx-name>
+ <type>org.exoplatform.services.cache.impl.CacheServiceImpl</type>
+ <init-params>
+ <object-param>
+ <name>cache.config.default</name>
+ <description>The default cache configuration</description>
+ <object type="org.exoplatform.services.cache.ExoCacheConfig">
+ <field name="name"><string>default</string></field>
+ <field name="maxSize"><int>300</int></field>
+ <field name="liveTime"><long>60</long></field>
+ <field name="distributed"><boolean>false</boolean></field>
+ <field name="implementation"><string>org.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache</string></field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+</configuration>
Property changes on: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/common-configuration.xml
___________________________________________________________________
Name: svn:executable
+
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/database-configuration.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/database-configuration.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/database-configuration.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<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">
+ <component>
+ <key>org.exoplatform.services.database.HibernateService</key>
+ <jmx-name>database:type=HibernateService</jmx-name>
+ <type>org.exoplatform.services.database.impl.HibernateServiceImpl</type>
+ <init-params>
+ <properties-param>
+ <name>hibernate.properties</name>
+ <description>Default Hibernate Service</description>
+ <property name="hibernate.show_sql" value="false"/>
+ <property name="hibernate.cglib.use_reflection_optimizer" value="true"/>
+ <property name="hibernate.connection.url" value="jdbc:hsqldb:file:target/temp/data/exodb"/>
+ <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
+ <property name="hibernate.connection.autocommit" value="true"/>
+ <property name="hibernate.connection.username" value="sa"/>
+ <property name="hibernate.connection.password" value=""/>
+ <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
+ <property name="hibernate.c3p0.min_size" value="5"/>
+ <property name="hibernate.c3p0.max_size" value="20"/>
+ <property name="hibernate.c3p0.timeout" value="1800"/>
+ <property name="hibernate.c3p0.max_statements" value="50"/>
+ </properties-param>
+ </init-params>
+ </component>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.naming.InitialContextInitializer</target-component>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcexo</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
+ <property name="url" value="jdbc:hsqldb:file:target/temp/data/exodb"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+</configuration>
Property changes on: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/database-configuration.xml
___________________________________________________________________
Name: svn:executable
+
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/jcr-configuration.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/jcr-configuration.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/jcr-configuration.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<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">
+ <component>
+ <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
+ <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
+ <init-params>
+ <value-param>
+ <name>conf-path</name>
+ <description>JCR configuration file</description>
+ <value>jar:/conf/portal/repository-configuration.xml</value>
+ </value-param>
+ <properties-param>
+ <name>working-conf</name>
+ <description>working-conf</description>
+ <property name="persister-class-name" value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"/>
+ <property name="source-name" value="jdbcexo"/>
+ <property name="dialect" value="hsqldb"/>
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.RepositoryService</key>
+ <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.ext.registry.RegistryService</type>
+ <init-params>
+ <properties-param>
+ <name>locations</name>
+ <property name="repository" value="system"/>
+ </properties-param>
+ </init-params>
+ </component>
+</configuration>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/model-nodetypes.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/model-nodetypes.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/model-nodetypes.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,15 @@
+<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
+ xmlns:jcr="http://www.jcp.org/jcr/1.0">
+
+ <nodeType name="exo:gadget" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:unstructured</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <!--propertyDefinition name="data" requiredType="Binary" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition-->
+ </propertyDefinitions>
+ </nodeType>
+
+</nodeTypes>
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/repository-configuration.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/repository-configuration.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/repository-configuration.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,152 @@
+<repository-service default-repository="repository">
+ <repositories>
+ <repository name="repository" system-workspace="system" default-workspace="collaboration">
+ <security-domain>exo-domain</security-domain>
+ <access-control>optional</access-control>
+ <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
+ <workspaces>
+ <workspace name="system">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcexo"/>
+ <property name="dialect" value="${dialect}"/>
+ <property name="multi-db" value="false"/>
+ <property name="update-storage" value="true"/>
+ <property name="max-buffer-size" value="204800"/>
+ <property name="swap-directory" value="target/temp/swap/system"/>
+ </properties>
+ <value-storages>
+ <value-storage id="system" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/system"/>
+ </properties>
+ <filters>
+ <filter property-type="Binary"/>
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured"/>
+ <property name="root-permissions" value="*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
+ </properties>
+ </initializer>
+ <cache enabled="true">
+ <properties>
+ <property name="max-size" value="20000"/>
+ <property name="live-time" value="30000"/>
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/jcrlucenedb/system"/>
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>15m</time-out><!-- 15min -->
+ <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path" value="target/temp/lock/system"/>
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+ <workspace name="collaboration">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcexo"/>
+ <property name="dialect" value="${dialect}"/>
+ <property name="multi-db" value="false"/>
+ <property name="update-storage" value="true"/>
+ <property name="max-buffer-size" value="204800"/>
+ <property name="swap-directory" value="target/temp/swap/collaboration"/>
+ </properties>
+ <value-storages>
+ <value-storage id="collaboration" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/collaboration"/>
+ </properties>
+ <filters>
+ <filter property-type="Binary"/>
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured"/>
+ <property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
+ </properties>
+ </initializer>
+ <cache enabled="true">
+ <properties>
+ <property name="max-size" value="20000"/>
+ <property name="live-time" value="30000"/>
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/jcrlucenedb/collaboration"/>
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>15m</time-out><!-- 15min -->
+ <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path" value="target/temp/lock/collaboration"/>
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+ <workspace name="gadgets">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcexo"/>
+ <property name="dialect" value="${dialect}"/>
+ <property name="multi-db" value="false"/>
+ <property name="update-storage" value="true"/>
+ <property name="max-buffer-size" value="204800"/>
+ <property name="swap-directory" value="target/temp/swap/gadgets"/>
+ </properties>
+ <value-storages>
+ <value-storage id="gadgets" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/gadgets"/>
+ </properties>
+ <filters>
+ <filter property-type="Binary"/>
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured"/>
+ <property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
+ </properties>
+ </initializer>
+ <cache enabled="true">
+ <properties>
+ <property name="max-size" value="20000"/>
+ <property name="live-time" value="30000"/>
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/jcrlucenedb/gadgets"/>
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>15m</time-out><!-- 15min -->
+ <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path" value="target/temp/lock/gadgets"/>
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+ </workspaces>
+ </repository>
+ </repositories>
+</repository-service>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/container.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/container.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/container.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<container>
+ <name>rootName</name>
+ <container id="childNode1">
+ <name>childNode</name>
+ </container>
+ <container id="childNode1">
+ <name>childNode</name>
+ </container>
+ <container id="childNode1">
+ <name>childNode</name>
+ </container>
+</container>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/containers/four-columns/container.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/containers/four-columns/container.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/containers/four-columns/container.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<container template="classpath:groovy/dashboard/webui/component/UIColumnContainer.gtmpl">
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/Calendar</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/Calculator</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/Todo</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/rssAggregator</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+</container>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/containers/one-column/container.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/containers/one-column/container.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/containers/one-column/container.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<container template="classpath:groovy/dashboard/webui/component/UIColumnContainer.gtmpl">
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/Calendar</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+</container>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/containers/three-columns/container.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/containers/three-columns/container.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/containers/three-columns/container.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<container template="classpath:groovy/dashboard/webui/component/UIColumnContainer.gtmpl">
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/Calendar</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/Calculator</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/rssAggregator</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+</container>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/containers/two-columns/container.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/containers/two-columns/container.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/containers/two-columns/container.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<container template="classpath:groovy/dashboard/webui/component/UIColumnContainer.gtmpl">
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/Calendar</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/Calculator</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+</container>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/dashboard/page.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/dashboard/page.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/dashboard/page.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <application>
+ <instance-id>/dashboard/DashboardPortlet</instance-id>
+ <title>Dashboard</title>
+ <show-info-bar>false</show-info-bar>
+ <show-application-state>true</show-application-state>
+ </application>
+</page>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/dashboard/portlet-preferences.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/dashboard/portlet-preferences.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/dashboard/portlet-preferences.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set/>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/empty/page.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/empty/page.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/empty/page.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+</page>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/empty/portlet-preferences.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/empty/portlet-preferences.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/empty/portlet-preferences.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set/>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/one-row-two-columns/page.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/one-row-two-columns/page.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/one-row-two-columns/page.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+ <container template='system:/groovy/portal/webui/container/UITableColumnContainer.gtmpl'>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+ </container>
+</page>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/one-row-two-columns/portlet-preferences.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/one-row-two-columns/portlet-preferences.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/one-row-two-columns/portlet-preferences.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set/>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-columns/page.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-columns/page.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-columns/page.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <container template="system:/groovy/portal/webui/container/UITableColumnContainer.gtmpl">
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ </container>
+</page>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-columns/portlet-preferences.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-columns/portlet-preferences.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-columns/portlet-preferences.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set/>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-rows/page.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-rows/page.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-rows/page.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+</page>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-rows/portlet-preferences.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-rows/portlet-preferences.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-rows/portlet-preferences.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set/>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-rows-two-columns/page.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-rows-two-columns/page.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-rows-two-columns/page.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <container template='system:/groovy/portal/webui/container/UITableColumnContainer.gtmpl'>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+ </container>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+</page>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-rows-two-columns/portlet-preferences.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-rows-two-columns/portlet-preferences.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-rows-two-columns/portlet-preferences.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set/>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-tabs/page.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-tabs/page.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-tabs/page.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <title></title>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
+ <container template="system:/groovy/portal/webui/container/UITabContainer.gtmpl">
+ <factory-id>TabContainer</factory-id>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ </container>
+ </container>
+</page>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-tabs/portlet-preferences.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-tabs/portlet-preferences.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/three-tabs/portlet-preferences.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set/>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-columns/page.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-columns/page.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-columns/page.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <container template="system:/groovy/portal/webui/container/UITableColumnContainer.gtmpl">
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ </container>
+</page>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-columns/portlet-preferences.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-columns/portlet-preferences.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-columns/portlet-preferences.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set/>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-columns-one-row/page.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-columns-one-row/page.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-columns-one-row/page.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <container template='system:/groovy/portal/webui/container/UITableColumnContainer.gtmpl'>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+ </container>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+</page>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-columns-one-row/portlet-preferences.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-columns-one-row/portlet-preferences.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-columns-one-row/portlet-preferences.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set/>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-rows/page.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-rows/page.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-rows/page.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+</page>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-rows/portlet-preferences.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-rows/portlet-preferences.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-rows/portlet-preferences.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set/>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-tabs/page.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-tabs/page.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-tabs/page.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <title></title>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
+ <container template="system:/groovy/portal/webui/container/UITabContainer.gtmpl">
+ <factory-id>TabContainer</factory-id>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
+ <application>
+ <instance-id>/exoadmin/AccountPortlet</instance-id>
+ <title>New Account</title>
+ <show-info-bar>true</show-info-bar>
+ <show-application-state>true</show-application-state>
+ </application>
+ </container>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
+ <application>
+ <instance-id>/web/SiteMapPortlet</instance-id>
+ <title>Sitemap Portlet</title>
+ <show-info-bar>true</show-info-bar>
+ <show-application-state>true</show-application-state>
+ </application>
+ </container>
+ </container>
+ </container>
+</page>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-tabs/portlet-preferences.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-tabs/portlet-preferences.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/template/pages/two-tabs/portlet-preferences.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set>
+ <portlet-preferences>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <window-id>/exoadmin/AccountPortlet</window-id>
+ <preference>
+ <name>NewAccountPreference</name>
+ <value>Preference value for Account portlet</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+ <portlet-preferences>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <window-id>/web/SiteMapPortlet</window-id>
+ <preference>
+ <name>SitemapPreference</name>
+ <value>Preference value for Sitemap portlet</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+</portlet-preferences-set>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/test-configuration.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/test-configuration.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/conf/portal/test-configuration.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,348 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<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">
+ <component>
+ <key>org.exoplatform.services.portletcontainer.persistence.PortletPreferencesPersister</key>
+ <type>org.exoplatform.portal.application.jcr.PortletPreferencesPersisterImpl</type>
+ </component>
+ <component>
+ <key>org.exoplatform.portal.config.DataStorage</key>
+ <type>org.exoplatform.portal.config.jcr.DataStorageImpl</type>
+ </component>
+ <component>
+ <key>org.exoplatform.portal.application.UserGadgetStorage</key>
+ <type>org.exoplatform.portal.application.jcr.UserGadgetStorageImpl</type>
+ </component>
+ <component>
+ <key>org.exoplatform.portal.layout.PortalLayoutService</key>
+ <type>org.exoplatform.portal.layout.jcr.PortalLayoutServiceImpl</type>
+ <init-params>
+ <value-param>
+ <name>template.location</name>
+ <description>Location of container templates</description>
+ <value>jar:/conf/portal</value>
+ </value-param>
+ </init-params>
+ </component>
+ <component>
+ <key>org.exoplatform.portal.config.UserACL</key>
+ <type>org.exoplatform.portal.config.UserACL</type>
+ <init-params>
+ <value-param>
+ <name>super.user</name>
+ <description>administrator</description>
+ <value>root</value>
+ </value-param>
+ <value-param>
+ <name>guests.group</name>
+ <description>guests group</description>
+ <value>/platform/guests</value>
+ </value-param>
+ </init-params>
+ </component>
+ <component>
+ <key>org.exoplatform.services.portletcontainer.bundle.ResourceBundleDelegate</key>
+ <type>org.exoplatform.portal.application.ResourceBundleDelegateImpl</type>
+ </component>
+ <component>
+ <key>org.exoplatform.portal.config.UserPortalConfigService</key>
+ <type>org.exoplatform.portal.config.UserPortalConfigService</type>
+ <component-plugins>
+ <component-plugin>
+ <name>new.portal.config.user.listener</name>
+ <set-method>initListener</set-method>
+ <type>org.exoplatform.portal.config.NewPortalConfigListener</type>
+ <description>this listener init the portal configuration</description>
+ <init-params>
+ <value-param>
+ <name>default.portal</name>
+ <description>The default portal for checking db is empty or not</description>
+ <value>classic</value>
+ </value-param>
+ <object-param>
+ <name>portal.configuration</name>
+ <description>description</description>
+ <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:/portal</string>
+ </field>
+ </object>
+ </object-param>
+ <object-param>
+ <name>group.configuration</name>
+ <description>description</description>
+ <object type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+ <value>
+ <string>platform/administrators</string>
+ </value>
+ <value>
+ <string>platform/users</string>
+ </value>
+ <value>
+ <string>platform/guests</string>
+ </value>
+ <value>
+ <string>organization/management/executive-board</string>
+ </value>
+ </collection>
+ </field>
+ <field name="ownerType">
+ <string>group</string>
+ </field>
+ <field name="templateLocation">
+ <string>classpath:/portal</string>
+ </field>
+ </object>
+ </object-param>
+ <object-param>
+ <name>user.configuration</name>
+ <description>description</description>
+ <object type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+ <value>
+ <string>root</string>
+ </value>
+ <value>
+ <string>john</string>
+ </value>
+ <value>
+ <string>marry</string>
+ </value>
+ <value>
+ <string>demo</string>
+ </value>
+ </collection>
+ </field>
+ <field name="ownerType">
+ <string>user</string>
+ </field>
+ <field name="templateLocation">
+ <string>classpath:/portal</string>
+ </field>
+ </object>
+ </object-param>
+ <object-param>
+ <name>page.templates</name>
+ <description>List of page templates</description>
+ <object type="org.exoplatform.portal.config.PageTemplateConfig">
+ <field name="templates">
+ <collection type="java.util.ArrayList"></collection>
+ </field>
+ <field name="location">
+ <string>classpath:/portal/template/pages</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </component-plugins>
+ </component>
+ <component>
+ <key>org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator</key>
+ <type>org.exoplatform.services.jcr.ext.hierarchy.impl.NodeHierarchyCreatorImpl</type>
+ </component>
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.jcr.RepositoryService</target-component>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcexo</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver" />
+ <property name="url" value="jdbc:hsqldb:file:target/temp/data/portal" />
+ <property name="username" value="sa" />
+ <property name="password" value="" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+ `
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.organization.OrganizationService</target-component>
+ <component-plugin>
+ <name>ecm.new.user.event.listener</name>
+ <set-method>addListenerPlugin</set-method>
+ <type>org.exoplatform.services.jcr.ext.hierarchy.impl.NewUserListener</type>
+ <description>description</description>
+ <init-params>
+ <object-param>
+ <name>configuration</name>
+ <description>description</description>
+ <object type="org.exoplatform.services.jcr.ext.hierarchy.impl.HierarchyConfig">
+ <field name="repository">
+ <string>repository</string>
+ </field>
+ <field name="workspaces">
+ <collection type="java.util.ArrayList">
+ <value>
+ <string>collaboration</string>
+ </value>
+ </collection>
+ </field>
+ <field name="jcrPaths">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.jcr.ext.hierarchy.impl.HierarchyConfig$JcrPath">
+ <field name="alias">
+ <string>userApplicationData</string>
+ </field>
+ <field name="path">
+ <string>ApplicationData</string>
+ </field>
+ <field name="nodeType">
+ <string>nt:unstructured</string>
+ </field>
+ <field name="permissions">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object
+ type="org.exoplatform.services.jcr.ext.hierarchy.impl.HierarchyConfig$Permission">
+ <field name="identity">
+ <string>*:/platform/administrators</string>
+ </field>
+ <field name="read">
+ <string>true</string>
+ </field>
+ <field name="addNode">
+ <string>true</string>
+ </field>
+ <field name="setProperty">
+ <string>true</string>
+ </field>
+ <field name="remove">
+ <string>true</string>
+ </field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ <field name="mixinTypes">
+ <collection type="java.util.ArrayList">
+ </collection>
+ </field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator</target-component>
+ <component-plugin>
+ <name>addPaths</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.ext.hierarchy.impl.AddPathPlugin</type>
+ <init-params>
+ <object-param>
+ <name>cms.configuration</name>
+ <description>configuration for the cms path</description>
+ <object type="org.exoplatform.services.jcr.ext.hierarchy.impl.HierarchyConfig">
+ <field name="repository">
+ <string>repository</string>
+ </field>
+ <field name="workspaces">
+ <collection type="java.util.ArrayList">
+ <value>
+ <string>collaboration</string>
+ </value>
+ </collection>
+ </field>
+ <field name="jcrPaths">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.jcr.ext.hierarchy.impl.HierarchyConfig$JcrPath">
+ <field name="alias">
+ <string>usersPath</string>
+ </field>
+ <field name="path">
+ <string>/Users</string>
+ </field>
+ <field name="permissions">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object
+ type="org.exoplatform.services.jcr.ext.hierarchy.impl.HierarchyConfig$Permission">
+ <field name="identity">
+ <string>*:/platform/administrators</string>
+ </field>
+ <field name="read">
+ <string>true</string>
+ </field>
+ <field name="addNode">
+ <string>true</string>
+ </field>
+ <field name="setProperty">
+ <string>true</string>
+ </field>
+ <field name="remove">
+ <string>true</string>
+ </field>
+ </object>
+ </value>
+ <value>
+ <object
+ type="org.exoplatform.services.jcr.ext.hierarchy.impl.HierarchyConfig$Permission">
+ <field name="identity">
+ <string>*:/platform/users</string>
+ </field>
+ <field name="read">
+ <string>true</string>
+ </field>
+ <field name="addNode">
+ <string>false</string>
+ </field>
+ <field name="setProperty">
+ <string>true</string>
+ </field>
+ <field name="remove">
+ <string>false</string>
+ </field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+ <import>jar:/conf/portal/common-configuration.xml</import>
+ <import>jar:/conf/portal/database-configuration.xml</import>
+ <import>jar:/conf/portal/jcr-configuration.xml</import>
+</configuration>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,227 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config;
+
+import java.io.FileInputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.portal.application.PortletPreferences;
+import org.exoplatform.portal.application.Preference;
+import org.exoplatform.portal.application.PortletPreferences.PortletPreferencesSet;
+import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.portal.config.model.Page.PageSet;
+import org.exoplatform.services.portletcontainer.pci.ExoWindowID;
+import org.exoplatform.test.BasicTestCase;
+import org.jibx.runtime.BindingDirectory;
+import org.jibx.runtime.IBindingFactory;
+import org.jibx.runtime.IUnmarshallingContext;
+
+/**
+ * Created by The eXo Platform SARL Author : Tung Pham thanhtungty(a)gmail.com Nov
+ * 13, 2007
+ */
+public class TestDataStorage extends BasicTestCase {
+
+ private final String testPortal = "testPortal";
+ private final String testPage = "portal::classic::testPage";
+ private final String testPortletPreferences = "portal#classic:/web/BannerPortlet/testPortletPreferences";
+
+ DataStorage storage_;
+
+ public TestDataStorage(String name) {
+ super(name);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+ if (storage_ != null) return;
+ PortalContainer container = PortalContainer.getInstance();
+ storage_ = (DataStorage) container.getComponentInstanceOfType(DataStorage.class);
+ }
+
+ public void testPortalConfigCreate() throws Exception {
+ PortalConfig portalConfig = new PortalConfig();
+ portalConfig.setName(testPortal);
+ portalConfig.setLocale("en");
+ portalConfig.setAccessPermissions(new String[]{UserACL.EVERYONE});
+
+ PortalConfig returnConfig = storage_.getPortalConfig(portalConfig.getName());
+ if (returnConfig != null)
+ storage_.remove(returnConfig);
+
+ storage_.create(portalConfig);
+ returnConfig = storage_.getPortalConfig(portalConfig.getName());
+ assertNotNull(returnConfig);
+ assertEquals(portalConfig.getName(), returnConfig.getName());
+ assertEquals(portalConfig.getCreator(), returnConfig.getCreator());
+ }
+
+ public void testPortalConfigSave() throws Exception {
+ PortalConfig portalConfig = storage_.getPortalConfig(testPortal);
+
+ assertNotNull(portalConfig);
+
+ String newLocale = "vietnam";
+ portalConfig.setLocale(newLocale);
+ storage_.save(portalConfig);
+ portalConfig = storage_.getPortalConfig(testPortal);
+ assertNotNull(portalConfig);
+ assertEquals(newLocale, portalConfig.getLocale());
+ }
+
+ public void testPortalConfigRemove() throws Exception {
+ PortalConfig portalConfig = storage_.getPortalConfig(testPortal);
+ assertNotNull(portalConfig);
+
+ storage_.remove(portalConfig);
+ assertNull(storage_.getPortalConfig(testPortal));
+ }
+
+ public void testPageConfigCreate() throws Exception {
+ createPageConfig(PortalConfig.PORTAL_TYPE, "portalone");
+ createPageConfig(PortalConfig.USER_TYPE, "exoadmin");
+ createPageConfig(PortalConfig.GROUP_TYPE, "portal/admin");
+ }
+
+ private void createPageConfig(String ownerType, String ownerId) throws Exception {
+ Page page = new Page();
+ page.setName("testPage");
+ page.setOwnerId("classic");
+ page.setOwnerType("portal");
+
+ try {
+ storage_.create(page);
+ } catch (Exception e) {
+ page = storage_.getPage(page.getPageId());
+ }
+
+ Page returnPage = storage_.getPage(page.getPageId());
+ assertNotNull(returnPage);
+ assertEquals(page.getPageId(), returnPage.getPageId());
+ assertEquals(page.getOwnerType(), returnPage.getOwnerType());
+ assertEquals(page.getOwnerId(), returnPage.getOwnerId());
+ assertEquals(page.getChildren().size(), returnPage.getChildren().size());
+ }
+
+ public void testPageConfigSave() throws Exception {
+ Page page = storage_.getPage(testPage);
+ assertNotNull(page);
+
+ page.setTitle("New Page Title");
+ page.setOwnerId("customers");
+ storage_.save(page);
+
+ Page returnPage = storage_.getPage(page.getPageId());
+ assertEquals("New Page Title", returnPage.getTitle());
+ assertEquals(page.getPageId(), returnPage.getPageId());
+ assertEquals(page.getOwnerType(), returnPage.getOwnerType());
+ assertEquals(page.getOwnerId(), returnPage.getOwnerId());
+ assertEquals(page.getChildren().size(), returnPage.getChildren().size());
+ }
+
+ public void testPageConfigRemove() throws Exception {
+ Page page = storage_.getPage(testPage);
+ assertNotNull(page);
+
+ storage_.remove(page);
+
+ page = storage_.getPage(testPage);
+ assertNull(page);
+ }
+
+ public void testNavigationCreate() throws Exception {
+ PageNavigation pageNavi = new PageNavigation();
+ pageNavi.setOwnerId(testPortal);
+ pageNavi.setOwnerType("portal");
+ storage_.create(pageNavi);
+ }
+
+ public void testNavigationSave() throws Exception {
+ PageNavigation pageNavi = storage_.getPageNavigation("portal", testPortal);
+ assertNotNull(pageNavi);
+
+ String newModifier = "trong.tran";
+ pageNavi.setModifier(newModifier);
+ storage_.save(pageNavi);
+
+ PageNavigation newPageNavi = storage_.getPageNavigation(pageNavi.getOwnerType(), pageNavi.getOwnerId());
+ assertEquals(newModifier, newPageNavi.getModifier());
+ }
+
+ public void testNavigationRemove() throws Exception {
+ PageNavigation pageNavi = storage_.getPageNavigation("portal", testPortal);
+ assertNotNull(pageNavi);
+
+ storage_.remove(pageNavi);
+
+ pageNavi = storage_.getPageNavigation("portal", testPortal);
+ assertNull(pageNavi);
+ }
+
+ public void testPortletPreferencesCreate() throws Exception {
+ ArrayList<Preference> prefs = new ArrayList<Preference>();
+ for(int i = 0; i < 5; i++) {
+ Preference pref = new Preference();
+ pref.setName("name" + i);
+ pref.addValue("value" + i);
+ prefs.add(pref);
+ }
+
+ PortletPreferences portletPreferences = new PortletPreferences();
+ portletPreferences.setWindowId(testPortletPreferences);
+ portletPreferences.setOwnerId("classic");
+ portletPreferences.setOwnerType("portal");
+ portletPreferences.setPreferences(prefs);
+
+ storage_.save(portletPreferences);
+
+ PortletPreferences portletPref = storage_.getPortletPreferences(new ExoWindowID(testPortletPreferences));
+ assertEquals(portletPref.getWindowId(), testPortletPreferences);
+ }
+
+ public void testPortletPreferencesSave() throws Exception {
+ PortletPreferences portletPref = storage_.getPortletPreferences(new ExoWindowID(testPortletPreferences));
+ assertNotNull(portletPref);
+
+ List<Preference> prefs = portletPref.getPreferences();
+ assertNotNull(prefs);
+ assertEquals(5, prefs.size());
+ }
+
+ public void testPortletPreferencesRemove() throws Exception {
+ PortletPreferences portletPref = storage_.getPortletPreferences(new ExoWindowID(testPortletPreferences));
+ assertNotNull(portletPref);
+
+ storage_.remove(portletPref);
+
+ portletPref = storage_.getPortletPreferences(new ExoWindowID(testPortletPreferences));
+ assertNull(portletPref);
+ }
+
+ @SuppressWarnings("unchecked")
+ public void testFind() throws Exception {
+ Query<Page> query = new Query<Page>(null, null, Page.class);
+ List<Page> findedPages = storage_.find(query).getAll();
+
+ findedPages = storage_.find(query).getAll();
+ assertTrue(findedPages.size() > 0);
+ }
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestJIBXXmlMapping.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestJIBXXmlMapping.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestJIBXXmlMapping.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config;
+
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+
+import org.exoplatform.portal.application.PortletPreferences;
+import org.exoplatform.portal.application.PortletPreferences.PortletPreferencesSet;
+import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.portal.config.model.Page.PageSet;
+import org.exoplatform.test.BasicTestCase;
+import org.jibx.runtime.BindingDirectory;
+import org.jibx.runtime.IBindingFactory;
+import org.jibx.runtime.IMarshallingContext;
+import org.jibx.runtime.IUnmarshallingContext;
+
+/**
+ * Thu, May 15, 2003 @
+ * @author: Tuan Nguyen
+ * @version: $Id: TestConverter.java,v 1.6 2004/07/20 12:41:09 tuan08 Exp $
+ * @since: 0.0
+ * @email: tuan08(a)yahoo.com
+ */
+public class TestJIBXXmlMapping extends BasicTestCase {
+
+ public TestJIBXXmlMapping(String name) {
+ super(name);
+ }
+
+ public void setUp() throws Exception {
+
+ }
+
+ public void testPageSetMapping() throws Exception {
+ IBindingFactory bfact = BindingDirectory.getFactory(PageSet.class);
+ IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
+ Object obj = uctx.unmarshalDocument(new FileInputStream("src/test/resources/portal/portal/classic/pages.xml"), null);
+ assertEquals(Page.PageSet.class, obj.getClass());
+
+ IMarshallingContext mctx = bfact.createMarshallingContext();
+ mctx.setIndent(2);
+ mctx.marshalDocument(obj, "UTF-8", null, new FileOutputStream("target/pages.xml")) ;
+
+ obj = uctx.unmarshalDocument(new FileInputStream("target/pages.xml"), null);
+ assertEquals(Page.PageSet.class, obj.getClass());
+ }
+
+ public void testPortalConfigMapping() throws Exception {
+ IBindingFactory bfact = BindingDirectory.getFactory(PortalConfig.class);
+ IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
+ Object obj = uctx.unmarshalDocument(new FileInputStream("src/test/resources/portal/portal/classic/portal.xml"), null);
+ assertEquals(PortalConfig.class, obj.getClass());
+
+ IMarshallingContext mctx = bfact.createMarshallingContext();
+ mctx.setIndent(2);
+ mctx.marshalDocument(obj, "UTF-8", null, new FileOutputStream("target/portal.xml")) ;
+ assertEquals(PortalConfig.class, obj.getClass());
+ }
+
+ public void testNavigationMapping() throws Exception {
+ IBindingFactory bfact = BindingDirectory.getFactory(PageNavigation.class);
+ IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
+ Object obj = uctx.unmarshalDocument(new FileInputStream("src/test/resources/portal/portal/classic/navigation.xml"), null);
+ assertEquals(PageNavigation.class, obj.getClass());
+
+ IMarshallingContext mctx = bfact.createMarshallingContext();
+ mctx.setIndent(2);
+ mctx.marshalDocument(obj, "UTF-8", null, new FileOutputStream("target/navigation.xml")) ;
+
+ obj = uctx.unmarshalDocument(new FileInputStream("target/navigation.xml"), null);
+ assertEquals(PageNavigation.class, obj.getClass());
+ }
+
+ public void testPortletPreferencesMapping() throws Exception {
+ IBindingFactory bfact = BindingDirectory.getFactory(PortalConfig.class);
+ IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
+ Object obj = uctx.unmarshalDocument(new FileInputStream("src/test/resources/portal/portal/classic/portlet-preferences.xml"), null);
+ assertEquals(PortletPreferencesSet.class, obj.getClass());
+
+ IMarshallingContext mctx = bfact.createMarshallingContext();
+ mctx.setIndent(2);
+ mctx.marshalDocument(obj, "UTF-8", null, new FileOutputStream("target/portlet-preferences.xml")) ;
+ assertEquals(PortletPreferencesSet.class, obj.getClass());
+ }
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,247 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config;
+
+import java.io.FileInputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.config.model.PageNode;
+import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.services.organization.OrganizationService;
+import org.jibx.runtime.BindingDirectory;
+import org.jibx.runtime.IBindingFactory;
+import org.jibx.runtime.IUnmarshallingContext;
+
+/**
+ * Author : Nhu Dinh Thuan
+ * nhudinhthuan(a)yahoo.com
+ * May 23, 2006
+ */
+public class TestUserPortalConfigService extends UserPortalServiceTestBase {
+
+ private UserPortalConfigService userPortalConfigSer_;
+
+ public TestUserPortalConfigService(String name){
+ super(name);
+ }
+
+ public void setUp() throws Exception {
+ if(userPortalConfigSer_ != null) return;
+ PortalContainer manager = PortalContainer.getInstance();
+ userPortalConfigSer_ = (UserPortalConfigService) manager.getComponentInstanceOfType(UserPortalConfigService.class) ;
+ orgService_ = (OrganizationService) manager.getComponentInstanceOfType(OrganizationService.class);
+ }
+
+ public void tearDown() throws Exception {
+ String newName = "newportal" ;
+ UserPortalConfig portal = userPortalConfigSer_.getUserPortalConfig(newName, "root") ;
+ if(portal != null) {
+ userPortalConfigSer_.removeUserPortalConfig(newName) ;
+ assertNull(userPortalConfigSer_.getUserPortalConfig(newName, "none")) ;
+ }
+ }
+
+
+ public void testCreateUserPortalConfig() throws Exception {
+ String portalTemplate = "classic" ;
+ String newName = "newportal" ;
+
+ userPortalConfigSer_.createUserPortalConfig(newName, portalTemplate) ;
+ UserPortalConfig newportal = userPortalConfigSer_.getUserPortalConfig(newName, "root");
+
+ PortalConfig newPortalConfig = newportal.getPortalConfig() ;
+ assertEquals(newName, newPortalConfig.getName()) ;
+// service_.removeUserPortalConfig(newName) ;
+ }
+
+ public void testGetUserPortalConfig() throws Exception {
+ UserPortalConfig userPortalConfig = userPortalConfigSer_.getUserPortalConfig("classic" ,"root");
+ PortalConfig portalConfig = userPortalConfig.getPortalConfig();
+
+ assertTrue(portalConfig != null);
+ }
+
+ public void testPortalConfigUpdate() throws Exception {
+ String portalName = "newportal" ;
+ userPortalConfigSer_.createUserPortalConfig(portalName, "classic") ;
+ UserPortalConfig oldUserPortalConfig = userPortalConfigSer_.getUserPortalConfig(portalName, "root") ;
+ PortalConfig oldPortalConfig = oldUserPortalConfig.getPortalConfig() ;
+ assertEquals(portalName, oldPortalConfig.getName()) ;
+ assertEquals("en", oldPortalConfig.getLocale()) ;
+ assertEquals(1, oldPortalConfig.getAccessPermissions().length);
+ assertEquals("Everyone", oldPortalConfig.getAccessPermissions()[0]) ;
+ assertEquals(2, oldUserPortalConfig.getNavigations().size());
+
+
+ String newLocate = "vi" ;
+ oldPortalConfig.setLocale(newLocate) ;
+ userPortalConfigSer_.update(oldPortalConfig) ;
+
+ UserPortalConfig newUserPortalConfig = userPortalConfigSer_.getUserPortalConfig(portalName, "root") ;
+ PortalConfig newPortalConfig = newUserPortalConfig.getPortalConfig() ;
+ assertEquals(portalName, oldPortalConfig.getName()) ;
+ assertEquals(newLocate, newPortalConfig.getLocale()) ;
+ assertEquals(1, newPortalConfig.getAccessPermissions().length);
+ assertEquals("Everyone", newPortalConfig.getAccessPermissions()[0]) ;
+ assertEquals(2, newUserPortalConfig.getNavigations().size());
+ }
+
+ public void testNavigationUpdate() throws Exception {
+ String portalName = "classic" ;
+ String accessUser = "root" ;
+
+ UserPortalConfig oldUserPortalConfig = userPortalConfigSer_.getUserPortalConfig(portalName, accessUser) ;
+ List<PageNavigation> oldNavigations = oldUserPortalConfig.getNavigations() ;
+ assertTrue(oldNavigations.size() > 0);
+
+ // Change description
+ String newDescription = "This is new description.";
+ for (PageNavigation navi : oldNavigations) {
+ navi.setDescription(newDescription) ;
+ userPortalConfigSer_.update(navi) ;
+ }
+
+ UserPortalConfig newUserPortalConfig = userPortalConfigSer_.getUserPortalConfig(portalName, accessUser) ;
+ List<PageNavigation> newNavigations = newUserPortalConfig.getNavigations() ;
+ assertTrue(newNavigations.size() > 0);
+
+ PageNavigation portalNavigation = newNavigations.get(0) ;
+ assertEquals(newDescription, portalNavigation.getDescription()) ;
+ }
+
+ public void testNavigationRemove() throws Exception {
+ String portalName = "classic" ;
+ String accessUser = "exoadmin" ;
+
+ UserPortalConfig oldUserPortalConfig = userPortalConfigSer_.getUserPortalConfig(portalName, accessUser) ;
+ List<PageNavigation> oldNavigations = oldUserPortalConfig.getNavigations() ;
+ assertEquals(1, oldNavigations.size()) ;
+
+ // Remove navigation of the portal
+ PageNavigation portalNavigation = oldNavigations.get(0) ;
+ userPortalConfigSer_.remove(portalNavigation) ;
+
+ UserPortalConfig newUserPortalConfig = userPortalConfigSer_.getUserPortalConfig(portalName, accessUser) ;
+ List<PageNavigation> newNavigations = newUserPortalConfig.getNavigations() ;
+ assertEquals(0, newNavigations.size()) ;
+// PageNavigation userNavigation = newNavigations.get(0) ;
+// assertEquals(accessUser, userNavigation.getOwnerId()) ;
+//
+// // Remove remain navigation
+// service_.remove(userNavigation) ;
+// newUserPortalConfig = service_.getUserPortalConfig(portalName, accessUser) ;
+// assertEquals(0, newUserPortalConfig.getNavigations().size()) ;
+ }
+
+// public void testPageCreate() throws Exception {
+// String accessUser = "exoadmin" ;
+// String[] sitePortalPageNames = {"homepage", "register", "sitemap", "test"} ;
+//
+// List<Page> pages = new ArrayList<Page>() ;
+// for (String pageName : sitePortalPageNames) {
+// String sitePortalPageId = "portal::classic::" + pageName ;
+// Page page = service_.getPage(sitePortalPageId, accessUser) ;
+// if (page != null) pages.add(page) ;
+// }
+// assertEquals(1, pages.size()) ;
+//
+//
+// // Add new page to Site portal
+// String pageSetFile = "testpages.xml" ;
+// PageSet pageSet = loadObject(PageSet.class, pageSetFile) ;
+// List<Page> addPages = pageSet.getPages() ;
+// assertTrue(addPages.size() == 1);
+// for (Page p : addPages) {
+// service_.create(p) ;
+// }
+// int totalPage = pages.size() + addPages.size() ;
+//
+// pages = new ArrayList<Page>() ;
+// for (String pageName : sitePortalPageNames) {
+// String sitePortalPageId = "portal::classic::" + pageName ;
+// Page page = service_.getPage(sitePortalPageId, accessUser) ;
+// if (page != null) pages.add(page) ;
+// }
+//
+// assertEquals(totalPage, pages.size()) ;
+// }
+
+ public void testPageGet() throws Exception {
+ this.prepareOrganizationData();
+ String pageId = "group::platform/administrators::newAccount" ;
+ Page page = userPortalConfigSer_.getPage(pageId);
+ assertNotNull(page);
+ assertEquals(pageId, page.getPageId()) ;
+ }
+
+ public void testPageUpdate() throws Exception {
+ String[] sitePortalPageNames = {"homepage", "webexplorer"} ;
+
+ for (String pageName : sitePortalPageNames) {
+ String sitePortalPageId = "portal::classic::" + pageName ;
+ // TODO
+ //Page page = service_.getPage(sitePortalPageId, accessUser) ;
+ Page page = userPortalConfigSer_.getPage(sitePortalPageId) ;
+ String newTitle = "New title of " + pageName ;
+ page.setTitle(newTitle) ;
+ userPortalConfigSer_.update(page) ;
+
+ //Page returnPage = service_.getPage(sitePortalPageId, accessUser) ;
+ Page returnPage = userPortalConfigSer_.getPage(sitePortalPageId) ;
+ assertEquals(sitePortalPageId, returnPage.getPageId()) ;
+ }
+ }
+
+ public void testPageRemove() throws Exception {
+ String accessUser = "exoadmin" ;
+ String[] sitePortalPageNames = {"homepage", "webexplorer"} ;
+
+ List<Page> pages = new ArrayList<Page>() ;
+ for (String pageName : sitePortalPageNames) {
+ String sitePortalPageId = "portal::classic::" + pageName ;
+ //Page page = service_.getPage(sitePortalPageId, accessUser) ;
+ Page page = userPortalConfigSer_.getPage(sitePortalPageId, accessUser) ;
+ if (page != null) pages.add(page) ;
+ }
+ assertEquals(1, pages.size()) ;
+
+ //Page deletePage = service_.getPage("portal::classic::homepage", accessUser) ;
+ Page deletePage = userPortalConfigSer_.getPage("portal::classic::homepage") ;
+ userPortalConfigSer_.remove(deletePage) ;
+ pages = new ArrayList<Page>() ;
+ for (String pageName : sitePortalPageNames) {
+ String sitePortalPageId = "portal::classic::" + pageName ;
+ Page page = userPortalConfigSer_.getPage(sitePortalPageId, accessUser) ;
+ if (page != null) pages.add(page) ;
+ }
+ assertEquals(0, pages.size()) ;
+ //assertEquals(sitePortalPageNames[1], pages.get(0).getName()) ;
+ }
+
+ private <T> T loadObject(Class<T> clazz, String file) throws Exception{
+ IBindingFactory bfact = BindingDirectory.getFactory(clazz) ;
+ IUnmarshallingContext uctx = bfact.createUnmarshallingContext() ;
+ FileInputStream is = new FileInputStream("src/test/resources/" + file) ;
+
+ return clazz.cast(uctx.unmarshalDocument(is, null));
+ }
+
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/UserPortalServiceTestBase.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/UserPortalServiceTestBase.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/UserPortalServiceTestBase.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,151 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config;
+
+import org.exoplatform.services.database.HibernateService;
+import org.exoplatform.services.organization.Group;
+import org.exoplatform.services.organization.MembershipType;
+import org.exoplatform.services.organization.OrganizationService;
+import org.exoplatform.services.organization.User;
+import org.exoplatform.services.organization.UserProfile;
+import org.exoplatform.test.BasicTestCase;
+
+/**
+ * Created by The eXo Platform SARL
+ * Author : Tuan Nguyen
+ * tuan08(a)users.sourceforge.net
+ * Dec 2, 2005
+ */
+abstract class UserPortalServiceTestBase extends BasicTestCase {
+
+ protected static OrganizationService orgService_ ;
+ protected static HibernateService hservice_;
+
+ protected static String demo = "demo" ;
+ protected static String Group1 = "Group1" ;
+ protected static String Group2 = "Group2" ;
+ protected static String username1 = "userName_1";
+ protected static String username2 = "userName_2" ;
+ protected static String memtype1 = "MembershipType_1" ;
+ protected static String memtype2 = "MembershipType_2" ;
+
+ protected Group group1, group2, groupDefault;
+ protected MembershipType mType1,mType2, mTypeDefault ;
+ protected User user1, user2 ,userDefault;
+
+ public UserPortalServiceTestBase(String name) {
+ super(name);
+ }
+
+
+ public void setUp() throws Exception {
+ }
+
+ public void tearDown() throws Exception {
+ }
+
+ protected void prepareOrganizationData() throws Exception{
+ groupDefault = orgService_.getGroupHandler().findGroupById("/users") ;
+ if(group1 ==null) { group1 = createGroup( Group1); }
+ if(group2 ==null) { group2 = createGroup( Group2) ; }
+
+ mTypeDefault = orgService_.getMembershipTypeHandler().findMembershipType("member") ;
+ if(mType1 ==null) { mType1 = createMembershipType(memtype1); }
+ if(mType2 ==null) {mType2 = createMembershipType(memtype2);
+ }
+
+ if(user1 ==null) {
+ user1 = createUser(username1);
+ //createDataUser(user1);
+ }
+ if(user2 ==null) {
+ user2= createUser(username2) ;
+ //createDataUser(user2) ;
+ }
+
+ userDefault = orgService_.getUserHandler().findUserByName(demo) ;
+ }
+ protected void removeOrganizationData() throws Exception {
+ if(orgService_.getGroupHandler().findGroupById("/"+Group1) !=null) {
+ orgService_.getGroupHandler().removeGroup(group1,true) ;
+ group1 = null ;
+ }
+ if(orgService_.getGroupHandler().findGroupById("/"+Group2) !=null) {
+ orgService_.getGroupHandler().removeGroup(group2,true) ;
+ group2 = null ;
+ }
+
+ if(orgService_.getMembershipTypeHandler().findMembershipType(memtype1)!= null) {
+ orgService_.getMembershipTypeHandler().removeMembershipType(memtype1,true) ;
+ mType1 = null ;
+ }
+ if(orgService_.getMembershipTypeHandler().findMembershipType(memtype2)!= null) {
+ orgService_.getMembershipTypeHandler().removeMembershipType(memtype2,true) ;
+ mType2 = null ;
+ }
+
+ if(orgService_.getUserHandler().findUserByName(username1) != null) {
+ orgService_.getUserHandler().removeUser(username1,true) ;
+ user1 = null ;
+ }
+ if(orgService_.getUserHandler().findUserByName(username2) != null) {
+ orgService_.getUserHandler().removeUser(username2,true) ;
+ user2 = null ;
+ }
+ }
+
+ protected Group createGroup(String groupName) throws Exception {
+ Group savedGroup = orgService_.getGroupHandler().findGroupById("/"+groupName);
+ if(savedGroup != null) return savedGroup;
+ Group groupParent = orgService_.getGroupHandler().createGroupInstance() ;
+ groupParent.setGroupName( groupName);
+ groupParent.setDescription("This is description");
+ orgService_.getGroupHandler().addChild(null, groupParent, true);
+ return groupParent;
+ }
+
+ protected MembershipType createMembershipType(String name) throws Exception {
+ MembershipType savedMt = orgService_.getMembershipTypeHandler().findMembershipType(name);
+ if(savedMt != null) return savedMt;
+ MembershipType mt = orgService_.getMembershipTypeHandler().createMembershipTypeInstance();
+ mt.setName( name) ;
+ mt.setDescription("This is a test") ;
+ mt.setOwner("exo") ;
+ orgService_.getMembershipTypeHandler().createMembershipType(mt, true);
+ return mt;
+ }
+
+ @SuppressWarnings("deprecation")
+ protected User createUser(String userName) throws Exception {
+ User savedUser = orgService_.getUserHandler().findUserByName(userName);
+ if(savedUser != null) return savedUser;
+ User user = orgService_.getUserHandler().createUserInstance(userName) ;
+ user.setPassword("default") ;
+ user.setFirstName("default") ;
+ user.setLastName("default") ;
+ user.setEmail("exo(a)exoportal.org") ;
+ orgService_.getUserHandler().createUser(user, true);
+ return user ;
+ }
+
+ protected User createDataUser(User u) throws Exception {
+ UserProfile up = orgService_.getUserProfileHandler().findUserProfileByName(u.getUserName());
+ up.getUserInfoMap().put("user.gender", "male");
+ orgService_.getUserProfileHandler().saveUserProfile(up, true);
+ return u;
+ }
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/AbstractTestSharedPageACL.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/AbstractTestSharedPageACL.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/AbstractTestSharedPageACL.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,205 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config.security;
+
+import org.exoplatform.portal.config.model.Page;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public abstract class AbstractTestSharedPageACL extends AbstractTestUserACL {
+
+ protected abstract String getOwnerType();
+
+ public void testPage() {
+ Page page = new Page();
+ page.setOwnerType("group");
+ page.setOwnerId("foo");
+ page.setAccessPermissions(new String[0]);
+
+ //
+ assertTrue(root.hasPermission(page));
+ assertFalse(administrator.hasPermission(page));
+ assertFalse(manager.hasPermission(page));
+ assertFalse(user.hasPermission(page));
+ assertFalse(guest.hasPermission(page));
+
+ //
+ assertTrue(root.hasEditPermission(page));
+ assertFalse(administrator.hasEditPermission(page));
+ assertFalse(manager.hasEditPermission(page));
+ assertFalse(user.hasEditPermission(page));
+ assertFalse(guest.hasEditPermission(page));
+ }
+
+ public void testPageAccessibleByEveryone() {
+ Page page = new Page();
+ page.setOwnerType("group");
+ page.setOwnerId("foo");
+ page.setAccessPermissions(new String[]{"Everyone"});
+
+ //
+ assertTrue(root.hasPermission(page));
+ assertTrue(administrator.hasPermission(page));
+ assertTrue(manager.hasPermission(page));
+ assertTrue(user.hasPermission(page));
+ assertTrue(guest.hasPermission(page));
+
+ //
+ assertTrue(root.hasEditPermission(page));
+ assertFalse(administrator.hasEditPermission(page));
+ assertFalse(manager.hasEditPermission(page));
+ assertFalse(user.hasEditPermission(page));
+ assertFalse(guest.hasEditPermission(page));
+ }
+
+ public void testPageEditableByEveryone() {
+ Page page = new Page();
+ page.setOwnerType("group");
+ page.setOwnerId("foo");
+ page.setAccessPermissions(new String[0]);
+ page.setEditPermission("Everyone");
+
+ //
+ assertTrue(root.hasPermission(page));
+ assertTrue(administrator.hasPermission(page));
+ assertTrue(manager.hasPermission(page));
+ assertTrue(user.hasPermission(page));
+ assertTrue(guest.hasPermission(page));
+
+ //
+ assertTrue(root.hasEditPermission(page));
+ assertTrue(administrator.hasEditPermission(page));
+ assertTrue(manager.hasEditPermission(page));
+ assertTrue(user.hasEditPermission(page));
+ assertTrue(guest.hasEditPermission(page));
+ }
+
+ public void testPageAccessibleByGuests() {
+ Page page = new Page();
+ page.setOwnerType("group");
+ page.setOwnerId("foo");
+ page.setAccessPermissions(new String[]{"whatever:/platform/guests"});
+
+ //
+ assertTrue(root.hasPermission(page));
+ assertFalse(administrator.hasPermission(page));
+ assertFalse(manager.hasPermission(page));
+ assertFalse(user.hasPermission(page));
+ assertTrue(guest.hasPermission(page));
+
+ //
+ assertTrue(root.hasEditPermission(page));
+ assertFalse(administrator.hasEditPermission(page));
+ assertFalse(manager.hasEditPermission(page));
+ assertFalse(user.hasEditPermission(page));
+ assertFalse(guest.hasEditPermission(page));
+ }
+
+ public void testPageEditableByGuests() {
+ Page page = new Page();
+ page.setOwnerType("group");
+ page.setOwnerId("foo");
+ page.setAccessPermissions(new String[0]);
+ page.setEditPermission("whatever:/platform/guests");
+
+ //
+ assertTrue(root.hasPermission(page));
+ assertFalse(administrator.hasPermission(page));
+ assertFalse(manager.hasPermission(page));
+ assertFalse(user.hasPermission(page));
+ assertTrue(guest.hasPermission(page));
+
+ //
+ assertTrue(root.hasEditPermission(page));
+ assertFalse(administrator.hasEditPermission(page));
+ assertFalse(manager.hasEditPermission(page));
+ assertFalse(user.hasEditPermission(page));
+ assertTrue(guest.hasEditPermission(page));
+ }
+
+ public void testPageAccessibleByEveryOneAndGuests() {
+ Page page = new Page();
+ page.setOwnerType("group");
+ page.setOwnerId("foo");
+ page.setAccessPermissions(new String[]{"Everyone", "whatever:/platform/guests"});
+
+ //
+ assertTrue(root.hasPermission(page));
+ assertTrue(administrator.hasPermission(page));
+ assertTrue(manager.hasPermission(page));
+ assertTrue(user.hasPermission(page));
+ assertTrue(guest.hasPermission(page));
+
+ //
+ assertTrue(root.hasEditPermission(page));
+ assertFalse(administrator.hasEditPermission(page));
+ assertFalse(manager.hasEditPermission(page));
+ assertFalse(user.hasEditPermission(page));
+ assertFalse(guest.hasEditPermission(page));
+ }
+
+ public void testPageWithAccessPermission() {
+ Page page = new Page();
+ page.setOwnerType("group");
+ page.setOwnerId("foo");
+ page.setAccessPermissions(new String[]{"manager:/manageable"});
+
+ //
+ assertTrue(root.hasPermission(page));
+ assertFalse(administrator.hasPermission(page));
+ assertTrue(manager.hasPermission(page));
+ assertFalse(user.hasPermission(page));
+ assertFalse(guest.hasPermission(page));
+
+ //
+ page.setAccessPermissions(new String[]{"*:/manageable"});
+
+ //
+ assertTrue(root.hasPermission(page));
+ assertFalse(administrator.hasPermission(page));
+ assertTrue(manager.hasPermission(page));
+ assertFalse(user.hasPermission(page));
+ assertFalse(guest.hasPermission(page));
+ }
+
+ public void testPageWithEditPermission() {
+ Page page = new Page();
+ page.setOwnerType("group");
+ page.setOwnerId("foo");
+ page.setAccessPermissions(new String[0]);
+ page.setEditPermission("manager:/manageable");
+
+ //
+ assertTrue(root.hasPermission(page));
+ assertFalse(administrator.hasPermission(page));
+ assertTrue(manager.hasPermission(page));
+ assertFalse(user.hasPermission(page));
+ assertFalse(guest.hasPermission(page));
+
+ //
+ page.setEditPermission("*:/manageable");
+
+ //
+ assertTrue(root.hasPermission(page));
+ assertFalse(administrator.hasPermission(page));
+ assertTrue(manager.hasPermission(page));
+ assertFalse(user.hasPermission(page));
+ assertFalse(guest.hasPermission(page));
+ }
+}
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/AbstractTestUserACL.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/AbstractTestUserACL.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/AbstractTestUserACL.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,173 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config.security;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.exoplatform.portal.config.UserACL;
+import org.exoplatform.portal.config.UserACLMetaData;
+import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.services.security.ConversationState;
+import org.exoplatform.services.security.Identity;
+import org.exoplatform.services.security.MembershipEntry;
+import org.exoplatform.test.BasicTestCase;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class AbstractTestUserACL extends BasicTestCase {
+
+ UserACL ua;
+ User root, administrator, manager, user, guest;
+
+ @Override
+ protected void setUp() throws Exception {
+ UserACLMetaData md = new UserACLMetaData();
+ md.setSuperUser("root");
+ md.setGuestsGroups("/platform/guests");
+ md.setPortalCreateGroups("*:/platform/administrators,*:/organization/management/executive-board");
+ md.setNavigationCreatorMembershipType("manager");
+ UserACL ua = new UserACL(md);
+ User root = new User("root");
+ User administrator = new User("administrator");
+ administrator.addMembership("whatever", "/platform/administrators");
+ User manager = new User("manager");
+ manager.addMembership("manager", "/manageable");
+ User user = new User("user");
+ User guest = new User(null);
+
+ //
+ this.ua = ua;
+ this.root = root;
+ this.administrator = administrator;
+ this.manager = manager;
+ this.user = user;
+ this.guest = guest;
+ }
+
+ public class User {
+
+ private final Identity identity;
+
+ private User(String id) {
+ if (id != null) {
+ Collection<String> roles = Collections.emptySet();
+ Set<MembershipEntry> memberships = new HashSet<MembershipEntry>();
+ identity = new Identity(id, memberships, roles);
+ } else {
+ identity = null;
+ }
+ }
+
+ private String getId() {
+ return identity != null ? identity.getUserId() : null;
+ }
+
+ public void addMembership(String type, String group) {
+ identity.getMemberships().add(new MembershipEntry(group, type));
+ }
+
+ public void removeMembership(String type, String group) {
+ for (Iterator<MembershipEntry> i = identity.getMemberships().iterator();i.hasNext();) {
+ MembershipEntry membership = i.next();
+ if (type == null || type.equals(membership.getMembershipType())) {
+ if (group == null || group.equals(membership.getGroup())) {
+ i.remove();
+ }
+ }
+ }
+ }
+
+ public void removeMembershipByType(String type) {
+ removeMembership(type, null);
+ }
+
+ public void removeMembershipByGroup(String group) {
+ removeMembership(null, group);
+ }
+
+ public void run(Runnable runnable) {
+ ConversationState.setCurrent(new ConversationState(identity));
+ try {
+ runnable.run();
+ } finally {
+ ConversationState.setCurrent(null);
+ }
+ }
+
+ public boolean hasEditPermission(PageNavigation nav) {
+ ConversationState.setCurrent(new ConversationState(identity));
+ try {
+ return ua.hasEditPermission(nav);
+ } finally {
+ ConversationState.setCurrent(null);
+ }
+ }
+
+ public boolean hasPermission(Page page) {
+ ConversationState.setCurrent(new ConversationState(identity));
+ try {
+ return ua.hasPermission(page);
+ } finally {
+ ConversationState.setCurrent(null);
+ }
+ }
+
+ public boolean hasEditPermission(Page page) {
+ ConversationState.setCurrent(new ConversationState(identity));
+ try {
+ return ua.hasEditPermission(page);
+ } finally {
+ ConversationState.setCurrent(null);
+ }
+ }
+
+ public boolean hasPermission(PortalConfig portal) {
+ ConversationState.setCurrent(new ConversationState(identity));
+ try {
+ return ua.hasPermission(portal);
+ } finally {
+ ConversationState.setCurrent(null);
+ }
+ }
+
+ public boolean hasEditPermission(PortalConfig portal) {
+ ConversationState.setCurrent(new ConversationState(identity));
+ try {
+ return ua.hasEditPermission(portal);
+ } finally {
+ ConversationState.setCurrent(null);
+ }
+ }
+
+ public boolean hasCreatePortalPermission() {
+ ConversationState.setCurrent(new ConversationState(identity));
+ try {
+ return ua.hasCreatePortalPermission();
+ } finally {
+ ConversationState.setCurrent(null);
+ }
+ }
+ }
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestCreatePortalACL.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestCreatePortalACL.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestCreatePortalACL.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config.security;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class TestCreatePortalACL extends AbstractTestUserACL {
+
+ public void testPermission() {
+ assertTrue(root.hasCreatePortalPermission());
+ assertTrue(administrator.hasCreatePortalPermission());
+ assertFalse(manager.hasCreatePortalPermission());
+ assertFalse(user.hasCreatePortalPermission());
+ }
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestGroupNavACL.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestGroupNavACL.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestGroupNavACL.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config.security;
+
+import org.exoplatform.portal.config.model.PageNavigation;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class TestGroupNavACL extends AbstractTestUserACL {
+
+ public void testNavEditByManager() {
+ PageNavigation nav = new PageNavigation();
+ nav.setOwnerType("group");
+ nav.setOwnerId("manageable");
+
+ //
+ assertTrue(root.hasEditPermission(nav));
+ assertFalse(administrator.hasEditPermission(nav));
+ assertTrue(manager.hasEditPermission(nav));
+ assertFalse(user.hasEditPermission(nav));
+ assertFalse(guest.hasEditPermission(nav));
+
+ //
+ nav.setOwnerId("foo");
+
+ //
+ assertTrue(root.hasEditPermission(nav));
+ assertFalse(administrator.hasEditPermission(nav));
+ assertFalse(manager.hasEditPermission(nav));
+ assertFalse(user.hasEditPermission(nav));
+ assertFalse(guest.hasEditPermission(nav));
+ }
+}
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestGroupPageACL.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestGroupPageACL.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestGroupPageACL.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config.security;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class TestGroupPageACL extends AbstractTestSharedPageACL {
+ protected String getOwnerType() {
+ return "Group";
+ }
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestPortalConfigACL.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestPortalConfigACL.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestPortalConfigACL.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config.security;
+
+import org.exoplatform.portal.config.model.PortalConfig;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class TestPortalConfigACL extends AbstractTestUserACL {
+
+
+ public void testFoo() {
+ PortalConfig portal = new PortalConfig();
+ portal.setAccessPermissions(new String[0]);
+
+ //
+ assertTrue(root.hasEditPermission(portal));
+ assertFalse(administrator.hasEditPermission(portal));
+ assertFalse(manager.hasEditPermission(portal));
+ assertFalse(user.hasEditPermission(portal));
+ assertFalse(guest.hasEditPermission(portal));
+
+ //
+ assertTrue(root.hasPermission(portal));
+ assertFalse(administrator.hasPermission(portal));
+ assertFalse(manager.hasPermission(portal));
+ assertFalse(user.hasPermission(portal));
+ assertFalse(guest.hasPermission(portal));
+ }
+
+ public void testPortalAccessible() {
+ PortalConfig portal = new PortalConfig();
+ portal.setAccessPermissions(new String[]{"manager:/manageable"});
+
+ //
+ assertTrue(root.hasEditPermission(portal));
+ assertFalse(administrator.hasEditPermission(portal));
+ assertFalse(manager.hasEditPermission(portal));
+ assertFalse(user.hasEditPermission(portal));
+ assertFalse(guest.hasEditPermission(portal));
+
+ //
+ assertTrue(root.hasPermission(portal));
+ assertFalse(administrator.hasPermission(portal));
+ assertTrue(manager.hasPermission(portal));
+ assertFalse(user.hasPermission(portal));
+ assertFalse(guest.hasPermission(portal));
+ }
+
+ public void testPortalEditable() {
+ PortalConfig portal = new PortalConfig();
+ portal.setAccessPermissions(new String[0]);
+ portal.setEditPermission("manager:/manageable");
+
+ //
+ assertTrue(root.hasEditPermission(portal));
+ assertFalse(administrator.hasEditPermission(portal));
+ assertTrue(manager.hasEditPermission(portal));
+ assertFalse(user.hasEditPermission(portal));
+ assertFalse(guest.hasEditPermission(portal));
+
+ //
+ assertTrue(root.hasPermission(portal));
+ assertFalse(administrator.hasPermission(portal));
+ assertTrue(manager.hasPermission(portal));
+ assertFalse(user.hasPermission(portal));
+ assertFalse(guest.hasPermission(portal));
+ }
+
+ public void testPortalAccessibleAndEditable() {
+ PortalConfig portal = new PortalConfig();
+ portal.setAccessPermissions(new String[]{"manager:/manageable"});
+ portal.setEditPermission("manager:/manageable");
+
+ //
+ assertTrue(root.hasEditPermission(portal));
+ assertFalse(administrator.hasEditPermission(portal));
+ assertTrue(manager.hasEditPermission(portal));
+ assertFalse(user.hasEditPermission(portal));
+ assertFalse(guest.hasEditPermission(portal));
+
+ //
+ assertTrue(root.hasPermission(portal));
+ assertFalse(administrator.hasPermission(portal));
+ assertTrue(manager.hasPermission(portal));
+ assertFalse(user.hasPermission(portal));
+ assertFalse(guest.hasPermission(portal));
+ }
+
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestPortalNavACL.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestPortalNavACL.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestPortalNavACL.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config.security;
+
+import org.exoplatform.portal.config.model.PageNavigation;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class TestPortalNavACL extends AbstractTestUserACL {
+
+ public void testNavEditByRoot() {
+ PageNavigation nav = new PageNavigation();
+ nav.setOwnerType("portal");
+ nav.setOwnerId("foo");
+
+ //
+ assertTrue(root.hasEditPermission(nav));
+ assertFalse(administrator.hasEditPermission(nav));
+ assertFalse(manager.hasEditPermission(nav));
+ assertFalse(user.hasEditPermission(nav));
+ assertFalse(guest.hasEditPermission(nav));
+ }
+}
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestPortalPageACL.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestPortalPageACL.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestPortalPageACL.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config.security;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class TestPortalPageACL extends AbstractTestSharedPageACL {
+ protected String getOwnerType() {
+ return "Portal";
+ }
+}
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestUserNavACL.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestUserNavACL.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestUserNavACL.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config.security;
+
+import org.exoplatform.portal.config.model.PageNavigation;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class TestUserNavACL extends AbstractTestUserACL {
+
+ public void testNav() {
+
+ PageNavigation nav = new PageNavigation();
+ nav.setOwnerType("user");
+ nav.setOwnerId("user");
+
+ assertTrue(root.hasEditPermission(nav));
+ assertFalse(administrator.hasEditPermission(nav));
+ assertFalse(manager.hasEditPermission(nav));
+ assertTrue(user.hasEditPermission(nav));
+ assertFalse(guest.hasEditPermission(nav));
+ }
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestUserPageACL.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestUserPageACL.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestUserPageACL.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.config.security;
+
+import org.exoplatform.portal.config.model.Page;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class TestUserPageACL extends AbstractTestUserACL {
+ public void testUserPageIsAlwaysUsableOnlyByItsOwner() {
+ Page[] pages = new Page[]{new Page(), new Page(), new Page(), new Page(), new Page()};
+
+ //
+ pages[0].setOwnerType("user");
+ pages[0].setOwnerId("user");
+ pages[0].setAccessPermissions(new String[0]);
+
+ //
+ pages[1].setOwnerType("user");
+ pages[1].setOwnerId("user");
+ pages[1].setAccessPermissions(new String[]{"manager:/manageable"});
+
+ //
+ pages[2].setOwnerType("user");
+ pages[2].setOwnerId("user");
+ pages[2].setAccessPermissions(new String[0]);
+ pages[2].setEditPermission("manager:/manageable") ;
+
+ //
+ pages[3].setOwnerType("user");
+ pages[3].setOwnerId("user");
+ pages[3].setAccessPermissions(new String[]{"Everyone"});
+
+ //
+ pages[4].setOwnerType("user");
+ pages[4].setOwnerId("user");
+ pages[4].setAccessPermissions(new String[0]);
+ pages[4].setEditPermission("Everyone") ;
+
+ //
+ for (Page page : pages) {
+ assertFalse(root.hasPermission(page));
+ assertFalse(administrator.hasPermission(page));
+ assertFalse(manager.hasPermission(page));
+ assertTrue(user.hasPermission(page));
+ assertFalse(guest.hasPermission(page));
+
+ //
+ assertFalse(root.hasEditPermission(page));
+ assertFalse(administrator.hasEditPermission(page));
+ assertFalse(manager.hasEditPermission(page));
+ assertTrue(user.hasEditPermission(page));
+ assertFalse(guest.hasEditPermission(page));
+ }
+ }
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/jboss/OwnerType.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/jboss/OwnerType.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/jboss/OwnerType.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,42 @@
+/**
+ *
+ */
+package org.exoplatform.portal.config.security.jboss;
+
+import org.jboss.security.authz.component.Component;
+import org.jboss.security.authz.component.ComponentCategory;
+import org.jboss.security.authz.component.ComponentType;
+import org.jboss.security.authz.component.SecurityContextData;
+
+/**
+ * This is a custom "Security Component"
+ *
+ * @author soshah
+ *
+ */
+@Component(
+ name="ownerType",
+ type=ComponentType.TARGET,
+ category=ComponentCategory.CUSTOM_SUBJECT_ATTRIBUTE
+)
+public class OwnerType
+{
+ //Indicates the Type of Owner that owns this Portal Object. Examples of usch types are User Types, Group Types etc
+ @SecurityContextData
+ private String type;
+
+ public OwnerType()
+ {
+
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public void setType(String type)
+ {
+ this.type = type;
+ }
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/jboss/TestJBossAuthzIntegration.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/jboss/TestJBossAuthzIntegration.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/jboss/TestJBossAuthzIntegration.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,131 @@
+package org.exoplatform.portal.config.security.jboss;
+
+
+import java.net.URI;
+
+import org.apache.log4j.Logger;
+
+import org.exoplatform.test.BasicTestCase;
+
+import org.jboss.security.authz.bootstrap.ServiceContainer;
+
+import org.jboss.security.authz.components.resource.URIResource;
+import org.jboss.security.authz.components.subject.Roles;
+import org.jboss.security.authz.components.action.Read;
+
+import org.jboss.security.authz.model.Effect;
+import org.jboss.security.authz.model.Policy;
+import org.jboss.security.authz.model.PolicyMetaData;
+
+import org.jboss.security.authz.agent.enforcement.PolicyEnforcementPoint;
+import org.jboss.security.authz.agent.enforcement.EnforcementContext;
+import org.jboss.security.authz.agent.enforcement.EnforcementResponse;
+import org.jboss.security.authz.agent.provisioning.PolicyProvisioner;
+
+import org.jboss.security.authz.agent.services.CompositionContext;
+import org.jboss.security.authz.agent.services.PolicyComposer;
+
+
+
+/**
+ *
+ * @author soshah
+ *
+ */
+public class TestJBossAuthzIntegration extends BasicTestCase
+{
+ private static Logger log = Logger.getLogger(TestJBossAuthzIntegration.class);
+
+ private PolicyComposer policyComposer;
+ private PolicyEnforcementPoint enforcer;
+ private PolicyProvisioner provisioner;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ ServiceContainer.bootstrap();
+ this.policyComposer = (PolicyComposer)ServiceContainer.lookup("/agent/PolicyComposer");
+ this.enforcer = (PolicyEnforcementPoint)ServiceContainer.lookup("/agent/LocalEnforcementPoint");
+ this.provisioner = (PolicyProvisioner)ServiceContainer.lookup("/agent/LocalPolicyProvisioner");
+ }
+
+ public void testIntegration() throws Exception
+ {
+ //SetUp Resource
+ URIResource resource = new URIResource();
+ resource.setUri(new URI("/root/level1/level2/index.html"));
+
+ Read action = new Read();
+
+ Roles allowedRoles = new Roles();
+ allowedRoles.addName("user");
+
+ //Setup the Context for the Composition with these components
+ CompositionContext context = new CompositionContext();
+ context.setPolicyTarget(resource);
+ context.addPolicyRule(Effect.PERMIT, action, allowedRoles, "allowExpression");
+
+ //Store the policy into the Policy Server
+ PolicyMetaData policyMetaData = this.policyComposer.compose(context);
+ this.provisioner.newPolicy(policyMetaData);
+
+ this.assertServerState();
+
+ //Go ahead and produce a RequestContext for a "Permit" Enforcement
+ URIResource contextResource = new URIResource();
+ contextResource.setUri(new URI("/root/level1/level2/index.html"));
+
+ //Perform enforcement
+ this.enforce(this.createEnforcementContext(contextResource, action), true);
+ }
+ //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ private void assertServerState() throws Exception
+ {
+ //Assert Policy State of the Server
+ Policy[] policies = this.provisioner.readAllPolicies();
+
+ assertTrue("Policy Store must not be empty!!", (policies != null && policies.length == 1));
+ log.info("------------------------------------------------------------------------------");
+ log.info(policies[0].generateSystemPolicy());
+ }
+
+ private void enforce(EnforcementContext enforcementContext, boolean mustBePermitted) throws Exception
+ {
+ EnforcementResponse response = this.enforcer.checkAccess(enforcementContext);
+
+ assertNotNull(response);
+ log.info("-----------------------------------");
+ log.info("Decision="+response.getMessage());
+
+ if(mustBePermitted)
+ {
+ assertTrue("Access must be granted!!!", response.isAccessGranted());
+ }
+ else
+ {
+ assertFalse("Access must be denied!!!", response.isAccessGranted());
+ }
+ }
+
+ private EnforcementContext createEnforcementContext(URIResource protectedResource, Read action) throws Exception
+ {
+ // Create an EnforcementContext
+ EnforcementContext context = new EnforcementContext();
+
+ // Enable Hierarchial Enforcement
+ context.activateHierarchialEnforcement();
+
+ // Create Resource
+ context.setAttribute("uri-resource", protectedResource);
+
+ // Create Subjects
+ Roles roles = new Roles();
+ roles.addName("user");
+ context.setAttribute("roles", roles);
+
+ // Create Action
+ context.setAttribute("action", action);
+
+ return context;
+ }
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/jboss/TestOwnerTypeRules.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/jboss/TestOwnerTypeRules.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/jboss/TestOwnerTypeRules.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,151 @@
+package org.exoplatform.portal.config.security.jboss;
+
+
+import java.net.URI;
+
+import org.apache.log4j.Logger;
+
+import org.exoplatform.test.BasicTestCase;
+import org.exoplatform.portal.config.model.PortalConfig;
+
+import org.jboss.security.authz.bootstrap.ServiceContainer;
+
+import org.jboss.security.authz.components.resource.URIResource;
+import org.jboss.security.authz.components.subject.Roles;
+import org.jboss.security.authz.components.subject.Identity;
+import org.jboss.security.authz.components.action.Read;
+
+import org.jboss.security.authz.model.Effect;
+import org.jboss.security.authz.model.Policy;
+import org.jboss.security.authz.model.PolicyMetaData;
+
+import org.jboss.security.authz.agent.enforcement.PolicyEnforcementPoint;
+import org.jboss.security.authz.agent.enforcement.EnforcementContext;
+import org.jboss.security.authz.agent.enforcement.EnforcementResponse;
+import org.jboss.security.authz.agent.provisioning.PolicyProvisioner;
+
+import org.jboss.security.authz.agent.services.CompositionContext;
+import org.jboss.security.authz.agent.services.PolicyComposer;
+
+
+
+/**
+ *
+ * @author soshah
+ *
+ */
+public class TestOwnerTypeRules extends BasicTestCase
+{
+ private static Logger log = Logger.getLogger(TestOwnerTypeRules.class);
+
+ private PolicyComposer policyComposer;
+ private PolicyEnforcementPoint enforcer;
+ private PolicyProvisioner provisioner;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ ServiceContainer.bootstrap();
+ this.policyComposer = (PolicyComposer)ServiceContainer.lookup("/agent/PolicyComposer");
+ this.enforcer = (PolicyEnforcementPoint)ServiceContainer.lookup("/agent/LocalEnforcementPoint");
+ this.provisioner = (PolicyProvisioner)ServiceContainer.lookup("/agent/LocalPolicyProvisioner");
+ }
+
+ public void testGroupType() throws Exception
+ {
+ //SetUp Resource
+ URIResource resource = new URIResource();
+ resource.setUri(new URI("/root/level1/level2/index.html"));
+
+ OwnerType ownerType = new OwnerType();
+ ownerType.setType(PortalConfig.GROUP_TYPE);
+
+ Roles allowedRoles = new Roles();
+ allowedRoles.addName("navigationCreatorMembershipType_:/marketing");
+
+ //Setup the Context for the Composition with these components
+ CompositionContext context = new CompositionContext();
+ context.setPolicyTarget(resource);
+ context.addPolicyRule(Effect.PERMIT, ownerType, allowedRoles, "allowExpression");
+
+ //Store the policy into the Policy Server
+ PolicyMetaData policyMetaData = this.policyComposer.compose(context);
+ this.provisioner.newPolicy(policyMetaData);
+
+ this.assertServerState();
+ }
+
+ public void testUserType() throws Exception
+ {
+ //SetUp Resource
+ URIResource resource = new URIResource();
+ resource.setUri(new URI("/root/level1/level2/index.html"));
+
+ OwnerType ownerType = new OwnerType();
+ ownerType.setType(PortalConfig.USER_TYPE);
+
+ Identity identity = new Identity();
+ identity.setName("mockuser(a)exoportal.com");
+
+ //Setup the Context for the Composition with these components
+ CompositionContext context = new CompositionContext();
+ context.setPolicyTarget(resource);
+ context.addPolicyRule(Effect.PERMIT, ownerType, identity, null);
+
+ //Store the policy into the Policy Server
+ PolicyMetaData policyMetaData = this.policyComposer.compose(context);
+ this.provisioner.newPolicy(policyMetaData);
+
+ this.assertServerState();
+ }
+ //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ private void assertServerState() throws Exception
+ {
+ //Assert Policy State of the Server
+ Policy[] policies = this.provisioner.readAllPolicies();
+
+ assertTrue("Policy Store must not be empty!!", (policies != null && policies.length == 1));
+ log.info("------------------------------------------------------------------------------");
+ log.info(policies[0].generateSystemPolicy());
+ }
+
+ private void enforce(EnforcementContext enforcementContext, boolean mustBePermitted) throws Exception
+ {
+ EnforcementResponse response = this.enforcer.checkAccess(enforcementContext);
+
+ assertNotNull(response);
+ log.info("-----------------------------------");
+ log.info("Decision="+response.getMessage());
+
+ if(mustBePermitted)
+ {
+ assertTrue("Access must be granted!!!", response.isAccessGranted());
+ }
+ else
+ {
+ assertFalse("Access must be denied!!!", response.isAccessGranted());
+ }
+ }
+
+ private EnforcementContext createEnforcementContext(URIResource protectedResource, Read action) throws Exception
+ {
+ // Create an EnforcementContext
+ EnforcementContext context = new EnforcementContext();
+
+ // Enable Hierarchial Enforcement
+ context.activateHierarchialEnforcement();
+
+ // Create Resource
+ context.setAttribute("uri-resource", protectedResource);
+
+ // Create Subjects
+ Roles roles = new Roles();
+ roles.addName("user");
+ context.setAttribute("roles", roles);
+
+ // Create Action
+ context.setAttribute("action", action);
+
+ return context;
+ }
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/jboss/TestPageNavSecurityRules.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/jboss/TestPageNavSecurityRules.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/jboss/TestPageNavSecurityRules.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,153 @@
+package org.exoplatform.portal.config.security.jboss;
+
+
+import java.net.URI;
+
+import org.apache.log4j.Logger;
+
+import org.exoplatform.test.BasicTestCase;
+import org.exoplatform.portal.config.UserACL;
+import org.exoplatform.portal.config.model.PortalConfig;
+
+import org.jboss.security.authz.bootstrap.ServiceContainer;
+
+import org.jboss.security.authz.components.resource.URIResource;
+import org.jboss.security.authz.components.subject.Roles;
+import org.jboss.security.authz.components.subject.Identity;
+import org.jboss.security.authz.components.action.Operation;
+import org.jboss.security.authz.components.action.Write;
+
+import org.jboss.security.authz.model.Effect;
+import org.jboss.security.authz.model.Policy;
+import org.jboss.security.authz.model.PolicyMetaData;
+
+import org.jboss.security.authz.agent.enforcement.PolicyEnforcementPoint;
+import org.jboss.security.authz.agent.enforcement.EnforcementContext;
+import org.jboss.security.authz.agent.enforcement.EnforcementResponse;
+import org.jboss.security.authz.agent.provisioning.PolicyProvisioner;
+
+import org.jboss.security.authz.agent.services.CompositionContext;
+import org.jboss.security.authz.agent.services.PolicyComposer;
+
+
+
+/**
+ *
+ * @author soshah
+ *
+ */
+public class TestPageNavSecurityRules extends BasicTestCase
+{
+ private static Logger log = Logger.getLogger(TestPageNavSecurityRules.class);
+
+ private PolicyComposer policyComposer;
+ private PolicyEnforcementPoint enforcer;
+ private PolicyProvisioner provisioner;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ ServiceContainer.bootstrap();
+ this.policyComposer = (PolicyComposer)ServiceContainer.lookup("/agent/PolicyComposer");
+ this.enforcer = (PolicyEnforcementPoint)ServiceContainer.lookup("/agent/LocalEnforcementPoint");
+ this.provisioner = (PolicyProvisioner)ServiceContainer.lookup("/agent/LocalPolicyProvisioner");
+ }
+
+ public void testReadRule() throws Exception
+ {
+ this.provisionPortalSecurityRules();
+ this.assertServerState();
+ }
+ //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ private void assertServerState() throws Exception
+ {
+ //Assert Policy State of the Server
+ Policy[] policies = this.provisioner.readAllPolicies();
+
+ assertTrue("Policy Store must not be empty!!", (policies != null && policies.length == 1));
+ log.info("------------------------------------------------------------------------------");
+ log.info(policies[0].generateSystemPolicy());
+ }
+
+ private void enforce(EnforcementContext enforcementContext, boolean mustBePermitted) throws Exception
+ {
+ EnforcementResponse response = this.enforcer.checkAccess(enforcementContext);
+
+ assertNotNull(response);
+ log.info("-----------------------------------");
+ log.info("Decision="+response.getMessage());
+
+ if(mustBePermitted)
+ {
+ assertTrue("Access must be granted!!!", response.isAccessGranted());
+ }
+ else
+ {
+ assertFalse("Access must be denied!!!", response.isAccessGranted());
+ }
+ }
+
+ private EnforcementContext createEnforcementContext(URIResource protectedResource, Operation action) throws Exception
+ {
+ // Create an EnforcementContext
+ EnforcementContext context = new EnforcementContext();
+
+ // Enable Hierarchial Enforcement
+ context.activateHierarchialEnforcement();
+
+ // Create Resource
+ context.setAttribute("uri-resource", protectedResource);
+
+ // Create Subjects
+ Roles roles = new Roles();
+ roles.addName("user");
+ context.setAttribute("roles", roles);
+
+ // Create Action
+ context.setAttribute("action", action);
+
+ return context;
+ }
+
+ private void provisionPortalSecurityRules() throws Exception
+ {
+ //SetUp Resource
+ URIResource resource = new URIResource();
+ resource.setUri(new URI("adminPortal"));
+
+ //Super User/Everyone (gives access without further evaluation)
+ Identity superuser = new Identity();
+ superuser.setName("administrator"); //Provided via system configuration
+ Roles everyone = new Roles();
+ everyone.addName(UserACL.EVERYONE);
+
+ //Guest Group
+ Roles guest = new Roles();
+ guest.addName("guests"); //Provided via system configuration
+ guest.addName(Roles.ANONYMOUS);
+ guest.setMustMatchAll(true);
+
+ //PortalCreators Group
+ Roles portalCreators = new Roles();
+ portalCreators.addName("portalCreator1"); //Provided via system configuration
+ portalCreators.addName("portalCreator2");
+
+ //Other allowed Roles
+ Roles others = new Roles();
+ others.addName("employees");
+ others.addName("partners");
+
+ //Setup the Context for the Composition with these components
+ CompositionContext context = new CompositionContext();
+ context.setPolicyTarget(resource);
+ context.addPolicyRule(Effect.PERMIT, new Write(), superuser);
+ context.addPolicyRule(Effect.PERMIT, new Write(), everyone, "allowExpression");
+ context.addPolicyRule(Effect.PERMIT, new Write(), guest, "allowExpression");
+ context.addPolicyRule(Effect.PERMIT, new Write(), portalCreators, "allowExpression");
+ context.addPolicyRule(Effect.PERMIT, new Write(), others, "allowExpression");
+
+ //Store the policy into the Policy Server
+ PolicyMetaData policyMetaData = this.policyComposer.compose(context);
+ this.provisioner.newPolicy(policyMetaData);
+ }
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/jboss/TestPageSecurityRules.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/jboss/TestPageSecurityRules.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/jboss/TestPageSecurityRules.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,153 @@
+package org.exoplatform.portal.config.security.jboss;
+
+
+import java.net.URI;
+
+import org.apache.log4j.Logger;
+
+import org.exoplatform.test.BasicTestCase;
+import org.exoplatform.portal.config.UserACL;
+import org.exoplatform.portal.config.model.PortalConfig;
+
+import org.jboss.security.authz.bootstrap.ServiceContainer;
+
+import org.jboss.security.authz.components.resource.URIResource;
+import org.jboss.security.authz.components.subject.Roles;
+import org.jboss.security.authz.components.subject.Identity;
+import org.jboss.security.authz.components.action.Operation;
+import org.jboss.security.authz.components.action.Write;
+
+import org.jboss.security.authz.model.Effect;
+import org.jboss.security.authz.model.Policy;
+import org.jboss.security.authz.model.PolicyMetaData;
+
+import org.jboss.security.authz.agent.enforcement.PolicyEnforcementPoint;
+import org.jboss.security.authz.agent.enforcement.EnforcementContext;
+import org.jboss.security.authz.agent.enforcement.EnforcementResponse;
+import org.jboss.security.authz.agent.provisioning.PolicyProvisioner;
+
+import org.jboss.security.authz.agent.services.CompositionContext;
+import org.jboss.security.authz.agent.services.PolicyComposer;
+
+
+
+/**
+ *
+ * @author soshah
+ *
+ */
+public class TestPageSecurityRules extends BasicTestCase
+{
+ private static Logger log = Logger.getLogger(TestPageSecurityRules.class);
+
+ private PolicyComposer policyComposer;
+ private PolicyEnforcementPoint enforcer;
+ private PolicyProvisioner provisioner;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ ServiceContainer.bootstrap();
+ this.policyComposer = (PolicyComposer)ServiceContainer.lookup("/agent/PolicyComposer");
+ this.enforcer = (PolicyEnforcementPoint)ServiceContainer.lookup("/agent/LocalEnforcementPoint");
+ this.provisioner = (PolicyProvisioner)ServiceContainer.lookup("/agent/LocalPolicyProvisioner");
+ }
+
+ public void testReadRule() throws Exception
+ {
+ this.provisionPortalSecurityRules();
+ this.assertServerState();
+ }
+ //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ private void assertServerState() throws Exception
+ {
+ //Assert Policy State of the Server
+ Policy[] policies = this.provisioner.readAllPolicies();
+
+ assertTrue("Policy Store must not be empty!!", (policies != null && policies.length == 1));
+ log.info("------------------------------------------------------------------------------");
+ log.info(policies[0].generateSystemPolicy());
+ }
+
+ private void enforce(EnforcementContext enforcementContext, boolean mustBePermitted) throws Exception
+ {
+ EnforcementResponse response = this.enforcer.checkAccess(enforcementContext);
+
+ assertNotNull(response);
+ log.info("-----------------------------------");
+ log.info("Decision="+response.getMessage());
+
+ if(mustBePermitted)
+ {
+ assertTrue("Access must be granted!!!", response.isAccessGranted());
+ }
+ else
+ {
+ assertFalse("Access must be denied!!!", response.isAccessGranted());
+ }
+ }
+
+ private EnforcementContext createEnforcementContext(URIResource protectedResource, Operation action) throws Exception
+ {
+ // Create an EnforcementContext
+ EnforcementContext context = new EnforcementContext();
+
+ // Enable Hierarchial Enforcement
+ context.activateHierarchialEnforcement();
+
+ // Create Resource
+ context.setAttribute("uri-resource", protectedResource);
+
+ // Create Subjects
+ Roles roles = new Roles();
+ roles.addName("user");
+ context.setAttribute("roles", roles);
+
+ // Create Action
+ context.setAttribute("action", action);
+
+ return context;
+ }
+
+ private void provisionPortalSecurityRules() throws Exception
+ {
+ //SetUp Resource
+ URIResource resource = new URIResource();
+ resource.setUri(new URI("adminPortal"));
+
+ //Super User/Everyone (gives access without further evaluation)
+ Identity superuser = new Identity();
+ superuser.setName("administrator"); //Provided via system configuration
+ Roles everyone = new Roles();
+ everyone.addName(UserACL.EVERYONE);
+
+ //Guest Group
+ Roles guest = new Roles();
+ guest.addName("guests"); //Provided via system configuration
+ guest.addName(Roles.ANONYMOUS);
+ guest.setMustMatchAll(true);
+
+ //PortalCreators Group
+ Roles portalCreators = new Roles();
+ portalCreators.addName("portalCreator1"); //Provided via system configuration
+ portalCreators.addName("portalCreator2");
+
+ //Other allowed Roles
+ Roles others = new Roles();
+ others.addName("employees");
+ others.addName("partners");
+
+ //Setup the Context for the Composition with these components
+ CompositionContext context = new CompositionContext();
+ context.setPolicyTarget(resource);
+ context.addPolicyRule(Effect.PERMIT, new Write(), superuser);
+ context.addPolicyRule(Effect.PERMIT, new Write(), everyone, "allowExpression");
+ context.addPolicyRule(Effect.PERMIT, new Write(), guest, "allowExpression");
+ context.addPolicyRule(Effect.PERMIT, new Write(), portalCreators, "allowExpression");
+ context.addPolicyRule(Effect.PERMIT, new Write(), others, "allowExpression");
+
+ //Store the policy into the Policy Server
+ PolicyMetaData policyMetaData = this.policyComposer.compose(context);
+ this.provisioner.newPolicy(policyMetaData);
+ }
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/jboss/TestPortalConfigSecurityRules.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/jboss/TestPortalConfigSecurityRules.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/jboss/TestPortalConfigSecurityRules.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,153 @@
+package org.exoplatform.portal.config.security.jboss;
+
+
+import java.net.URI;
+
+import org.apache.log4j.Logger;
+
+import org.exoplatform.test.BasicTestCase;
+import org.exoplatform.portal.config.UserACL;
+import org.exoplatform.portal.config.model.PortalConfig;
+
+import org.jboss.security.authz.bootstrap.ServiceContainer;
+
+import org.jboss.security.authz.components.resource.URIResource;
+import org.jboss.security.authz.components.subject.Roles;
+import org.jboss.security.authz.components.subject.Identity;
+import org.jboss.security.authz.components.action.Operation;
+import org.jboss.security.authz.components.action.Write;
+
+import org.jboss.security.authz.model.Effect;
+import org.jboss.security.authz.model.Policy;
+import org.jboss.security.authz.model.PolicyMetaData;
+
+import org.jboss.security.authz.agent.enforcement.PolicyEnforcementPoint;
+import org.jboss.security.authz.agent.enforcement.EnforcementContext;
+import org.jboss.security.authz.agent.enforcement.EnforcementResponse;
+import org.jboss.security.authz.agent.provisioning.PolicyProvisioner;
+
+import org.jboss.security.authz.agent.services.CompositionContext;
+import org.jboss.security.authz.agent.services.PolicyComposer;
+
+
+
+/**
+ *
+ * @author soshah
+ *
+ */
+public class TestPortalConfigSecurityRules extends BasicTestCase
+{
+ private static Logger log = Logger.getLogger(TestPortalConfigSecurityRules.class);
+
+ private PolicyComposer policyComposer;
+ private PolicyEnforcementPoint enforcer;
+ private PolicyProvisioner provisioner;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ ServiceContainer.bootstrap();
+ this.policyComposer = (PolicyComposer)ServiceContainer.lookup("/agent/PolicyComposer");
+ this.enforcer = (PolicyEnforcementPoint)ServiceContainer.lookup("/agent/LocalEnforcementPoint");
+ this.provisioner = (PolicyProvisioner)ServiceContainer.lookup("/agent/LocalPolicyProvisioner");
+ }
+
+ public void testReadRule() throws Exception
+ {
+ this.provisionPortalSecurityRules();
+ this.assertServerState();
+ }
+ //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ private void assertServerState() throws Exception
+ {
+ //Assert Policy State of the Server
+ Policy[] policies = this.provisioner.readAllPolicies();
+
+ assertTrue("Policy Store must not be empty!!", (policies != null && policies.length == 1));
+ log.info("------------------------------------------------------------------------------");
+ log.info(policies[0].generateSystemPolicy());
+ }
+
+ private void enforce(EnforcementContext enforcementContext, boolean mustBePermitted) throws Exception
+ {
+ EnforcementResponse response = this.enforcer.checkAccess(enforcementContext);
+
+ assertNotNull(response);
+ log.info("-----------------------------------");
+ log.info("Decision="+response.getMessage());
+
+ if(mustBePermitted)
+ {
+ assertTrue("Access must be granted!!!", response.isAccessGranted());
+ }
+ else
+ {
+ assertFalse("Access must be denied!!!", response.isAccessGranted());
+ }
+ }
+
+ private EnforcementContext createEnforcementContext(URIResource protectedResource, Operation action) throws Exception
+ {
+ // Create an EnforcementContext
+ EnforcementContext context = new EnforcementContext();
+
+ // Enable Hierarchial Enforcement
+ context.activateHierarchialEnforcement();
+
+ // Create Resource
+ context.setAttribute("uri-resource", protectedResource);
+
+ // Create Subjects
+ Roles roles = new Roles();
+ roles.addName("user");
+ context.setAttribute("roles", roles);
+
+ // Create Action
+ context.setAttribute("action", action);
+
+ return context;
+ }
+
+ private void provisionPortalSecurityRules() throws Exception
+ {
+ //SetUp Resource
+ URIResource resource = new URIResource();
+ resource.setUri(new URI("adminPortal"));
+
+ //Super User/Everyone (gives access without further evaluation)
+ Identity superuser = new Identity();
+ superuser.setName("administrator"); //Provided via system configuration
+ Roles everyone = new Roles();
+ everyone.addName(UserACL.EVERYONE);
+
+ //Guest Group
+ Roles guest = new Roles();
+ guest.addName("guests"); //Provided via system configuration
+ guest.addName(Roles.ANONYMOUS);
+ guest.setMustMatchAll(true);
+
+ //PortalCreators Group
+ Roles portalCreators = new Roles();
+ portalCreators.addName("portalCreator1"); //Provided via system configuration
+ portalCreators.addName("portalCreator2");
+
+ //Other allowed Roles
+ Roles others = new Roles();
+ others.addName("employees");
+ others.addName("partners");
+
+ //Setup the Context for the Composition with these components
+ CompositionContext context = new CompositionContext();
+ context.setPolicyTarget(resource);
+ context.addPolicyRule(Effect.PERMIT, new Write(), superuser);
+ context.addPolicyRule(Effect.PERMIT, new Write(), everyone, "allowExpression");
+ context.addPolicyRule(Effect.PERMIT, new Write(), guest, "allowExpression");
+ context.addPolicyRule(Effect.PERMIT, new Write(), portalCreators, "allowExpression");
+ context.addPolicyRule(Effect.PERMIT, new Write(), others, "allowExpression");
+
+ //Store the policy into the Policy Server
+ PolicyMetaData policyMetaData = this.policyComposer.compose(context);
+ this.provisioner.newPolicy(policyMetaData);
+ }
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/layout/TestPortalLayoutService.java
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/layout/TestPortalLayoutService.java (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/java/org/exoplatform/portal/layout/TestPortalLayoutService.java 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,158 @@
+/*
+ * Copyright (C) 2003-2009 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.layout;
+
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.portal.config.model.Container;
+import org.exoplatform.test.BasicTestCase;
+
+/**
+ * Created by The eXo Platform SAS
+ * Author : Tan Pham Dinh
+ * tan.pham(a)exoplatform.com
+ * Feb 20, 2009
+ */
+public class TestPortalLayoutService extends BasicTestCase {
+
+ protected String userName = "root" ;
+ protected Container container1, container2;
+ protected PortalLayoutService service ;
+
+ public TestPortalLayoutService(String name) {
+ super(name);
+ }
+
+ public void setUp() throws Exception {
+ // PortalContainer portalCont = PortalContainer.getInstance() ;
+ // service = (PortalLayoutService) portalCont.getComponentInstanceOfType(PortalLayoutService.class) ;
+
+// container1 = new Container() ;
+// container1.setId("testId1") ;
+// container1.setFactoryId("testFactoryId1") ;
+// container1.setName("testName1") ;
+// container1.setHeight("300") ;
+// container1.setWidth("400") ;
+// container1.setTitle("testTitle1") ;
+// container1.setDescription("testDescription1") ;
+//
+// container2 = new Container() ;
+// container2.setId("testId2") ;
+// container2.setFactoryId("testFactoryId2") ;
+// container2.setName("testName2") ;
+// container2.setHeight("500") ;
+// container2.setWidth("600") ;
+// container2.setTitle("testTitle2") ;
+// container2.setDescription("testDescription2") ;
+//
+// assertNotNull(service) ;
+// assertNotNull(container1) ;
+// assertNotNull(container2) ;
+ }
+
+ public void testCreate() throws Exception {
+// service.create(container1) ;
+// Container rCont = service.getContainer(container1.getId()) ;
+// assertNotNull(rCont) ;
+// assertEquals(container1.getName(), rCont.getName()) ;
+// rCont = service.getContainer(container1.getId(), userName) ;
+// assertNull(rCont) ;
+// service.remove(container1) ;
+ }
+//
+// public void testCreateWithUserId() throws Exception {
+// service.create(container1, userName) ;
+// Container rCont = service.getContainer(container1.getId(), userName) ;
+// assertNotNull(rCont) ;
+// assertEquals(container1.getName(), rCont.getName()) ;
+// rCont = service.getContainer(container1.getId()) ;
+// assertNull(rCont) ;
+// service.remove(container1, userName) ;
+// }
+//
+// public void testCreateWithTemplate() throws Exception {
+// String id = "testTemplate" ;
+// String template = "template" ;
+// service.create(id, template, userName) ;
+// Container rCont = service.getContainer(id, userName) ;
+// assertNotNull(rCont) ;
+// assertEquals("rootName", rCont.getName()) ;
+// assertNotNull(rCont.getChildren()) ;
+// assertEquals(3, rCont.getChildren().size()) ;
+// service.remove(rCont, userName) ;
+// rCont = service.getContainer(id, userName) ;
+// assertNull(rCont) ;
+// }
+//
+// public void testSave() throws Exception {
+// service.create(container1) ;
+// Container rCont1 = service.getContainer(container1.getId()) ;
+// assertEquals(container1.getName(), rCont1.getName()) ;
+// container1.setName("title") ;
+// Container rCont2 = service.getContainer(container1.getId()) ;
+// assertEquals(rCont1.getName(), rCont2.getName()) ;
+// service.save(container1) ;
+// rCont2 = service.getContainer(container1.getId()) ;
+// assertNotSame(rCont1.getName(), rCont2.getName()) ;
+// service.remove(container1) ;
+// }
+//
+// public void testSaveWithUserId() throws Exception {
+// service.create(container1, userName) ;
+// Container rCont1 = service.getContainer(container1.getId(), userName) ;
+// assertEquals(container1.getName(), rCont1.getName()) ;
+// container1.setName("title") ;
+// Container rCont2 = service.getContainer(container1.getId(), userName) ;
+// assertEquals(rCont1.getName(), rCont2.getName()) ;
+// service.save(container1, userName) ;
+// rCont2 = service.getContainer(container1.getId(), userName) ;
+// assertNotSame(rCont1.getName(), rCont2.getName()) ;
+// service.remove(container1, userName) ;
+// }
+//
+// public void testDelete() throws Exception {
+// service.create(container1) ;
+// service.save(container1) ;
+// service.create(container2) ;
+// service.save(container2) ;
+// Container rCont = service.getContainer(container1.getId()) ;
+// assertNotNull(rCont) ;
+// service.remove(container1) ;
+// assertNotNull(rCont) ;
+// rCont = service.getContainer(container1.getId()) ;
+// assertNull(rCont) ;
+// rCont = service.getContainer(container2.getId()) ;
+// assertNotNull(rCont) ;
+// service.remove(rCont) ;
+// }
+//
+// public void testDeleteWithUserId() throws Exception {
+// service.create(container1, userName) ;
+// service.save(container1, userName) ;
+// service.create(container2, userName) ;
+// service.save(container2, userName) ;
+// Container rCont = service.getContainer(container1.getId(), userName) ;
+// assertNotNull(rCont) ;
+// service.remove(container1, userName) ;
+// assertNotNull(rCont) ;
+// rCont = service.getContainer(container1.getId(), userName) ;
+// assertNull(rCont) ;
+// rCont = service.getContainer(container2.getId(), userName) ;
+// assertNotNull(rCont) ;
+// service.remove(container2, userName) ;
+// }
+
+}
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/organization/management/executive-board/navigation.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/organization/management/executive-board/navigation.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/organization/management/executive-board/navigation.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<node-navigation>
+ <owner-type>group</owner-type>
+ <owner-id>organization/management/executive-board</owner-id>
+ <priority>5</priority>
+
+ <page-nodes>
+ <node>
+ <uri>organization</uri>
+ <name>organization</name>
+ <label>#{organization.title}</label>
+
+ <node>
+ <uri>organization/newStaff</uri>
+ <name>newStaff</name>
+ <label>#{organization.newstaff}</label>
+ <page-reference>group::organization/management/executive-board::newStaff</page-reference>
+ </node>
+
+ <node>
+ <uri>organization/management</uri>
+ <name>management</name>
+ <label>#{organization.management}</label>
+ <page-reference>group::organization/management/executive-board::management</page-reference>
+ </node>
+ </node>
+
+ </page-nodes>
+</node-navigation>
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/organization/management/executive-board/pages.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/organization/management/executive-board/pages.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/organization/management/executive-board/pages.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page-set>
+
+ <page>
+ <page-id>group::organization/management/executive-board::newStaff</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>organization/management/executive-board</owner-id>
+ <name>newStaff</name>
+ <title>New Staff</title>
+ <access-permissions>*:/organization/management/executive-board</access-permissions>
+ <edit-permission>manager:/organization/management/executive-board</edit-permission>
+
+ <application>
+ <instance-id>group#organization/managerment/executive-board:/exoadmin/AccountPortlet/Account</instance-id>
+ <title>New Staff</title>
+ <show-info-bar>true</show-info-bar>
+ <show-application-state>true</show-application-state>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::organization/management/executive-board::management</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>organization/management/executive-board</owner-id>
+ <name>management</name>
+ <title>Organization Management</title>
+ <access-permissions>*:/organization/management/executive-board</access-permissions>
+ <edit-permission>manager:/organization/management/executive-board</edit-permission>
+
+ <application>
+ <instance-id>group#organization/managerment/executive-board:/exoadmin/OrganizationPortlet/Organization</instance-id>
+ <title>Organization Management</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+</page-set>
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/organization/management/executive-board/portlet-preferences.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/organization/management/executive-board/portlet-preferences.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/organization/management/executive-board/portlet-preferences.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set />
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/administrators/navigation.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/administrators/navigation.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/administrators/navigation.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<node-navigation>
+ <owner-type>group</owner-type>
+ <owner-id>platform/administrators</owner-id>
+ <priority>2</priority>
+
+ <page-nodes>
+ <node>
+ <uri>administration</uri>
+ <name>administration</name>
+ <label>#{administration.title}</label>
+
+ <node>
+ <uri>administration/registry</uri>
+ <name>registry</name>
+ <label>#{administration.application-registry}</label>
+ <page-reference>group::platform/administrators::registry</page-reference>
+ </node>
+
+ <node>
+ <uri>administration/newAccount</uri>
+ <name>newAccount</name>
+ <label>#{administration.newAccount}</label>
+ <page-reference>group::platform/administrators::newAccount</page-reference>
+ </node>
+
+ <node>
+ <uri>administration/communityManagement</uri>
+ <name>communityManagement</name>
+ <label>#{administration.community-management}</label>
+ <page-reference>group::platform/administrators::communityManagement</page-reference>
+ </node>
+
+ <node>
+ <uri>administration/i18n</uri>
+ <name>i18n</name>
+ <label>#{administration.i18n}</label>
+ <page-reference>group::platform/administrators::i18n</page-reference>
+ </node>
+
+ <node>
+ <uri>administration/console</uri>
+ <name>console</name>
+ <label>#{administration.console}</label>
+ <page-reference>group::platform/administrators::console</page-reference>
+ </node>
+ </node>
+ </page-nodes>
+</node-navigation>
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/administrators/pages.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/administrators/pages.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/administrators/pages.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page-set>
+
+ <page>
+ <page-id>group::platform/administrators::newAccount</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>platform/administrators</owner-id>
+ <name>newAccount</name>
+ <title>New Account</title>
+ <access-permissions>MembershipType_1:/Group1</access-permissions>
+ <edit-permission>manager:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/administrators:/exoadmin/AccountPortlet/Account</instance-id>
+ <title>New Account</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::platform/administrators::communityManagement</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>platform/administrators</owner-id>
+ <name>communityManagement</name>
+ <title>Community Management</title>
+ <access-permissions>manager:/platform/administrators</access-permissions>
+ <edit-permission>manager:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/administrators:/exoadmin/OrganizationPortlet/Organization</instance-id>
+ <title>Community Management</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::platform/administrators::i18n</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>platform/administrators</owner-id>
+ <name>i18n</name>
+ <title>Internationalization</title>
+ <access-permissions>manager:/platform/administrators</access-permissions>
+ <edit-permission>manager:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/administrators:/exoadmin/I18nPortlet/i18n</instance-id>
+ <title>Internationalization</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::platform/administrators::registry</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>platform/administrators</owner-id>
+ <name>registry</name>
+ <title>Registry</title>
+ <access-permissions>manager:/platform/administrators</access-permissions>
+ <edit-permission>manager:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/administrators:/exoadmin/ApplicationRegistryPortlet/ApplicationRegistry</instance-id>
+ <title>Application Registry</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+</page-set>
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/administrators/portlet-preferences.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/administrators/portlet-preferences.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/administrators/portlet-preferences.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set />
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/guests/navigation.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/guests/navigation.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/guests/navigation.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<node-navigation>
+ <owner-type>group</owner-type>
+ <owner-id>platform/guests</owner-id>
+ <priority>9</priority>
+ <description>description for node navigation </description>
+
+ <page-nodes>
+ <node>
+ <uri>register</uri>
+ <name>register</name>
+ <label>#{platform.guests.register}</label>
+ <page-reference>group::platform/guests::register</page-reference>
+ </node>
+
+ <node>
+ <uri>link</uri>
+ <name>link</name>
+ <label>#{platform.guests.link}</label>
+ <page-reference>group::platform/guests::link</page-reference>
+ </node>
+
+ <node>
+ <uri>sitemap</uri>
+ <name>sitemap</name>
+ <label>#{platform.guests.sitemap}</label>
+ <page-reference>group::platform/guests::sitemap</page-reference>
+ </node>
+
+ </page-nodes>
+
+</node-navigation>
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/guests/pages.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/guests/pages.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/guests/pages.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page-set>
+
+ <page>
+ <page-id>group::platform/guests::register</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>platform/guests</owner-id>
+ <name>register</name>
+ <title>Register</title>
+ <access-permissions>*:/platform/guests</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/guests:/exoadmin/AccountPortlet/Account</instance-id>
+ <title>New Account</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::platform/guests::sitemap</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>platform/guests</owner-id>
+ <name>sitemap</name>
+ <title>Site Map</title>
+ <access-permissions>*:/platform/guests</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/guests:/web/SiteMapPortlet/sitemapportlet</instance-id>
+ <title>SiteMap</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::platform/guests::link</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>platform/guests</owner-id>
+ <name>link</name>
+ <title>Link</title>
+ <access-permissions>*:/platform/guests</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/guests:/web/IFramePortlet/blog</instance-id>
+ <title>Blog</title>
+ <show-info-bar>false</show-info-bar>
+ <show-application-state>true</show-application-state>
+ <show-application-mode>true</show-application-mode>
+ </application>
+ </page>
+
+</page-set>
+
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/guests/portlet-preferences.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/guests/portlet-preferences.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/guests/portlet-preferences.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set>
+
+ <portlet-preferences>
+ <owner-type>group</owner-type>
+ <owner-id>platform/guests</owner-id>
+ <window-id>group#platform/guests:/web/IFramePortlet/blog</window-id>
+ <preference>
+ <name>url</name>
+ <value>http://blog.exoplatform.org</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+</portlet-preferences-set>
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/users/navigation.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/users/navigation.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/users/navigation.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<node-navigation>
+ <owner-type>group</owner-type>
+ <owner-id>platform/users</owner-id>
+ <priority>8</priority>
+ <description>description for node navigation </description>
+
+ <page-nodes>
+ <node>
+ <uri>dashboard</uri>
+ <name>dashboard</name>
+ <label>#{platform.users.dashboard}</label>
+ <page-reference>group::platform/users::dashboard</page-reference>
+ </node>
+
+ <node>
+ <uri>mylink</uri>
+ <name>mylink</name>
+ <label>#{platform.users.mylink}</label>
+
+ <node>
+ <uri>mylink/blog</uri>
+ <name>blog</name>
+ <label>#{platform.users.mylink-blog}</label>
+ <page-reference>group::platform/users::mylink-blog</page-reference>
+ </node>
+
+ <node>
+ <uri>mylink/google</uri>
+ <name>google</name>
+ <label>#{platform.users.mylink-google}</label>
+ <page-reference>group::platform/users::mylink-google</page-reference>
+ </node>
+
+ <node>
+ <uri>mylink/facebooks</uri>
+ <name>facebooks</name>
+ <label>#{platform.users.mylink-facebook}</label>
+ <page-reference>group::platform/users::mylink-facebook</page-reference>
+ </node>
+ </node>
+
+ <node>
+ <uri>sitemap</uri>
+ <name>sitemap</name>
+ <label>#{platform.users.sitemap}</label>
+ <page-reference>group::platform/users::sitemap</page-reference>
+ </node>
+ </page-nodes>
+</node-navigation>
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/users/pages.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/users/pages.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/users/pages.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page-set>
+
+ <page>
+ <page-id>group::platform/users::dashboard</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>platform/users</owner-id>
+ <name>dashboard</name>
+ <title>Dashboard</title>
+ <access-permissions>*:/platform/users</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/users:/dashboard/DashboardPortlet/Dashboard</instance-id>
+ <title>Dashboard</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::platform/users::webexplorer</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>platform/users</owner-id>
+ <name>webexplorer</name>
+ <title>Web Explorer</title>
+ <access-permissions>*:/platform/users</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/users:/web/BrowserPortlet/WebExplorer</instance-id>
+ <title>Web Explorer</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::platform/users::mylink-blog</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>platform/users</owner-id>
+ <name>mylink-blog</name>
+ <title>Blog</title>
+ <access-permissions>*:/platform/users</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/users:/web/IFramePortlet/blog</instance-id>
+ <title>Blog</title>
+ <show-info-bar>true</show-info-bar>
+ <show-application-state>true</show-application-state>
+ <show-application-mode>true</show-application-mode>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::platform/users::mylink-google</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>platform/users</owner-id>
+ <name>mylink-google</name>
+ <title>Google</title>
+ <access-permissions>*:/platform/users</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/users:/web/IFramePortlet/google</instance-id>
+ <title>Google</title>
+ <show-info-bar>false</show-info-bar>
+ <show-application-state>true</show-application-state>
+ <show-application-mode>true</show-application-mode>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::platform/users::mylink-facebook</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>platform/users</owner-id>
+ <name>mylink-facebook</name>
+ <title>FaceBook</title>
+ <access-permissions>*:/platform/users</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/users:/web/IFramePortlet/facebook</instance-id>
+ <title>FaceBook</title>
+ <show-info-bar>false</show-info-bar>
+ <show-application-state>true</show-application-state>
+ <show-application-mode>true</show-application-mode>
+ </application>
+ </page>
+
+ <page>
+ <page-id>group::platform/users::sitemap</page-id>
+ <owner-type>group</owner-type>
+ <owner-id>platform/users</owner-id>
+ <name>sitemap</name>
+ <title>Site Map</title>
+ <access-permissions>*:/platform/users</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/users:/web/SiteMapPortlet/sitemapportlet</instance-id>
+ <title>SiteMap</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+</page-set>
+
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/users/portlet-preferences.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/users/portlet-preferences.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/group/platform/users/portlet-preferences.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set>
+
+ <portlet-preferences>
+ <owner-type>group</owner-type>
+ <owner-id>platform/users</owner-id>
+ <window-id>group#platform/users:/web/IFramePortlet/blog</window-id>
+ <preference>
+ <name>url</name>
+ <value>http://blog.exoplatform.org</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+ <portlet-preferences>
+ <owner-type>group</owner-type>
+ <owner-id>platform/users</owner-id>
+ <window-id>group#platform/users:/web/IFramePortlet/google</window-id>
+ <preference>
+ <name>url</name>
+ <value>http://www.google.com</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+ <portlet-preferences>
+ <owner-type>group</owner-type>
+ <owner-id>platform/users</owner-id>
+ <window-id>group#platform/users:/web/IFramePortlet/facebook</window-id>
+ <preference>
+ <name>url</name>
+ <value>http://www.facebook.com</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+</portlet-preferences-set>
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/classic/navigation.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/classic/navigation.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/classic/navigation.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<node-navigation>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <priority>1</priority>
+
+ <page-nodes>
+ <node>
+ <uri>home</uri>
+ <name>home</name>
+ <label>#{portal.classic.home}</label>
+ <page-reference>portal::classic::homepage</page-reference>
+ </node>
+ <node>
+ <uri>webexplorer</uri>
+ <name>webexplorer</name>
+ <label>#{portal.classic.webexplorer}</label>
+ <page-reference>portal::classic::webexplorer</page-reference>
+ </node>
+ </page-nodes>
+</node-navigation>
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/classic/pages.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/classic/pages.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/classic/pages.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page-set>
+
+ <page>
+ <page-id>portal::classic::homepage</page-id>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <name>homepage</name>
+ <title>Home Page</title>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>portal#classic:/web/HomePagePortlet/homepageportlet</instance-id>
+ <title>Home Page portlet</title>
+ <show-info-bar>false</show-info-bar>
+ <show-application-state>false</show-application-state>
+ <show-application-mode>false</show-application-mode>
+ <properties>
+ <entry key="locationX">23432</entry>
+ <entry key="locationY">343534</entry>
+ </properties>
+ </application>
+ </page>
+
+ <page>
+ <page-id>portal::classic::webexplorer</page-id>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <name>webexplorer</name>
+ <title>Web Explorer</title>
+ <access-permissions>*:/platform/users</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/users:/web/BrowserPortlet/WebExplorer</instance-id>
+ <title>Web Explorer</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+
+</page-set>
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/classic/portal.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/classic/portal.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/classic/portal.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portal-config>
+ <portal-name>classic</portal-name>
+ <locale>en</locale>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <creator>root</creator>
+
+ <portal-layout>
+ <application>
+ <instance-id>portal#classic:/web/BannerPortlet/banner</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#classic:/web/NavigationPortlet/toolbar</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#classic:/web/BreadcumbsPortlet/breadcumbs</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <page-body> </page-body>
+
+ <application>
+ <instance-id>portal#classic:/web/FooterPortlet/footer</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </portal-layout>
+
+</portal-config>
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/classic/portlet-preferences.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/classic/portlet-preferences.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/classic/portlet-preferences.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set>
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <window-id>portal#classic:/web/BannerPortlet/banner</window-id>
+ <preference>
+ <name>template</name>
+ <value>par:/groovy/groovy/webui/component/UIBannerPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <window-id>portal#classic:/web/FooterPortlet/footer</window-id>
+ <preference>
+ <name>template</name>
+ <value>par:/groovy/groovy/webui/component/UIFooterPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <window-id>portal#classic:/web/GroovyPortlet/groovyportlet</window-id>
+ <preference>
+ <name>template</name>
+ <value>par:/groovy/groovy/webui/component/UIGroovyPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <window-id>portal#classic:/web/HomePagePortlet/homepageportlet</window-id>
+ <preference>
+ <name>template</name>
+ <value>system:/templates/groovy/webui/component/UIHomePagePortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+</portlet-preferences-set>
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/template/classic/navigation.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/template/classic/navigation.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/template/classic/navigation.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<node-navigation>
+ <owner-type>portal</owner-type>
+ <owner-id>@owner@</owner-id>
+ <priority>1</priority>
+
+ <page-nodes>
+ <node>
+ <uri>home</uri>
+ <name>home</name>
+ <label>Home</label>
+ <page-reference>portal::@owner@::sitemap</page-reference>
+ </node>
+ </page-nodes>
+</node-navigation>
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/template/classic/pages.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/template/classic/pages.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/template/classic/pages.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page-set>
+
+ <page>
+ <page-id>portal::@owner@::sitemap</page-id>
+ <owner-type>portal</owner-type>
+ <owner-id>@owner@</owner-id>
+ <name>sitemap</name>
+ <title>Site Map</title>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>portal#@owner@:/web/SiteMapPortlet/sitemapportlet</instance-id>
+ <title>Site Map portlet</title>
+ <show-info-bar>true</show-info-bar>
+ <show-application-state>true</show-application-state>
+ <show-application-mode>true</show-application-mode>
+ </application>
+ </page>
+
+</page-set>
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/template/classic/portal.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/template/classic/portal.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/template/classic/portal.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portal-config>
+ <portal-name>@owner@</portal-name>
+ <locale>en</locale>
+ <!--<factory-id>office</factory-id>-->
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <creator>root</creator>
+
+ <portal-layout>
+ <application>
+ <instance-id>portal#@owner@:/web/BannerPortlet/banner</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#@owner@:/web/NavigationPortlet/toolbar</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+ <instance-id>portal#@owner@:/web/BreadcumbsPortlet/breadcumbs</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+
+ <page-body> </page-body>
+
+ <application>
+ <instance-id>portal#@owner@:/web/FooterPortlet/footer</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </portal-layout>
+
+</portal-config>
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/template/classic/portlet-preferences.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/template/classic/portlet-preferences.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/portal/template/classic/portlet-preferences.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set>
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>@owner@</owner-id>
+ <window-id>portal#portalclassic:/web/BannerPortlet/banner</window-id>
+ <preference>
+ <name>template</name>
+ <value>par:/groovy/groovy/webui/component/UIBannerPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>@owner@</owner-id>
+ <window-id>portal#portalclassic:/web/FooterPortlet/footer</window-id>
+ <preference>
+ <name>template</name>
+ <value>par:/groovy/groovy/webui/component/UIFooterPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>@owner@</owner-id>
+ <window-id>portal#portalclassic:/web/GroovyPortlet/groovyportlet</window-id>
+ <preference>
+ <name>template</name>
+ <value>par:/groovy/groovy/webui/component/UIGroovyPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+</portlet-preferences-set>
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/container.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/container.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/container.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<container>
+ <name>rootName</name>
+ <container id="childNode1">
+ <name>childNode</name>
+ </container>
+ <container id="childNode1">
+ <name>childNode</name>
+ </container>
+ <container id="childNode1">
+ <name>childNode</name>
+ </container>
+</container>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/containers/four-columns/container.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/containers/four-columns/container.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/containers/four-columns/container.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<container template="classpath:groovy/dashboard/webui/component/UIColumnContainer.gtmpl">
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/Calendar</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/Calculator</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/Todo</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/rssAggregator</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+</container>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/containers/one-column/container.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/containers/one-column/container.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/containers/one-column/container.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<container template="classpath:groovy/dashboard/webui/component/UIColumnContainer.gtmpl">
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/Calendar</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+</container>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/containers/three-columns/container.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/containers/three-columns/container.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/containers/three-columns/container.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<container template="classpath:groovy/dashboard/webui/component/UIColumnContainer.gtmpl">
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/Calendar</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/Calculator</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/rssAggregator</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+</container>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/containers/two-columns/container.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/containers/two-columns/container.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/containers/two-columns/container.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<container template="classpath:groovy/dashboard/webui/component/UIColumnContainer.gtmpl">
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/Calendar</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+ <container template="classpath:groovy/dashboard/webui/component/UIContainer.gtmpl">
+ <application>
+ <instance-id>/eXoGadgets/Calculator</instance-id>
+ <application-type>eXoGadget</application-type>
+ </application>
+ </container>
+</container>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/dashboard/page.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/dashboard/page.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/dashboard/page.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <application>
+ <instance-id>/dashboard/DashboardPortlet</instance-id>
+ <title>Dashboard</title>
+ <show-info-bar>false</show-info-bar>
+ <show-application-state>true</show-application-state>
+ </application>
+</page>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/dashboard/portlet-preferences.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/dashboard/portlet-preferences.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/dashboard/portlet-preferences.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set/>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/empty/page.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/empty/page.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/empty/page.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+</page>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/empty/portlet-preferences.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/empty/portlet-preferences.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/empty/portlet-preferences.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set/>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/one-row-two-columns/page.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/one-row-two-columns/page.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/one-row-two-columns/page.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+ <container template='system:/groovy/portal/webui/container/UITableColumnContainer.gtmpl'>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+ </container>
+</page>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/one-row-two-columns/portlet-preferences.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/one-row-two-columns/portlet-preferences.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/one-row-two-columns/portlet-preferences.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set/>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-columns/page.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-columns/page.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-columns/page.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <container template="system:/groovy/portal/webui/container/UITableColumnContainer.gtmpl">
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ </container>
+</page>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-columns/portlet-preferences.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-columns/portlet-preferences.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-columns/portlet-preferences.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set/>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-rows/page.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-rows/page.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-rows/page.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+</page>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-rows/portlet-preferences.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-rows/portlet-preferences.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-rows/portlet-preferences.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set/>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-rows-two-columns/page.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-rows-two-columns/page.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-rows-two-columns/page.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <container template='system:/groovy/portal/webui/container/UITableColumnContainer.gtmpl'>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+ </container>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+</page>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-rows-two-columns/portlet-preferences.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-rows-two-columns/portlet-preferences.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-rows-two-columns/portlet-preferences.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set/>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-tabs/page.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-tabs/page.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-tabs/page.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <title></title>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
+ <container template="system:/groovy/portal/webui/container/UITabContainer.gtmpl">
+ <factory-id>TabContainer</factory-id>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ </container>
+ </container>
+</page>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-tabs/portlet-preferences.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-tabs/portlet-preferences.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/three-tabs/portlet-preferences.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set/>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-columns/page.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-columns/page.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-columns/page.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <container template="system:/groovy/portal/webui/container/UITableColumnContainer.gtmpl">
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ </container>
+</page>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-columns/portlet-preferences.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-columns/portlet-preferences.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-columns/portlet-preferences.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set/>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-columns-one-row/page.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-columns-one-row/page.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-columns-one-row/page.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <container template='system:/groovy/portal/webui/container/UITableColumnContainer.gtmpl'>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+ </container>
+ <container template='system:/groovy/portal/webui/container/UIContainer.gtmpl'></container>
+</page>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-columns-one-row/portlet-preferences.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-columns-one-row/portlet-preferences.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-columns-one-row/portlet-preferences.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set/>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-rows/page.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-rows/page.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-rows/page.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl"></container>
+</page>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-rows/portlet-preferences.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-rows/portlet-preferences.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-rows/portlet-preferences.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set/>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-tabs/page.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-tabs/page.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-tabs/page.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <name></name>
+ <title></title>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
+ <container template="system:/groovy/portal/webui/container/UITabContainer.gtmpl">
+ <factory-id>TabContainer</factory-id>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
+ <application>
+ <instance-id>/exoadmin/AccountPortlet</instance-id>
+ <title>New Account</title>
+ <show-info-bar>true</show-info-bar>
+ <show-application-state>true</show-application-state>
+ </application>
+ </container>
+ <container template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
+ <application>
+ <instance-id>/web/SiteMapPortlet</instance-id>
+ <title>Sitemap Portlet</title>
+ <show-info-bar>true</show-info-bar>
+ <show-application-state>true</show-application-state>
+ </application>
+ </container>
+ </container>
+ </container>
+</page>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-tabs/portlet-preferences.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-tabs/portlet-preferences.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/template/pages/two-tabs/portlet-preferences.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set>
+ <portlet-preferences>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <window-id>/exoadmin/AccountPortlet</window-id>
+ <preference>
+ <name>NewAccountPreference</name>
+ <value>Preference value for Account portlet</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+ <portlet-preferences>
+ <owner-type></owner-type>
+ <owner-id></owner-id>
+ <window-id>/web/SiteMapPortlet</window-id>
+ <preference>
+ <name>SitemapPreference</name>
+ <value>Preference value for Sitemap portlet</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+</portlet-preferences-set>
\ No newline at end of file
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/demo/navigation.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/demo/navigation.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/demo/navigation.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<node-navigation>
+ <owner-type>user</owner-type>
+ <owner-id>demo</owner-id>
+ <priority>3</priority>
+ <description>description for node navigation </description>
+
+ <page-nodes />
+</node-navigation>
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/demo/pages.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/demo/pages.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/demo/pages.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page-set />
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/john/navigation.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/john/navigation.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/john/navigation.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<node-navigation>
+ <owner-type>user</owner-type>
+ <owner-id>john</owner-id>
+ <priority>3</priority>
+ <description>description for node navigation </description>
+
+ <page-nodes />
+</node-navigation>
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/john/pages.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/john/pages.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/john/pages.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page-set />
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/marry/navigation.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/marry/navigation.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/marry/navigation.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<node-navigation>
+ <owner-type>user</owner-type>
+ <owner-id>marry</owner-id>
+ <priority>3</priority>
+ <description>description for node navigation </description>
+
+ <page-nodes />
+</node-navigation>
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/marry/pages.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/marry/pages.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/marry/pages.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page-set />
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/root/navigation.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/root/navigation.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/root/navigation.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<node-navigation>
+ <owner-type>user</owner-type>
+ <owner-id>root</owner-id>
+ <priority>3</priority>
+ <description>description for node navigation </description>
+
+ <page-nodes />
+</node-navigation>
Added: jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/root/pages.xml
===================================================================
--- jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/root/pages.xml (rev 0)
+++ jbossexo/branches/security-integration-sandbox/portal/trunk/component/portal/src/test/resources/portal/user/root/pages.xml 2009-07-28 14:57:57 UTC (rev 13608)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<page-set />
16 years, 9 months
JBoss Portal SVN: r13606 - in modules/wsrp/trunk: package and 5 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-07-28 07:43:32 -0400 (Tue, 28 Jul 2009)
New Revision: 13606
Added:
modules/wsrp/trunk/package/
modules/wsrp/trunk/package/pom.xml
modules/wsrp/trunk/package/src/
modules/wsrp/trunk/package/src/assemble/
modules/wsrp/trunk/package/src/assemble/wsrp-producer-jboss42.xml
modules/wsrp/trunk/producer/src/main/webapp/WEB-INF/context.xml
Modified:
modules/wsrp/trunk/pom.xml
modules/wsrp/trunk/producer/src/main/webapp/WEB-INF/web.xml
modules/wsrp/trunk/service/pom.xml
modules/wsrp/trunk/service/src/main/resources/META-INF/jboss-service.xml
Log:
- JBPORTAL-2186: Backup commit mostly.
+ Added package module to try to output something that would satisfy JBoss' classloader. >_<
+ Added ContainerServlet to Producer + priviledged context for that servlet to work properly.
+ Inject ServletContainerFactory instead of injecting ServletContainer and make sure that ContextDispatchInterceptor uses it.
Added: modules/wsrp/trunk/package/pom.xml
===================================================================
--- modules/wsrp/trunk/package/pom.xml (rev 0)
+++ modules/wsrp/trunk/package/pom.xml 2009-07-28 11:43:32 UTC (rev 13606)
@@ -0,0 +1,74 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.jboss.portal.wsrp</groupId>
+ <artifactId>module-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../build/pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>package</artifactId>
+ <name>JBoss WSRP Producer packaging</name>
+
+ <dependencies>
+
+ <!--<dependency>
+ <groupId>org.jboss.portal.wsrp</groupId>
+ <artifactId>wsrp-service</artifactId>
+ <type>jboss-sar</type>
+ <version>${project.version}</version>
+ </dependency>-->
+
+ <dependency>
+ <groupId>org.jboss.portal.web</groupId>
+ <artifactId>web-web</artifactId>
+ <version>${version.web}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.portal.portlet</groupId>
+ <artifactId>portlet-portlet</artifactId>
+ <version>${version.portlet}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.ccpp</groupId>
+ <artifactId>ccpp</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.portlet</groupId>
+ <artifactId>portlet-api</artifactId>
+ <version>2.0</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <finalName>wsrp-producer</finalName>
+ <descriptors>
+ <descriptor>src/assemble/wsrp-producer-jboss42.xml</descriptor>
+ <!--<descriptor>src/assemble/wsrp-producer-tomcat60.xml</descriptor>
+ <descriptor>src/assemble/wsrp-producer-jboss50.xml</descriptor>-->
+ </descriptors>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attached</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+
+ </build>
+
+</project>
Added: modules/wsrp/trunk/package/src/assemble/wsrp-producer-jboss42.xml
===================================================================
--- modules/wsrp/trunk/package/src/assemble/wsrp-producer-jboss42.xml (rev 0)
+++ modules/wsrp/trunk/package/src/assemble/wsrp-producer-jboss42.xml 2009-07-28 11:43:32 UTC (rev 13606)
@@ -0,0 +1,56 @@
+<assembly>
+ <id>jboss42</id>
+ <formats>
+ <format>dir</format>
+ </formats>
+ <baseDirectory>wsrp-producer</baseDirectory>
+
+ <!--<componentDescriptors>
+ <componentDescriptor>src/assemble/simple-portal-war.xml</componentDescriptor>
+ </componentDescriptors>-->
+
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory>lib</outputDirectory>
+ <includes>
+
+ <include>org.jboss.portal.common:common-common</include>
+ <include>org.jboss.portal.common:common-portal</include>
+ <include>org.jboss.portal.web:web-web</include>
+ <include>org.jboss.portal.portlet:portlet-portlet</include>
+
+ <include>javax.ccpp:ccpp</include>
+ <include>javax.portlet:portlet-api</include>
+
+ </includes>
+ </dependencySet>
+
+ <!-- <dependencySet>
+ <outputDirectory></outputDirectory>
+ <includes>
+ <include>org.jboss.portal.wsrp:wsrp-service</include>
+ </includes>
+ </dependencySet>-->
+
+ </dependencySets>
+
+ <files>
+ <file>
+ <source>../service/target/wsrp-producer.sar</source>
+ <outputDirectory></outputDirectory>
+ </file>
+ </files>
+
+ <!--<moduleSets>
+ <moduleSet>
+ <includes>
+ <include>org.jboss.portal.wsrp:*</include>
+ </includes>
+ <binaries>
+ <outputDirectory></outputDirectory>
+ <unpack>false</unpack>
+ </binaries>
+ </moduleSet>
+ </moduleSets>-->
+
+</assembly>
Modified: modules/wsrp/trunk/pom.xml
===================================================================
--- modules/wsrp/trunk/pom.xml 2009-07-27 15:50:05 UTC (rev 13605)
+++ modules/wsrp/trunk/pom.xml 2009-07-28 11:43:32 UTC (rev 13606)
@@ -52,50 +52,11 @@
<module>api</module>
<module>wsrp1-rpc</module>
<module>core</module>
- <module>producer</module>
<module>test-support</module>
- <module>admin-gui</module>
+ <module>producer</module>
+ <!--<module>consumer</module>
+ <module>admin-gui</module>-->
<module>service</module>
+ <module>package</module>
</modules>
-
- <!--<build>
- <plugins>
- <plugin>
- <artifactId>maven-dependency-plugin</artifactId>
- <version>2.0</version>
- <executions>
- <execution>
- <id>copy-portal-jopr-plugin-jar</id>
- <phase>process-resources</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.jboss.portal.jopr</groupId>
- <artifactId>portal-management</artifactId>
- <version>${project.version}</version>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.outputDirectory}/lib</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>jboss-packaging-maven-plugin</artifactId>
- <version>2.0-beta-1</version>
-
- <!– Enable packaging types and lifecycle bindings. –>
- <extensions>true</extensions>
- <configuration>
- <excludeAll>true</excludeAll>
- <primaryArtifact>false</primaryArtifact>
- </configuration>
- </plugin>
- </plugins>
- </build>-->
</project>
\ No newline at end of file
Added: modules/wsrp/trunk/producer/src/main/webapp/WEB-INF/context.xml
===================================================================
--- modules/wsrp/trunk/producer/src/main/webapp/WEB-INF/context.xml (rev 0)
+++ modules/wsrp/trunk/producer/src/main/webapp/WEB-INF/context.xml 2009-07-28 11:43:32 UTC (rev 13606)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context privileged="true"/>
\ No newline at end of file
Modified: modules/wsrp/trunk/producer/src/main/webapp/WEB-INF/web.xml
===================================================================
--- modules/wsrp/trunk/producer/src/main/webapp/WEB-INF/web.xml 2009-07-27 15:50:05 UTC (rev 13605)
+++ modules/wsrp/trunk/producer/src/main/webapp/WEB-INF/web.xml 2009-07-28 11:43:32 UTC (rev 13606)
@@ -47,6 +47,14 @@
<url-pattern>/*</url-pattern>
</filter-mapping>
+ <!-- To listen to portlet deployments -->
+ <servlet>
+ <servlet-name>ContainerServlet</servlet-name>
+ <servlet-class>org.jboss.portal.web.impl.tomcat.TC6ContainerServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+
<!-- WSRP Endpoints -->
<servlet>
<servlet-name>ServiceDescriptionService</servlet-name>
Modified: modules/wsrp/trunk/service/pom.xml
===================================================================
--- modules/wsrp/trunk/service/pom.xml 2009-07-27 15:50:05 UTC (rev 13605)
+++ modules/wsrp/trunk/service/pom.xml 2009-07-28 11:43:32 UTC (rev 13606)
@@ -148,6 +148,8 @@
<artifactId>ccpp</artifactId>
<version>1.0</version>
</artifactItem>
+
+ <!-- hibernate -->
<artifactItem>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
Modified: modules/wsrp/trunk/service/src/main/resources/META-INF/jboss-service.xml
===================================================================
--- modules/wsrp/trunk/service/src/main/resources/META-INF/jboss-service.xml 2009-07-27 15:50:05 UTC (rev 13605)
+++ modules/wsrp/trunk/service/src/main/resources/META-INF/jboss-service.xml 2009-07-28 11:43:32 UTC (rev 13606)
@@ -32,13 +32,6 @@
<!-- **** Portlet application registry beans -->
- <!-- Default servlet container (should ideally be obtained from a ServletContainerFactory but directly instantiated here) -->
- <mbean code="org.jboss.portal.web.impl.DefaultServletContainer"
- name="portletcontainer:service=ServletContainer" xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
-
<mbean code="org.jboss.portal.web.impl.DefaultServletContainerFactory"
name="portletcontainer:service=ServletContainerFactory" xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
@@ -50,8 +43,8 @@
name="portletcontainer:service=PortletApplicationRegistry" xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="ServletContainer" proxy-type="attribute">
- portletcontainer:service=ServletContainer
+ <depends optional-attribute-name="ServletContainerFactory" proxy-type="attribute">
+ portletcontainer:service=ServletContainerFactory
</depends>
<depends optional-attribute-name="ContainerPortletInvoker" proxy-type="attribute">
portletcontainer:service=PortletInvoker,type=Container
@@ -67,8 +60,8 @@
<xmbean/>
<!--<depends optional-attribute-name="PortletApplicationRegistry" proxy-type="attribute">
portletcontainer:service=PortletApplicationRegistry
- </depends>
- <depends optional-attribute-name="Next" proxy-type="attribute">
+ </depends>-->
+ <!--<depends optional-attribute-name="Next" proxy-type="attribute">
portletcontainer:service=Interceptor,type=Producer,name=SecureTransport
</depends>-->
</mbean>
@@ -84,10 +77,10 @@
name="portletcontainer:service=Interceptor,type=Producer,name=ContextDispatcher" xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <!--<depends optional-attribute-name="ServletContainerFactory" proxy-type="attribute">
+ <depends optional-attribute-name="ServletContainerFactory" proxy-type="attribute">
portletcontainer:service=ServletContainerFactory
</depends>
- <depends optional-attribute-name="Next" proxy-type="attribute">
+ <!--<depends optional-attribute-name="Next" proxy-type="attribute">
portletcontainer:service=Interceptor,type=Producer,name=ProducerCache
</depends>-->
</mbean>
16 years, 9 months
JBoss Portal SVN: r13605 - branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium.
by portal-commits@lists.jboss.org
Author: vrockai
Date: 2009-07-27 11:50:05 -0400 (Mon, 27 Jul 2009)
New Revision: 13605
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/assert.properties
Log:
[selenium] - google portlet fix
Modified: branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/assert.properties
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/assert.properties 2009-07-26 17:23:41 UTC (rev 13604)
+++ branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/assert.properties 2009-07-27 15:50:05 UTC (rev 13605)
@@ -21,8 +21,8 @@
portal.e2e.port1=Cart Portlet
portal.e2e.port1.str=Cart Portlet
-portal.e2e.port2=Calendar and Calculators
-portal.e2e.port2.str=Calendar and Calculators
+portal.e2e.port2=World Clocks & ISD Codes
+portal.e2e.port2.str=World Clocks & ISD Codes
portal.e2e.port3=Web Assurance
portal.e2e.port3.str=web-assurance.net
portal.e2e.port4=dir1/foo.txt
16 years, 9 months
JBoss Portal SVN: r13604 - in modules/authorization/trunk: agent/src/main/java/org/jboss/security/authz/agent/services and 7 other directories.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2009-07-26 13:23:41 -0400 (Sun, 26 Jul 2009)
New Revision: 13604
Added:
modules/authorization/trunk/agent/src/main/java/org/jboss/security/authz/agent/services/CompositionUtil.java
Modified:
modules/authorization/trunk/agent/src/main/java/org/jboss/security/authz/agent/services/RuleComposition.java
modules/authorization/trunk/agent/src/main/java/org/jboss/security/authz/agent/services/TargetComposition.java
modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/features/TestHierarchialPropagation.java
modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/services/TestPolicyComposition.java
modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/test/MockPolicy.java
modules/authorization/trunk/common-api/src/main/java/org/jboss/security/authz/component/ComponentCategory.java
modules/authorization/trunk/common-api/src/main/java/org/jboss/security/authz/xacml/AttributeDesignatorUtil.java
modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/components/MockPolicy.java
modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/plugin/XACMLPolicy.java
modules/authorization/trunk/pom.xml
Log:
core engine changes inspired by the exo integration task. lots more to come
Added: modules/authorization/trunk/agent/src/main/java/org/jboss/security/authz/agent/services/CompositionUtil.java
===================================================================
--- modules/authorization/trunk/agent/src/main/java/org/jboss/security/authz/agent/services/CompositionUtil.java (rev 0)
+++ modules/authorization/trunk/agent/src/main/java/org/jboss/security/authz/agent/services/CompositionUtil.java 2009-07-26 17:23:41 UTC (rev 13604)
@@ -0,0 +1,182 @@
+/**
+ *
+ */
+package org.jboss.security.authz.agent.services;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Array;
+import java.util.Collection;
+import java.util.Set;
+import java.util.List;
+import java.util.Map;
+import java.util.ArrayList;
+
+import org.jboss.security.authz.component.Component;
+import org.jboss.security.authz.component.ComponentCategory;
+import org.jboss.security.authz.model.Attribute;
+import org.jboss.security.authz.model.AttributeExpression;
+import org.jboss.security.xacml.interfaces.XACMLConstants;
+import org.jboss.security.xacml.interfaces.XMLSchemaConstants;
+
+/**
+ * @author soshah
+ *
+ */
+class CompositionUtil
+{
+ static ComponentCategory findComponentCategory(Class targetClass)
+ {
+ Annotation component = targetClass.getAnnotation(Component.class);
+ if(component != null)
+ {
+ return ((Component)component).category();
+ }
+
+ return null;
+ }
+
+ static AttributeExpression generateConditionExpression(String conditionContext, String attributeCategory)
+ {
+ AttributeExpression expression = new AttributeExpression();
+ setConditionAttribute(expression, attributeCategory, conditionContext.toString());
+
+ return expression;
+ }
+
+ static List<AttributeExpression> generateAttributeExpression(Object[] securityContextState, String attributeCategory)
+ {
+ List<AttributeExpression> expressions = new ArrayList<AttributeExpression>();
+
+ for(Object input: securityContextState)
+ {
+ if(Collection.class.isAssignableFrom(input.getClass()) || input.getClass().isArray())
+ {
+ Set<String> uris = null;
+ if(input.getClass().isArray())
+ {
+ List<Object> local = new ArrayList<Object>();
+ int arrayLength = Array.getLength(input);
+ for(int i=0; i<arrayLength; i++)
+ {
+ local.add(Array.get(input, i));
+ }
+ uris = SecurityContextDataProcessor.processEnforcementState(local);
+ }
+ else
+ {
+ uris = SecurityContextDataProcessor.processEnforcementState((Collection)input);
+ }
+
+ for(String uri: uris)
+ {
+ AttributeExpression expression = new AttributeExpression();
+ setAttribute(expression, attributeCategory, uri);
+ expressions.add(expression);
+ }
+ }
+ else if(Map.class.isAssignableFrom(input.getClass()))
+ {
+ Map<String, String> mappedUris = SecurityContextDataProcessor.processEnforcementState((Map)input);
+ Set<String> customCategories = mappedUris.keySet();
+ for(String customCategory: customCategories)
+ {
+ AttributeExpression expression = new AttributeExpression();
+ setAttribute(expression, customCategory, mappedUris.get(customCategory));
+ expressions.add(expression);
+ }
+ }
+ else
+ {
+ AttributeExpression expression = new AttributeExpression();
+ setAttribute(expression, attributeCategory, input.toString());
+ expressions.add(expression);
+ }
+ }
+
+ return expressions;
+ }
+
+ static void setAttribute(AttributeExpression urlExpression, String attributeCategory, String uriStr)
+ {
+ Attribute attribute = null;
+
+ if (uriStr.charAt(0) == '/' && uriStr.endsWith("/*"))
+ {
+ // If URL starts with '/' and ends with "/*", use a regular
+ // expression to match it (In consistency with the servlet spec)
+ urlExpression.setFunctionId(XACMLConstants.FUNCTION_REGEXP_STRING_MATCH);
+
+ String uriexp = uriStr.substring(1, uriStr.length() - 2);
+ StringBuilder buffer = new StringBuilder();
+ buffer.append("^/" + uriexp + "$|");
+ buffer.append("^" + uriexp + "$|");
+ buffer.append("^/" + uriexp + "/.*|");
+ buffer.append("^" + uriexp + "/.*");
+
+ attribute = new Attribute(
+ attributeCategory,
+ XMLSchemaConstants.DATATYPE_STRING, buffer.toString());
+ }
+ else
+ {
+ // use an exact match
+ urlExpression.setFunctionId(XACMLConstants.FUNCTION_STRING_EQUAL);
+
+ attribute = new Attribute(
+ attributeCategory,
+ XMLSchemaConstants.DATATYPE_STRING, uriStr);
+ }
+
+ if(attributeCategory.endsWith("resource-id") ||
+ attributeCategory.endsWith("subject-id") ||
+ attributeCategory.endsWith("action-id")
+ )
+ {
+ urlExpression.setDesignatorMustBePresent(true);
+ }
+
+ urlExpression.setAttribute(attribute);
+ }
+
+ static void setConditionAttribute(AttributeExpression urlExpression, String attributeCategory, String uriStr)
+ {
+ Attribute attribute = null;
+
+ if (uriStr.charAt(0) == '/' && uriStr.endsWith("/*"))
+ {
+ // If URL starts with '/' and ends with "/*", use a regular
+ // expression to match it (In consistency with the servlet spec)
+ urlExpression.setFunctionId(XACMLConstants.FUNCTION_REGEXP_STRING_MATCH);
+
+ String uriexp = uriStr.substring(1, uriStr.length() - 2);
+ StringBuilder buffer = new StringBuilder();
+ buffer.append("^/" + uriexp + "$|");
+ buffer.append("^" + uriexp + "$|");
+ buffer.append("^/" + uriexp + "/.*|");
+ buffer.append("^" + uriexp + "/.*");
+
+ attribute = new Attribute(
+ attributeCategory,
+ XMLSchemaConstants.DATATYPE_STRING, buffer.toString());
+ }
+ else
+ {
+ // use an exact match
+ urlExpression.setFunctionId(XACMLConstants.FUNCTION_STRING_IS_IN);
+
+ attribute = new Attribute(
+ attributeCategory,
+ XMLSchemaConstants.DATATYPE_STRING, uriStr);
+ }
+
+ if(attributeCategory.endsWith("resource-id") ||
+ attributeCategory.endsWith("subject-id") ||
+ attributeCategory.endsWith("action-id")
+ )
+ {
+ urlExpression.setDesignatorMustBePresent(true);
+ }
+
+ urlExpression.setAttribute(attribute);
+ }
+}
Modified: modules/authorization/trunk/agent/src/main/java/org/jboss/security/authz/agent/services/RuleComposition.java
===================================================================
--- modules/authorization/trunk/agent/src/main/java/org/jboss/security/authz/agent/services/RuleComposition.java 2009-07-24 18:08:22 UTC (rev 13603)
+++ modules/authorization/trunk/agent/src/main/java/org/jboss/security/authz/agent/services/RuleComposition.java 2009-07-26 17:23:41 UTC (rev 13604)
@@ -23,6 +23,7 @@
import java.lang.reflect.Method;
import java.util.Set;
+import java.util.List;
import java.util.HashSet;
import org.apache.log4j.Logger;
@@ -34,6 +35,9 @@
import org.jboss.security.authz.model.DroolsRuleExpression;
import org.jboss.security.authz.tools.GeneralTool;
+import org.jboss.security.authz.component.ComponentCategory;
+import org.jboss.security.authz.model.AttributeExpression;
+
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
*/
@@ -115,7 +119,7 @@
{
throw new IllegalStateException("Logic Component is missing!!");
}
- }
+ }
try
{
@@ -146,6 +150,25 @@
{
rule.setExpression(this.generateExpression());
}
+ else if(this.logicComponent != null)
+ {
+ //Generate a native XACML Conditional Expression
+ ComponentCategory category = CompositionUtil.findComponentCategory(this.logicComponent.getClass());
+ String attributeCategory = category.getAttributeCategory();
+
+ //Read the SecurityContext State of the Component being provisioned
+ Object[] securityContextData = AnnotationProcessor.extractSecurityContextData(this.logicComponent);
+ if(securityContextData == null || securityContextData.length != 1)
+ {
+ throw new IllegalStateException("State of the Logic Component "+this.logicComponent+" is invalid!!");
+ }
+
+ //Get the Attribute expression based on the Security Context State
+ String conditionContext = securityContextData[0].toString();
+ AttributeExpression conditionExpression = CompositionUtil.generateConditionExpression(conditionContext, attributeCategory);
+
+ rule.setExpression(conditionExpression);
+ }
rules.add(rule);
Modified: modules/authorization/trunk/agent/src/main/java/org/jboss/security/authz/agent/services/TargetComposition.java
===================================================================
--- modules/authorization/trunk/agent/src/main/java/org/jboss/security/authz/agent/services/TargetComposition.java 2009-07-24 18:08:22 UTC (rev 13603)
+++ modules/authorization/trunk/agent/src/main/java/org/jboss/security/authz/agent/services/TargetComposition.java 2009-07-26 17:23:41 UTC (rev 13604)
@@ -22,24 +22,16 @@
package org.jboss.security.authz.agent.services;
import java.lang.annotation.Annotation;
-import java.lang.reflect.Array;
-import java.util.ArrayList;
-import java.util.Collection;
import java.util.List;
-import java.util.Map;
import java.util.Set;
import java.util.HashSet;
import org.apache.log4j.Logger;
-import org.jboss.security.authz.component.Component;
import org.jboss.security.authz.component.ComponentCategory;
import org.jboss.security.authz.component.ImpliedActions;
import org.jboss.security.authz.model.Target;
-import org.jboss.security.authz.model.Attribute;
import org.jboss.security.authz.model.AttributeExpression;
-import org.jboss.security.xacml.interfaces.XACMLConstants;
-import org.jboss.security.xacml.interfaces.XMLSchemaConstants;
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
@@ -129,14 +121,14 @@
Target target = new Target();
//use the proper category for the data
- ComponentCategory category = this.findComponentCategory(this.targetComponent.getClass());
+ ComponentCategory category = CompositionUtil.findComponentCategory(this.targetComponent.getClass());
String attributeCategory = category.getAttributeCategory();
//Read the SecurityContext State of the Component being provisioned
Object[] securityContextData = AnnotationProcessor.extractSecurityContextData(this.targetComponent);
//Get the Attribute expression based on the Security Context State
- List<AttributeExpression> urlExpressions = this.generateAttributeExpression(securityContextData, attributeCategory);
+ List<AttributeExpression> urlExpressions = CompositionUtil.generateAttributeExpression(securityContextData, attributeCategory);
//Depending up the data category add the appropriate match expression
for(AttributeExpression urlExpression: urlExpressions)
@@ -146,18 +138,7 @@
return target;
}
-
- private ComponentCategory findComponentCategory(Class targetClass)
- {
- Annotation component = targetClass.getAnnotation(Component.class);
- if(component != null)
- {
- return ((Component)component).category();
- }
- return null;
- }
-
private String[] findImpliedActions(Class targetClass)
{
Annotation impliedActions = targetClass.getAnnotation(ImpliedActions.class);
@@ -167,100 +148,5 @@
}
return null;
- }
-
- private List<AttributeExpression> generateAttributeExpression(Object[] securityContextState, String attributeCategory)
- {
- List<AttributeExpression> expressions = new ArrayList<AttributeExpression>();
-
- for(Object input: securityContextState)
- {
- if(Collection.class.isAssignableFrom(input.getClass()) || input.getClass().isArray())
- {
- Set<String> uris = null;
- if(input.getClass().isArray())
- {
- List<Object> local = new ArrayList<Object>();
- int arrayLength = Array.getLength(input);
- for(int i=0; i<arrayLength; i++)
- {
- local.add(Array.get(input, i));
- }
- uris = SecurityContextDataProcessor.processEnforcementState(local);
- }
- else
- {
- uris = SecurityContextDataProcessor.processEnforcementState((Collection)input);
- }
-
- for(String uri: uris)
- {
- AttributeExpression expression = new AttributeExpression();
- this.setAttribute(expression, attributeCategory, uri);
- expressions.add(expression);
- }
- }
- else if(Map.class.isAssignableFrom(input.getClass()))
- {
- Map<String, String> mappedUris = SecurityContextDataProcessor.processEnforcementState((Map)input);
- Set<String> customCategories = mappedUris.keySet();
- for(String customCategory: customCategories)
- {
- AttributeExpression expression = new AttributeExpression();
- this.setAttribute(expression, customCategory, mappedUris.get(customCategory));
- expressions.add(expression);
- }
- }
- else
- {
- AttributeExpression expression = new AttributeExpression();
- this.setAttribute(expression, attributeCategory, input.toString());
- expressions.add(expression);
- }
- }
-
- return expressions;
- }
-
- private void setAttribute(AttributeExpression urlExpression, String attributeCategory, String uriStr)
- {
- Attribute attribute = null;
-
- if (uriStr.charAt(0) == '/' && uriStr.endsWith("/*"))
- {
- // If URL starts with '/' and ends with "/*", use a regular
- // expression to match it (In consistency with the servlet spec)
- urlExpression.setFunctionId(XACMLConstants.FUNCTION_REGEXP_STRING_MATCH);
-
- String uriexp = uriStr.substring(1, uriStr.length() - 2);
- StringBuilder buffer = new StringBuilder();
- buffer.append("^/" + uriexp + "$|");
- buffer.append("^" + uriexp + "$|");
- buffer.append("^/" + uriexp + "/.*|");
- buffer.append("^" + uriexp + "/.*");
-
- attribute = new Attribute(
- attributeCategory,
- XMLSchemaConstants.DATATYPE_STRING, buffer.toString());
- }
- else
- {
- // use an exact match
- urlExpression.setFunctionId(XACMLConstants.FUNCTION_STRING_EQUAL);
-
- attribute = new Attribute(
- attributeCategory,
- XMLSchemaConstants.DATATYPE_STRING, uriStr);
- }
-
- if(attributeCategory.endsWith("resource-id") ||
- attributeCategory.endsWith("subject-id") ||
- attributeCategory.endsWith("action-id")
- )
- {
- urlExpression.setDesignatorMustBePresent(true);
- }
-
- urlExpression.setAttribute(attribute);
- }
+ }
}
Modified: modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/features/TestHierarchialPropagation.java
===================================================================
--- modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/features/TestHierarchialPropagation.java 2009-07-24 18:08:22 UTC (rev 13603)
+++ modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/features/TestHierarchialPropagation.java 2009-07-26 17:23:41 UTC (rev 13604)
@@ -29,6 +29,7 @@
import org.jboss.security.authz.bootstrap.ServiceContainer;
import org.jboss.security.authz.components.resource.URIResource;
+import org.jboss.security.authz.components.subject.Identity;
import org.jboss.security.authz.components.subject.Roles;
import org.jboss.security.authz.components.action.Read;
@@ -260,6 +261,36 @@
//Perform enforcement
this.enforce(this.createEnforcementContext(contextResource, action), false);
}
+
+ public void testExplicitPermitByIdentity() throws Exception
+ {
+ //SetUp Resource
+ URIResource resource = new URIResource();
+ resource.setUri(new URI("/root/level1/level2/index.html"));
+
+ Read action = new Read();
+
+ Identity identity = new Identity();
+ identity.setName("blah(a)blah.com");
+
+ //Setup the Context for the Composition with these components
+ CompositionContext context = new CompositionContext();
+ context.setPolicyTarget(resource);
+ context.addPolicyRule(Effect.PERMIT, action, identity, null);
+
+ //Store the policy into the Policy Server
+ PolicyMetaData policyMetaData = this.policyComposer.compose(context);
+ this.provisioner.newPolicy(policyMetaData);
+
+ this.assertServerState();
+
+ //Go ahead and produce a RequestContext for a "Permit" Enforcement
+ URIResource contextResource = new URIResource();
+ contextResource.setUri(new URI("/root/level1/level2/index.html"));
+
+ //Perform enforcement
+ this.enforce(this.createEnforcementContext(contextResource, action), true);
+ }
//------------------------------------------------------------------------------------------------------------------------------------------------------
private void enforce(EnforcementContext enforcementContext, boolean mustBePermitted) throws Exception
{
@@ -294,6 +325,9 @@
Roles roles = new Roles();
roles.addName("user");
context.setAttribute("roles", roles);
+ Identity identity = new Identity();
+ identity.setName("blah(a)blah.com");
+ context.setAttribute("identity", identity);
// Create Action
context.setAttribute("action", action);
Modified: modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/services/TestPolicyComposition.java
===================================================================
--- modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/services/TestPolicyComposition.java 2009-07-24 18:08:22 UTC (rev 13603)
+++ modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/services/TestPolicyComposition.java 2009-07-26 17:23:41 UTC (rev 13604)
@@ -136,4 +136,30 @@
log.info("----------------------------------------------------------------");
log.info(policy.generateSystemPolicy());
}
+
+ public void testComposePermitIdentityAsCondition() throws Exception
+ {
+ //Setup the state of Components to be used for Policy Composition
+ URIResource uriResource = new URIResource();
+ uriResource.setUri(new URI("/portal/admin-tool/modifyLayout"));
+
+ Read read = new Read();
+
+ Identity identity = new Identity();
+ identity.setName("blahUser(a)blah.com");
+
+ //Setup the Context for the Composition with these components
+ CompositionContext context = new CompositionContext();
+ context.setPolicyTarget(uriResource);
+ context.addPolicyRule(Effect.PERMIT, read, identity, null);
+
+ PolicyMetaData metadata = this.policyComposer.compose(context);
+ assertNotNull("Target must not be null!!", metadata.getTarget());
+ assertNotNull("Rule must not be null!!", metadata.getRules());
+
+ Policy policy = new MockPolicy("testComposePermitIdentityAsCondition", metadata);
+
+ log.info("----------------------------------------------------------------");
+ log.info(policy.generateSystemPolicy());
+ }
}
Modified: modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/test/MockPolicy.java
===================================================================
--- modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/test/MockPolicy.java 2009-07-24 18:08:22 UTC (rev 13603)
+++ modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/test/MockPolicy.java 2009-07-26 17:23:41 UTC (rev 13604)
@@ -110,7 +110,7 @@
ResourceMatchType rmt = new ResourceMatchType();
rmt.setMatchId(resourceMatch.getFunctionId());
- rmt.setResourceAttributeDesignator(AttributeDesignatorUtil.getAttributeDesignator(resourceMatch.getAttribute(), resourceMatch.designatorMustBePresent()));
+ rmt.setResourceAttributeDesignator(AttributeDesignatorUtil.getAttributeDesignator(resourceMatch));
rmt.setAttributeValue(PolicyAttributeFactory
.createStringAttributeType(resourceMatch.getAttribute().getValue()));
@@ -194,7 +194,7 @@
ActionMatchType amct = new ActionMatchType();
amct.setMatchId(action.getFunctionId());
amct.setAttributeValue(PolicyAttributeFactory.createStringAttributeType(action.getAttribute().getValue()));
- amct.setActionAttributeDesignator(AttributeDesignatorUtil.getAttributeDesignator(action.getAttribute(), action.designatorMustBePresent()));
+ amct.setActionAttributeDesignator(AttributeDesignatorUtil.getAttributeDesignator(action));
actionType.getActionMatch().add(amct);
actions.getAction().add(actionType);
}
@@ -212,7 +212,7 @@
SubjectMatchType match = new SubjectMatchType();
match.setMatchId(subject.getFunctionId());
match.setAttributeValue(PolicyAttributeFactory.createStringAttributeType(subject.getAttribute().getValue()));
- match.setSubjectAttributeDesignator((SubjectAttributeDesignatorType)AttributeDesignatorUtil.getAttributeDesignator(subject.getAttribute(), subject.designatorMustBePresent()));
+ match.setSubjectAttributeDesignator((SubjectAttributeDesignatorType)AttributeDesignatorUtil.getAttributeDesignator(subject));
subjectType.getSubjectMatch().add(match);
subjects.getSubject().add(subjectType);
}
@@ -243,8 +243,7 @@
apply.getExpression().add(jaxbAttrValue);
//Place within the Context where this Value should exist during an Authorization Request
- apply.getExpression().add(AttributeDesignatorUtil.getAttributeDesignatorXml(attributeExpression.getAttribute(),
- attributeExpression.designatorMustBePresent()));
+ apply.getExpression().add(AttributeDesignatorUtil.getAttributeDesignatorXml(attributeExpression));
condition.setExpression(objectFactory.createApply(apply));
Modified: modules/authorization/trunk/common-api/src/main/java/org/jboss/security/authz/component/ComponentCategory.java
===================================================================
--- modules/authorization/trunk/common-api/src/main/java/org/jboss/security/authz/component/ComponentCategory.java 2009-07-24 18:08:22 UTC (rev 13603)
+++ modules/authorization/trunk/common-api/src/main/java/org/jboss/security/authz/component/ComponentCategory.java 2009-07-26 17:23:41 UTC (rev 13604)
@@ -23,6 +23,7 @@
import org.jboss.security.authz.model.Target;
import org.jboss.security.authz.model.AttributeExpression;
+import org.jboss.security.authz.xacml.AttributeDesignatorUtil;
import org.jboss.security.xacml.interfaces.XACMLConstants;
/**
@@ -69,6 +70,19 @@
{
target.addActionMatch(expression);
}
+ },
+
+ CUSTOM_SUBJECT_ATTRIBUTE
+ {
+ public String getAttributeCategory()
+ {
+ return AttributeDesignatorUtil.ATTRIBUTEID_CUSTOM_SUBJECT_ATTRIBUTE;
+ }
+
+ public void setExpression(Target target, AttributeExpression expression)
+ {
+ target.addSubjectMatch(expression);
+ }
};
//Define the enum behavior
Modified: modules/authorization/trunk/common-api/src/main/java/org/jboss/security/authz/xacml/AttributeDesignatorUtil.java
===================================================================
--- modules/authorization/trunk/common-api/src/main/java/org/jboss/security/authz/xacml/AttributeDesignatorUtil.java 2009-07-24 18:08:22 UTC (rev 13603)
+++ modules/authorization/trunk/common-api/src/main/java/org/jboss/security/authz/xacml/AttributeDesignatorUtil.java 2009-07-26 17:23:41 UTC (rev 13604)
@@ -29,6 +29,7 @@
import org.jboss.security.xacml.factories.PolicyAttributeFactory;
import org.jboss.security.xacml.core.model.policy.SubjectAttributeDesignatorType;
+import org.jboss.security.authz.model.AttributeExpression;
import org.jboss.security.authz.model.Attribute;
import org.jboss.security.xacml.interfaces.XACMLConstants;
@@ -38,22 +39,42 @@
*/
public class AttributeDesignatorUtil
{
+ public static final String ATTRIBUTEID_CUSTOM_RESOURCE_ATTRIBUTE = "custom-resource-attribute";
+ public static final String ATTRIBUTEID_CUSTOM_SUBJECT_ATTRIBUTE = "custom-subject-attribute";
+ public static final String ATTRIBUTEID_CUSTOM_ACTION_ATTRIBUTE = "custom-action-attribute";
+ public static final String ATTRIBUTEID_CUSTOM_ENVIRONMENT_ATTRIBUTE = "custom-environment-attribute";
+
/**
*
* @param attribute
* @return
*/
- public static AttributeDesignatorType getAttributeDesignator(Attribute attribute, boolean mustBePresent)
+ public static AttributeDesignatorType getAttributeDesignator(AttributeExpression attributeExpression)
{
AttributeDesignatorType attributeDesignator = null;
+ Attribute attribute = attributeExpression.getAttribute();
+ boolean mustBePresent = attributeExpression.designatorMustBePresent();
String uri = attribute.getUri();
- //TODO: add all the conditions to detect a Subject Attribute
- if(uri.equals(XACMLConstants.ATTRIBUTEID_ROLE) ||
+ //All the conditions to detect a Subject Attribute
+ if(uri.equals(XACMLConstants.ATTRIBUTEID_SUBJECT_ID) ||
+ uri.equals(XACMLConstants.ATTRIBUTEID_ROLE) ||
+ uri.equals(XACMLConstants.ATTRIBUTEID_DNS_NAME) ||
uri.equals(XACMLConstants.ATTRIBUTEID_IP_ADDRESS) ||
uri.equals(XACMLConstants.ATTRIBUTEID_AUTHENTICATION_METHOD) ||
- uri.equals(XACMLConstants.ATTRIBUTEID_SUBJECT_ID)
+ uri.equals(XACMLConstants.ATTRIBUTEID_AUTHENTICATION_TIME) ||
+ uri.equals(XACMLConstants.ATTRIBUTEID_KEY_INFO) ||
+ uri.equals(XACMLConstants.ATTRIBUTEID_REQUEST_TIME) ||
+ uri.equals(XACMLConstants.ATTRIBUTEID_NAME_FORMAT) ||
+ uri.equals(XACMLConstants.ATTRIBUTEID_SESSION_START_TIME) ||
+ uri.equals(XACMLConstants.ATTRIBUTEID_SUBJECT_ID_QUALIFIER) ||
+ uri.equals(XACMLConstants.ATTRIBUTEID_ACCESS_SUBJECT) ||
+ uri.equals(XACMLConstants.ATTRIBUTEID_CODEBASE) ||
+ uri.equals(XACMLConstants.ATTRIBUTEID_INTERMEDIARY_SUBJECT) ||
+ uri.equals(XACMLConstants.ATTRIBUTEID_RECIPIENT_SUBJECT) ||
+ uri.equals(XACMLConstants.ATTRIBUTEID_REQUESTING_MACHINE) ||
+ uri.equals(ATTRIBUTEID_CUSTOM_SUBJECT_ATTRIBUTE)
)
{
attributeDesignator = PolicyAttributeFactory.createSubjectAttributeDesignatorType(attribute.getUri(),
@@ -72,12 +93,12 @@
* @param attribute
* @return
*/
- public static JAXBElement<? extends AttributeDesignatorType> getAttributeDesignatorXml(Attribute attribute, boolean mustBePresent)
+ public static JAXBElement<? extends AttributeDesignatorType> getAttributeDesignatorXml(AttributeExpression attributeExpression)
{
JAXBElement<? extends AttributeDesignatorType> xmlRep = null;
ObjectFactory objectFactory = new ObjectFactory();
- AttributeDesignatorType attributeDesignator = AttributeDesignatorUtil.getAttributeDesignator(attribute, mustBePresent);
+ AttributeDesignatorType attributeDesignator = AttributeDesignatorUtil.getAttributeDesignator(attributeExpression);
if(attributeDesignator instanceof SubjectAttributeDesignatorType)
{
@@ -87,12 +108,25 @@
{
String uri = attributeDesignator.getAttributeId();
- //TODO: finish this implementation to include all Attribute Types like Resource, Action, and Environment
- if(uri.equals(XACMLConstants.ATTRIBUTEID_ACTION_ID)
+ //TODO: Include all Attribute Types like Resource, Action, and Environment
+ if(uri.equals(XACMLConstants.ATTRIBUTEID_ACTION_ID) ||
+ uri.equals(ATTRIBUTEID_CUSTOM_SUBJECT_ATTRIBUTE)
)
{
xmlRep = objectFactory.createActionAttributeDesignator(attributeDesignator);
}
+ else if(uri.equals(ATTRIBUTEID_CUSTOM_RESOURCE_ATTRIBUTE)
+
+ )
+ {
+ xmlRep = objectFactory.createResourceAttributeDesignator(attributeDesignator);
+ }
+ else if(uri.equals(ATTRIBUTEID_CUSTOM_ENVIRONMENT_ATTRIBUTE)
+
+ )
+ {
+ xmlRep = objectFactory.createEnvironmentAttributeDesignator(attributeDesignator);
+ }
}
return xmlRep;
Modified: modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/components/MockPolicy.java
===================================================================
--- modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/components/MockPolicy.java 2009-07-24 18:08:22 UTC (rev 13603)
+++ modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/components/MockPolicy.java 2009-07-26 17:23:41 UTC (rev 13604)
@@ -110,8 +110,7 @@
ResourceMatchType rmt = new ResourceMatchType();
rmt.setMatchId(resourceMatch.getFunctionId());
- rmt.setResourceAttributeDesignator(AttributeDesignatorUtil.getAttributeDesignator(resourceMatch.getAttribute(), resourceMatch.
- designatorMustBePresent()));
+ rmt.setResourceAttributeDesignator(AttributeDesignatorUtil.getAttributeDesignator(resourceMatch));
rmt.setAttributeValue(PolicyAttributeFactory
.createStringAttributeType(resourceMatch.getAttribute().getValue()));
@@ -195,8 +194,7 @@
ActionMatchType amct = new ActionMatchType();
amct.setMatchId(action.getFunctionId());
amct.setAttributeValue(PolicyAttributeFactory.createStringAttributeType(action.getAttribute().getValue()));
- amct.setActionAttributeDesignator(AttributeDesignatorUtil.getAttributeDesignator(action.getAttribute(),
- action.designatorMustBePresent()));
+ amct.setActionAttributeDesignator(AttributeDesignatorUtil.getAttributeDesignator(action));
actionType.getActionMatch().add(amct);
actions.getAction().add(actionType);
}
@@ -214,8 +212,7 @@
SubjectMatchType match = new SubjectMatchType();
match.setMatchId(subject.getFunctionId());
match.setAttributeValue(PolicyAttributeFactory.createStringAttributeType(subject.getAttribute().getValue()));
- match.setSubjectAttributeDesignator((SubjectAttributeDesignatorType)AttributeDesignatorUtil.getAttributeDesignator(subject.getAttribute(),
- subject.designatorMustBePresent()));
+ match.setSubjectAttributeDesignator((SubjectAttributeDesignatorType)AttributeDesignatorUtil.getAttributeDesignator(subject));
subjectType.getSubjectMatch().add(match);
subjects.getSubject().add(subjectType);
}
@@ -246,7 +243,7 @@
apply.getExpression().add(jaxbAttrValue);
//Place within the Context where this Value should exist during an Authorization Request
- apply.getExpression().add(AttributeDesignatorUtil.getAttributeDesignatorXml(attributeExpression.getAttribute(), attributeExpression.designatorMustBePresent()));
+ apply.getExpression().add(AttributeDesignatorUtil.getAttributeDesignatorXml(attributeExpression));
condition.setExpression(objectFactory.createApply(apply));
Modified: modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/plugin/XACMLPolicy.java
===================================================================
--- modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/plugin/XACMLPolicy.java 2009-07-24 18:08:22 UTC (rev 13603)
+++ modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/plugin/XACMLPolicy.java 2009-07-26 17:23:41 UTC (rev 13604)
@@ -110,8 +110,7 @@
rmt.setMatchId(resourceMatch.getFunctionId());
- rmt.setResourceAttributeDesignator(AttributeDesignatorUtil.getAttributeDesignator(resourceMatch.getAttribute(), resourceMatch.
- designatorMustBePresent()));
+ rmt.setResourceAttributeDesignator(AttributeDesignatorUtil.getAttributeDesignator(resourceMatch));
rmt.setAttributeValue(PolicyAttributeFactory
.createStringAttributeType(resourceMatch.getAttribute().getValue()));
@@ -208,7 +207,7 @@
ActionMatchType amct = new ActionMatchType();
amct.setMatchId(action.getFunctionId());
amct.setAttributeValue(PolicyAttributeFactory.createStringAttributeType(action.getAttribute().getValue()));
- amct.setActionAttributeDesignator(AttributeDesignatorUtil.getAttributeDesignator(action.getAttribute(), action.designatorMustBePresent()));
+ amct.setActionAttributeDesignator(AttributeDesignatorUtil.getAttributeDesignator(action));
actionType.getActionMatch().add(amct);
actions.getAction().add(actionType);
}
@@ -226,8 +225,7 @@
SubjectMatchType match = new SubjectMatchType();
match.setMatchId(subject.getFunctionId());
match.setAttributeValue(PolicyAttributeFactory.createStringAttributeType(subject.getAttribute().getValue()));
- match.setSubjectAttributeDesignator((SubjectAttributeDesignatorType)AttributeDesignatorUtil.getAttributeDesignator(subject.getAttribute(),
- subject.designatorMustBePresent()));
+ match.setSubjectAttributeDesignator((SubjectAttributeDesignatorType)AttributeDesignatorUtil.getAttributeDesignator(subject));
subjectType.getSubjectMatch().add(match);
subjects.getSubject().add(subjectType);
}
@@ -258,8 +256,7 @@
apply.getExpression().add(jaxbAttrValue);
//Place within the Context where this Value should exist during an Authorization Request
- apply.getExpression().add(AttributeDesignatorUtil.getAttributeDesignatorXml(attributeExpression.getAttribute(),
- attributeExpression.designatorMustBePresent()));
+ apply.getExpression().add(AttributeDesignatorUtil.getAttributeDesignatorXml(attributeExpression));
condition.setExpression(objectFactory.createApply(apply));
Modified: modules/authorization/trunk/pom.xml
===================================================================
--- modules/authorization/trunk/pom.xml 2009-07-24 18:08:22 UTC (rev 13603)
+++ modules/authorization/trunk/pom.xml 2009-07-26 17:23:41 UTC (rev 13604)
@@ -36,18 +36,22 @@
-->
<version.junit>3.8.2</version.junit>
+ <version.apache.log4j>1.2.14</version.apache.log4j>
+
<version.sun.jaxb>2.1.4</version.sun.jaxb>
<version.sun.jaf>1.1</version.sun.jaf>
<version.jboss.xacml>2.0.3-SNAPSHOT</version.jboss.xacml>
- <version.apache.log4j>1.2.14</version.apache.log4j>
+
<version.org.drools>4.0.7</version.org.drools>
<version.org.mvel.mvel>1.3.1-java1.4</version.org.mvel.mvel>
<version.org.antlr>3.0</version.org.antlr>
- <version.javax.servlet.servlet-api>2.4</version.javax.servlet.servlet-api>
+
<version.org.jboss.microcontainer>2.0.2.GA</version.org.jboss.microcontainer>
<version.org.jboss.jboss-reflect>2.0.2.GA</version.org.jboss.jboss-reflect>
<version.org.jboss.jboss-common-core>2.2.9.GA</version.org.jboss.jboss-common-core>
<version.org.jboss.jboss-mdr>2.0.1.GA</version.org.jboss.jboss-mdr>
+
+ <version.javax.servlet.servlet-api>2.4</version.javax.servlet.servlet-api>
<version.commons-httpclient>3.1</version.commons-httpclient>
</properties>
@@ -321,6 +325,22 @@
<version>2.3.1</version>
<configuration>
</configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <inherited>true</inherited>
+ <configuration>
+ <attach>true</attach>
+ </configuration>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
</plugin>
</plugins>
</build>
16 years, 9 months
JBoss Portal SVN: r13603 - modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-07-24 14:08:22 -0400 (Fri, 24 Jul 2009)
New Revision: 13603
Modified:
modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/PortletApplicationDeployer.java
Log:
- Worked around jboss-service.xml injection mechanism so that it can be used in an MBean context.
Modified: modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/PortletApplicationDeployer.java
===================================================================
--- modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/PortletApplicationDeployer.java 2009-07-24 18:03:18 UTC (rev 13602)
+++ modules/portlet/trunk/mc/src/main/java/org/jboss/portal/portlet/mc/PortletApplicationDeployer.java 2009-07-24 18:08:22 UTC (rev 13603)
@@ -24,27 +24,29 @@
import org.apache.log4j.Logger;
import org.jboss.portal.common.io.IOTools;
-import org.jboss.portal.portlet.container.managed.PortletApplicationRegistry;
-import org.jboss.portal.portlet.container.managed.ManagedPortletApplication;
+import org.jboss.portal.portlet.PortletInvoker;
+import org.jboss.portal.portlet.container.ContainerPortletInvoker;
+import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.container.managed.LifeCycleStatus;
+import org.jboss.portal.portlet.container.managed.ManagedObject;
+import org.jboss.portal.portlet.container.managed.ManagedObjectEvent;
+import org.jboss.portal.portlet.container.managed.ManagedObjectLifeCycleEvent;
+import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEvent;
import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEventBroadcaster;
import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEventListener;
-import org.jboss.portal.portlet.container.managed.ManagedObjectRegistryEvent;
-import org.jboss.portal.portlet.container.managed.ManagedObjectEvent;
-import org.jboss.portal.portlet.container.managed.ManagedObject;
-import org.jboss.portal.portlet.container.managed.ManagedObjectLifeCycleEvent;
-import org.jboss.portal.portlet.container.managed.LifeCycleStatus;
-import org.jboss.portal.portlet.container.ContainerPortletInvoker;
-import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.container.managed.ManagedPortletApplication;
+import org.jboss.portal.portlet.container.managed.PortletApplicationRegistry;
+import org.jboss.portal.portlet.impl.container.PortletApplicationLifeCycle;
+import org.jboss.portal.portlet.impl.container.PortletContainerLifeCycle;
import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
import static org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants.PORTLET_JSR_168_NS;
import static org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants.PORTLET_JSR_286_NS;
-import org.jboss.portal.portlet.impl.container.PortletApplicationLifeCycle;
-import org.jboss.portal.portlet.impl.container.PortletContainerLifeCycle;
import org.jboss.portal.portlet.mc.metadata.factory.PortletApplicationModelFactory;
import org.jboss.portal.portlet.mc.metadata.impl.AnnotationPortletApplication10MetaData;
import org.jboss.portal.portlet.mc.metadata.impl.AnnotationPortletApplication20MetaData;
import org.jboss.portal.portlet.mc.metadata.impl.ValueTrimmingFilter;
import org.jboss.portal.web.ServletContainer;
+import org.jboss.portal.web.ServletContainerFactory;
import org.jboss.portal.web.WebApp;
import org.jboss.portal.web.WebAppEvent;
import org.jboss.portal.web.WebAppLifeCycleEvent;
@@ -58,9 +60,9 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
+import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
-import java.util.Collection;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -97,6 +99,8 @@
/** . */
private ServletContainer servletContainer;
+ private ServletContainerFactory servletContainerFactory;
+
/** . */
private Map<String, PortletApplicationDeployment> deploymentMap = new HashMap<String, PortletApplicationDeployment>();
@@ -124,22 +128,47 @@
public ServletContainer getServletContainer()
{
+ if (servletContainer == null)
+ {
+ servletContainer = servletContainerFactory.getServletContainer();
+ }
return servletContainer;
}
public void setServletContainer(ServletContainer servletContainer)
{
- this.servletContainer = servletContainer;
+ throw new UnsupportedOperationException("Inject ServletContainerFactory instead!");
}
- public ContainerPortletInvoker getContainerPortletInvoker()
+ public ServletContainerFactory getServletContainerFactory()
{
+ return servletContainerFactory;
+ }
+
+ public void setServletContainerFactory(ServletContainerFactory servletContainerFactory)
+ {
+ this.servletContainerFactory = servletContainerFactory;
+ }
+
+ public PortletInvoker getContainerPortletInvoker()
+ {
return containerPortletInvoker;
}
- public void setContainerPortletInvoker(ContainerPortletInvoker containerPortletInvoker)
+ public void setContainerPortletInvoker(PortletInvoker containerPortletInvoker)
{
- this.containerPortletInvoker = containerPortletInvoker;
+ if (containerPortletInvoker instanceof ContainerPortletInvoker)
+ {
+ this.containerPortletInvoker = (ContainerPortletInvoker)containerPortletInvoker;
+ }
+ else
+ {
+ if (containerPortletInvoker == null)
+ {
+ return; // this method is called with null on shutdown
+ }
+ throw new IllegalArgumentException("PortletApplicationDeployer can only accept ContainerPortletInvokers!");
+ }
}
public void onEvent(WebAppEvent event)
@@ -225,14 +254,14 @@
//
broadcaster.addListener(bridgeToInvoker);
- servletContainer.addWebAppListener(this);
+ getServletContainer().addWebAppListener(this);
}
public void stop()
{
// This should generate remove web app event and in cascade clear the registry
// as well as the portlet container invoker
- servletContainer.removeWebAppListener(this);
+ getServletContainer().removeWebAppListener(this);
//
classLoader = null;
@@ -303,9 +332,7 @@
broadcaster.addListener(listener);
}
- /**
- * Bridge managed object event to add/remove portlet container in portlet container invoker.
- */
+ /** Bridge managed object event to add/remove portlet container in portlet container invoker. */
private final ManagedObjectRegistryEventListener bridgeToInvoker = new ManagedObjectRegistryEventListener()
{
public void onEvent(ManagedObjectRegistryEvent event)
16 years, 9 months
JBoss Portal SVN: r13602 - in modules/portlet/trunk: portlet and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-07-24 14:03:18 -0400 (Fri, 24 Jul 2009)
New Revision: 13602
Modified:
modules/portlet/trunk/build/pom.xml
modules/portlet/trunk/portlet/pom.xml
Log:
- Use most recent version of web module.
- Do not bundle shared libs.
Modified: modules/portlet/trunk/build/pom.xml
===================================================================
--- modules/portlet/trunk/build/pom.xml 2009-07-24 17:51:51 UTC (rev 13601)
+++ modules/portlet/trunk/build/pom.xml 2009-07-24 18:03:18 UTC (rev 13602)
@@ -34,7 +34,7 @@
<version.jbossxb>2.0.0.GA</version.jbossxb>
<version.jboss-remoting>2.2.1.GA</version.jboss-remoting>
<version.jboss.portal.common>1.2.3</version.jboss.portal.common>
- <version.jboss.portal.web>1.2.3</version.jboss.portal.web>
+ <version.jboss.portal.web>1.2.0-SNAPSHOT</version.jboss.portal.web>
<version.jboss.unit>1.2.2</version.jboss.unit>
<version.log4j>1.2.14</version.log4j>
<version.apache.commons-logging>1.1.1</version.apache.commons-logging>
@@ -102,11 +102,11 @@
<artifactId>maven-jar-plugin</artifactId>
<version>2.1</version>
<configuration>
- <archive>
- <manifest>
- <addClasspath>false</addClasspath>
- </manifest>
- </archive>
+ <archive>
+ <manifest>
+ <addClasspath>false</addClasspath>
+ </manifest>
+ </archive>
</configuration>
</plugin>
</plugins>
@@ -223,9 +223,9 @@
<version>${version.javax.servlet.jsp}</version>
</dependency>
<dependency>
- <groupId>javax.ccpp</groupId>
- <artifactId>ccpp</artifactId>
- <version>${version.ccpp-api}</version>
+ <groupId>javax.ccpp</groupId>
+ <artifactId>ccpp</artifactId>
+ <version>${version.ccpp-api}</version>
</dependency>
<dependency>
Modified: modules/portlet/trunk/portlet/pom.xml
===================================================================
--- modules/portlet/trunk/portlet/pom.xml 2009-07-24 17:51:51 UTC (rev 13601)
+++ modules/portlet/trunk/portlet/pom.xml 2009-07-24 18:03:18 UTC (rev 13602)
@@ -12,14 +12,14 @@
<name>portlet</name>
<dependencies>
-<!--
+ <!--
+ <dependency>
+ <groupId>org.jboss.portal.portlet</groupId>
+ <artifactId>portlet-jsr168api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ -->
<dependency>
- <groupId>org.jboss.portal.portlet</groupId>
- <artifactId>portlet-jsr168api</artifactId>
- <version>${project.version}</version>
- </dependency>
--->
- <dependency>
<groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId>
</dependency>
@@ -38,10 +38,11 @@
<dependency>
<groupId>sun-jaxb</groupId>
<artifactId>jaxb-api</artifactId>
+ <scope>provided</scope>
</dependency>
<dependency>
- <groupId>javax.ccpp</groupId>
- <artifactId>ccpp</artifactId>
+ <groupId>javax.ccpp</groupId>
+ <artifactId>ccpp</artifactId>
</dependency>
<!--TEST SCOPE-->
@@ -53,7 +54,6 @@
</dependencies>
-
<profiles>
<!--By default Annotation Processing Tool related classes need to be disabled-->
<profile>
@@ -116,7 +116,7 @@
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
- </dependencies>
+ </dependencies>
</profile>
<!--On MacOSX the tools.jar should be already in the classpath-->
@@ -150,7 +150,6 @@
</profiles>
-
<build>
<plugins>
<plugin>
16 years, 9 months
JBoss Portal SVN: r13601 - modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-07-24 13:51:51 -0400 (Fri, 24 Jul 2009)
New Revision: 13601
Modified:
modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/DefaultServletContainerFactory.java
Log:
- DefaultServletContainerFactory is used as a singleton but yet allows direct instantiation. In particular, injecting it as an
MBean causes 2 instances to be created. The injected instance not being the "singleton" one, this would cause dependent
MBeans to not be able to detect portlet deployments because registerContext would refer to the "singleton" instance, not
the injected version. Hence, WebAppEvent listeners would be registered with the wrong instance. We need to fix this design
issue better than making the current solution.
Modified: modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/DefaultServletContainerFactory.java
===================================================================
--- modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/DefaultServletContainerFactory.java 2009-07-24 17:46:15 UTC (rev 13600)
+++ modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/DefaultServletContainerFactory.java 2009-07-24 17:51:51 UTC (rev 13601)
@@ -42,7 +42,7 @@
}
/** . */
- private final DefaultServletContainer container = new DefaultServletContainer();
+ private static final DefaultServletContainer container = new DefaultServletContainer();
/**
* Returns the singleton instance.
@@ -63,6 +63,6 @@
*/
public static void registerContext(ServletContainerContext context) throws IllegalArgumentException
{
- instance.container.register(context);
+ container.register(context);
}
}
16 years, 9 months
JBoss Portal SVN: r13600 - modules/web/trunk/web.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-07-24 13:46:15 -0400 (Fri, 24 Jul 2009)
New Revision: 13600
Modified:
modules/web/trunk/web/pom.xml
Log:
- Avoid bundling shared libs.
Modified: modules/web/trunk/web/pom.xml
===================================================================
--- modules/web/trunk/web/pom.xml 2009-07-23 16:09:29 UTC (rev 13599)
+++ modules/web/trunk/web/pom.xml 2009-07-24 17:46:15 UTC (rev 13600)
@@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>web-web</artifactId>
<packaging>jar</packaging>
- <name>JBoss Unit</name>
+ <name>JBoss Portal Web Module</name>
<dependencies>
@@ -21,28 +21,32 @@
<dependency>
<groupId>org.jboss.portal.common</groupId>
<artifactId>common-common</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-core-uberjar</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-core-uberjar</artifactId>
</exclusion>
</exclusions>
</dependency>
- <dependency>
+ <dependency>
<groupId>sun-servlet</groupId>
<artifactId>servlet-api</artifactId>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>catalina</artifactId>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>apache-log4j</groupId>
<artifactId>log4j</artifactId>
+ <scope>provided</scope>
</dependency>
<!-- SCOPE TEST -->
@@ -99,6 +103,7 @@
<dependency>
<groupId>jboss</groupId>
<artifactId>jboss-remoting</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.microcontainer</groupId>
@@ -126,12 +131,14 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>jaxen</groupId>
- <artifactId>jaxen</artifactId>
+ <groupId>jaxen</groupId>
+ <artifactId>jaxen</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
- <groupId>saxpath</groupId>
- <artifactId>saxpath</artifactId>
+ <groupId>saxpath</groupId>
+ <artifactId>saxpath</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>cargo</groupId>
@@ -149,18 +156,20 @@
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-core-uberjar</artifactId>
<version>${version.cargo}</version>
+ <scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-ant</artifactId>
- <version>${version.cargo}</version>
- <exclusions>
- <exclusion>
- <groupId>ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
+ <dependency>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-ant</artifactId>
+ <version>${version.cargo}</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
</dependencies>
<build>
@@ -169,7 +178,7 @@
<groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
<artifactId>maven-antrun-extended-plugin</artifactId>
<version>1.13</version>
-
+
<dependencies>
<dependency>
<groupId>org.jboss.unit</groupId>
@@ -177,7 +186,7 @@
<version>${version.jboss.unit}</version>
</dependency>
- <!--stuff to run servers for tests-->
+ <!--stuff to run servers for tests-->
<dependency>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-ant</artifactId>
@@ -212,47 +221,73 @@
<!-- -->
<property name="dependency.log4j.jar" value="${maven.dependency.apache-log4j.log4j.jar.path}"/>
- <property name="dependency.commons-logging.jar" value="${maven.dependency.commons-logging.commons-logging.jar.path}"/>
- <property name="dependency.commons-httpclient.jar" value="${maven.dependency.commons-httpclient.commons-httpclient.jar.path}"/>
- <property name="dependency.activation.jar" value="${maven.dependency.javax.activation.activation.jar.path}"/>
+ <property name="dependency.commons-logging.jar"
+ value="${maven.dependency.commons-logging.commons-logging.jar.path}"/>
+ <property name="dependency.commons-httpclient.jar"
+ value="${maven.dependency.commons-httpclient.commons-httpclient.jar.path}"/>
+ <property name="dependency.activation.jar"
+ value="${maven.dependency.javax.activation.activation.jar.path}"/>
<property name="dependency.junit.jar" value="${maven.dependency.junit.junit.jar.path}"/>
- <property name="dependency.cargo-manager.war" value="${maven.dependency.cargo.cargo-manager.war.path}"/>
+ <property name="dependency.cargo-manager.war"
+ value="${maven.dependency.cargo.cargo-manager.war.path}"/>
<!-- JBoss Portal -->
- <property name="dependency.portal-common-common.jar" value="${maven.dependency.org.jboss.portal.common.common-common.jar.path}"/>
- <property name="dependency.portal-common-mc.jar" value="${maven.dependency.org.jboss.portal.common.common-mc.jar.path}"/>
+ <property name="dependency.portal-common-common.jar"
+ value="${maven.dependency.org.jboss.portal.common.common-common.jar.path}"/>
+ <property name="dependency.portal-common-mc.jar"
+ value="${maven.dependency.org.jboss.portal.common.common-mc.jar.path}"/>
<!-- JBoss Unit -->
- <property name="dependency.jboss-unit.jar" value="${maven.dependency.org.jboss.unit.jboss-unit.jar.path}"/>
- <property name="dependency.jboss-unit-mc.jar" value="${maven.dependency.org.jboss.unit.jboss-unit-mc.jar.path}"/>
- <property name="dependency.jboss-unit-remote.jar" value="${maven.dependency.org.jboss.unit.jboss-unit-remote.jar.path}"/>
- <property name="dependency.portal-test.jar" value="${maven.dependency.org.jboss.unit.portal-test.jar.path}"/>
- <property name="dependency.portal-test-generic.jar" value="${maven.dependency.org.jboss.unit.portal-test-generic.jar.path}"/>
- <property name="dependency.jboss-remoting.jar" value="${maven.dependency.jboss.jboss-remoting.jar.path}"/>
+ <property name="dependency.jboss-unit.jar"
+ value="${maven.dependency.org.jboss.unit.jboss-unit.jar.path}"/>
+ <property name="dependency.jboss-unit-mc.jar"
+ value="${maven.dependency.org.jboss.unit.jboss-unit-mc.jar.path}"/>
+ <property name="dependency.jboss-unit-remote.jar"
+ value="${maven.dependency.org.jboss.unit.jboss-unit-remote.jar.path}"/>
+ <property name="dependency.portal-test.jar"
+ value="${maven.dependency.org.jboss.unit.portal-test.jar.path}"/>
+ <property name="dependency.portal-test-generic.jar"
+ value="${maven.dependency.org.jboss.unit.portal-test-generic.jar.path}"/>
+ <property name="dependency.jboss-remoting.jar"
+ value="${maven.dependency.jboss.jboss-remoting.jar.path}"/>
<!-- JBoss Microcontainer -->
- <property name="dependency.concurrent.jar" value="${maven.dependency.concurrent.concurrent.jar.path}"/>
- <property name="dependency.jboss-logging-spi.jar" value="${maven.dependency.jboss.jboss-common-logging-spi.jar.path}"/>
- <property name="dependency.jboss-logging-jdk.jar" value="${maven.dependency.jboss.jboss-common-logging-jdk.jar.path}"/>
- <property name="dependency.jboss-logging-log4j.jar" value="${maven.dependency.jboss.jboss-common-logging-log4j.jar.path}"/>
- <property name="dependency.jboss-kernel.jar" value="${maven.dependency.org.jboss.microcontainer.jboss-kernel.jar.path}"/>
- <property name="dependency.jboss-dependency.jar" value="${maven.dependency.org.jboss.microcontainer.jboss-dependency.jar.path}"/>
- <property name="dependency.jboss-reflect.jar" value="${maven.dependency.org.jboss.jboss-reflect.jar.path}"/>
- <property name="dependency.jboss-common-core.jar" value="${maven.dependency.org.jboss.jboss-common-core.jar.path}"/>
- <property name="dependency.jaxb.jar" value="${maven.dependency.javax.xml.bind.jaxb-api.jar.path}"/>
- <property name="dependency.jboss-mdr.jar" value="${maven.dependency.org.jboss.jboss-mdr.jar.path}"/>
- <property name="dependency.resolver.jar" value="${maven.dependency.apache-xerces.resolver.jar.path}"/>
- <property name="dependency.xercesImpl.jar" value="${maven.dependency.apache-xerces.xercesImpl.jar.path}"/>
- <property name="dependency.xml-apis.jar" value="${maven.dependency.apache-xerces.xml-apis.jar.path}"/>
+ <property name="dependency.concurrent.jar"
+ value="${maven.dependency.concurrent.concurrent.jar.path}"/>
+ <property name="dependency.jboss-logging-spi.jar"
+ value="${maven.dependency.jboss.jboss-common-logging-spi.jar.path}"/>
+ <property name="dependency.jboss-logging-jdk.jar"
+ value="${maven.dependency.jboss.jboss-common-logging-jdk.jar.path}"/>
+ <property name="dependency.jboss-logging-log4j.jar"
+ value="${maven.dependency.jboss.jboss-common-logging-log4j.jar.path}"/>
+ <property name="dependency.jboss-kernel.jar"
+ value="${maven.dependency.org.jboss.microcontainer.jboss-kernel.jar.path}"/>
+ <property name="dependency.jboss-dependency.jar"
+ value="${maven.dependency.org.jboss.microcontainer.jboss-dependency.jar.path}"/>
+ <property name="dependency.jboss-reflect.jar"
+ value="${maven.dependency.org.jboss.jboss-reflect.jar.path}"/>
+ <property name="dependency.jboss-common-core.jar"
+ value="${maven.dependency.org.jboss.jboss-common-core.jar.path}"/>
+ <property name="dependency.jaxb.jar"
+ value="${maven.dependency.javax.xml.bind.jaxb-api.jar.path}"/>
+ <property name="dependency.jboss-mdr.jar"
+ value="${maven.dependency.org.jboss.jboss-mdr.jar.path}"/>
+ <property name="dependency.resolver.jar"
+ value="${maven.dependency.apache-xerces.resolver.jar.path}"/>
+ <property name="dependency.xercesImpl.jar"
+ value="${maven.dependency.apache-xerces.xercesImpl.jar.path}"/>
+ <property name="dependency.xml-apis.jar"
+ value="${maven.dependency.apache-xerces.xml-apis.jar.path}"/>
<property name="dependency.jbossxb.jar" value="${maven.dependency.org.jboss.jbossxb.jar.path}"/>
<!-- Cargo Jetty deployer -->
- <property name="dependency.cargo.jetty-deployer" value="${maven.dependency.org.codehaus.cargo.cargo-jetty-deployer.war.path}"/>
+ <property name="dependency.cargo.jetty-deployer"
+ value="${maven.dependency.org.codehaus.cargo.cargo-jetty-deployer.war.path}"/>
<ant antfile="${basedir}/src/test/build.xml">
<target name="tests"/>
</ant>
-
+
</tasks>
</configuration>
<goals>
16 years, 9 months