portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r733524 [1/6] - in /portals/jetspeed-2/portal/branches/JPA_BRANCH: components/jetspeed-page-manager/ components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/ components/jetspeed-page-manager/src/main/java/org/apache...
Date Sun, 11 Jan 2009 21:58:24 GMT
Author: rwatler
Date: Sun Jan 11 13:58:21 2009
New Revision: 733524

URL: http://svn.apache.org/viewvc?rev=733524&view=rev
Log:
JPA Registry Component Integration 
----------------------------------
- added new OM and managers for JPA specific registry implementation
- added registry context support for extended/long transaction entity managers
- consolidated JPA functionality used in both DBPM and Registry to RDBMS component
- upgraded JPA DBPM implementation to unify DBPM and Registry approaches
- note: as with DBPM, portal-level integration not attempted yet: JPA implementation in test cases only


Added:
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/OpenJPARemoteCommitListenerImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/util/jpa/
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/util/jpa/JPADatasourceEnabledSpringTestCase.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletentity/jpa/
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletentity/jpa/PortletEntityAccessComponentImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletentity/jpa/PortletEntityImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/jpa/
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/jpa/DatabasePreference.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/jpa/DatabasePreferenceValue.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/jpa/DatabasePreferenceValueCollection.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/jpa/PortletPreferencesProviderImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/jpa/
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/jpa/PortletRegistryImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/jpa/RegistryManager.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/jpa/RegistryManagerContext.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/jpa/RegistryManagerImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/AbstractPortletApplicationDefinitionImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/AbstractPortletDefinitionImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/BaseLocalizedImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/CustomPortletModeDescriptionImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/CustomPortletModeImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/CustomWindowStateDescriptionImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/CustomWindowStateImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/DescriptionImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/DisplayNameImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/InitParamDescriptionImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/InitParamImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/JetspeedServiceReferenceImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/LanguageImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/LocalizedFieldImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletApplicationDefinitionImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletApplicationDescriptionImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletApplicationDisplayNameImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletApplicationLocalizedFieldImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletApplicationMetadataImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletDefinitionCollection.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletDefinitionCollectionMember.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletDefinitionDescriptionImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletDefinitionDisplayNameImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletDefinitionImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletDefinitionList.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletDefinitionLocalizedFieldImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletDefinitionMetadataImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/SecurityRoleDescriptionImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/SecurityRoleImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/SecurityRoleRefDescriptionImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/SecurityRoleRefImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/SupportsImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/UserAttributeDescriptionImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/UserAttributeImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/UserAttributeRefDescriptionImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/UserAttributeRefImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/resources/
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/resources/META-INF/
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/resources/META-INF/persistence.xml
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletentity/TestOpenJPAPortletEntityDAO.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletpreferences/TestOpenJPAPortletPreferencesProvider.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestOpenJPAPortletRegistryDAO.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestOpenJPARegistryCache.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/direct/TestOpenJPARegistryDirectAll.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/jpa-registry.xml
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/log4j.properties
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/openjpa-registry-base.xml
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/openjpa-registry.xml
Modified:
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/pom.xml
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderBaseMenuDefinitionMetadata.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/BaseElementImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/BaseMetadataLocalizedFieldImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/FragmentImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/LinkImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageBaseMenuDefinitionMetadata.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageSecurityImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/AbstractPageManager.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/DatabasePageManager.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/DatabasePageManagerImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/OpenJPADatabasePageManagerImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/resources/META-INF/persistence.xml
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestDatabasePageManager.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestOpenJPADatabasePageManager.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestOpenJPATransactions.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestSecureDatabasePageManager.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestSecureOpenJPADatabasePageManager.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestSecurePermissionsOpenJPADatabasePageManager.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestTransactions.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/resources/jpa-database-page-manager.xml
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-portal/src/test/java/org/apache/jetspeed/tools/pamanager/TestPortletDescriptorSecurityRoles.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-portal/src/test/java/org/apache/jetspeed/userinfo/TestUserInfoManager.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/pom.xml
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/PersistenceBrokerPortletRegistry.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/descriptor/JetspeedDescriptorServiceImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/InlinePortletResourceBundle.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PortletApplicationDefinitionImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/impl/PortletDefinitionImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletentity/TestPortletEntityDAO.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletpreferences/TestPortletPreferencesProvider.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/AbstractRegistryTest.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestPortletRegistryDAO.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestRegistryCache.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/direct/TestRegistryDirectAll.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/direct/TestRegistryDirectPart1a.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/direct/TestRegistryDirectPart1b.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-api/src/main/java/org/apache/jetspeed/components/portletregistry/PortletRegistry.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/PortletDefinition.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-api/src/main/java/org/apache/jetspeed/page/PageManager.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/ddl-schema/registry-schema.xml
    portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/deployment.xml
    portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/static-bean-references.xml
    portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/ddl/mssql/create-schema.sql

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/pom.xml?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/pom.xml (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/pom.xml Sun Jan 11 13:58:21 2009
@@ -271,7 +271,7 @@
                     </execution>
                 </executions>
                 <dependencies>
-                    <!-- om objects implement jetspeed APIs -->
+                    <!-- om objects implement Jetspeed APIs -->
                     <dependency>
                         <groupId>${pom.groupId}</groupId>
                         <artifactId>jetspeed-api</artifactId>

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderBaseMenuDefinitionMetadata.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderBaseMenuDefinitionMetadata.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderBaseMenuDefinitionMetadata.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderBaseMenuDefinitionMetadata.java Sun Jan 11 13:58:21 2009
@@ -33,7 +33,7 @@
 import org.apache.jetspeed.om.page.PageMetadataImpl;
 import org.apache.jetspeed.om.page.jpa.MetadataLocalizedFieldCollection;
 import org.apache.jetspeed.om.portlet.GenericMetadata;
-import org.apache.jetspeed.page.impl.DatabasePageManagerUtils;
+import org.apache.jetspeed.page.jpa.DatabasePageManagerUtils;
 
 /**
  * FolderBaseMenuDefinitionMetadata

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderImpl.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderImpl.java Sun Jan 11 13:58:21 2009
@@ -125,6 +125,19 @@
     private List menus;
 
     @PostLoad
+    private void postLoad()
+    {
+        eagerFetchReferences();
+        eagerFetchCollections();
+        eagerFetchEmbeddedCollections();
+    }
+    private void eagerFetchReferences()
+    {
+        if (parent != null)
+        {
+            parent.getName();
+        }
+    }
     private void eagerFetchCollections()
     {
         if (metadataFields != null)
@@ -139,7 +152,6 @@
         {
             menus.size();
         }
-        eagerFetchEmbeddedCollections();
     }
     
     @Transient

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/BaseElementImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/BaseElementImpl.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/BaseElementImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/BaseElementImpl.java Sun Jan 11 13:58:21 2009
@@ -124,18 +124,26 @@
      */
     public PageManager getPageManager()
     {
-        // page manager should never be null
+        // page manager should never be null: log
+        // error since this is unexpected
         if (pageManager == null)
         {
-            // log error since this is unexpected
             log.error("Element "+name+" not managed: operations probably invoked before element added to page manager");
         }
         return pageManager;
     }
 
     /**
-     * setPageManager
+     * Test infused page manager for this element.
      *
+     * @param pageManager page manager.
+     */
+    public boolean testPageManager(DatabasePageManager pageManager)
+    {
+        return (this.pageManager == pageManager);
+    }
+
+    /**
      * Infuses page manager for use by this element.
      *
      * @param pageManager page manager that manages this element.

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/BaseMetadataLocalizedFieldImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/BaseMetadataLocalizedFieldImpl.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/BaseMetadataLocalizedFieldImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/BaseMetadataLocalizedFieldImpl.java Sun Jan 11 13:58:21 2009
@@ -173,6 +173,10 @@
      */
     public static String localeToString(Locale locale)
     {
+        if (locale == null)
+        {
+            return null;
+        }
         String country = locale.getCountry();
         String language = locale.getLanguage();
         String variant = locale.getVariant();
@@ -202,8 +206,12 @@
      */
     public static Locale stringToLocale(String locale)
     {
+        if (locale == null)
+        {
+            return null;
+        }
         StringTokenizer tokenizer = new StringTokenizer(locale, ",");
-        if (tokenizer.hasMoreTokens() == false)            
+        if (!tokenizer.hasMoreTokens())            
         {
             return JetspeedLocale.getDefaultLocale();
         }

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/FragmentImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/FragmentImpl.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/FragmentImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/FragmentImpl.java Sun Jan 11 13:58:21 2009
@@ -134,6 +134,11 @@
     private List preferences;
 
     @PostLoad
+    private void postLoad()
+    {
+        eagerFetchCollections();
+        eagerFetchEmbeddedCollections();
+    }
     private void eagerFetchCollections()
     {
         if (fragments != null)
@@ -144,7 +149,6 @@
         {
             preferences.size();
         }
-        eagerFetchEmbeddedCollections();
     }
 
     @Transient

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/LinkImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/LinkImpl.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/LinkImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/LinkImpl.java Sun Jan 11 13:58:21 2009
@@ -70,7 +70,7 @@
     @Column (name="IS_HIDDEN")
     private boolean hidden;
 
-    @ManyToOne (targetEntity=FolderImpl.class, fetch=FetchType.LAZY, optional=true, cascade=CascadeType.PERSIST)
+    @ManyToOne (targetEntity=FolderImpl.class, fetch=FetchType.LAZY, optional=false, cascade=CascadeType.PERSIST)
     @JoinColumn (name="PARENT_ID", referencedColumnName="FOLDER_ID")
     private FolderImpl parent;
     @OneToMany (targetEntity=LinkMetadataLocalizedFieldImpl.class, mappedBy="link", fetch=FetchType.LAZY, cascade=CascadeType.ALL)
@@ -86,13 +86,25 @@
     private String url;
 
     @PostLoad
+    private void postLoad()
+    {
+        eagerFetchReferences();
+        eagerFetchCollections();
+        eagerFetchEmbeddedCollections();
+    }
+    private void eagerFetchReferences()
+    {
+        if (parent != null)
+        {
+            parent.getName();
+        }
+    }
     private void eagerFetchCollections()
     {
         if (metadataFields != null)
         {
             metadataFields.size();
         }
-        eagerFetchEmbeddedCollections();
     }
 
     /**

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageBaseMenuDefinitionMetadata.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageBaseMenuDefinitionMetadata.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageBaseMenuDefinitionMetadata.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageBaseMenuDefinitionMetadata.java Sun Jan 11 13:58:21 2009
@@ -32,7 +32,7 @@
 
 import org.apache.jetspeed.om.page.PageMetadataImpl;
 import org.apache.jetspeed.om.portlet.GenericMetadata;
-import org.apache.jetspeed.page.impl.DatabasePageManagerUtils;
+import org.apache.jetspeed.page.jpa.DatabasePageManagerUtils;
 
 /**
  * PageBaseMenuDefinitionMetadata

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageImpl.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageImpl.java Sun Jan 11 13:58:21 2009
@@ -80,7 +80,7 @@
     @Column (name="IS_HIDDEN")
     private boolean hidden;
 
-    @ManyToOne (targetEntity=FolderImpl.class, fetch=FetchType.LAZY, optional=true, cascade=CascadeType.PERSIST)
+    @ManyToOne (targetEntity=FolderImpl.class, fetch=FetchType.LAZY, optional=false, cascade=CascadeType.PERSIST)
     @JoinColumn (name="PARENT_ID", referencedColumnName="FOLDER_ID")
     private FolderImpl parent;
     @OneToMany (targetEntity=PageMetadataLocalizedFieldImpl.class, mappedBy="page", fetch=FetchType.LAZY, cascade=CascadeType.ALL)
@@ -101,6 +101,19 @@
     private List menus;
 
     @PostLoad
+    private void postLoad()
+    {
+        eagerFetchReferences();
+        eagerFetchCollections();
+        eagerFetchEmbeddedCollections();
+    }
+    private void eagerFetchReferences()
+    {
+        if (parent != null)
+        {
+            parent.getName();
+        }
+    }
     private void eagerFetchCollections()
     {
         if (metadataFields != null)
@@ -115,7 +128,6 @@
         {
             menus.size();
         }
-        eagerFetchEmbeddedCollections();
     }
 
     @Transient

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageSecurityImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageSecurityImpl.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageSecurityImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageSecurityImpl.java Sun Jan 11 13:58:21 2009
@@ -63,7 +63,7 @@
                @NamedQuery(name="PAGE_SECURITY", query="select ps from PageSecurity ps where ps.path = :path")})
 public class PageSecurityImpl extends DocumentImpl implements PageSecurity
 {
-    @ManyToOne (targetEntity=FolderImpl.class, fetch=FetchType.LAZY, optional=true, cascade=CascadeType.PERSIST)
+    @ManyToOne (targetEntity=FolderImpl.class, fetch=FetchType.LAZY, optional=false, cascade=CascadeType.PERSIST)
     @JoinColumn (name="PARENT_ID", referencedColumnName="FOLDER_ID")
     private FolderImpl parent;
     @OneToMany (targetEntity=SecurityConstraintsDefImpl.class, mappedBy="pageSecurity", fetch=FetchType.LAZY, cascade=CascadeType.ALL)
@@ -74,6 +74,18 @@
     private List globalConstraintsRefs;
     
     @PostLoad
+    private void postLoad()
+    {
+        eagerFetchReferences();
+        eagerFetchCollections();
+    }
+    private void eagerFetchReferences()
+    {
+        if (parent != null)
+        {
+            parent.getName();
+        }
+    }
     private void eagerFetchCollections()
     {
         if (constraintsDefs != null)

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/AbstractPageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/AbstractPageManager.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/AbstractPageManager.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/AbstractPageManager.java Sun Jan 11 13:58:21 2009
@@ -153,31 +153,6 @@
     }
 
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.PageManager#registerContext(java.lang.Object)
-     */
-    public void registerContext(Object context)
-    {
-        // no context supported by default
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.PageManager#getContext()
-     */
-    public Object getContext()
-    {
-        // no context supported by default
-        return null;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.PageManager#unregisterContext(java.lang.Object)
-     */
-    public void unregisterContext(Object context)
-    {
-        // no context supported by default
-    }
-
-    /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#newPage(java.lang.String)
      */
     public Page newPage(String path)

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java Sun Jan 11 13:58:21 2009
@@ -188,30 +188,6 @@
     }
 
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.PageManager#registerContext(java.lang.Object)
-     */
-    public void registerContext(Object context)
-    {
-        delegator.registerContext(context);
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.PageManager#getContext()
-     */
-    public Object getContext()
-    {
-        return delegator.getContext();
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.PageManager#unregisterContext(java.lang.Object)
-     */
-    public void unregisterContext(Object context)
-    {
-        delegator.unregisterContext(context);
-    }
-
-    /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#newPage(java.lang.String)
      */
     public Page newPage(String path)

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/DatabasePageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/DatabasePageManager.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/DatabasePageManager.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/DatabasePageManager.java Sun Jan 11 13:58:21 2009
@@ -16,6 +16,8 @@
  */
 package org.apache.jetspeed.page.jpa;
 
+import javax.persistence.EntityManager;
+
 import org.apache.jetspeed.page.PageManager;
 
 /**
@@ -42,4 +44,34 @@
      * @return global cached constraints version
      */
     public long getCachedConstraintsVersion();
+
+    /**
+     * Return entity manager associated with current thread from
+     * registered context or default transactional entity manager
+     * created for this request.
+     * 
+     * @return entity manager.
+     */
+    public EntityManager getEntityManager();
+
+    /**
+     * Register page manager context with current thread.
+     * 
+     * @param context page manager context.
+     */
+    public void registerContext(Object context);
+
+    /**
+     * Get page manager context registered with current thread.
+     * 
+     * @return page manager context.
+     */
+    public Object getContext();
+
+    /**
+     * Unregister page manager context with current thread.
+     * 
+     * @param context page manager context.
+     */
+    public void unregisterContext(Object context);
 }

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/DatabasePageManagerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/DatabasePageManagerImpl.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/DatabasePageManagerImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/DatabasePageManagerImpl.java Sun Jan 11 13:58:21 2009
@@ -23,11 +23,12 @@
 import java.util.List;
 import java.util.Map;
 
-import javax.persistence.EntityExistsException;
 import javax.persistence.EntityManager;
 import javax.persistence.NoResultException;
 import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
 import javax.persistence.Query;
+
 import javax.security.auth.Subject;
 
 import org.apache.jetspeed.JetspeedActions;
@@ -152,6 +153,18 @@
     }
 
     /**
+     * Inject proxied page manager interface used to
+     * inject into Folder instances to provide
+     * transaction/interception.
+     *
+     * @param proxy proxied page manager interface.
+     */
+    public void setDatabasePageManagerProxy(DatabasePageManager proxy)
+    {
+        databasePageManagerProxy = proxy;
+    }
+
+    /**
      * Inject shared entity manager from assembly; this entity
      * manager is expected to honor existing entity manager
      * context attached to current thread, (otherwise, a new
@@ -159,14 +172,23 @@
      * 
      * @param entityManager injected shared entity manager
      */
-    @PersistenceContext (unitName="jetspeed-page-manager")
+    @PersistenceContext (type=PersistenceContextType.TRANSACTION, unitName="jetspeed-page-manager")
     public void setEntityManager(EntityManager entityManager) 
     {
         this.entityManager = entityManager;
     }
     
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.PageManager#registerContext(java.lang.Object)
+     * @see org.apache.jetspeed.page.jpa.DatabasePageManager#getEntityManager()
+     */
+    public EntityManager getEntityManager()
+    {
+        DatabasePageManagerContext context = (DatabasePageManagerContext)getContext();
+        return ((context != null) ? context.getExtendedEntityManager() : entityManager);
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.jpa.DatabasePageManager#registerContext(java.lang.Object)
      */
     public void registerContext(Object context)
     {
@@ -178,7 +200,7 @@
     }
 
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.PageManager#getContext()
+     * @see org.apache.jetspeed.page.jpa.DatabasePageManager#getContext()
      */
     public Object getContext()
     {
@@ -186,7 +208,7 @@
     }
 
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.PageManager#unregisterContext(java.lang.Object)
+     * @see org.apache.jetspeed.page.jpa.DatabasePageManager#unregisterContext(java.lang.Object)
      */
     public void unregisterContext(Object context)
     {
@@ -197,31 +219,6 @@
         }
     }
 
-    /**
-     * Return entity manager associated with current thread from
-     * registered context or default transactional entity manager
-     * created for this request.
-     * 
-     * @return entity manager.
-     */
-    protected EntityManager getEntityManager()
-    {
-        DatabasePageManagerContext context = (DatabasePageManagerContext)getContext();
-        return ((context != null) ? context.getExtendedEntityManager() : entityManager);
-    }
-    
-    /**
-     * Inject proxied page manager interface used to
-     * inject into Folder instances to provide
-     * transaction/interception.
-     *
-     * @param proxy proxied page manager interface.
-     */
-    public void setDatabasePageManagerProxy(DatabasePageManager proxy)
-    {
-        databasePageManagerProxy = proxy;
-    }
-
     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.jpa.DatabasePageManager#getCachedConstraintsVersion()
      */
@@ -2031,7 +2028,7 @@
         {
             // skip if previously infused
             BaseElementImpl baseElement = (BaseElementImpl)element;
-            if (baseElement.getPageManager() != databasePageManagerProxy)
+            if (!baseElement.testPageManager(databasePageManagerProxy))
             {
                 // infuse base element
                 baseElement.setPageManager(databasePageManagerProxy);
@@ -2099,7 +2096,7 @@
             }
         }
         entityManager.remove(element);
-        // explicitly flush entity manager after update
+        // explicitly flush entity manager after remove
         entityManager.flush();
         return element;
     }

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/OpenJPADatabasePageManagerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/OpenJPADatabasePageManagerImpl.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/OpenJPADatabasePageManagerImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/OpenJPADatabasePageManagerImpl.java Sun Jan 11 13:58:21 2009
@@ -16,10 +16,11 @@
  */
 package org.apache.jetspeed.page.jpa;
 
-import javax.persistence.EntityExistsException;
+import javax.persistence.EntityManager;
 
 import org.apache.openjpa.conf.OpenJPAConfiguration;
-import org.apache.openjpa.event.RemoteCommitEvent;
+import org.apache.openjpa.datacache.DataCache;
+import org.apache.openjpa.datacache.DataCacheManager;
 import org.apache.openjpa.event.RemoteCommitEventManager;
 import org.apache.openjpa.event.RemoteCommitListener;
 import org.apache.openjpa.event.RemoteCommitProvider;
@@ -35,6 +36,7 @@
 public class OpenJPADatabasePageManagerImpl extends DatabasePageManagerImpl
 {
     private RemoteCommitEventManager openJPAEventManager;
+    private DataCache openJPASystemDataCache;
     private boolean distributed;
     private RemoteCommitListener listener;
     
@@ -63,7 +65,8 @@
     public void initialize()
     {
         // get OpenJPA entity manager and event manager
-        EntityManagerImpl openJPAEntityManager = (EntityManagerImpl)getEntityManager().getDelegate();
+        EntityManager entityManager = getEntityManager();
+        EntityManagerImpl openJPAEntityManager = (EntityManagerImpl)entityManager.getDelegate();
         if (openJPAEntityManager != null)
         {
             // check OpenJPA configuration for distributed operation
@@ -74,47 +77,20 @@
                 RemoteCommitProvider provider = openJPAEventManager.getRemoteCommitProvider();
                 distributed = ((provider != null) && !(provider instanceof SingleJVMRemoteCommitProvider));
             }
+            // access system wide data cache
+            DataCacheManager openJPADataCacheManager = configuration.getDataCacheManagerInstance();
+            openJPASystemDataCache = openJPADataCacheManager.getSystemDataCache();
         }
+        entityManager.close();
+
         // register remote listener for distributed operation
-        if ((openJPAEventManager != null) && distributed)
+        if ((openJPAEventManager != null) && (openJPASystemDataCache != null) && distributed)
         {
-            listener = new RemoteCommitListener()
-            {
-                /* (non-Javadoc)
-                 * @see org.apache.openjpa.event.RemoteCommitListener#afterCommit(org.apache.openjpa.event.RemoteCommitEvent)
-                 */
-                public void afterCommit(RemoteCommitEvent event)
-                {
-                    switch (event.getPayloadType())
-                    {
-                        case RemoteCommitEvent.PAYLOAD_EXTENTS :
-                        case RemoteCommitEvent.PAYLOAD_OIDS :
-                        case RemoteCommitEvent.PAYLOAD_OIDS_WITH_ADDS :
-                        {
-                            // node instance not generally available or worth
-                            // creating transactional scope to lookup from oids:
-                            // notify page manager listeners with unspecified
-                            // updated node
-                            notifyUpdatedNode(null);
-                        }
-                        break;
-                        case RemoteCommitEvent.PAYLOAD_LOCAL_STALE_DETECTION :
-                        default :
-                        {
-                            // ignore local or unknown payloads.
-                        }
-                        break;
-                    }
-                }
-
-                /* (non-Javadoc)
-                 * @see org.apache.openjpa.event.RemoteCommitListener#close()
-                 */
-                public void close()
-                {
-                }                
-            };
-            openJPAEventManager.addListener(listener);
+            listener = new OpenJPARemoteCommitListenerImpl(this, openJPASystemDataCache);
+            // add as an internal listener to receive events
+            // before underlying caches so that oids can be
+            // looked up in the internal system caches
+            openJPAEventManager.addInternalListener(listener);
         }
     }
 

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/OpenJPARemoteCommitListenerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/OpenJPARemoteCommitListenerImpl.java?rev=733524&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/OpenJPARemoteCommitListenerImpl.java (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/OpenJPARemoteCommitListenerImpl.java Sun Jan 11 13:58:21 2009
@@ -0,0 +1,189 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.page.jpa;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jetspeed.page.document.Node;
+import org.apache.jetspeed.om.folder.jpa.FolderImpl;
+import org.apache.jetspeed.om.page.jpa.LinkImpl;
+import org.apache.jetspeed.om.page.jpa.PageImpl;
+import org.apache.jetspeed.om.page.jpa.PageSecurityImpl;
+import org.apache.openjpa.datacache.DataCache;
+import org.apache.openjpa.datacache.DataCachePCData;
+import org.apache.openjpa.event.RemoteCommitEvent;
+import org.apache.openjpa.event.RemoteCommitListener;
+
+/**
+ * OpenJPARemoteCommitListenerImpl
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $
+ */
+public class OpenJPARemoteCommitListenerImpl implements RemoteCommitListener
+{
+    private static final Log log = LogFactory.getLog(OpenJPARemoteCommitListenerImpl.class);
+
+    private DatabasePageManager databasePageManager;
+    private DataCache openJPASystemDataCache;
+    
+    public OpenJPARemoteCommitListenerImpl(DatabasePageManager databasePageManager, DataCache openJPASystemDataCache)
+    {
+        this.databasePageManager = databasePageManager;
+        this.openJPASystemDataCache = openJPASystemDataCache;
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.openjpa.event.RemoteCommitListener#afterCommit(org.apache.openjpa.event.RemoteCommitEvent)
+     */
+    public void afterCommit(RemoteCommitEvent event)
+    {
+        try
+        {
+            switch (event.getPayloadType())
+            {
+                case RemoteCommitEvent.PAYLOAD_OIDS_WITH_ADDS :
+                case RemoteCommitEvent.PAYLOAD_OIDS :
+                {
+                    // lookup oids in system cache if available
+                    if (openJPASystemDataCache != null)
+                    {
+                        // get payload delete/update oid/class pairs from event
+                        class PayloadOidClassPairData
+                        {
+                            Object payloadOid;
+                            Class payloadClass;
+                            Node payloadNode;
+                            PayloadOidClassPairData(Object payloadOid,Class payloadClass)
+                            {
+                                this.payloadOid = payloadOid;
+                                this.payloadClass = payloadClass;
+                            }
+                        }
+                        List<PayloadOidClassPairData> payloadOidClassPairsData = new ArrayList<PayloadOidClassPairData>();
+                        Collection deletedIds = event.getDeletedObjectIds();
+                        if (deletedIds != null)
+                        {
+                            for (Iterator iter = deletedIds.iterator(); iter.hasNext();)
+                            {
+                                DataCachePCData cacheData = openJPASystemDataCache.get(iter.next());
+                                if ((cacheData != null) && (cacheData.getId() != null) && (cacheData.getType() != null))
+                                {
+                                    payloadOidClassPairsData.add(new PayloadOidClassPairData(cacheData.getId(), cacheData.getType()));
+                                }
+                            }
+                        }
+                        Collection updatedIds = event.getUpdatedObjectIds();
+                        if (updatedIds != null)
+                        {
+                            for (Iterator iter = updatedIds.iterator(); iter.hasNext();)
+                            {
+                                DataCachePCData cacheData = openJPASystemDataCache.get(iter.next());
+                                if ((cacheData != null) && (cacheData.getId() != null) && (cacheData.getType() != null))
+                                {
+                                    payloadOidClassPairsData.add(new PayloadOidClassPairData(cacheData.getId(), cacheData.getType()));
+                                }
+                            }
+                        }
+
+                        // lookup payload nodes, (nodes will be detached)
+                        if ((payloadOidClassPairsData != null) && !payloadOidClassPairsData.isEmpty())
+                        {
+                            // get transient entity manager for lookups
+                            EntityManager entityManager = databasePageManager.getEntityManager();
+                            try
+                            {
+                                // lookup payload node from oid/class pair
+                                for (Iterator<PayloadOidClassPairData> iter = payloadOidClassPairsData.iterator(); iter.hasNext();)
+                                {
+                                    PayloadOidClassPairData data = iter.next();
+                                    // check class for node types
+                                    if (data.payloadClass.equals(PageImpl.class) || data.payloadClass.equals(FolderImpl.class) || data.payloadClass.equals(LinkImpl.class) || data.payloadClass.equals(PageSecurityImpl.class))
+                                    {
+                                        data.payloadNode = (Node)entityManager.find(data.payloadClass, data.payloadOid);
+                                    }
+                                    // remove payload data if node not found
+                                    if (data.payloadNode == null)
+                                    {
+                                        iter.remove();
+                                    }
+                                }
+                            }
+                            finally
+                            {
+                                entityManager.close();
+                            }
+                        }
+                        
+                        // send updated notification for each node looked up
+                        // successfully or a single notification with an
+                        // unspecified update node
+                        if ((payloadOidClassPairsData != null) && !payloadOidClassPairsData.isEmpty())
+                        {
+                            for (PayloadOidClassPairData data : payloadOidClassPairsData)
+                            {
+                                databasePageManager.notifyUpdatedNode(data.payloadNode);
+                            }
+                        }
+                        else
+                        {
+                            databasePageManager.notifyUpdatedNode(null);
+                        }
+                    }
+                    else
+                    {
+                        // node instances not available: notify page manager
+                        // listeners with unspecified updated node
+                        databasePageManager.notifyUpdatedNode(null);                                    
+                    }
+                }
+                break;
+                case RemoteCommitEvent.PAYLOAD_EXTENTS :
+                {
+                    // node instances not available: notify page manager
+                    // listeners with unspecified updated node
+                    databasePageManager.notifyUpdatedNode(null);
+                }
+                break;
+                case RemoteCommitEvent.PAYLOAD_LOCAL_STALE_DETECTION :
+                default :
+                {
+                    // ignore local or unknown payloads.
+                }
+                break;
+            }
+        }
+        catch (Exception e)
+        {
+            log.error("Unexpected exception handling remote commit event: "+e, e);
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.openjpa.event.RemoteCommitListener#close()
+     */
+    public void close()
+    {
+    }                
+}

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/resources/META-INF/persistence.xml?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/resources/META-INF/persistence.xml (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/resources/META-INF/persistence.xml Sun Jan 11 13:58:21 2009
@@ -1,4 +1,20 @@
 <?xml version="1.0"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
 <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
 
     <persistence-unit name="jetspeed-page-manager">

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestDatabasePageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestDatabasePageManager.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestDatabasePageManager.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestDatabasePageManager.java Sun Jan 11 13:58:21 2009
@@ -20,7 +20,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
-import org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase;
+import org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase;
 import org.apache.jetspeed.om.common.SecurityConstraint;
 import org.apache.jetspeed.om.common.SecurityConstraintsContext;
 import org.apache.jetspeed.om.folder.Folder;
@@ -50,7 +50,7 @@
  * @version $Id: $
  *          
  */
-public class TestDatabasePageManager extends DatasourceEnabledSpringTestCase implements PageManagerTestShared
+public class TestDatabasePageManager extends JPADatasourceEnabledSpringTestCase implements PageManagerTestShared
 {
     private static final String deepFolderPath = "/__subsite-rootx/_user/userx/_role/rolex/_group/groupx/_mediatype/xhtml/_language/en/_country/us/_custom/customx";
     private static final String deepPagePath = deepFolderPath + "/default-page.psml";       
@@ -66,17 +66,6 @@
     }
     
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase#setUp()
-     */
-    protected void setUp() throws Exception
-    {
-        // setup
-        super.setUp();
-        // start test conversational transaction
-        startConversationalTxn();
-    }
-
-    /* (non-Javadoc)
      * @see org.apache.jetspeed.components.test.AbstractSpringTestCase#getConfigurations()
      */
     protected String[] getConfigurations()
@@ -84,33 +73,6 @@
         return new String[]{"database-page-manager.xml", "transaction.xml"};
     }
 
-    /**
-     * Start conversational transaction for current thread.
-     */
-    protected void startConversationalTxn()
-    {
-        // N/A for OJB based implementation with detached object caches.
-    }
-    
-    /**
-     * End conversational transaction for current thread.
-     */
-    protected void endConversationalTxn()
-    {
-        // N/A for OJB based implementation with detached object caches.
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase#tearDown()
-     */
-    protected void tearDown() throws Exception
-    {
-        // end test conversational transaction
-        endConversationalTxn();
-        // teardown
-        super.tearDown();
-    }
-    
     public void firstTestSetup() throws Exception
     {
         try

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestOpenJPADatabasePageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestOpenJPADatabasePageManager.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestOpenJPADatabasePageManager.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestOpenJPADatabasePageManager.java Sun Jan 11 13:58:21 2009
@@ -50,7 +50,7 @@
     }
     
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.TestDatabasePageManager#startConversationalTxn()
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#startConversationalTxn()
      */
     protected void startConversationalTxn()
     {
@@ -59,7 +59,7 @@
     }
     
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.TestDatabasePageManager#endConversationalTxn()
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#endConversationalTxn()
      */
     protected void endConversationalTxn()
     {

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestOpenJPATransactions.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestOpenJPATransactions.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestOpenJPATransactions.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestOpenJPATransactions.java Sun Jan 11 13:58:21 2009
@@ -52,7 +52,7 @@
     }
     
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.TestDatabasePageManager#startConversationalTxn()
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#startConversationalTxn()
      */
     protected void startConversationalTxn()
     {
@@ -61,7 +61,7 @@
     }
     
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.TestDatabasePageManager#endConversationalTxn()
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#endConversationalTxn()
      */
     protected void endConversationalTxn()
     {

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestSecureDatabasePageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestSecureDatabasePageManager.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestSecureDatabasePageManager.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestSecureDatabasePageManager.java Sun Jan 11 13:58:21 2009
@@ -16,7 +16,7 @@
  */
 package org.apache.jetspeed.page;
 
-import org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase;
+import org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase;
 
 import junit.framework.Test;
 import junit.framework.TestSuite;
@@ -28,7 +28,7 @@
  * @version $Id: $
  *          
  */
-public class TestSecureDatabasePageManager extends DatasourceEnabledSpringTestCase implements PageManagerTestShared
+public class TestSecureDatabasePageManager extends JPADatasourceEnabledSpringTestCase implements PageManagerTestShared
 {
     /**
      * Create test suite.
@@ -42,17 +42,6 @@
     }
     
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase#setUp()
-     */
-    protected void setUp() throws Exception
-    {
-        // setup
-        super.setUp();
-        // start test conversational transaction
-        startConversationalTxn();
-    }
-
-    /* (non-Javadoc)
      * @see org.apache.jetspeed.components.test.AbstractSpringTestCase#getConfigurations()
      */
     protected String[] getConfigurations()
@@ -60,33 +49,6 @@
         return new String[]{"secure-database-page-manager.xml", "transaction.xml"};
     }
 
-    /**
-     * Start conversational transaction for current thread.
-     */
-    protected void startConversationalTxn()
-    {
-        // N/A for OJB based implementation with detached object caches.
-    }
-    
-    /**
-     * End conversational transaction for current thread.
-     */
-    protected void endConversationalTxn()
-    {
-        // N/A for OJB based implementation with detached object caches.
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase#tearDown()
-     */
-    protected void tearDown() throws Exception
-    {
-        // end test conversational transaction
-        endConversationalTxn();
-        // teardown
-        super.tearDown();
-    }    
-    
     public void testSecurePageManager() throws Exception
     {
         // utilize standard secure page manager test

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestSecureOpenJPADatabasePageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestSecureOpenJPADatabasePageManager.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestSecureOpenJPADatabasePageManager.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestSecureOpenJPADatabasePageManager.java Sun Jan 11 13:58:21 2009
@@ -52,7 +52,7 @@
     }
     
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.TestDatabasePageManager#startConversationalTxn()
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#startConversationalTxn()
      */
     protected void startConversationalTxn()
     {
@@ -61,7 +61,7 @@
     }
     
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.TestDatabasePageManager#endConversationalTxn()
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#endConversationalTxn()
      */
     protected void endConversationalTxn()
     {

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestSecurePermissionsOpenJPADatabasePageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestSecurePermissionsOpenJPADatabasePageManager.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestSecurePermissionsOpenJPADatabasePageManager.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestSecurePermissionsOpenJPADatabasePageManager.java Sun Jan 11 13:58:21 2009
@@ -52,7 +52,7 @@
     }
     
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.TestDatabasePageManager#startConversationalTxn()
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#startConversationalTxn()
      */
     protected void startConversationalTxn()
     {
@@ -61,7 +61,7 @@
     }
     
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.TestDatabasePageManager#endConversationalTxn()
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#endConversationalTxn()
      */
     protected void endConversationalTxn()
     {

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestTransactions.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestTransactions.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestTransactions.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestTransactions.java Sun Jan 11 13:58:21 2009
@@ -19,7 +19,7 @@
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
-import org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase;
+import org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase;
 import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.page.Page;
 
@@ -31,7 +31,7 @@
  * @version $Id: $
  *          
  */
-public class TestTransactions extends DatasourceEnabledSpringTestCase implements PageManagerTestShared
+public class TestTransactions extends JPADatasourceEnabledSpringTestCase implements PageManagerTestShared
 {
     /**
      * Create test suite.
@@ -45,17 +45,6 @@
     }
     
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase#setUp()
-     */
-    protected void setUp() throws Exception
-    {
-        // setup
-        super.setUp();
-        // start test conversational transaction
-        startConversationalTxn();
-    }
-
-    /* (non-Javadoc)
      * @see org.apache.jetspeed.components.test.AbstractSpringTestCase#getConfigurations()
      */
     protected String[] getConfigurations()
@@ -63,33 +52,6 @@
         return new String[]{"database-page-manager.xml", "transaction.xml"}; 
     }
 
-    /**
-     * Start conversational transaction for current thread.
-     */
-    protected void startConversationalTxn()
-    {
-        // N/A for OJB based implementation with detached object caches.
-    }
-    
-    /**
-     * End conversational transaction for current thread.
-     */
-    protected void endConversationalTxn()
-    {
-        // N/A for OJB based implementation with detached object caches.
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase#tearDown()
-     */
-    protected void tearDown() throws Exception
-    {
-        // end test conversational transaction
-        endConversationalTxn();
-        // teardown
-        super.tearDown();
-    }
-    
     public void testTx() throws Exception
     {
         PageManager pageManager = (PageManager)scm.getComponent("pageManager");

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/resources/jpa-database-page-manager.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/resources/jpa-database-page-manager.xml?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/resources/jpa-database-page-manager.xml (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/resources/jpa-database-page-manager.xml Sun Jan 11 13:58:21 2009
@@ -39,6 +39,7 @@
     </bean>
     <bean id="abstractEntityManagerFactory" abstract="true" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
         <property name="persistenceUnitManager" ref="persistenceUnitManager"/>
+        <property name="persistenceUnitName" value="jetspeed-page-manager"/>
     </bean>
 
     <!-- Spring/JPA Transaction Manager -->

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-portal/src/test/java/org/apache/jetspeed/tools/pamanager/TestPortletDescriptorSecurityRoles.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-portal/src/test/java/org/apache/jetspeed/tools/pamanager/TestPortletDescriptorSecurityRoles.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-portal/src/test/java/org/apache/jetspeed/tools/pamanager/TestPortletDescriptorSecurityRoles.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-portal/src/test/java/org/apache/jetspeed/tools/pamanager/TestPortletDescriptorSecurityRoles.java Sun Jan 11 13:58:21 2009
@@ -79,7 +79,7 @@
     {
         System.out.println("Testing securityRoles");
         File warFile = new File(getBaseDir()+"src/test/testdata/deploy/webapp");
-        JetspeedDescriptorService descriptorService = new JetspeedDescriptorServiceImpl(new PortletAppDescriptorServiceImpl());
+        JetspeedDescriptorService descriptorService = new JetspeedDescriptorServiceImpl(new PortletAppDescriptorServiceImpl(), portletRegistry);
         PortletApplicationWar paWar = new PortletApplicationWar(new DirectoryHelper(warFile), "unit-test", "/", descriptorService );
 
         PortletApplication portletApp = null;

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-portal/src/test/java/org/apache/jetspeed/userinfo/TestUserInfoManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-portal/src/test/java/org/apache/jetspeed/userinfo/TestUserInfoManager.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-portal/src/test/java/org/apache/jetspeed/userinfo/TestUserInfoManager.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-portal/src/test/java/org/apache/jetspeed/userinfo/TestUserInfoManager.java Sun Jan 11 13:58:21 2009
@@ -90,7 +90,7 @@
 
     private void innerTestSetUserInfoMap(UserInfoManager uim) throws Exception
     {
-        JetspeedDescriptorService descriptorService = new JetspeedDescriptorServiceImpl(new PortletAppDescriptorServiceImpl());
+        JetspeedDescriptorService descriptorService = new JetspeedDescriptorServiceImpl(new PortletAppDescriptorServiceImpl(), portletRegistry);
         InputStream webDescriptor = new FileInputStream(getBaseDir()+"src/test/testdata/deploy/web.xml");
         InputStream portletDescriptor = new FileInputStream(getBaseDir()+"src/test/testdata/deploy/portlet.xml");
         InputStream jetspeedPortletDescriptor = new FileInputStream(getBaseDir()+"src/test/testdata/deploy/jetspeed-portlet.xml");

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/util/jpa/JPADatasourceEnabledSpringTestCase.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/util/jpa/JPADatasourceEnabledSpringTestCase.java?rev=733524&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/util/jpa/JPADatasourceEnabledSpringTestCase.java (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/util/jpa/JPADatasourceEnabledSpringTestCase.java Sun Jan 11 13:58:21 2009
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.components.util.jpa;
+
+import org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase;
+
+/**
+ * JPADatasourceEnabledSpringTestCase
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $
+ */
+public abstract class JPADatasourceEnabledSpringTestCase extends DatasourceEnabledSpringTestCase
+{
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase#setUp()
+     */
+    protected void setUp() throws Exception
+    {
+        // setup
+        super.setUp();
+        // start optional test JPA conversational transaction
+        startConversationalTxn();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase#tearDown()
+     */
+    protected void tearDown() throws Exception
+    {
+        // end optional test JPA conversational transaction
+        endConversationalTxn();
+        // teardown
+        super.tearDown();
+    }
+    
+    /**
+     * Start optional JPA conversational transaction for current thread.
+     */
+    protected void startConversationalTxn()
+    {
+    }
+    
+    /**
+     * End optional JPA conversational transaction for current thread.
+     */
+    protected void endConversationalTxn()
+    {
+    }
+}

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/pom.xml?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/pom.xml (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/pom.xml Sun Jan 11 13:58:21 2009
@@ -70,6 +70,14 @@
             <groupId>commons-collections</groupId>
             <artifactId>commons-collections</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.openjpa</groupId>
+            <artifactId>openjpa-persistence-jdbc</artifactId>
+        </dependency>        
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring</artifactId>
+        </dependency>    
 
         <!-- Test Dependencies -->
         <dependency>
@@ -168,6 +176,113 @@
                     </execution>
                 </executions>
             </plugin>
+ 	        <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>openjpa-maven-plugin</artifactId>
+                <version>1.0-alpha</version>
+                <executions>
+                    <execution>
+                        <id>org.apache.jetspeed.om.portlet.jpa</id>
+                        <phase>process-classes</phase>
+                        <goals>
+                            <goal>enhance</goal>
+                        </goals>
+                        <configuration>
+                            <classes>${project.build.directory}/classes/org/apache/jetspeed/om/portlet/jpa</classes>                   	  
+                            <toolProperties>                      	 
+                                <property>
+                                    <name>addDefaultConstructor</name>
+                                    <value>true</value>
+                                </property>
+                                <property>
+                                    <name>enforcePropertyRestrictions</name>
+                                    <value>true</value>
+                                </property>
+                            </toolProperties>
+                        </configuration>                  
+                    </execution>
+                    <execution>
+                        <id>org.apache.jetspeed.components.portletentity.jpa</id>
+                        <phase>process-classes</phase>
+                        <goals>
+                            <goal>enhance</goal>
+                        </goals>
+                        <configuration>
+                            <classes>${project.build.directory}/classes/org/apache/jetspeed/components/portletentity/jpa</classes>                   	  
+                            <toolProperties>                      	 
+                                <property>
+                                    <name>addDefaultConstructor</name>
+                                    <value>true</value>
+                                </property>
+                                <property>
+                                    <name>enforcePropertyRestrictions</name>
+                                    <value>true</value>
+                                </property>
+                            </toolProperties>
+                        </configuration>                  
+                    </execution>
+                    <execution>
+                        <id>org.apache.jetspeed.components.portletpreferences.jpa</id>
+                        <phase>process-classes</phase>
+                        <goals>
+                            <goal>enhance</goal>
+                        </goals>
+                        <configuration>
+                            <classes>${project.build.directory}/classes/org/apache/jetspeed/components/portletpreferences/jpa</classes>                   	  
+                            <toolProperties>                      	 
+                                <property>
+                                    <name>addDefaultConstructor</name>
+                                    <value>true</value>
+                                </property>
+                                <property>
+                                    <name>enforcePropertyRestrictions</name>
+                                    <value>true</value>
+                                </property>
+                            </toolProperties>
+                        </configuration>                  
+                    </execution>
+                    <execution>
+                        <id>org.apache.jetspeed.components.portletregistry.jpa</id>
+                        <phase>process-classes</phase>
+                        <goals>
+                            <goal>enhance</goal>
+                        </goals>
+                        <configuration>
+                            <classes>${project.build.directory}/classes/org/apache/jetspeed/components/portletregistry/jpa</classes>                   	  
+                            <toolProperties>                      	 
+                                <property>
+                                    <name>addDefaultConstructor</name>
+                                    <value>true</value>
+                                </property>
+                                <property>
+                                    <name>enforcePropertyRestrictions</name>
+                                    <value>true</value>
+                                </property>
+                            </toolProperties>
+                        </configuration>                  
+                    </execution>
+                </executions>
+                <dependencies>
+                    <!-- om objects implement Jetspeed/Pluto APIs -->
+                    <dependency>
+                        <groupId>${pom.groupId}</groupId>
+                        <artifactId>jetspeed-api</artifactId>
+                        <version>${pom.version}</version>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.apache.pluto</groupId>
+                        <artifactId>pluto-container-api</artifactId>
+                        <version>${org.apache.pluto.version}</version>
+                    </dependency>
+                    <!-- force upgrade of JPA for plugin -->
+                    <dependency>
+                        <groupId>org.apache.openjpa</groupId>
+                        <artifactId>openjpa-persistence-jdbc</artifactId>
+                        <version>${openjpa.version}</version>
+                        <scope>runtime</scope>
+                    </dependency>
+                </dependencies>
+            </plugin>
         </plugins>
         <testResources>
             <testResource>



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message