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 />