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 [6/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
Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/UserAttributeRefImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/UserAttributeRefImpl.java?rev=733524&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/UserAttributeRefImpl.java (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/UserAttributeRefImpl.java Sun Jan 11 13:58:21 2009
@@ -0,0 +1,181 @@
+/* 
+ * 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.om.portlet.jpa;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import javax.persistence.Basic;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.PostLoad;
+import javax.persistence.Table;
+import javax.persistence.Transient;
+import javax.persistence.Version;
+
+import org.apache.jetspeed.om.portlet.Description;
+import org.apache.jetspeed.om.portlet.UserAttribute;
+import org.apache.jetspeed.om.portlet.UserAttributeRef;
+import org.apache.jetspeed.util.JetspeedLocale;
+
+/**
+ * <p>User attribute ref implementation.</p>
+ * 
+ * @author <a href="mailto:dlestrat@apache.org">David Le Strat</a>
+ */
+@Entity (name="UserAttributeRef")
+@Table (name="USER_ATTRIBUTE_REF")
+public class UserAttributeRefImpl implements UserAttributeRef, Serializable, PortletDefinitionCollectionMember
+{
+    private static final long serialVersionUID = -3366771543188089494L;
+
+    // Members
+    
+    @Id
+    @GeneratedValue (strategy=GenerationType.AUTO)
+    @Column (name="ID")
+    private long id;
+    @Version
+    @Column (name="JPA_VERSION")
+    private int jpaVersion;
+    @ManyToOne (targetEntity=PortletApplicationDefinitionImpl.class, fetch=FetchType.LAZY, optional=false)
+    @JoinColumn (name="APPLICATION_ID", referencedColumnName="APPLICATION_ID")
+    private PortletApplicationDefinitionImpl app;
+    @Basic
+    @Column (name="NAME")
+    private String name;
+    @Basic
+    @Column (name="NAME_LINK")
+    private String nameLink;
+    @OneToMany (targetEntity=UserAttributeRefDescriptionImpl.class, mappedBy="owner", fetch=FetchType.LAZY, cascade=CascadeType.ALL)
+    private List<Description> descriptions;
+
+    @PostLoad
+    private void eagerFetchCollections()
+    {
+        if (descriptions != null)
+        {
+            descriptions.size();
+        }
+    }
+
+    @Transient
+    private transient PortletDefinitionList<Description> descriptionsList;     
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.om.portlet.jpa.PortletDefinitionCollectionMember#setInverseRelationship(java.lang.Object)
+     */
+    public void setInverseRelationship(Object inverse)
+    {
+        app = (PortletApplicationDefinitionImpl)inverse;
+    }
+    
+    // Implementation
+    
+    /**
+     * Default constructor.
+     */
+    public UserAttributeRefImpl()
+    {
+    }
+
+    /**
+     * <p>User attribute ref constructor given a {@link UserAttribute}.</p>
+     * @param The user attribute ref name.
+     * @param The user attribute ref name link.
+     */
+    public UserAttributeRefImpl(UserAttribute userAttribute)
+    {
+        this.name = userAttribute.getName();
+        for (Description d : userAttribute.getDescriptions())
+        {
+            addDescription(d.getLang()).setDescription(d.getDescription());
+        }
+    }
+    
+    public long getId()
+    {
+        return this.id;
+    }
+    
+    public void setId(long id)
+    {
+        this.id = id;
+    }
+     
+    public String getName()
+    {
+        return name;
+    }
+
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+
+    public String getNameLink()
+    {
+        return nameLink;
+    }
+
+    public void setNameLink(String nameLink)
+    {
+        this.nameLink = nameLink;
+    }
+
+    public Description getDescription(Locale locale)
+    {
+        return (Description)JetspeedLocale.getBestLocalizedObject(getDescriptions(), locale);
+    }
+    
+    public List<Description> getDescriptions()
+    {
+        if (descriptions == null)
+        {
+            descriptions = new ArrayList<Description>();
+        }
+        if (descriptionsList == null)
+        {
+            descriptionsList = new PortletDefinitionList<Description>(this, descriptions);
+        }
+        return descriptionsList;
+    }
+    
+    public Description addDescription(String lang)
+    {
+        UserAttributeRefDescriptionImpl d = new UserAttributeRefDescriptionImpl(this, lang);
+        for (Description desc : getDescriptions())
+        {
+            if (desc.getLocale().equals(d.getLocale()))
+            {
+                throw new IllegalArgumentException("Description for language: "+d.getLocale()+" already defined");
+            }
+        }
+        descriptionsList.add(d);
+        return d;
+    }
+}

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/resources/META-INF/persistence.xml?rev=733524&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/resources/META-INF/persistence.xml (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/resources/META-INF/persistence.xml Sun Jan 11 13:58:21 2009
@@ -0,0 +1,63 @@
+<?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-registry">
+
+        <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
+
+        <non-jta-data-source>jetspeed</non-jta-data-source>
+
+        <class>org.apache.jetspeed.components.portletentity.jpa.PortletEntityImpl</class>
+        <class>org.apache.jetspeed.components.portletpreferences.jpa.DatabasePreference</class>
+        <class>org.apache.jetspeed.components.portletpreferences.jpa.DatabasePreferenceValue</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.BaseLocalizedImpl</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.CustomPortletModeDescriptionImpl</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.CustomPortletModeImpl</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.CustomWindowStateDescriptionImpl</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.CustomWindowStateImpl</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.DescriptionImpl</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.DisplayNameImpl</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.InitParamDescriptionImpl</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.InitParamImpl</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.JetspeedServiceReferenceImpl</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.LanguageImpl</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.LocalizedFieldImpl</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.PortletApplicationDefinitionImpl</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.PortletApplicationDescriptionImpl</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.PortletApplicationDisplayNameImpl</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.PortletApplicationLocalizedFieldImpl</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.PortletDefinitionDescriptionImpl</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.PortletDefinitionDisplayNameImpl</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.PortletDefinitionImpl</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.PortletDefinitionLocalizedFieldImpl</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.SecurityRoleDescriptionImpl</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.SecurityRoleImpl</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.SecurityRoleRefDescriptionImpl</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.SecurityRoleRefImpl</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.SupportsImpl</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.UserAttributeDescriptionImpl</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.UserAttributeImpl</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.UserAttributeRefDescriptionImpl</class>
+        <class>org.apache.jetspeed.om.portlet.jpa.UserAttributeRefImpl</class>
+
+        <exclude-unlisted-classes>true</exclude-unlisted-classes>
+
+    </persistence-unit>
+
+</persistence>

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletentity/TestOpenJPAPortletEntityDAO.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletentity/TestOpenJPAPortletEntityDAO.java?rev=733524&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletentity/TestOpenJPAPortletEntityDAO.java (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletentity/TestOpenJPAPortletEntityDAO.java Sun Jan 11 13:58:21 2009
@@ -0,0 +1,89 @@
+/*
+ * 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.portletentity;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.jetspeed.components.portletregistry.jpa.RegistryManagerContext;
+
+/**
+ * TestOpenJPAPortletEntityDAO
+ * 
+ * @author <a href="rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $
+ *          
+ */
+public class TestOpenJPAPortletEntityDAO extends TestPortletEntityDAO
+{
+    private RegistryManagerContext context;
+
+    /**
+     * Create test suite.
+     * 
+     * @return test suite to execute.
+     */
+    public static Test suite()
+    {
+        // All methods starting with "test" will be executed in the test suite.
+        return new TestSuite(TestOpenJPAPortletEntityDAO.class);
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.portletentity.TestPortletEntityDAO#getBeanDefinitionFilterCategories()
+     */
+    protected String getBeanDefinitionFilterCategories()
+    {
+        return "default,jdbcDS";
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.portletentity.TestPortletEntityDAO#getConfigurations()
+     */
+    protected String[] getConfigurations()
+    {
+        return new String[]{"openjpa-registry.xml"};
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#startConversationalTxn()
+     */
+    protected void startConversationalTxn()
+    {
+        // create scoped context bean for thread transaction
+        context = (RegistryManagerContext)scm.createPrototypeComponent("registryManagerContext");
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#endConversationalTxn()
+     */
+    protected void endConversationalTxn()
+    {
+        // destroy scoped context bean for thread transaction
+        scm.destroyPrototypeComponent("registryManagerContext", context);
+    }
+
+    /**
+     * Test main entry point.
+     * 
+     * @param args process args
+     */
+    public static void main(String args[])
+    {
+        junit.awtui.TestRunner.main(new String[]{TestOpenJPAPortletEntityDAO.class.getName()});
+    }
+}

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletentity/TestPortletEntityDAO.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletentity/TestPortletEntityDAO.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletentity/TestPortletEntityDAO.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletentity/TestPortletEntityDAO.java Sun Jan 11 13:58:21 2009
@@ -24,7 +24,7 @@
 import org.apache.jetspeed.Jetspeed;
 import org.apache.jetspeed.components.portletregistry.PortletRegistry;
 import org.apache.jetspeed.components.portletentity.ContentFragmentTestImpl;
-import org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase;
+import org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase;
 import org.apache.jetspeed.container.PortletEntity;
 import org.apache.jetspeed.engine.MockJetspeedEngine;
 import org.apache.jetspeed.om.portlet.InitParam;
@@ -34,7 +34,6 @@
 import org.apache.jetspeed.om.page.ContentFragment;
 import org.apache.jetspeed.om.page.Fragment;
 import org.apache.jetspeed.om.portlet.PortletDefinition;
-import org.apache.jetspeed.om.portlet.impl.PortletApplicationDefinitionImpl;
 
 import org.apache.pluto.om.portlet.PortletApplicationDefinition;
 
@@ -50,7 +49,7 @@
  * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
  * @version $Id: TestPortletEntityDAO.java,v 1.3 2005/05/24 14:43:19 ate Exp $
  */
-public class TestPortletEntityDAO extends DatasourceEnabledSpringTestCase
+public class TestPortletEntityDAO extends JPADatasourceEnabledSpringTestCase
 {
     private static final String TEST_APP = "EntityTestApp";
 
@@ -93,6 +92,7 @@
     {
         PortletApplicationDefinition pa = registry.getPortletApplication(TEST_APP);
         assertNotNull("Portlet Application", pa);
+        assertTrue("Portlet Application Name", pa.getName().equals(TEST_APP));
         System.out.println("pa = " + pa.getName());
         List<PortletDefinition> portlets = (List<PortletDefinition>) pa.getPortlets(); // .get(JetspeedObjectID.createFromString(TEST_PORTLET));
         Iterator pi = portlets.iterator();
@@ -100,6 +100,7 @@
         while (pi.hasNext())
         {
             pd = (PortletDefinition) pi.next();
+            assertNotNull("Portlet Def application not set", pd.getApplication());
             assertTrue("Portlet Def not found", pd.getPortletName().equals("EntityTestPortlet"));
         }
         assertNotNull("Portlet Def is null", pd);
@@ -109,8 +110,8 @@
         mockf1.expects(new InvokeAtLeastOnceMatcher()).method("getId").will(new ReturnStub(TEST_ENTITY));
         ContentFragment f1 = new ContentFragmentTestImpl((Fragment) mockf1.proxy(), new HashMap());
 
-        PortletEntity entity = entityAccess
-                .generateEntityFromFragment(new ContentFragmentTestImpl(f1, new HashMap()));
+        PortletEntity entity = entityAccess.generateEntityFromFragment(new ContentFragmentTestImpl(f1, new HashMap()));
+        
         // TODO: how to access prefs of entity??
         /*
         PreferenceSetComposite prefs = (PreferenceSetComposite) entity.getPreferenceSet();
@@ -235,10 +236,8 @@
 
     private void teardownTestData() throws Exception
     {
-
         PortletEntity entity = entityAccess.getPortletEntity(TEST_ENTITY);
         System.out.println("entity == " + entity);
-
         if (entity != null)
         {
             entityAccess.removePortletEntity(entity);
@@ -250,7 +249,7 @@
         {
             registry.removeApplication(pa);
         }
-        
+
         // TODO: remove portletPreferences...
     }
 
@@ -258,18 +257,18 @@
     {
         String lang = Locale.getDefault().toString();
 
-        PortletApplicationDefinitionImpl app = new PortletApplicationDefinitionImpl();
+        PortletApplication app = registry.newPortletApplication();
         app.setName(TEST_APP);
         app.setContextRoot("/app1");
 
         PortletDefinition portlet = app.addPortlet(TEST_PORTLET);
         portlet.setPortletClass("org.apache.Portlet");
-        portlet.addDescription(lang).setDescription("Portlet description.");
+        //portlet.addDescription(lang).setDescription("Portlet description.");
         portlet.addDisplayName(lang).setDisplayName("Portlet display Name.");
         
         InitParam initParam = portlet.addInitParam("testparam");
         initParam.setParamValue("test value");
-        initParam.addDescription(lang).setDescription("This is a test portlet parameter");
+        //initParam.addDescription(lang).setDescription("This is a test portlet parameter");
         
         Preferences prefs = portlet.getPortletPreferences();
         Preference pref = prefs.addPreference("pref1");

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletpreferences/TestOpenJPAPortletPreferencesProvider.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletpreferences/TestOpenJPAPortletPreferencesProvider.java?rev=733524&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletpreferences/TestOpenJPAPortletPreferencesProvider.java (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletpreferences/TestOpenJPAPortletPreferencesProvider.java Sun Jan 11 13:58:21 2009
@@ -0,0 +1,89 @@
+/*
+ * 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.portletpreferences;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.jetspeed.components.portletregistry.jpa.RegistryManagerContext;
+
+/**
+ * TestOpenJPAPortletPreferencesProvider
+ * 
+ * @author <a href="rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $
+ *          
+ */
+public class TestOpenJPAPortletPreferencesProvider extends TestPortletPreferencesProvider
+{
+    private RegistryManagerContext context;
+
+    /**
+     * Create test suite.
+     * 
+     * @return test suite to execute.
+     */
+    public static Test suite()
+    {
+        // All methods starting with "test" will be executed in the test suite.
+        return new TestSuite(TestOpenJPAPortletPreferencesProvider.class);
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase#getBeanDefinitionFilterCategories()
+     */
+    protected String getBeanDefinitionFilterCategories()
+    {
+        return "default,jdbcDS";
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.portletpreferences.TestPortletPreferencesProvider#getConfigurations()
+     */
+    protected String[] getConfigurations()
+    {
+        return new String[]{"openjpa-registry.xml"};
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#startConversationalTxn()
+     */
+    protected void startConversationalTxn()
+    {
+        // create scoped context bean for thread transaction
+        context = (RegistryManagerContext)scm.createPrototypeComponent("registryManagerContext");
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#endConversationalTxn()
+     */
+    protected void endConversationalTxn()
+    {
+        // destroy scoped context bean for thread transaction
+        scm.destroyPrototypeComponent("registryManagerContext", context);
+    }
+
+    /**
+     * Test main entry point.
+     * 
+     * @param args process args
+     */
+    public static void main(String args[])
+    {
+        junit.awtui.TestRunner.main(new String[]{TestOpenJPAPortletPreferencesProvider.class.getName()});
+    }
+}

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletpreferences/TestPortletPreferencesProvider.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletpreferences/TestPortletPreferencesProvider.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletpreferences/TestPortletPreferencesProvider.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletpreferences/TestPortletPreferencesProvider.java Sun Jan 11 13:58:21 2009
@@ -17,11 +17,10 @@
 package org.apache.jetspeed.components.portletpreferences;
 
 import org.apache.jetspeed.Jetspeed;
-import org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase;
+import org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase;
 import org.apache.jetspeed.engine.MockJetspeedEngine;
 
-public class TestPortletPreferencesProvider extends
-		DatasourceEnabledSpringTestCase 
+public class TestPortletPreferencesProvider extends JPADatasourceEnabledSpringTestCase 
 {
 
     private static MockJetspeedEngine mockEngine = new MockJetspeedEngine();
@@ -39,24 +38,16 @@
         super.setUp();
         mockEngine.setComponentManager(scm);
         Jetspeed.setEngine(mockEngine);
-        this.prefs = (PortletPreferencesProvider) scm.getComponent("org.apache.jetspeed.components.portletpreferences.PortletPreferencesProvider");
-        PortletPreferencesProvider temp = (PortletPreferencesProvider) scm.getComponent("portletPreferencesProvider");
-        System.out.println("temp = " + temp);
-        System.out.println("prefs = " + prefs);        
-//        teardownTestData();
-//        setupTestData();
+        PortletPreferencesProvider prefs = (PortletPreferencesProvider) scm.getComponent("portletPreferencesProvider");
     }
 
     protected void tearDown() throws Exception
     {
-//        teardownTestData();
         Jetspeed.setEngine(null);
         super.tearDown();
     }
     
     public void testEntities() throws Exception
     {
-    	System.out.println("Testing baby");    	
-    }
-    
+    }    
 }

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/AbstractRegistryTest.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/AbstractRegistryTest.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/AbstractRegistryTest.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/AbstractRegistryTest.java Sun Jan 11 13:58:21 2009
@@ -21,19 +21,18 @@
 import java.util.Locale;
 
 import org.apache.jetspeed.Jetspeed;
-import org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase;
+import org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase;
 import org.apache.jetspeed.engine.MockJetspeedEngine;
 import org.apache.jetspeed.om.portlet.DublinCore;
 import org.apache.jetspeed.om.portlet.GenericMetadata;
 import org.apache.jetspeed.om.portlet.PortletApplication;
 import org.apache.jetspeed.om.portlet.PortletDefinition;
 import org.apache.jetspeed.om.portlet.impl.DublinCoreImpl;
-import org.apache.jetspeed.om.portlet.impl.PortletDefinitionImpl;
 
 /**
  * @author scott
  */
-public abstract class AbstractRegistryTest extends DatasourceEnabledSpringTestCase
+public abstract class AbstractRegistryTest extends JPADatasourceEnabledSpringTestCase
 {
 
     protected static final String PORTLET_0_CLASS = "com.portlet.MyClass0";
@@ -124,7 +123,7 @@
 
         app = registry.getPortletApplication("App_1");
 
-        portlet = (PortletDefinitionImpl) app.getPortlet("Portlet 1");
+        portlet = (PortletDefinition) app.getPortlet("Portlet 1");
 
         assertNotNull("Failed to reteive portlet application", app);
 

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestOpenJPAPortletRegistryDAO.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestOpenJPAPortletRegistryDAO.java?rev=733524&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestOpenJPAPortletRegistryDAO.java (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestOpenJPAPortletRegistryDAO.java Sun Jan 11 13:58:21 2009
@@ -0,0 +1,89 @@
+/*
+ * 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.portletregistry;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.jetspeed.components.portletregistry.jpa.RegistryManagerContext;
+
+/**
+ * TestOpenJPAPortletRegistryDAO
+ * 
+ * @author <a href="rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $
+ *          
+ */
+public class TestOpenJPAPortletRegistryDAO extends TestPortletRegistryDAO
+{
+    private RegistryManagerContext context;
+
+    /**
+     * Create test suite.
+     * 
+     * @return test suite to execute.
+     */
+    public static Test suite()
+    {
+        // All methods starting with "test" will be executed in the test suite.
+        return new TestSuite(TestOpenJPAPortletRegistryDAO.class);
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.portletregistry.TestPortletRegistryDAO#getBeanDefinitionFilterCategories()
+     */
+    protected String getBeanDefinitionFilterCategories()
+    {
+        return "default,jdbcDS";
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.portletregistry.TestPortletRegistryDAO#getConfigurations()
+     */
+    protected String[] getConfigurations()
+    {
+        return new String[]{"openjpa-registry.xml"};
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#startConversationalTxn()
+     */
+    protected void startConversationalTxn()
+    {
+        // create scoped context bean for thread transaction
+        context = (RegistryManagerContext)scm.createPrototypeComponent("registryManagerContext");
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#endConversationalTxn()
+     */
+    protected void endConversationalTxn()
+    {
+        // destroy scoped context bean for thread transaction
+        scm.destroyPrototypeComponent("registryManagerContext", context);
+    }
+
+    /**
+     * Test main entry point.
+     * 
+     * @param args process args
+     */
+    public static void main(String args[])
+    {
+        junit.awtui.TestRunner.main(new String[]{TestOpenJPAPortletRegistryDAO.class.getName()});
+    }
+}

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestOpenJPARegistryCache.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestOpenJPARegistryCache.java?rev=733524&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestOpenJPARegistryCache.java (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestOpenJPARegistryCache.java Sun Jan 11 13:58:21 2009
@@ -0,0 +1,89 @@
+/*
+ * 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.portletregistry;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.jetspeed.components.portletregistry.jpa.RegistryManagerContext;
+
+/**
+ * TestOpenJPARegistryCache
+ * 
+ * @author <a href="rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $
+ *          
+ */
+public class TestOpenJPARegistryCache extends TestRegistryCache
+{
+    private RegistryManagerContext context;
+
+    /**
+     * Create test suite.
+     * 
+     * @return test suite to execute.
+     */
+    public static Test suite()
+    {
+        // All methods starting with "test" will be executed in the test suite.
+        return new TestSuite(TestOpenJPARegistryCache.class);
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.portletregistry.TestRegistryCache#getBeanDefinitionFilterCategories()
+     */
+    protected String getBeanDefinitionFilterCategories()
+    {
+        return "default,jdbcDS";
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.portletregistry.TestRegistryCache#getConfigurations()
+     */
+    protected String[] getConfigurations()
+    {
+        return new String[]{"openjpa-registry.xml"};
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#startConversationalTxn()
+     */
+    protected void startConversationalTxn()
+    {
+        // create scoped context bean for thread transaction
+        context = (RegistryManagerContext)scm.createPrototypeComponent("registryManagerContext");
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#endConversationalTxn()
+     */
+    protected void endConversationalTxn()
+    {
+        // destroy scoped context bean for thread transaction
+        scm.destroyPrototypeComponent("registryManagerContext", context);
+    }
+
+   /**
+     * Test main entry point.
+     * 
+     * @param args process args
+     */
+    public static void main(String args[])
+    {
+        junit.awtui.TestRunner.main(new String[]{TestOpenJPARegistryCache.class.getName()});
+    }
+}

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestPortletRegistryDAO.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestPortletRegistryDAO.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestPortletRegistryDAO.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestPortletRegistryDAO.java Sun Jan 11 13:58:21 2009
@@ -22,7 +22,7 @@
 
 import org.apache.jetspeed.Jetspeed;
 import org.apache.jetspeed.components.persistence.store.LockFailedException;
-import org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase;
+import org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase;
 import org.apache.jetspeed.engine.MockJetspeedEngine;
 import org.apache.jetspeed.om.portlet.InitParam;
 import org.apache.jetspeed.om.portlet.Language;
@@ -36,8 +36,6 @@
 import org.apache.jetspeed.om.portlet.PortletDefinition;
 import org.apache.jetspeed.om.portlet.UserAttributeRef;
 import org.apache.jetspeed.om.portlet.impl.DublinCoreImpl;
-import org.apache.jetspeed.om.portlet.impl.PortletApplicationDefinitionImpl;
-import org.apache.jetspeed.om.portlet.impl.PortletDefinitionImpl;
 import org.apache.jetspeed.util.JetspeedLocale;
 
 /**
@@ -48,7 +46,7 @@
  * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
  * @version $Id$
  */
-public class TestPortletRegistryDAO extends DatasourceEnabledSpringTestCase
+public class TestPortletRegistryDAO extends JPADatasourceEnabledSpringTestCase
 {
     public static final String APP_1_NAME = "RegistryTestPortlet";
 
@@ -155,7 +153,7 @@
 
         // Create an Application and a Web app
 
-        PortletApplicationDefinitionImpl app = new PortletApplicationDefinitionImpl();
+        PortletApplication app = portletRegistry.newPortletApplication();
         app.setName("App_1");
         app.setContextRoot("/app1");
 
@@ -218,7 +216,7 @@
 
         assertNotNull(app);
 
-        portlet = (PortletDefinitionImpl) app.getPortlet("Portlet 1");
+        portlet = (PortletDefinition) app.getPortlet("Portlet 1");
 
         assertNotNull("Failed to reteive portlet application", app);
 

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestRegistryCache.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestRegistryCache.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestRegistryCache.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestRegistryCache.java Sun Jan 11 13:58:21 2009
@@ -21,7 +21,7 @@
 
 import org.apache.jetspeed.Jetspeed;
 import org.apache.jetspeed.components.persistence.store.LockFailedException;
-import org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase;
+import org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase;
 import org.apache.jetspeed.engine.MockJetspeedEngine;
 import org.apache.jetspeed.om.portlet.InitParam;
 import org.apache.jetspeed.om.portlet.Language;
@@ -32,7 +32,6 @@
 import org.apache.jetspeed.om.portlet.PortletApplication;
 import org.apache.jetspeed.om.portlet.PortletDefinition;
 import org.apache.jetspeed.om.portlet.UserAttributeRef;
-import org.apache.jetspeed.om.portlet.impl.PortletApplicationDefinitionImpl;
 
 /**
  * <p>
@@ -42,7 +41,7 @@
  * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
  * @version $Id: TestPortletRegistryDAO.java 506825 2007-02-13 02:47:07Z taylor $
  */
-public class TestRegistryCache extends DatasourceEnabledSpringTestCase
+public class TestRegistryCache extends JPADatasourceEnabledSpringTestCase
 {
     protected PortletRegistry portletRegistry;
 
@@ -106,7 +105,7 @@
 
         // Create an Application and a Web app
 
-        PortletApplicationDefinitionImpl app = new PortletApplicationDefinitionImpl();
+        PortletApplication app = portletRegistry.newPortletApplication();
         app.setName("PA-001");
         app.setContextRoot("/pa-001");
 

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/direct/TestOpenJPARegistryDirectAll.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/direct/TestOpenJPARegistryDirectAll.java?rev=733524&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/direct/TestOpenJPARegistryDirectAll.java (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/direct/TestOpenJPARegistryDirectAll.java Sun Jan 11 13:58:21 2009
@@ -0,0 +1,89 @@
+/*
+ * 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.portletregistry.direct;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.jetspeed.components.portletregistry.jpa.RegistryManagerContext;
+
+/**
+ * TestOpenJPARegistryDirectAll
+ * 
+ * @author <a href="rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $
+ *          
+ */
+public class TestOpenJPARegistryDirectAll extends TestRegistryDirectAll
+{
+    private RegistryManagerContext context;
+
+    /**
+     * Create test suite.
+     * 
+     * @return test suite to execute.
+     */
+    public static Test suite()
+    {
+        // All methods starting with "test" will be executed in the test suite.
+        return new TestSuite(TestOpenJPARegistryDirectAll.class);
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.portletregistry.AbstractRegistryTest#getBeanDefinitionFilterCategories()
+     */
+    protected String getBeanDefinitionFilterCategories()
+    {
+        return "default,jdbcDS";
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.portletregistry.AbstractRegistryTest#getConfigurations()
+     */
+    protected String[] getConfigurations()
+    {
+        return new String[]{"openjpa-registry.xml"};
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#startConversationalTxn()
+     */
+    protected void startConversationalTxn()
+    {
+        // create scoped context bean for thread transaction
+        context = (RegistryManagerContext)scm.createPrototypeComponent("registryManagerContext");
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#endConversationalTxn()
+     */
+    protected void endConversationalTxn()
+    {
+        // destroy scoped context bean for thread transaction
+        scm.destroyPrototypeComponent("registryManagerContext", context);
+    }
+
+    /**
+     * Test main entry point.
+     * 
+     * @param args process args
+     */
+    public static void main(String args[])
+    {
+        junit.awtui.TestRunner.main(new String[]{TestOpenJPARegistryDirectAll.class.getName()});
+    }
+}

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/direct/TestRegistryDirectAll.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/direct/TestRegistryDirectAll.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/direct/TestRegistryDirectAll.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/direct/TestRegistryDirectAll.java Sun Jan 11 13:58:21 2009
@@ -30,10 +30,10 @@
 import org.apache.jetspeed.om.portlet.UserAttribute;
 import org.apache.jetspeed.om.portlet.DublinCore;
 import org.apache.jetspeed.om.portlet.GenericMetadata;
+import org.apache.jetspeed.om.portlet.PortletApplication;
 import org.apache.jetspeed.om.portlet.PortletDefinition;
 import org.apache.jetspeed.om.portlet.UserAttributeRef;
 import org.apache.jetspeed.om.portlet.impl.DublinCoreImpl;
-import org.apache.jetspeed.om.portlet.impl.PortletApplicationDefinitionImpl;
 import org.apache.jetspeed.util.JetspeedLocale;
 
 /**
@@ -75,7 +75,7 @@
         String lang = Locale.getDefault().toString();
         
         // Create an Application and a Web app      
-        PortletApplicationDefinitionImpl app = new PortletApplicationDefinitionImpl();
+        PortletApplication app = registry.newPortletApplication();
         app.setName("App_1");
         app.setContextRoot("/app1");
         
@@ -153,7 +153,7 @@
         verifyData(false);
 
         // Part1b: updates
-        PortletApplicationDefinitionImpl app = (PortletApplicationDefinitionImpl) registry.getPortletApplication("App_1");
+        PortletApplication app = registry.getPortletApplication("App_1");
         assertNotNull("PA App_1 is NULL", app);
 
         app.addUserAttribute("user.pets.doggie").addDescription(Locale.getDefault().toString()).setDescription("Busby");

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/direct/TestRegistryDirectPart1a.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/direct/TestRegistryDirectPart1a.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/direct/TestRegistryDirectPart1a.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/direct/TestRegistryDirectPart1a.java Sun Jan 11 13:58:21 2009
@@ -16,11 +16,8 @@
  */
 package org.apache.jetspeed.components.portletregistry.direct;
 
-import java.util.Arrays;
 import java.util.Locale;
 
-import javax.portlet.PortletMode;
-
 import org.apache.jetspeed.components.persistence.store.LockFailedException;
 import org.apache.jetspeed.components.portletregistry.AbstractRegistryTest;
 import org.apache.jetspeed.components.portletregistry.RegistryException;
@@ -32,16 +29,10 @@
 import org.apache.jetspeed.om.portlet.Preferences;
 import org.apache.jetspeed.om.portlet.DublinCore;
 import org.apache.jetspeed.om.portlet.GenericMetadata;
-import org.apache.jetspeed.om.portlet.JetspeedServiceReference;
+import org.apache.jetspeed.om.portlet.PortletApplication;
 import org.apache.jetspeed.om.portlet.PortletDefinition;
 import org.apache.jetspeed.om.portlet.UserAttributeRef;
 import org.apache.jetspeed.om.portlet.impl.DublinCoreImpl;
-import org.apache.jetspeed.om.portlet.impl.JetspeedServiceReferenceImpl;
-import org.apache.jetspeed.om.portlet.impl.SupportsImpl;
-import org.apache.jetspeed.om.portlet.impl.PortletApplicationDefinitionImpl;
-import org.apache.jetspeed.om.portlet.impl.PortletDefinitionImpl;
-import org.apache.jetspeed.om.portlet.impl.UserAttributeImpl;
-import org.apache.jetspeed.om.portlet.impl.UserAttributeRefImpl;
 import org.apache.jetspeed.util.JetspeedLocale;
 
 /**
@@ -81,7 +72,7 @@
         String lang = Locale.getDefault().toString();
         
         // Create an Application and a Web app      
-        PortletApplicationDefinitionImpl app = new PortletApplicationDefinitionImpl();
+        PortletApplication app = registry.newPortletApplication();
         app.setName("App_1");
         app.setContextRoot("/app1");
 

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/direct/TestRegistryDirectPart1b.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/direct/TestRegistryDirectPart1b.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/direct/TestRegistryDirectPart1b.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/direct/TestRegistryDirectPart1b.java Sun Jan 11 13:58:21 2009
@@ -22,8 +22,8 @@
 import junit.framework.TestSuite;
 
 import org.apache.jetspeed.components.portletregistry.AbstractRegistryTest;
+import org.apache.jetspeed.om.portlet.PortletApplication;
 import org.apache.jetspeed.om.portlet.UserAttribute;
-import org.apache.jetspeed.om.portlet.impl.PortletApplicationDefinitionImpl;
 
 /**
  * 
@@ -45,7 +45,7 @@
     {
         String lang = Locale.getDefault().toString();
         
-        PortletApplicationDefinitionImpl app = (PortletApplicationDefinitionImpl) registry.getPortletApplication("App_1");
+        PortletApplication app = (PortletApplication) registry.getPortletApplication("App_1");
         assertNotNull("PA App_1 is NULL", app);
 
         UserAttribute ua = app.addUserAttribute("user.pets.doggie");

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/jpa-registry.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/jpa-registry.xml?rev=733524&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/jpa-registry.xml (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/jpa-registry.xml Sun Jan 11 13:58:21 2009
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:tx="http://www.springframework.org/schema/tx"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans
+      http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+      http://www.springframework.org/schema/tx
+      http://www.springframework.org/schema/tx/spring-tx.xsd">
+
+    <!-- JPA Configuration -->
+    <bean id="persistenceUnitManager" class="org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager">
+        <property name="dataSources">
+            <map>
+                <entry key="jetspeed" value-ref="JetspeedDS"/>
+            </map>
+        </property>
+        <property name="defaultDataSource" ref="JetspeedDS"/>
+        <property name="persistenceXmlLocations">
+            <list>
+                <value>classpath*:META-INF/persistence.xml</value>
+            </list>
+        </property>
+    </bean>
+    <bean id="abstractEntityManagerFactory" abstract="true" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+        <property name="persistenceUnitManager" ref="persistenceUnitManager"/>
+        <property name="persistenceUnitName" value="jetspeed-registry"/>
+    </bean>
+
+    <!-- Spring/JPA Transaction Manager -->
+    <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
+        <property name="entityManagerFactory" ref="entityManagerFactory"/>
+    </bean>
+    <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>
+
+    <!-- Spring Transaction Annotations -->
+    <tx:annotation-driven/>
+
+    <!-- JPA Registry Manager Context -->
+    <bean id="registryManagerContext" class="org.apache.jetspeed.components.portletregistry.jpa.RegistryManagerContext" scope="prototype" init-method="initialize" destroy-method="terminate">
+        <property name="registryManager"><ref bean="registryManager"/></property>
+    </bean>
+
+</beans>

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/log4j.properties?rev=733524&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/log4j.properties (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/log4j.properties Sun Jan 11 13:58:21 2009
@@ -0,0 +1,74 @@
+# 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.
+
+# ------------------------------------------------------------------------
+#
+# Logging Configuration
+#
+# $Id: log4j.properties 731466 2009-01-05 06:04:13Z rwatler $
+#
+# ------------------------------------------------------------------------
+
+log4j.rootCategory = ERROR, errorlogging
+
+#log4j.category.openjpa.Tool = INFO, infologging
+#log4j.category.openjpa.Runtime = INFO, infologging
+#log4j.category.openjpa.Remote = WARN, infologging
+#log4j.category.openjpa.DataCache = WARN, infologging
+#log4j.category.openjpa.MetaData = WARN, infologging
+#log4j.category.openjpa.Enhance = WARN, infologging
+#log4j.category.openjpa.Query = WARN, infologging
+#log4j.category.openjpa.jdbc.SQL = WARN, infologging
+#log4j.category.openjpa.jdbc.JDBC = WARN, infologging
+#log4j.category.openjpa.jdbc.Schema = WARN, infologging
+
+log4j.category.org.springframework = DEBUG, infologging
+log4j.additivity.org.springframework = false
+
+log4j.category.openjpa.Tool = TRACE, infologging
+log4j.additivity.openjpa.Tool = false
+log4j.category.openjpa.Runtime = TRACE, infologging
+log4j.additivity.openjpa.Runtime = false
+log4j.category.openjpa.Remote = TRACE, infologging
+log4j.additivity.openjpa.Remote = false
+log4j.category.openjpa.DataCache = TRACE, infologging
+log4j.additivity.openjpa.DataCache = false
+log4j.category.openjpa.MetaData = TRACE, infologging
+log4j.additivity.openjpa.MetaData = false
+log4j.category.openjpa.Enhance = TRACE, infologging
+log4j.additivity.openjpa.Enhance = false
+log4j.category.openjpa.Query = TRACE, infologging
+log4j.additivity.openjpa.Query = false
+log4j.category.openjpa.jdbc.SQL = TRACE, infologging
+log4j.additivity.openjpa.jdbc.SQL = false
+log4j.category.openjpa.jdbc.JDBC = TRACE, infologging
+log4j.additivity.openjpa.jdbc.JDBC = false
+log4j.category.openjpa.jdbc.Schema = TRACE, infologging
+log4j.additivity.openjpa.jdbc.Schema = false
+
+log4j.category.org.apache.jetspeed = DEBUG, infologging
+log4j.additivity.org.apache.jetspeed = false
+
+log4j.appender.errorlogging = org.apache.log4j.FileAppender
+log4j.appender.errorlogging.file = ${basedir}/target/surefire-reports/tests-error.log
+log4j.appender.errorlogging.layout = org.apache.log4j.PatternLayout
+log4j.appender.errorlogging.layout.conversionPattern = %d [%t] %-5p %c - %m%n
+log4j.appender.errorlogging.append = false
+
+log4j.appender.infologging = org.apache.log4j.FileAppender
+log4j.appender.infologging.file = ${basedir}/target/surefire-reports/tests-info.log
+log4j.appender.infologging.layout = org.apache.log4j.PatternLayout
+log4j.appender.infologging.layout.conversionPattern = %d [%t] %-5p %c - %m%n
+log4j.appender.infologging.append = false

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/openjpa-registry-base.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/openjpa-registry-base.xml?rev=733524&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/openjpa-registry-base.xml (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/openjpa-registry-base.xml Sun Jan 11 13:58:21 2009
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:tx="http://www.springframework.org/schema/tx"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans
+      http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+      http://www.springframework.org/schema/tx
+      http://www.springframework.org/schema/tx/spring-tx.xsd">
+
+    <import resource="jpa-registry.xml"/>
+
+    <!-- OpenJPA Configuration -->
+    <bean id="jpaRegistryProperties" class="org.apache.jetspeed.components.rdbms.jpa.OpenJPAConfigurationProperties"/>
+    <bean id="entityManagerFactory" parent="abstractEntityManagerFactory">
+        <property name="jpaProperties" ref="jpaRegistryProperties"/>
+    </bean>
+
+</beans>

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/openjpa-registry.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/openjpa-registry.xml?rev=733524&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/openjpa-registry.xml (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/openjpa-registry.xml Sun Jan 11 13:58:21 2009
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:tx="http://www.springframework.org/schema/tx"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans
+      http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+      http://www.springframework.org/schema/tx
+      http://www.springframework.org/schema/tx/spring-tx.xsd">
+
+    <import resource="openjpa-registry-base.xml"/>
+
+    <!-- JPA/OpenJPA Registry Components -->
+    <bean id="portletFactory" class="org.apache.jetspeed.factory.JetspeedPortletFactory"/>
+    <bean id="registryManager" class="org.apache.jetspeed.components.portletregistry.jpa.RegistryManagerImpl"/>
+    <bean id="portletPreferencesProvider" class="org.apache.jetspeed.components.portletpreferences.jpa.PortletPreferencesProviderImpl" init-method="init" destroy-method="destroy">
+        <constructor-arg index="0"><ref bean="registryManager"/></constructor-arg>
+        <constructor-arg index="1"><ref bean="portletFactory"/></constructor-arg>
+        <property name="useEntityPreferences"><value>true</value></property>
+    </bean>
+    <bean id="portletRegistry" class="org.apache.jetspeed.components.portletregistry.jpa.PortletRegistryImpl">
+        <constructor-arg index="0"><ref bean="registryManager"/></constructor-arg>
+        <constructor-arg index="1"><ref bean="portletPreferencesProvider"/></constructor-arg>
+    </bean>
+    <bean id="portletEntityAccess" class="org.apache.jetspeed.components.portletentity.jpa.PortletEntityAccessComponentImpl">
+        <constructor-arg index="0"><ref bean="registryManager"/></constructor-arg>
+        <constructor-arg index="1"><ref bean="portletRegistry"/></constructor-arg>
+        <constructor-arg index="2"><value>false</value></constructor-arg>
+    </bean>
+
+    <!-- JPA/OpenJPA Registry Component Injection, (consider component/object infusion to eliminate these) -->
+    <bean class="org.apache.jetspeed.components.LifecycleAwareStaticClassInitializer">
+        <property name="className" value="org.apache.jetspeed.om.portlet.jpa.PortletDefinitionImpl"/>
+        <property name="methodName" value="setPortletFactory"/>
+        <property name="typeName" value="org.apache.jetspeed.factory.PortletFactory"/>
+        <property name="value"><ref bean="portletFactory"/></property>
+    </bean>
+    <bean class="org.apache.jetspeed.components.LifecycleAwareStaticClassInitializer">
+        <property name="className" value="org.apache.jetspeed.om.portlet.jpa.PortletDefinitionImpl"/>
+        <property name="methodName" value="setPortletPreferencesProvider"/>
+        <property name="typeName" value="org.apache.jetspeed.components.portletpreferences.PortletPreferencesProvider"/>
+        <property name="value"><ref bean="portletPreferencesProvider"/></property>
+    </bean>
+    <bean class="org.apache.jetspeed.components.LifecycleAwareStaticClassInitializer">
+        <property name="className" value="org.apache.jetspeed.components.portletentity.jpa.PortletEntityImpl"/>
+        <property name="methodName" value="setPortletRegistry"/>
+        <property name="typeName" value="org.apache.jetspeed.components.portletregistry.PortletRegistry"/>
+        <property name="value"><ref bean="portletRegistry"/></property>
+    </bean>
+</beans>

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-api/src/main/java/org/apache/jetspeed/components/portletregistry/PortletRegistry.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-api/src/main/java/org/apache/jetspeed/components/portletregistry/PortletRegistry.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-api/src/main/java/org/apache/jetspeed/components/portletregistry/PortletRegistry.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-api/src/main/java/org/apache/jetspeed/components/portletregistry/PortletRegistry.java Sun Jan 11 13:58:21 2009
@@ -34,6 +34,19 @@
  */
 public interface PortletRegistry
 {
+    /**
+     * The separator used to create a unique portlet name as
+     * {portletApplication}::{portlet}
+     */
+    public static final String PORTLET_UNIQUE_NAME_SEPARATOR = "::";
+    
+    /**
+     * Create new PortletApplication.
+     * 
+     * @return created PortletApplication
+     */
+    PortletApplication newPortletApplication();
+
     Collection<PortletDefinition> getAllPortletDefinitions();
 
     /**

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/PortletDefinition.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/PortletDefinition.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/PortletDefinition.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/PortletDefinition.java Sun Jan 11 13:58:21 2009
@@ -152,22 +152,6 @@
     void setJetspeedSecurityConstraint(String constraint);
     
     /**
-     * <p>
-     * Persistence callback to allow a PortletDefinition instance to persist children
-     * objects (like portlet preferences) <em>within</em> the same transaction.
-     * </p>
-     * <p>
-     * This method must be called <em>always</em> from the #store() method. Using a callback from
-     * the persistence manager might not be reliable when the PortletDefinition <em>itself</em>
-     * isn't changed but children might.
-     * </p>
-     * <p>
-     * Notably condition when this might happen is the Pluto 1.0.1 preferences handling calling
-     * the portletDefinition store() method
-     * */
-    void storeChildren();
-    
-    /**
      * Check if this instance its persistent identity has changed
      * @param other
      * @return true only if the internal identities are the same

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-api/src/main/java/org/apache/jetspeed/page/PageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-api/src/main/java/org/apache/jetspeed/page/PageManager.java?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-api/src/main/java/org/apache/jetspeed/page/PageManager.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-api/src/main/java/org/apache/jetspeed/page/PageManager.java Sun Jan 11 13:58:21 2009
@@ -76,27 +76,6 @@
     public boolean getPermissionsEnabled();
 
     /**
-     * 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);
-
-    /**
      * Creates a new empty Page instance
      *
      * @return a newly created Page object

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/ddl-schema/registry-schema.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/ddl-schema/registry-schema.xml?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/ddl-schema/registry-schema.xml (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/ddl-schema/registry-schema.xml Sun Jan 11 13:58:21 2009
@@ -31,6 +31,7 @@
         <column name="RESOURCE_BUNDLE" size="255" type="VARCHAR"/>
         <column name="PREFERENCE_VALIDATOR" size="255" type="VARCHAR"/>
         <column name="SECURITY_REF" size="40" type="VARCHAR"/>        
+        <column name="JPA_VERSION" type="INTEGER"/>
     </table>
 
     <!--
@@ -45,6 +46,7 @@
         <column name="APP_TYPE" type="INTEGER"/>
 		<column name="CHECKSUM" size="80" type="VARCHAR"/>
         <column name="SECURITY_REF" size="40" type="VARCHAR"/>
+        <column name="JPA_VERSION" type="INTEGER"/>
         <unique name="UK_APPLICATION">
             <unique-column name="APP_NAME"/>
         </unique>
@@ -59,6 +61,7 @@
         <column name="COLUMN_VALUE" required="true" type="LONGVARCHAR"/>
         <column name="NAME" required="true" size="100" type="VARCHAR"/>
         <column name="LOCALE_STRING" required="true" size="50" type="VARCHAR"/>
+        <column name="JPA_VERSION" type="INTEGER"/>
         <foreign-key foreignTable="PORTLET_APPLICATION" name="FK_PA_METADATA_FIELDS_1" onDelete="cascade">                        
             <reference foreign="APPLICATION_ID" local="OBJECT_ID"/>            
         </foreign-key>        
@@ -73,6 +76,7 @@
         <column name="COLUMN_VALUE" required="true" type="LONGVARCHAR"/>
         <column name="NAME" required="true" size="100" type="VARCHAR"/>
         <column name="LOCALE_STRING" required="true" size="50" type="VARCHAR"/>
+        <column name="JPA_VERSION" type="INTEGER"/>
         <foreign-key foreignTable="PORTLET_DEFINITION" name="FK_PD_METADATA_FIELDS_1" onDelete="cascade">                        
             <reference foreign="ID" local="OBJECT_ID"/>            
         </foreign-key>                
@@ -88,6 +92,7 @@
         <column name="SHORT_TITLE" size="100" type="VARCHAR"/>
         <column name="LOCALE_STRING" required="true" size="50" type="VARCHAR"/>
         <column name="KEYWORDS" type="LONGVARCHAR"/>
+        <column name="JPA_VERSION" type="INTEGER"/>
     </table>
     
     <!--
@@ -99,6 +104,7 @@
         <column name="MIME_TYPE" required="true" size="30" type="VARCHAR"/>
         <column name="MODES" type="VARCHAR" size="255"/>
         <column name="STATES" type="VARCHAR" size="255"/>
+        <column name="JPA_VERSION" type="INTEGER"/>
         <unique name="UK_SUPPORTS">
           <unique-column name="PORTLET_ID"/>
           <unique-column name="MIME_TYPE"/>
@@ -114,6 +120,7 @@
         <column name="OWNER_CLASS_NAME" required="true" size="255" type="VARCHAR"/>
         <column name="NAME" required="true" size="80" type="VARCHAR"/>
         <column name="PARAMETER_VALUE" required="false" type="LONGVARCHAR"/>
+        <column name="JPA_VERSION" type="INTEGER"/>
     </table>
 
     <!--
@@ -128,6 +135,7 @@
         <column name="ID" required="true" size="80" type="VARCHAR"/>
         <column name="APP_NAME" required="true" size="80" type="VARCHAR"/>
         <column name="PORTLET_NAME" required="true" size="80" type="VARCHAR"/>
+        <column name="JPA_VERSION" type="INTEGER"/>
         <unique name="UK_ENTITY_ID">
             <unique-column name="ID"/>
         </unique>
@@ -145,6 +153,7 @@
         <column name="USER_NAME"  size="80" type="VARCHAR"/>
         <column name="NAME" required="true" size="254" type="VARCHAR"/>
         <column name="READONLY" required="true" type="BOOLEANINT"/>        
+        <column name="JPA_VERSION" type="INTEGER"/>
         <unique name="UIX_PORTLET_PREFERENCE">
           <unique-column name="DTYPE"/>
           <unique-column name="APPLICATION_NAME"/>
@@ -161,6 +170,7 @@
         <column name="PREF_ID" primaryKey="true" required="true" type="INTEGER"/>
         <column name="IDX" primaryKey="true" required="true" type="SMALLINT"/>
         <column name="PREF_VALUE" size="4000" type="VARCHAR"/>
+        <column name="JPA_VERSION" type="INTEGER"/>
 
         <index name="IX_PREFS_PREF_ID">
             <index-column name="PREF_ID"/>
@@ -179,6 +189,7 @@
         <column name="PORTLET_DEFINITION_ID" required="true" type="INTEGER"/>
         <column name="ROLE_NAME" required="true" size="150" type="VARCHAR"/>
         <column name="ROLE_LINK" size="150" type="VARCHAR"/>
+        <column name="JPA_VERSION" type="INTEGER"/>
     </table>
     
     <!--                                                                   
@@ -188,6 +199,7 @@
         <column name="ID" primaryKey="true" required="true" type="INTEGER"/>
         <column name="APPLICATION_ID" required="true" type="INTEGER"/>  
         <column name="NAME" required="true" size="150" type="VARCHAR"/>
+        <column name="JPA_VERSION" type="INTEGER"/>
         <foreign-key foreignTable="PORTLET_APPLICATION" name="FK_SECURITY_ROLE_REF_1" onDelete="cascade">                        
             <reference foreign="APPLICATION_ID" local="APPLICATION_ID"/>            
         </foreign-key>
@@ -201,6 +213,7 @@
         <column name="APPLICATION_ID" required="true" type="INTEGER"/>
         <column name="NAME" size="150" type="VARCHAR"/>
         <column name="NAME_LINK" size="150" type="VARCHAR"/>
+        <column name="JPA_VERSION" type="INTEGER"/>
         <foreign-key foreignTable="PORTLET_APPLICATION" name="FK_USER_ATTRIBUTE_REF_1" onDelete="cascade">
             <reference foreign="APPLICATION_ID" local="APPLICATION_ID"/>
         </foreign-key>                
@@ -213,6 +226,7 @@
         <column name="ID" primaryKey="true" required="true" type="INTEGER"/>
         <column name="APPLICATION_ID" required="true" type="INTEGER"/>
         <column name="NAME" size="150" type="VARCHAR"/>
+        <column name="JPA_VERSION" type="INTEGER"/>
         <foreign-key foreignTable="PORTLET_APPLICATION" name="FK_USER_ATTRIBUTE_1" onDelete="cascade">
             <reference foreign="APPLICATION_ID" local="APPLICATION_ID"/>
         </foreign-key>        
@@ -225,6 +239,7 @@
         <column name="ID" primaryKey="true" required="true" type="INTEGER"/>
         <column name="APPLICATION_ID" required="true" type="INTEGER"/>
         <column name="NAME" size="150" type="VARCHAR"/>
+        <column name="JPA_VERSION" type="INTEGER"/>
     </table>
 
     
@@ -237,6 +252,7 @@
         <column name="OWNER_CLASS_NAME" required="true" size="255" type="VARCHAR"/>
         <column name="DESCRIPTION" required="true" type="LONGVARCHAR"/>
         <column name="LOCALE_STRING" required="true" size="50" type="VARCHAR"/>
+        <column name="JPA_VERSION" type="INTEGER"/>
     </table>
     
     <!--
@@ -248,8 +264,9 @@
         <column name="OWNER_CLASS_NAME" size="255" type="VARCHAR"/>
         <column name="DISPLAY_NAME" required="true" type="LONGVARCHAR"/>
         <column name="LOCALE_STRING" required="true" size="50" type="VARCHAR"/>
+        <column name="JPA_VERSION" type="INTEGER"/>
     </table>
-    
+
     <!--
        CustomPortletMode
     -->
@@ -258,6 +275,7 @@
         <column name="APPLICATION_ID" required="true" type="INTEGER"/>
         <column name="CUSTOM_NAME" required="true" size="150" type="VARCHAR"/>
         <column name="MAPPED_NAME" size="150" type="VARCHAR"/>
+        <column name="JPA_VERSION" type="INTEGER"/>
         <foreign-key foreignTable="PORTLET_APPLICATION" name="FK_CUSTOM_PORTLET_MODE_1" onDelete="cascade">
             <reference foreign="APPLICATION_ID" local="APPLICATION_ID"/>
         </foreign-key>        
@@ -271,6 +289,7 @@
         <column name="APPLICATION_ID" required="true" type="INTEGER"/>
         <column name="CUSTOM_NAME" required="true" size="150" type="VARCHAR"/>
         <column name="MAPPED_NAME" size="150" type="VARCHAR"/>
+        <column name="JPA_VERSION" type="INTEGER"/>
         <foreign-key foreignTable="PORTLET_APPLICATION" name="FK_CUSTOM_WINDOW_STATE_1" onDelete="cascade">
             <reference foreign="APPLICATION_ID" local="APPLICATION_ID"/>
         </foreign-key>        

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/deployment.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/deployment.xml?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/deployment.xml (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/deployment.xml Sun Jan 11 13:58:21 2009
@@ -47,8 +47,13 @@
 
   <bean id="org.apache.jetspeed.descriptor.JetspeedDescriptorService"
         class="org.apache.jetspeed.descriptor.JetspeedDescriptorServiceImpl">
-      <meta key="j2:cat" value="default"/>
-      <constructor-arg><bean class="org.apache.pluto.descriptors.services.jaxb.PortletAppDescriptorServiceImpl"/></constructor-arg>
+    <meta key="j2:cat" value="default"/>
+    <constructor-arg>
+      <bean class="org.apache.pluto.descriptors.services.jaxb.PortletAppDescriptorServiceImpl"/>
+    </constructor-arg>
+    <constructor-arg>
+      <ref bean="org.apache.jetspeed.components.portletregistry.PortletRegistry"/>
+    </constructor-arg>
   </bean>       
 
   <bean id="org.apache.jetspeed.tools.pamanager.PortletApplicationManager" class="org.apache.jetspeed.tools.pamanager.PortletApplicationManager" init-method="start"
@@ -180,4 +185,4 @@
     </constructor-arg>
   </bean>
 
-</beans>
\ No newline at end of file
+</beans>

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/static-bean-references.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/static-bean-references.xml?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/static-bean-references.xml (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/static-bean-references.xml Sun Jan 11 13:58:21 2009
@@ -18,17 +18,6 @@
 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
 
-  <bean id="_portletDefinitionImplPortletRegistryInitializer"
-    class="org.apache.jetspeed.components.LifecycleAwareStaticClassInitializer">
-    <meta key="j2:cat" value="default,registry" />
-    <property name="className" value="org.apache.jetspeed.om.portlet.impl.PortletDefinitionImpl" />
-    <property name="methodName" value="setPortletRegistry" />
-    <property name="typeName" value="org.apache.jetspeed.components.portletregistry.PortletRegistry" />
-    <property name="value">
-      <ref bean="portletRegistry" />
-    </property>
-  </bean>
-
   <bean id="_portletDefinitionImplPortletFactoryInitializer"
     class="org.apache.jetspeed.components.LifecycleAwareStaticClassInitializer">
     <meta key="j2:cat" value="default,registry" />
@@ -156,4 +145,4 @@
     </property>
   </bean>
 
-</beans>
\ No newline at end of file
+</beans>

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/ddl/mssql/create-schema.sql
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/ddl/mssql/create-schema.sql?rev=733524&r1=733523&r2=733524&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/ddl/mssql/create-schema.sql (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/ddl/mssql/create-schema.sql Sun Jan 11 13:58:21 2009
@@ -957,6 +957,7 @@
     RESOURCE_BUNDLE VARCHAR(255),
     PREFERENCE_VALIDATOR VARCHAR(255),
     SECURITY_REF VARCHAR(40),
+    JPA_VERSION INT,
     PRIMARY KEY (ID)
 );
 
@@ -975,6 +976,7 @@
     DESCRIPTION VARCHAR(80),
     WEB_APP_ID INT NOT NULL,
     SECURITY_REF VARCHAR(40),
+    JPA_VERSION INT,
     PRIMARY KEY (APPLICATION_ID)
 );
 
@@ -1002,6 +1004,7 @@
     COLUMN_VALUE TEXT NOT NULL,
     NAME VARCHAR(100) NOT NULL,
     LOCALE_STRING VARCHAR(50) NOT NULL,
+    JPA_VERSION INT,
     PRIMARY KEY (ID)
 );
 
@@ -1016,6 +1019,7 @@
     COLUMN_VALUE TEXT NOT NULL,
     NAME VARCHAR(100) NOT NULL,
     LOCALE_STRING VARCHAR(50) NOT NULL,
+    JPA_VERSION INT,
     PRIMARY KEY (ID)
 );
 
@@ -1031,6 +1035,7 @@
     SHORT_TITLE VARCHAR(100),
     LOCALE_STRING VARCHAR(50) NOT NULL,
     KEYWORDS TEXT,
+    JPA_VERSION INT,
     PRIMARY KEY (ID)
 );
 
@@ -1058,6 +1063,7 @@
     CLASS_NAME VARCHAR(255) NOT NULL,
     NAME VARCHAR(80) NOT NULL,
     PARAMETER_VALUE TEXT,
+    JPA_VERSION INT,
     PRIMARY KEY (PARAMETER_ID)
 );
 
@@ -1071,6 +1077,7 @@
     ID VARCHAR(80) NOT NULL,
     APP_NAME VARCHAR(80) NOT NULL,
     PORTLET_NAME VARCHAR(80) NOT NULL,
+    JPA_VERSION INT,
     PRIMARY KEY (PEID)
 );
 
@@ -1086,6 +1093,7 @@
     APPLICATION_NAME VARCHAR(80) NOT NULL,
     PORTLET_NAME VARCHAR(80) NOT NULL,
     NAME VARCHAR(254) NOT NULL,
+    JPA_VERSION INT,
     PRIMARY KEY (ID)
 );
 
@@ -1105,6 +1113,7 @@
     READONLY SMALLINT NOT NULL,
     NULL_VALUE SMALLINT NOT NULL,
     PREF_VALUE VARCHAR(4000),
+    JPA_VERSION INT,
     PRIMARY KEY (PREF_ID, IDX, ENTITY_OID, USER_NAME)
 );
 
@@ -1120,6 +1129,7 @@
     PORTLET_DEFINITION_ID INT NOT NULL,
     ROLE_NAME VARCHAR(150) NOT NULL,
     ROLE_LINK VARCHAR(150),
+    JPA_VERSION INT,
     PRIMARY KEY (ID)
 );
 
@@ -1133,6 +1143,7 @@
     WEB_APPLICATION_ID INT NOT NULL,
     ROLE_NAME VARCHAR(150) NOT NULL,
     DESCRIPTION VARCHAR(150),
+    JPA_VERSION INT,
     PRIMARY KEY (ID)
 );
 
@@ -1146,6 +1157,7 @@
     APPLICATION_ID INT NOT NULL,
     NAME VARCHAR(150),
     NAME_LINK VARCHAR(150),
+    JPA_VERSION INT,
     PRIMARY KEY (ID)
 );
 
@@ -1159,6 +1171,7 @@
     APPLICATION_ID INT NOT NULL,
     NAME VARCHAR(150),
     DESCRIPTION VARCHAR(150),
+    JPA_VERSION INT,
     PRIMARY KEY (ID)
 );
 
@@ -1171,6 +1184,7 @@
     ID INT NOT NULL,
     APPLICATION_ID INT NOT NULL,
     NAME VARCHAR(150),
+    JPA_VERSION INT,
     PRIMARY KEY (ID)
 );
 
@@ -1185,6 +1199,7 @@
     CLASS_NAME VARCHAR(255) NOT NULL,
     DESCRIPTION TEXT NOT NULL,
     LOCALE_STRING VARCHAR(50) NOT NULL,
+    JPA_VERSION INT,
     PRIMARY KEY (ID)
 );
 
@@ -1199,6 +1214,7 @@
     CLASS_NAME VARCHAR(255),
     DISPLAY_NAME TEXT NOT NULL,
     LOCALE_STRING VARCHAR(50) NOT NULL,
+    JPA_VERSION INT,
     PRIMARY KEY (ID)
 );
 
@@ -1213,6 +1229,7 @@
     CUSTOM_NAME VARCHAR(150) NOT NULL,
     MAPPED_NAME VARCHAR(150),
     DESCRIPTION TEXT,
+    JPA_VERSION INT,
     PRIMARY KEY (ID)
 );
 
@@ -1227,6 +1244,7 @@
     CUSTOM_NAME VARCHAR(150) NOT NULL,
     MAPPED_NAME VARCHAR(150),
     DESCRIPTION TEXT,
+    JPA_VERSION INT,
     PRIMARY KEY (ID)
 );
 



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