portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject cvs commit: jakarta-jetspeed-2/portal/src/webapp/WEB-INF/conf/test jetspeed.properties
Date Thu, 20 Nov 2003 19:02:24 GMT
taylor      2003/11/20 11:02:24

  Modified:    .        .classpath .project
               portal   maven.xml project.xml
               portal/src/java/org/apache/jetspeed Jetspeed.java
               portal/src/java/org/apache/jetspeed/engine
                        JetspeedEngine.java JetspeedServlet.java
               portal/src/java/org/apache/jetspeed/om/page Fragment.java
                        Page.java Property.java Reference.java
               portal/src/java/org/apache/jetspeed/om/page/psml
                        AbstractBaseElement.java Defaults.java
                        FragmentImpl.java PageImpl.java
               portal/src/java/org/apache/jetspeed/services/entity
                        PortletEntityService.java
                        PortletEntityServiceImpl.java
               portal/src/java/org/apache/jetspeed/services/factory
                        FactoryManagementService.java
               portal/src/java/org/apache/jetspeed/services/page/impl
                        CastorXmlPageManagerService.java
                        DatabasePageManagerService.java
               portal/src/sql/hsql create-db-phase2.sql
               portal/src/test/org/apache/jetspeed/services/page
                        TestPageXmlPersistence.java
               portal/src/webapp/WEB-INF/conf jetspeed.properties
               portal/src/webapp/WEB-INF/conf/ojb repository_page.xml
               portal/src/webapp/WEB-INF/conf/test jetspeed.properties
  Added:       portal/src/java/org/apache/jetspeed/om/page BaseElement.java
               portal/src/java/org/apache/jetspeed/services/page/impl
                        AbstractPageManagerService.java
               portal/src/test/org/apache/jetspeed/services/page
                        TestPageDBPersistence.java
  Log:
  - moved Pluto dep to 1.0
  - continued implementation of OJB database page service
  - extended debugging for JetspeedEngine and JetspeedServlet
  - continued refinement of Page model
  
  Revision  Changes    Path
  1.7       +3 -1      jakarta-jetspeed-2/.classpath
  
  Index: .classpath
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/.classpath,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- .classpath	10 Oct 2003 05:12:12 -0000	1.6
  +++ .classpath	20 Nov 2003 19:02:23 -0000	1.7
  @@ -35,6 +35,8 @@
       <classpathentry kind="var" path="MAVEN_REPO/ojb/jars/ojb-1.0.rc3-PATCHED.jar"/>
       <classpathentry kind="var" path="MAVEN_REPO/xerces/jars/xerces-2.3.0.jar"/>
       <classpathentry kind="var" path="MAVEN_REPO/xml-apis/jars/xml-apis-2.0.2.jar"/>
  -    <classpathentry kind="var" path="MAVEN_REPO/pluto-container/jars/pluto-0.1-dev-unreleased.jar"/>
  +    <classpathentry kind="src" path="/jakarta-pluto"/>
  +    <classpathentry kind="var" path="MAVEN_REPO/regexp/jars/regexp-1.2.jar"/>
  +    <classpathentry kind="var" path="MAVEN_REPO/velocity/jars/velocity-dep-1.3.1.jar"/>
       <classpathentry kind="output" path="bin"/>
   </classpath>
  
  
  
  1.7       +4 -2      jakarta-jetspeed-2/.project
  
  Index: .project
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/.project,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- .project	11 Oct 2003 20:20:34 -0000	1.6
  +++ .project	20 Nov 2003 19:02:23 -0000	1.7
  @@ -2,7 +2,9 @@
   <projectDescription>
   	<name>jetspeed-2</name>
   	<comment></comment>
  -
  +	<projects>
  +		<project>jakarta-pluto</project>
  +	</projects>
   	<buildSpec>
   		<buildCommand>
   			<name>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</name>
  @@ -19,4 +21,4 @@
   		<nature>org.eclipse.jdt.core.javanature</nature>
   		<nature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</nature>
   	</natures>
  -</projectDescription>
  \ No newline at end of file
  +</projectDescription>
  
  
  
  1.10      +1 -1      jakarta-jetspeed-2/portal/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/maven.xml,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- maven.xml	19 Nov 2003 21:12:45 -0000	1.9
  +++ maven.xml	20 Nov 2003 19:02:23 -0000	1.10
  @@ -5,7 +5,7 @@
   
     <!-- Target of maven test:single test -->
   <!--  <property name='testcase' value='org.apache.jetspeed.services.registry.TestRegistry'/>  -->
  - <property name='testcase' value='org.apache.jetspeed.tools.pamanager.TestPortletDescriptor'/>  
  + <property name='testcase' value='org.apache.jetspeed.services.page.TestPageXmlPersistence'/>  
   
    
   <!--
  
  
  
  1.12      +1 -1      jakarta-jetspeed-2/portal/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/project.xml,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- project.xml	17 Oct 2003 20:48:53 -0000	1.11
  +++ project.xml	20 Nov 2003 19:02:23 -0000	1.12
  @@ -23,7 +23,7 @@
       <dependency>
         <id>pluto</id>
         <groupId>pluto-container</groupId>
  -      <version>0.1-dev-unreleased</version>
  +      <version>1.0</version>
         <properties>
           <war.bundle.jar>false</war.bundle.jar>
         </properties>
  
  
  
  1.2       +3 -3      jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/Jetspeed.java
  
  Index: Jetspeed.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/Jetspeed.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Jetspeed.java	28 Jul 2003 23:47:36 -0000	1.1
  +++ Jetspeed.java	20 Nov 2003 19:02:23 -0000	1.2
  @@ -95,8 +95,8 @@
               log.info("Jetspeed environment attempting to initialize portal Engine...");
               engine = new JetspeedEngine();
               engine.init(configuration, applicationRoot, config);
  -            log.info("JetspeedEngine scuccessfuly intialized.");
  -            log.info("Jetspeed environment scuccessfuly intialized.");
  +            log.info("JetspeedEngine successfuly intialized.");
  +            log.info("Jetspeed environment successfuly intialized.");
               return engine;
           }
           catch (Exception e)
  
  
  
  1.5       +2 -2      jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/engine/JetspeedEngine.java
  
  Index: JetspeedEngine.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/engine/JetspeedEngine.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JetspeedEngine.java	20 Oct 2003 03:47:55 -0000	1.4
  +++ JetspeedEngine.java	20 Nov 2003 19:02:23 -0000	1.5
  @@ -202,7 +202,7 @@
               //TODO !!! Pluto has changed this siganture There is now a container unique id string and Properties. WE need to figure what these are really for.
               container.init("jetspeed", config, environment, new Properties());
           }
  -        catch (Exception e)
  +        catch (Throwable e)
           {
               console.error("Unable to initalize Engine.", e);
               log.error("Unable to initalize Engine.", e);
  
  
  
  1.2       +2 -2      jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/engine/JetspeedServlet.java
  
  Index: JetspeedServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/engine/JetspeedServlet.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JetspeedServlet.java	28 Jul 2003 23:47:39 -0000	1.1
  +++ JetspeedServlet.java	20 Nov 2003 19:02:23 -0000	1.2
  @@ -179,7 +179,7 @@
                   console.info("JetspeedServlet has successfuly initialized the portlet container...");
   
               }
  -            catch (Exception e)
  +            catch (Throwable e)
               {
                   // save the exception to complain loudly later :-)
                   initFailure = e;
  
  
  
  1.3       +4 -60     jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/om/page/Fragment.java
  
  Index: Fragment.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/om/page/Fragment.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Fragment.java	8 Aug 2003 22:05:55 -0000	1.2
  +++ Fragment.java	20 Nov 2003 19:02:23 -0000	1.3
  @@ -24,11 +24,11 @@
    *    if and wherever such third-party acknowledgments normally appear.
    *
    * 4. The names "Apache" and "Apache Software Foundation" and
  - *     "Apache Jetspeed" must not be used to endorse or promote products
  + *    "Apache Jetspeed" must not be used to endorse or promote products
    *    derived from this software without prior written permission. For
    *    written permission, please contact apache@apache.org.
    *
  - * 5. Products derived from this software may not be called "Apache" or
  + * 5. Products derived from this software may not be called "Apache",
    *    "Apache Jetspeed", nor may "Apache" appear in their name, without
    *    prior written permission of the Apache Software Foundation.
    *
  @@ -80,7 +80,7 @@
    *
    * @version $Id$
    */
  -public interface Fragment extends Cloneable, java.io.Serializable
  +public interface Fragment extends BaseElement, Cloneable, java.io.Serializable
   {
       /**
        * A fragment of type PORTLET is considered to be a compliant portlet
  @@ -96,50 +96,6 @@
        public String LAYOUT = "layout";
   
       /**
  -     * Returns a unique id number for this Fragment. This ID unique
  -     * number is guaranteed to be unique within the portal and can be
  -     * used as a unique key for this Fragment.
  -     *
  -     * @return the id of the fragment as a String.
  -     * This id may not be null.
  -     */
  -    public String getId();
  -
  -    /**
  -     * Sets a new unique id for this Fragment. This id cannot be null and
  -     * must be unique within the portal.
  -     *
  -     * @param id the new id for this Fragment.
  -     */
  -    public void setId(String id);
  -
  -    /**
  -     * Returns the name of an ACL that governs access to the Fragment
  -     * and some of the navigation/editing functionalities related to this
  -     * fragment.
  -     * The ACL should be a valid reference to a security policy in the
  -     * portal security repository. If it's invalid or null, the portal must
  -     * default to the parent fragment ACL, the page default ACL or the system
  -     * default.
  -     *
  -     * @return the name of an ACL in the security repository.
  -     */
  -    public String getAcl();
  -
  -    /**
  -     * Returns the name of an ACL that governs access to the Fragment
  -     * and some of the navigation/editing functionalities related to this
  -     * fragment.
  -     * The ACL should be a valid reference to a security policy in the
  -     * portal security repository. If it's invalid or null, the portal must
  -     * default to the parent fragment ACL, the page default ACL or the system
  -     * default.
  -     *
  -     * @return the name of an ACL in the security repository.
  -     */
  -    public void setAcl(String aclName);
  -
  -    /**
        * Returns the administrative name of this fragment. This name should map
        * to a component name in the component repository defined by the type
        * attribute.
  @@ -156,18 +112,6 @@
        * @param name the administrative name
        */
       public void setName(String name);
  -
  -    /**
  -     * Defines the title for this fragment
  -     *
  -     * @param title the new fragment title
  -     */
  -    public void setTitle(String title);
  -
  -    /**
  -     * Returns the title of this fragment
  -     */
  -    public String getTitle();
   
       /**
        * Returns the type of the class bound to this fragment
  
  
  
  1.3       +12 -54    jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/om/page/Page.java
  
  Index: Page.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/om/page/Page.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Page.java	8 Aug 2003 22:05:55 -0000	1.2
  +++ Page.java	20 Nov 2003 19:02:23 -0000	1.3
  @@ -24,11 +24,11 @@
    *    if and wherever such third-party acknowledgments normally appear.
    *
    * 4. The names "Apache" and "Apache Software Foundation" and
  - *     "Apache Jetspeed" must not be used to endorse or promote products
  + *    "Apache Jetspeed" must not be used to endorse or promote products
    *    derived from this software without prior written permission. For
    *    written permission, please contact apache@apache.org.
    *
  - * 5. Products derived from this software may not be called "Apache" or
  + * 5. Products derived from this software may not be called "Apache",
    *    "Apache Jetspeed", nor may "Apache" appear in their name, without
    *    prior written permission of the Apache Software Foundation.
    *
  @@ -51,7 +51,6 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    */
  -
   package org.apache.jetspeed.om.page;
   
   /**
  @@ -60,57 +59,8 @@
    *
    * @version $Id$
    */
  -public interface Page extends java.io.Serializable, Cloneable
  +public interface Page extends BaseElement, java.io.Serializable, Cloneable
   {
  -    /**
  -     * Returns the unique Id of this page. This id is guaranteed to be unique
  -     * from the complete portal and is suitable to be used as a unique key.
  -     *
  -     * @return the unique id of this page.
  -     */
  -    public String getId();
  -
  -    /**
  -     * Modifies the id of this page. This id must not be null and must be unique
  -     * for the portal.
  -     *
  -     * @param id the new id for this page
  -     */
  -    public void setId(String id);
  -
  -    /**
  -     * Returns the Page title in the default Locale
  -     *
  -     * @return the page title
  -     */
  -    public String getTitle();
  -
  -    /**
  -     * Sets the title for the default Locale
  -     *
  -     * @param title the new title
  -     */
  -    public void setTitle(String title);
  -
  -    /**
  -     * Returns the name of the default ACL that applies to this
  -     * page. This name should reference an entry in the Securtiy
  -     * registry
  -     *
  -     * @return the page default acl
  -     */
  -    public String getAcl();
  -
  -    /**
  -     * Modifies the default ACL for this page.
  -     * This new acl must reference an entry in the Security
  -     * registry.
  -     * Additionnally, replacing the default ACL will not affect any
  -     * children fragments with their own specific ACLs
  -     *
  -     * @param aclName the name of the new ACL for the page
  -     */
  -    public void setAcl(String aclName);
   
       /**
        * Returns the name of the default skin that applies to this
  @@ -156,6 +106,14 @@
        * @return the base Fragment object for this page.
        */
       public Fragment getRootFragment();
  +
  +    /**
  +     * Sets the top level fragment of this page. This Fragment should
  +     * never be null.
  +     *
  +     * @return the base Fragment object for this page.
  +     */    
  +    public void setRootFragment(Fragment fragment);
   
       /**
        * Retrieves the fragment contained within this page, with the
  
  
  
  1.2       +3 -4      jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/om/page/Property.java
  
  Index: Property.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/om/page/Property.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Property.java	3 Aug 2003 14:18:51 -0000	1.1
  +++ Property.java	20 Nov 2003 19:02:23 -0000	1.2
  @@ -24,11 +24,11 @@
    *    if and wherever such third-party acknowledgments normally appear.
    *
    * 4. The names "Apache" and "Apache Software Foundation" and
  - *     "Apache Jetspeed" must not be used to endorse or promote products
  + *    "Apache Jetspeed" must not be used to endorse or promote products
    *    derived from this software without prior written permission. For
    *    written permission, please contact apache@apache.org.
    *
  - * 5. Products derived from this software may not be called "Apache" or
  + * 5. Products derived from this software may not be called "Apache",
    *    "Apache Jetspeed", nor may "Apache" appear in their name, without
    *    prior written permission of the Apache Software Foundation.
    *
  @@ -51,7 +51,6 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    */
  -
   package org.apache.jetspeed.om.page;
   
   /**
  
  
  
  1.2       +3 -3      jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/om/page/Reference.java
  
  Index: Reference.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/om/page/Reference.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Reference.java	3 Aug 2003 14:18:51 -0000	1.1
  +++ Reference.java	20 Nov 2003 19:02:23 -0000	1.2
  @@ -24,11 +24,11 @@
    *    if and wherever such third-party acknowledgments normally appear.
    *
    * 4. The names "Apache" and "Apache Software Foundation" and
  - *     "Apache Jetspeed" must not be used to endorse or promote products
  + *    "Apache Jetspeed" must not be used to endorse or promote products
    *    derived from this software without prior written permission. For
    *    written permission, please contact apache@apache.org.
    *
  - * 5. Products derived from this software may not be called "Apache" or
  + * 5. Products derived from this software may not be called "Apache",
    *    "Apache Jetspeed", nor may "Apache" appear in their name, without
    *    prior written permission of the Apache Software Foundation.
    *
  
  
  
  1.1                  jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/om/page/BaseElement.java
  
  Index: BaseElement.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Jetspeed" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Jetspeed", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  package org.apache.jetspeed.om.page;
  
  /**
   * BaseElement
   *
   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
   * @version $Id: BaseElement.java,v 1.1 2003/11/20 19:02:23 taylor Exp $
   */
  public interface BaseElement
  {
      /**
       * Returns the unique Id of this element. This id is guaranteed to be unique
       * from the complete portal and is suitable to be used as a unique key.
       *
       * @return the unique id of this element.
       */
      public String getId();
  
      /**
       * Modifies the id of this element. This id must not be null and must be unique
       * for the portal.
       *
       * @param id the new id for this element
       */
      public void setId(String id);
  
      /**
       * Returns the title in the default Locale
       *
       * @return the page title
       */
      public String getTitle();
  
      /**
       * Sets the title for the default Locale
       *
       * @param title the new title
       */
      public void setTitle(String title);
  
      /**
       * Returns the name of the default ACL that applies to this
       * element. This name should reference an entry in the Securtiy
       * registry
       *
       * @return the page default acl
       */
      public String getAcl();
  
      /**
       * Modifies the default ACL for this element.
       * This new acl must reference an entry in the Security
       * registry.
       * Additionnally, replacing the default ACL will not affect any
       * children fragments with their own specific ACLs
       *
       * @param aclName the name of the new ACL for the element
       */
      public void setAcl(String aclName);
          
  }
  
  
  
  1.2       +3 -3      jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/om/page/psml/AbstractBaseElement.java
  
  Index: AbstractBaseElement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/om/page/psml/AbstractBaseElement.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractBaseElement.java	3 Aug 2003 14:18:52 -0000	1.1
  +++ AbstractBaseElement.java	20 Nov 2003 19:02:23 -0000	1.2
  @@ -24,11 +24,11 @@
    *    if and wherever such third-party acknowledgments normally appear.
    *
    * 4. The names "Apache" and "Apache Software Foundation" and
  - *     "Apache Jetspeed" must not be used to endorse or promote products
  + *    "Apache Jetspeed" must not be used to endorse or promote products
    *    derived from this software without prior written permission. For
    *    written permission, please contact apache@apache.org.
    *
  - * 5. Products derived from this software may not be called "Apache" or
  + * 5. Products derived from this software may not be called "Apache",
    *    "Apache Jetspeed", nor may "Apache" appear in their name, without
    *    prior written permission of the Apache Software Foundation.
    *
  
  
  
  1.3       +3 -3      jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/om/page/psml/Defaults.java
  
  Index: Defaults.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/om/page/psml/Defaults.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Defaults.java	8 Aug 2003 22:05:55 -0000	1.2
  +++ Defaults.java	20 Nov 2003 19:02:23 -0000	1.3
  @@ -24,11 +24,11 @@
    *    if and wherever such third-party acknowledgments normally appear.
    *
    * 4. The names "Apache" and "Apache Software Foundation" and
  - *     "Apache Jetspeed" must not be used to endorse or promote products
  + *    "Apache Jetspeed" must not be used to endorse or promote products
    *    derived from this software without prior written permission. For
    *    written permission, please contact apache@apache.org.
    *
  - * 5. Products derived from this software may not be called "Apache" or
  + * 5. Products derived from this software may not be called "Apache",
    *    "Apache Jetspeed", nor may "Apache" appear in their name, without
    *    prior written permission of the Apache Software Foundation.
    *
  
  
  
  1.3       +4 -4      jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/om/page/psml/FragmentImpl.java
  
  Index: FragmentImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/om/page/psml/FragmentImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FragmentImpl.java	8 Aug 2003 22:05:55 -0000	1.2
  +++ FragmentImpl.java	20 Nov 2003 19:02:23 -0000	1.3
  @@ -24,11 +24,11 @@
    *    if and wherever such third-party acknowledgments normally appear.
    *
    * 4. The names "Apache" and "Apache Software Foundation" and
  - *     "Apache Jetspeed" must not be used to endorse or promote products
  + *    "Apache Jetspeed" must not be used to endorse or promote products
    *    derived from this software without prior written permission. For
    *    written permission, please contact apache@apache.org.
    *
  - * 5. Products derived from this software may not be called "Apache" or
  + * 5. Products derived from this software may not be called "Apache",
    *    "Apache Jetspeed", nor may "Apache" appear in their name, without
    *    prior written permission of the Apache Software Foundation.
    *
  @@ -223,7 +223,7 @@
           this.properties=props;
       }
   
  -    public void setFragments(List fragements)
  +    public void setFragments(List fragments)
       {
           this.fragments = fragments;
       }
  
  
  
  1.3       +3 -3      jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/om/page/psml/PageImpl.java
  
  Index: PageImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/om/page/psml/PageImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PageImpl.java	8 Aug 2003 22:05:55 -0000	1.2
  +++ PageImpl.java	20 Nov 2003 19:02:23 -0000	1.3
  @@ -24,11 +24,11 @@
    *    if and wherever such third-party acknowledgments normally appear.
    *
    * 4. The names "Apache" and "Apache Software Foundation" and
  - *     "Apache Jetspeed" must not be used to endorse or promote products
  + *    "Apache Jetspeed" must not be used to endorse or promote products
    *    derived from this software without prior written permission. For
    *    written permission, please contact apache@apache.org.
    *
  - * 5. Products derived from this software may not be called "Apache" or
  + * 5. Products derived from this software may not be called "Apache",
    *    "Apache Jetspeed", nor may "Apache" appear in their name, without
    *    prior written permission of the Apache Software Foundation.
    *
  
  
  
  1.5       +2 -3      jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/services/entity/PortletEntityService.java
  
  Index: PortletEntityService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/services/entity/PortletEntityService.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PortletEntityService.java	18 Oct 2003 19:54:51 -0000	1.4
  +++ PortletEntityService.java	20 Nov 2003 19:02:23 -0000	1.5
  @@ -75,12 +75,11 @@
       PortletEntity getPortletEntity(ObjectID id);
   
       PortletEntity getPortletEntity(PortletDefinition portletDefinition, String portletName);
  -
  +       
       void storePortletEntity(PortletEntity portletEntity);
   
       void removePortletEntity(PortletEntity portletEntity);
   
       PortletEntity newPortletEntityInstance(PortletDefinition portletDefinition);
  -
   
   }
  
  
  
  1.10      +14 -8     jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/services/entity/PortletEntityServiceImpl.java
  
  Index: PortletEntityServiceImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/services/entity/PortletEntityServiceImpl.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- PortletEntityServiceImpl.java	18 Oct 2003 19:54:51 -0000	1.9
  +++ PortletEntityServiceImpl.java	20 Nov 2003 19:02:23 -0000	1.10
  @@ -55,10 +55,11 @@
   
   import java.util.HashMap;
   
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogFactory;
   import org.apache.jetspeed.cps.BaseCommonService;
   import org.apache.jetspeed.cps.CPSInitializationException;
   import org.apache.jetspeed.cps.CommonPortletServices;
  -import org.apache.jetspeed.om.entity.impl.PortletEntityImpl;
   import org.apache.jetspeed.persistence.LookupCriteria;
   import org.apache.jetspeed.persistence.PersistencePlugin;
   import org.apache.jetspeed.persistence.PersistenceService;
  @@ -79,11 +80,13 @@
    */
   public class PortletEntityServiceImpl extends BaseCommonService implements PortletEntityService
   {
  +    protected final static Log log = LogFactory.getLog(PortletEntityServiceImpl.class);
   
       // TODO: this should eventually use a system cach like JCS
       private HashMap entityCache = new HashMap();
       private PersistencePlugin plugin;
       private boolean autoCreateNewEntities;
  +    private Class entityClass = null;
   
       /**
        * @see org.apache.fulcrum.Service#init()
  @@ -95,6 +98,7 @@
               PersistenceService ps = (PersistenceService) CommonPortletServices.getPortalService(PersistenceService.SERVICE_NAME);
               String pluginName = getConfiguration().getString("persistence.plugin.name", "jetspeed");
               autoCreateNewEntities = getConfiguration().getBoolean("autocreate", false);
  +            entityClass = this.loadModelClass("entity.impl");            
               plugin = ps.getPersistencePlugin(pluginName);
               setInit(true);
           }
  @@ -115,8 +119,8 @@
   
               LookupCriteria c = plugin.newLookupCriteria();
               c.addEqualTo("oid", entityId);
  -            Object q = plugin.generateQuery(PortletEntityImpl.class, c);
  -            PortletEntity portletEntity = (PortletEntity) plugin.getObjectByQuery(PortletEntityImpl.class, q);
  +            Object q = plugin.generateQuery(entityClass, c);
  +            PortletEntity portletEntity = (PortletEntity) plugin.getObjectByQuery(entityClass, q);
   
               entityCache.put(entityId, portletEntity);
               return portletEntity;
  @@ -144,7 +148,6 @@
       public void storePortletEntity(PortletEntity portletEntity)
       {
           plugin.update(portletEntity);
  -
       }
   
       /**
  @@ -152,6 +155,10 @@
        */
       public void removePortletEntity(PortletEntity portletEntity)
       {
  +        if (entityCache.containsKey(portletEntity.getId()))
  +        {
  +            entityCache.remove(entityCache.get(portletEntity.getId()));
  +        }
           plugin.delete(portletEntity);
       }
   
  @@ -160,10 +167,9 @@
        */
       public PortletEntity newPortletEntityInstance(PortletDefinition portletDefinition)
       {
  -        // TODO: need to be made configurable
  -        PortletEntityImpl portletEntity = new PortletEntityImpl();
  +        PortletEntityCtrl portletEntity = (PortletEntityCtrl)this.createObject(entityClass);
           portletEntity.setPortletDefinition(portletDefinition);
  -        return portletEntity;
  +        return (PortletEntity)portletEntity;
       }
   
   }
  
  
  
  1.3       +3 -3      jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/services/factory/FactoryManagementService.java
  
  Index: FactoryManagementService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/services/factory/FactoryManagementService.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FactoryManagementService.java	18 Oct 2003 19:54:51 -0000	1.2
  +++ FactoryManagementService.java	20 Nov 2003 19:02:24 -0000	1.3
  @@ -79,6 +79,6 @@
         ** @return   the service implementation
         **/
   
  -     public Factory getFactory (Class aClass);
  -    
  +    public Factory getFactory (Class aClass);
  +        
   }
  
  
  
  1.5       +5 -44     jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/services/page/impl/CastorXmlPageManagerService.java
  
  Index: CastorXmlPageManagerService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/services/page/impl/CastorXmlPageManagerService.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CastorXmlPageManagerService.java	18 Nov 2003 17:56:24 -0000	1.4
  +++ CastorXmlPageManagerService.java	20 Nov 2003 19:02:24 -0000	1.5
  @@ -69,15 +69,9 @@
   import org.apache.jetspeed.cache.file.FileCache;
   import org.apache.jetspeed.cache.file.FileCacheEntry;
   import org.apache.jetspeed.cache.file.FileCacheEventListener;
  -import org.apache.jetspeed.cps.BaseCommonService;
   import org.apache.jetspeed.cps.CPSInitializationException;
   import org.apache.jetspeed.exception.JetspeedException;
  -import org.apache.jetspeed.om.page.Fragment;
   import org.apache.jetspeed.om.page.Page;
  -import org.apache.jetspeed.om.page.Property;
  -import org.apache.jetspeed.om.page.psml.FragmentImpl;
  -import org.apache.jetspeed.om.page.psml.PageImpl;
  -import org.apache.jetspeed.om.page.psml.PropertyImpl;
   import org.apache.jetspeed.services.idgenerator.JetspeedIdGenerator;
   import org.apache.jetspeed.services.page.PageManagerService;
   import org.apache.xml.serialize.OutputFormat;
  @@ -98,7 +92,7 @@
    * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
    * @version $Id$
    */
  -public class CastorXmlPageManagerService extends BaseCommonService implements FileCacheEventListener, PageManagerService
  +public class CastorXmlPageManagerService extends AbstractPageManagerService implements FileCacheEventListener, PageManagerService
   {
       // configuration keys
       protected final static String CONFIG_ROOT = "root";
  @@ -149,6 +143,8 @@
               return;
           }
   
  +        super.init();
  +        
           // get the PSML Root Directory
           this.root = getConfiguration().getString(CONFIG_ROOT, DEFAULT_ROOT);
           this.rootDir = new File(root);
  @@ -211,41 +207,6 @@
       }
   
       /**
  -     * @see org.apache.jetspeed.services.page.PageManagerService#newPage()
  -     */
  -    public Page newPage()
  -    {
  -        PageImpl p = new PageImpl();
  -        p.setId(JetspeedIdGenerator.getNextPeid());
  -        FragmentImpl f = new FragmentImpl();
  -        f.setId(JetspeedIdGenerator.getNextPeid());
  -        f.setType(Fragment.LAYOUT);
  -        p.setRootFragment(f);
  -
  -        return p;
  -    }
  -
  -    /**
  -     * @see org.apache.jetspeed.services.page.PageManagerService#newFragment()
  -     */
  -    public Fragment newFragment()
  -    {
  -        FragmentImpl f = new FragmentImpl();
  -        f.setId(JetspeedIdGenerator.getNextPeid());
  -        f.setType(Fragment.LAYOUT);
  -
  -        return f;
  -    }
  -
  -    /**
  -     * @see org.apache.jetspeed.services.page.PageManagerService#newProperty()
  -     */
  -    public Property newProperty()
  -    {
  -        return new PropertyImpl();
  -    }
  -
  -    /**
        * @see org.apache.jetspeed.services.page.PageManagerService#getPage(java.lang.String)
        */
       public Page getPage(String id)
  @@ -359,7 +320,7 @@
        */
       public void registerPage(Page page) throws JetspeedException
       {
  -        // snaity checks
  +        // sanity checks
           if (page == null)
           {
               log.warn("Recieved null page to register");
  
  
  
  1.2       +46 -122   jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/services/page/impl/DatabasePageManagerService.java
  
  Index: DatabasePageManagerService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/services/page/impl/DatabasePageManagerService.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DatabasePageManagerService.java	18 Nov 2003 17:56:24 -0000	1.1
  +++ DatabasePageManagerService.java	20 Nov 2003 19:02:24 -0000	1.2
  @@ -53,19 +53,20 @@
    */
   package org.apache.jetspeed.services.page.impl;
   
  +import java.util.HashMap;
   import java.util.List;
  +import java.util.Map;
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  -import org.apache.jetspeed.cps.BaseCommonService;
   import org.apache.jetspeed.cps.CPSInitializationException;
   import org.apache.jetspeed.cps.CommonPortletServices;
   import org.apache.jetspeed.exception.JetspeedException;
  -import org.apache.jetspeed.om.page.Fragment;
   import org.apache.jetspeed.om.page.Page;
  -import org.apache.jetspeed.om.page.Property;
  +import org.apache.jetspeed.persistence.LookupCriteria;
   import org.apache.jetspeed.persistence.PersistencePlugin;
   import org.apache.jetspeed.persistence.PersistenceService;
  +import org.apache.jetspeed.services.idgenerator.JetspeedIdGenerator;
   import org.apache.jetspeed.services.page.PageManagerService;
   
   /**
  @@ -75,7 +76,7 @@
    * @version $Id$
    */
   public class DatabasePageManagerService
  -    extends BaseCommonService
  +    extends AbstractPageManagerService
       implements PageManagerService
   {
       protected final static Log log = LogFactory.getLog(DatabasePageManagerService.class);
  @@ -86,8 +87,8 @@
   
       private String originalAlias;
       
  -    private Class fragmentClass = null;
  -    private Class pageClass = null;
  +    // TODO: this should eventually use a system cach like JCS
  +    private Map pageCache = new HashMap();
       
       /* (non-Javadoc)
        * @see org.apache.fulcrum.Service#init()
  @@ -96,89 +97,40 @@
       {
           if (!isInitialized())
           {
  +            super.init();
  +            
               PersistenceService ps = (PersistenceService) CommonPortletServices.getPortalService(PersistenceService.SERVICE_NAME);
               String pluginName = getConfiguration().getString("persistence.plugin.name", "jetspeed");
   
               plugin = ps.getPersistencePlugin(pluginName);
  -
  -            pageClass = this.loadModelClass("page.impl");
  -            fragmentClass = this.loadModelClass("fragment.impl");
               
               setInit(true);
           }
       }
       
  -    /* (non-Javadoc)
  -     * @see org.apache.jetspeed.services.page.PageManagerService#newPage()
  -     */
  -    public Page newPage()
  -    {
  -        Page page = null;
  -        try
  -        {
  -            // factory create the page
  -           // page = (Page)createObject(this.pageClass);
  -            
  -            // set the id
  -           // page.setId(JetspeedIdGenerator.getNextPeid());
  -            
  -            // create the default fragment
  -            // Fragment fragment = createObject(this.fragmentClass)
  -            // fragment.setId(JetspeedIdGenerator.getNextPeid());
  -            // fragment.setType(Fragment.LAYOUT);
  -            // page.setRootFragment(f);            
  -        }
  -        catch (ClassCastException e)
  -        {
  -            String message = "Failed to create page object for " + this.pageClass;
  -            log.error(message, e);
  -            //throw new JetspeedException(message, e);
  -        }
  -        return page;        
  -    }
       
       /* (non-Javadoc)
  -     * @see org.apache.jetspeed.services.page.PageManagerService#newFragment()
  +     * @see org.apache.jetspeed.services.page.PageManagerService#getPage(java.lang.String)
        */
  -    public Fragment newFragment()
  +    public Page getPage(String id)
       {
  -        Fragment fragment = null;
  -        try
  +        if (pageCache.containsKey(id))
           {
  -            // factory create the page
  -            // fragment = (Fragment)createObject(this.fragmentClass);
  -
  -            // fragment.setId(JetspeedIdGenerator.getNextPeid());
  -            fragment.setType(Fragment.LAYOUT);
  -            
  +            return (Page) pageCache.get(id);
           }
  -        catch (ClassCastException e)
  +        else
           {
  -            String message = "Failed to create page object for " + this.pageClass;
  -            log.error(message, e);
  -            // throw new JetspeedException(message, e);
  +            LookupCriteria c = plugin.newLookupCriteria();
  +            c.addEqualTo("id", id);
  +            Object q = plugin.generateQuery(pageClass, c);
  +            Page page = (Page) plugin.getObjectByQuery(pageClass, q);
  +
  +            pageCache.put(id, page);
  +            return page;
           }
  -        return fragment;        
  -    }
  -    
  -    /* (non-Javadoc)
  -     * @see org.apache.jetspeed.services.page.PageManagerService#newProperty()
  -     */
  -    public Property newProperty()
  -    {
  -        // TODO Auto-generated method stub
  -        return null;
       }
       
       /* (non-Javadoc)
  -     * @see org.apache.jetspeed.services.page.PageManagerService#getPage(java.lang.String)
  -     */
  -    public Page getPage(String id)
  -    {
  -        // TODO Auto-generated method stub
  -        return null;
  -    }
  -    /* (non-Javadoc)
        * @see org.apache.jetspeed.services.page.PageManagerService#listPages()
        */
       public List listPages()
  @@ -186,77 +138,49 @@
           // TODO Auto-generated method stub
           return null;
       }
  +    
       /* (non-Javadoc)
        * @see org.apache.jetspeed.services.page.PageManagerService#registerPage(org.apache.jetspeed.om.page.Page)
        */
       public void registerPage(Page page) throws JetspeedException
       {
  -        // TODO Auto-generated method stub
  +        // sanity checks
  +        if (page == null)
  +        {
  +            log.warn("Recieved null page to register");
  +            return;
  +        }
  +
  +        String id = page.getId();
  +
  +        if (id == null)
  +        {
  +            page.setId(JetspeedIdGenerator.getNextPeid());
  +            id = page.getId();
  +            log.warn("Page with no Id, created new Id : " + id);
  +        }
  +        
  +        
       }
  +    
       /* (non-Javadoc)
        * @see org.apache.jetspeed.services.page.PageManagerService#updatePage(org.apache.jetspeed.om.page.Page)
        */
       public void updatePage(Page page) throws JetspeedException
       {
  -        // TODO Auto-generated method stub
  +        plugin.update(page);
       }
  +    
       /* (non-Javadoc)
        * @see org.apache.jetspeed.services.page.PageManagerService#removePage(org.apache.jetspeed.om.page.Page)
        */
       public void removePage(Page page)
       {
  -        // TODO Auto-generated method stub
  -    }
  -    
  -    /**
  -     * Load an implementation class from the configuration.
  -     * 
  -     * @param configurationName
  -     * @return
  -     * @throws CPSInitializationException
  -     */
  -    private Class loadModelClass(String configurationName)
  -    throws CPSInitializationException
  -    {
  -        String className = getConfiguration().getString(configurationName, null);
  -        if (null == className)
  -        {
  -            throw new CPSInitializationException(configurationName + " implementation configuration not found.");
  -        }
  -
  -        try
  +        if (pageCache.containsKey(page.getId()))
           {
  -            return Class.forName(className);
  +            pageCache.remove(pageCache.get(page.getId()));
           }
  -        catch (ClassNotFoundException e)
  -        {
  -            throw new CPSInitializationException("Could not preload " + className + " implementation class.", e);
  -        }            
  +        plugin.delete(page);
       }
  -    
  -    /**
  -     * Creates page model objects given the class. 
  -     * Throws exceptions if the class is not found in the default class path, 
  -     * or the class is not an instance of CmsObject.
  -     * 
  -     * @param classe the class of object
  -     * @return the newly created object
  -     * @throws ContentManagementException
  -     */
  -    private Object createObject(Class classe)
  -    throws JetspeedException    
  -    {
  -        Object object = null;
  -        try
  -        {
  -            object = classe.newInstance();
  -        }
  -        catch (Exception e)
  -        {
  -            throw new JetspeedException("Syndication Model Factory failed to create model object: " + 
  -                                        classe.getName(), e);            
  -        }
           
  -        return object;        
  -    }
   }
  
  
  
  1.1                  jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/services/page/impl/AbstractPageManagerService.java
  
  Index: AbstractPageManagerService.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Jetspeed" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Jetspeed", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  package org.apache.jetspeed.services.page.impl;
  
  import org.apache.jetspeed.cps.BaseCommonService;
  import org.apache.jetspeed.cps.CPSInitializationException;
  import org.apache.jetspeed.om.page.Fragment;
  import org.apache.jetspeed.om.page.Page;
  import org.apache.jetspeed.om.page.Property;
  import org.apache.jetspeed.services.idgenerator.JetspeedIdGenerator;
  import org.apache.jetspeed.services.page.PageManagerService;
  
  /**
   * AbstractPageManagerService
   *
   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
   * @version $Id: AbstractPageManagerService.java,v 1.1 2003/11/20 19:02:24 taylor Exp $
   */
  public abstract class AbstractPageManagerService 
      extends BaseCommonService
      implements PageManagerService    
  {
      protected Class fragmentClass = null;
      protected Class pageClass = null;
      protected Class propertyClass = null;
      
      /* (non-Javadoc)
       * @see org.apache.fulcrum.Service#init()
       */
      public void init() throws CPSInitializationException
      {
          pageClass = loadModelClass("page.impl");
          fragmentClass = loadModelClass("fragment.impl");
          propertyClass = loadModelClass("property.impl"); 
      }
      
      /* (non-Javadoc)
       * @see org.apache.jetspeed.services.page.PageManagerService#newPage()
       */
      public Page newPage()
      {
          Page page = null;
          try
          {
              // factory create the page
              page = (Page)createObject(this.pageClass);            
              page.setId(JetspeedIdGenerator.getNextPeid());
              
              // create the default fragment
              Fragment fragment = (Fragment)createObject(this.fragmentClass);
              fragment.setId(JetspeedIdGenerator.getNextPeid());
              fragment.setType(Fragment.LAYOUT);
              page.setRootFragment(fragment);            
          }
          catch (ClassCastException e)
          {
              String message = "Failed to create page object for " + this.pageClass;
              log.error(message, e);
          }
          return page;        
      }
      
      /* (non-Javadoc)
       * @see org.apache.jetspeed.services.page.PageManagerService#newFragment()
       */
      public Fragment newFragment()
      {
          Fragment fragment = null;
          try
          {
              fragment = (Fragment)createObject(this.fragmentClass);
              fragment.setId(JetspeedIdGenerator.getNextPeid());
              fragment.setType(Fragment.LAYOUT);
              
          }
          catch (ClassCastException e)
          {
              String message = "Failed to create page object for " + this.pageClass;
              log.error(message, e);
              // throw new JetspeedException(message, e);
          }
          return fragment;        
      }
      
      /* (non-Javadoc)
       * @see org.apache.jetspeed.services.page.PageManagerService#newProperty()
       */
      public Property newProperty()
      {
          Property property = null;
          try
          {
              property = (Property)createObject(this.propertyClass);
              
          }
          catch (ClassCastException e)
          {
              String message = "Failed to create fragment-property object for " + this.propertyClass;
              log.error(message, e);
              // throw new JetspeedException(message, e);
          }
          return property;        
      }
      
  }
  
  
  
  1.3       +10 -12    jakarta-jetspeed-2/portal/src/sql/hsql/create-db-phase2.sql
  
  Index: create-db-phase2.sql
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/sql/hsql/create-db-phase2.sql,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- create-db-phase2.sql	15 Oct 2003 20:18:24 -0000	1.2
  +++ create-db-phase2.sql	20 Nov 2003 19:02:24 -0000	1.3
  @@ -3,8 +3,7 @@
   ----------------------------------------------------------------------------
   CREATE TABLE PAGE
   (
  -    PAGE_ID INTEGER NOT NULL PRIMARY KEY,
  -    ID VARCHAR(80),
  +    PAGE_ID VARCHAR(80) NOT NULL PRIMARY KEY,
       TITLE VARCHAR(100),
       DEFAULT_SKIN VARCHAR(100),
       DEFAULT_DECORATOR VARCHAR(100),
  @@ -18,8 +17,7 @@
   ----------------------------------------------------------------------------
   CREATE TABLE FRAGMENT
   ( 
  -    FRAGMENT_ID INTEGER NOT NULL PRIMARY KEY,
  -    ID VARCHAR(80),
  +    FRAGMENT_ID VARCHAR(80) NOT NULL PRIMARY KEY,
       COMPONENT_NAME(80),
       ACL VARCHAR(80),
       TITLE VARCHAR(100),
  @@ -33,8 +31,8 @@
   -- associates a page with its top level fragments
   CREATE TABLE PAGE_FRAGMENTS
   (
  -    PAGE_ID INTEGER NOT NULL,
  -    FRAGMENT_ID INTEGER NOT NULL,    
  +    PAGE_ID VARCHAR(80) NOT NULL,
  +    FRAGMENT_ID VARCHAR(80) NOT NULL,    
   );
   
   CREATE INDEX IX_PAGE_FRAGMENTS_1 ON PAGE_FRAGMENTS (PAGE_ID, FRAGMENT_ID);
  @@ -42,8 +40,8 @@
   -- associates a fragment with its top level fragments
   CREATE TABLE SUB_FRAGMENTS
   (
  -    FRAGMENT_ID INTEGER NOT NULL,
  -    SUB_FRAGMENT_ID INTEGER NOT NULL
  +    FRAGMENT_ID VARCHAR(80) NOT NULL,
  +    SUB_FRAGMENT_ID VARCHAR(80) NOT NULL
   );
   
   CREATE INDEX IX_SUB_FRAGMENTS_1 ON SUB_FRAGMENTS (FRAGMENT_ID, SUBFRAGMENT_ID);
  @@ -62,16 +60,16 @@
   -- names a reference to a fragment subtree
   CREATE TABLE FRAGMENT_REF
   (
  -    FRAGMENT_REF_ID INTEGER NOT NULL PRIMARY KEY,
  -    FRAGMENT_ID INTEGER NOT NULL,
  +    FRAGMENT_REF_ID VARCHAR(80) NOT NULL PRIMARY KEY,
  +    FRAGMENT_ID VARCHAR(80) NOT NULL,
       NAME VARCHAR(80) NOT NULL,
       TITLE VARCHAR(100)
   );
   
   CREATE TABLE FRAGMENT_REFS
   (
  -    FRAGMENT_REF_ID INTEGER NOT NULL,
  -    FRAGMENT_ID INTEGER NOT NULL
  +    FRAGMENT_REF_ID VARCHAR(80) NOT NULL,
  +    FRAGMENT_ID VARCHAR(80) NOT NULL
   );
   
   
  
  
  
  1.4       +11 -11    jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/services/page/TestPageXmlPersistence.java
  
  Index: TestPageXmlPersistence.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/services/page/TestPageXmlPersistence.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestPageXmlPersistence.java	18 Oct 2003 20:48:27 -0000	1.3
  +++ TestPageXmlPersistence.java	20 Nov 2003 19:02:24 -0000	1.4
  @@ -74,7 +74,7 @@
   public class TestPageXmlPersistence extends JetspeedTest
   {
       private PageManagerService service = null;
  -    private String test_id = "test002";
  +    private String testId = "test002";
   
       /**
        * Defines the testcase name for JUnit.
  @@ -215,8 +215,8 @@
       {
           PageManagerService pms = getService();
           Page page = pms.newPage();
  -        System.out.println("Retrieved test_id in register " + this.test_id);
  -        page.setId(this.test_id);
  +        System.out.println("Retrieved test_id in register " + this.testId);
  +        page.setId(this.testId);
           page.setDefaultSkin("myskin");
           page.setTitle("Registered Page");
   
  @@ -249,9 +249,9 @@
               assertNotNull(errmsg, null);
           }
   
  -        page = pms.getPage(this.test_id);
  +        page = pms.getPage(this.testId);
           assertNotNull(page);
  -        assertTrue(page.getId().equals(this.test_id));
  +        assertTrue(page.getId().equals(this.testId));
           assertTrue(page.getTitle().equals("Registered Page"));
           assertNotNull(page.getRootFragment());
           assertTrue(page.getRootFragment().getName().equals("TestLayout"));
  @@ -265,7 +265,7 @@
       public void testUpdatePage() throws Exception
       {
           PageManagerService pms = getService();
  -        Page page = pms.getPage(this.test_id);
  +        Page page = pms.getPage(this.testId);
           page.setTitle("Updated Title");
   
           try
  @@ -280,7 +280,7 @@
               assertNotNull(errmsg, null);
           }
   
  -        page = pms.getPage(this.test_id);
  +        page = pms.getPage(this.testId);
           assertTrue(page.getTitle().equals("Updated Title"));
       }
   
  @@ -289,14 +289,14 @@
           PageManagerService pms = getService();
           List pages = pms.listPages();
           assertTrue(pages.size() == 2);
  -        assertTrue(pages.contains(this.test_id));
  +        assertTrue(pages.contains(this.testId));
           assertTrue(pages.contains("test001"));
       }
   
       public void testRemovePage() throws Exception
       {
           PageManagerService pms = getService();
  -        Page page = pms.getPage(this.test_id);
  +        Page page = pms.getPage(this.testId);
   
           try
           {
  @@ -310,7 +310,7 @@
               assertNotNull(errmsg, null);
           }
   
  -        page = pms.getPage(this.test_id);
  +        page = pms.getPage(this.testId);
           assertNull(page);
       }
   }
  
  
  
  1.1                  jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/services/page/TestPageDBPersistence.java
  
  Index: TestPageDBPersistence.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Jetspeed" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Jetspeed", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  package org.apache.jetspeed.services.page;
  
  import junit.framework.Test;
  import junit.framework.TestSuite;
  
  import org.apache.jetspeed.cps.CommonPortletServices;
  import org.apache.jetspeed.om.page.Fragment;
  import org.apache.jetspeed.om.page.Page;
  import org.apache.jetspeed.test.JetspeedTest;
  
  /**
   * TestPageService
   *
   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
   * @version $Id: TestPageDBPersistence.java,v 1.1 2003/11/20 19:02:24 taylor Exp $
   */
  public class TestPageDBPersistence extends JetspeedTest
  {
      private PageManagerService service = null;
      
      /**
       * Defines the testcase name for JUnit.
       *
       * @param name the testcase's name.
       */
      public TestPageDBPersistence(String name)
      {
          super(name);
      }
  
      /**
       * Start the tests.
       *
       * @param args the arguments. Not used
       */
      public static void main(String args[])
      {
          junit.awtui.TestRunner.main(new String[] { TestPageDBPersistence.class.getName()});
      }
  
      public void setup()
      {
          System.out.println("Setup: Testing Page Service");
      }
  
      /**
       * Creates the test suite.
       *
       * @return a test suite (<code>TestSuite</code>) that includes all methods
       *         starting with "test"
       */
      public static Test suite()
      {
          // All methods starting with "test" will be executed in the test suite.
          return new TestSuite(TestPageDBPersistence.class);
      }
      
      protected PageManagerService getService()
      {
          if (service == null)
          {
              service = (PageManagerService) CommonPortletServices.getPortalService("DB" + PageManagerService.SERVICE_NAME);
          }
          return service;
      }
  
      public void testService()
      {
          assertNotNull(getService());
      }
      
      private Page buildBasePage(String name)
      {
          Page page = getService().newPage();
          page.setTitle("TEST");
  
          Fragment frag = getService().newFragment();
          frag.setId("Frag1");
          frag.setType(Fragment.LAYOUT);
  
          page.setRootFragment(frag);
  
          return page;
      }
      
  }
  
  
  
  1.9       +17 -3     jakarta-jetspeed-2/portal/src/webapp/WEB-INF/conf/jetspeed.properties
  
  Index: jetspeed.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/webapp/WEB-INF/conf/jetspeed.properties,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- jetspeed.properties	18 Oct 2003 20:43:30 -0000	1.8
  +++ jetspeed.properties	20 Nov 2003 19:02:24 -0000	1.9
  @@ -265,6 +265,14 @@
   #  E N T I T Y   S E R V I C E
   #---------------------------------------------------------------------------
   services.PortletEntityService.classname=org.apache.jetspeed.services.entity.PortletEntityServiceImpl
  +services.PortletEntityService.entity.impl = org.apache.jetspeed.om.entity.impl.PortletEntityImpl
  +
  +# -------------------------------------------------------------------
  +# Page Manager 
  +# -------------------------------------------------------------------
  +services.PageManager.fragment.impl = org.apache.jetspeed.om.page.psml.FragmentImpl
  +services.PageManager.page.impl = org.apache.jetspeed.om.page.psml.PageImpl
  +services.PageManager.property.impl = org.apache.jetspeed.om.page.psml.PropertyImpl
   
   # -------------------------------------------------------------------
   # Page Manager (Castor based)            
  @@ -273,8 +281,14 @@
   services.PageManager.root=/WEB-INF/pages
   services.PageManager.ext=.psml
   services.PageManager.mapping=/WEB-INF/conf/page-mapping.xml
  -# scan rate in seconds (every 2 minutes)
  +scan rate in seconds (every 2 minutes)
   services.PageManager.scanRate=120
  -# cache size - number of PSML pages to cache
  +cache size - number of PSML pages to cache
   services.PageManager.cacheSize=100
  +
  +# -------------------------------------------------------------------
  +# Page Manager (Database)            
  +# -------------------------------------------------------------------
  +# services.PageManager.classname = org.apache.jetspeed.services.page.impl.DatabasePageManagerService
  +
   
  
  
  
  1.2       +8 -18     jakarta-jetspeed-2/portal/src/webapp/WEB-INF/conf/ojb/repository_page.xml
  
  Index: repository_page.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/webapp/WEB-INF/conf/ojb/repository_page.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- repository_page.xml	15 Oct 2003 20:18:24 -0000	1.1
  +++ repository_page.xml	20 Nov 2003 19:02:24 -0000	1.2
  @@ -3,20 +3,15 @@
   -->	
    
     <class-descriptor
  -   	  class="org.apache.jetspeed.om.page.impl.ojb.PageImpl"
  +   	  class="org.apache.jetspeed.om.page.impl.PageImpl"
      	  table="PAGE"
      >     
         <field-descriptor
  -         name="pageId"
  -         column="PAGE_ID"
  -         jdbc-type="INTEGER"
  -         primarykey="true"
  -         autoincrement="true"         
  -      />
  -      <field-descriptor
            name="id"
            column="ID"
            jdbc-type="VARCHAR"
  +         primarykey="true"
  +         autoincrement="false"         
         />
         <field-descriptor
            name="title"
  @@ -45,7 +40,7 @@
         />              
         <collection-descriptor
         	  name="pageFragments" 
  -          element-class-ref="org.apache.jetspeed.om.page.impl.ojb.FragmentImpl" 
  +          element-class-ref="org.apache.jetspeed.om.page.impl.FragmentImpl" 
             indirection-table="PAGE_FRAGMENTS">
             <fk-pointing-to-this-class column="PAGE_ID"/>
             <fk-pointing-to-element-class column="FRAGMENT_ID"/>
  @@ -57,20 +52,15 @@
   -->	
    
     <class-descriptor
  -   	  class="org.apache.jetspeed.om.page.impl.ojb.FragmentImpl"
  +   	  class="org.apache.jetspeed.om.page.impl.FragmentImpl"
      	  table="FRAGMENT"
      >     
         <field-descriptor
  -         name="fragmentId"
  -         column="FRAGMENT_ID"
  -         jdbc-type="INTEGER"
  -         primarykey="true"
  -         autoincrement="true"         
  -      />
  -      <field-descriptor
            name="id"
            column="ID"
            jdbc-type="VARCHAR"
  +         primarykey="true"
  +         autoincrement="false"         
         />
         <field-descriptor
            name="title"
  @@ -110,7 +100,7 @@
   
           <collection-descriptor
         	  name="subFragments" 
  -          element-class-ref="org.apache.jetspeed.om.page.impl.ojb.FragmentImpl" 
  +          element-class-ref="org.apache.jetspeed.om.page.impl.FragmentImpl" 
             indirection-table="FRAGMENTS">
             <fk-pointing-to-this-class column="FRAGMENT_ID"/>
             <fk-pointing-to-element-class column="SUB_FRAGMENT_ID"/>
  
  
  
  1.6       +13 -2     jakarta-jetspeed-2/portal/src/webapp/WEB-INF/conf/test/jetspeed.properties
  
  Index: jetspeed.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/webapp/WEB-INF/conf/test/jetspeed.properties,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- jetspeed.properties	14 Oct 2003 06:37:57 -0000	1.5
  +++ jetspeed.properties	20 Nov 2003 19:02:24 -0000	1.6
  @@ -36,6 +36,17 @@
   services.XMLPageManager.scanRate=120
   # cache size - number of PSML pages to cache
   services.XMLPageManager.cacheSize=100
  +services.XMLPageManager.fragment.impl = org.apache.jetspeed.om.page.psml.FragmentImpl
  +services.XMLPageManager.page.impl = org.apache.jetspeed.om.page.psml.PageImpl
  +services.XMLPageManager.property.impl = org.apache.jetspeed.om.page.psml.PropertyImpl
   
   services.PageManager.root=./test/testdata/pages
  -services.PageManager.mapping=/WEB-INF/conf/page-mapping.xml
  \ No newline at end of file
  +services.PageManager.mapping=/WEB-INF/conf/page-mapping.xml
  +
  +# -------------------------------------------------------------------
  +# Page Manager (DB)            
  +# -------------------------------------------------------------------
  +services.DBPageManager.classname = org.apache.jetspeed.services.page.impl.DatabasePageManagerService
  +services.DBPageManager.fragment.impl = org.apache.jetspeed.om.page.psml.FragmentImpl
  +services.DBPageManager.page.impl = org.apache.jetspeed.om.page.psml.PageImpl
  +services.DBPageManager.property.impl = org.apache.jetspeed.om.page.psml.PropertyImpl
  
  
  

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


Mime
View raw message