incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r126056 - in incubator/graffito/trunk/components/src: java/META-INF java/org/apache/portals/graffito/store/impl java/org/apache/portals/graffito/store/impl/fs java/org/apache/portals/graffito/store/impl/ojb schema sql/GraffitoServer sql/GraffitoServer/mysql test/org/apache/portals/graffito/impl
Date Sat, 22 Jan 2005 21:41:35 GMT
Author: clombart
Date: Sat Jan 22 13:41:33 2005
New Revision: 126056

URL: http://svn.apache.org/viewcvs?view=rev&rev=126056
Log:
The unit test for the FileSystemServer failed for different reasons : 
* Missing constructor in FileSystemContentStore. Now, it is not possible to build if the constructor
is missing.
* the Master store schema was not yet ready to support a FS server. I modified the SQL DB
schema in order to support this kind of store. 
* Review the SQL script (drop & delete) in order to support correctly a FS store. 

The work completed by David shows that it is not easy to add a new content store type. We
have to find a better solution. it is tedious to change the DB schema each time a new kind
of content store is needed. 
Added:
   incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/AbstractGraffitoStore.java
Modified:
   incubator/graffito/trunk/components/src/java/META-INF/repository_graffito.xml
   incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/fs/FileSystemContentStore.java
   incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/ojb/GraffitoOJBStore.java
   incubator/graffito/trunk/components/src/schema/graffitostore-schema.xml
   incubator/graffito/trunk/components/src/sql/GraffitoServer/delete-db.sql
   incubator/graffito/trunk/components/src/sql/GraffitoServer/mysql/drop-db.sql
   incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/impl/TestContentServerService.java

Modified: incubator/graffito/trunk/components/src/java/META-INF/repository_graffito.xml
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/components/src/java/META-INF/repository_graffito.xml?view=diff&rev=126056&p1=incubator/graffito/trunk/components/src/java/META-INF/repository_graffito.xml&r1=126055&p2=incubator/graffito/trunk/components/src/java/META-INF/repository_graffito.xml&r2=126056
==============================================================================
--- incubator/graffito/trunk/components/src/java/META-INF/repository_graffito.xml	(original)
+++ incubator/graffito/trunk/components/src/java/META-INF/repository_graffito.xml	Sat Jan
22 13:41:33 2005
@@ -413,6 +413,7 @@
 	<class-descriptor class="org.apache.portals.graffito.model.Server">	      
 	      <extent-class class-ref="org.apache.portals.graffito.model.impl.WebdavServerImpl"
/>
 	      <extent-class class-ref="org.apache.portals.graffito.model.impl.GraffitoServerImpl"
/>      
+	      <extent-class class-ref="org.apache.portals.graffito.model.impl.FileSystemServerImpl"
/>		  
 	</class-descriptor>       
 	
 	<class-descriptor class="org.apache.portals.graffito.model.WebdavServer">
@@ -423,6 +424,10 @@
 	      <extent-class class-ref="org.apache.portals.graffito.model.impl.GraffitoServerImpl"
/>
 	</class-descriptor>       
 	
+	<class-descriptor class="org.apache.portals.graffito.model.FileSystemServer">
+	      <extent-class class-ref="org.apache.portals.graffito.model.impl.FileSystemServerImpl"
/>
+	</class-descriptor>       
+		
 	<class-descriptor
 	    class="org.apache.portals.graffito.model.impl.ServerImpl"
 	    table="SERVER"
@@ -586,6 +591,36 @@
 		jdbc-type="VARCHAR"
 	    />
 		    
+	    <reference-descriptor name="super"
+		class-ref="org.apache.portals.graffito.model.impl.ServerImpl"
+		auto-retrieve="true"
+		auto-update="true"
+		auto-delete="true"
+	    >
+		<foreignkey field-ref="serverId"/>
+	    </reference-descriptor>
+	    
+	</class-descriptor>
+
+
+	<class-descriptor
+	    class="org.apache.portals.graffito.model.impl.FileSystemServerImpl"
+	    table="GRAFFITO_FS_SERVER"
+	>
+	    <field-descriptor
+		name="serverId"
+		column="SERVER_ID"
+		jdbc-type="INTEGER"
+		primarykey="true"
+		autoincrement="true"
+	    />
+	
+	    <field-descriptor
+		name="root"
+		column="ROOT"
+		jdbc-type="VARCHAR"
+	    />
+	    		    
 	    <reference-descriptor name="super"
 		class-ref="org.apache.portals.graffito.model.impl.ServerImpl"
 		auto-retrieve="true"

Added: incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/AbstractGraffitoStore.java
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/AbstractGraffitoStore.java?view=auto&rev=126056
==============================================================================
--- (empty file)
+++ incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/AbstractGraffitoStore.java
Sat Jan 22 13:41:33 2005
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed 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.portals.graffito.store.impl;
+
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.portals.graffito.exception.CmsInstantiateException;
+import org.apache.portals.graffito.model.Server;
+import org.apache.portals.graffito.security.CmsAccessController;
+import org.apache.portals.graffito.store.ContentStore;
+
+/**
+ * Abstract Content Store
+ *
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe
</a>
+ * @version $Id: Exp $
+ */
+public abstract class AbstractGraffitoStore implements ContentStore
+{
+
+    protected static final Log log = LogFactory.getLog(AbstractGraffitoStore.class);
+    
+   
+    /** Server scope associated to this content store */
+    protected String scope;
+    
+    protected CmsAccessController cmsAccessController;
+
+    /**
+     * Constructor based on the a server object.
+     * 
+     * @param server
+     *            The server object contains all information to connect to this
+     *            content store
+     * @param cmsAccessController
+     *            The CmsAccesController used to check the permissions
+     *            
+     * @throws CmsInstantiateException
+     *             when it is not possible to instantiate this store
+     */
+    public AbstractGraffitoStore(Server server, CmsAccessController cmsAccessController)
throws CmsInstantiateException
+    {
+        this.cmsAccessController = cmsAccessController;
+
+
+    }
+
+ 
+}
\ No newline at end of file

Modified: incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/fs/FileSystemContentStore.java
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/fs/FileSystemContentStore.java?view=diff&rev=126056&p1=incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/fs/FileSystemContentStore.java&r1=126055&p2=incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/fs/FileSystemContentStore.java&r2=126056
==============================================================================
--- incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/fs/FileSystemContentStore.java
(original)
+++ incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/fs/FileSystemContentStore.java
Sat Jan 22 13:41:33 2005
@@ -18,13 +18,19 @@
 import java.util.Collection;
 import java.util.Iterator;
 
+
+import org.apache.portals.graffito.exception.CmsInstantiateException;
 import org.apache.portals.graffito.exception.CmsPermissionException;
 import org.apache.portals.graffito.model.CmsObject;
 import org.apache.portals.graffito.model.Document;
+import org.apache.portals.graffito.model.FileSystemServer;
 import org.apache.portals.graffito.model.HistoryElement;
+import org.apache.portals.graffito.model.Server;
 import org.apache.portals.graffito.persistence.ContentPersistenceException;
 import org.apache.portals.graffito.search.Filter;
+import org.apache.portals.graffito.security.CmsAccessController;
 import org.apache.portals.graffito.store.ContentStore;
+import org.apache.portals.graffito.store.impl.AbstractGraffitoStore;
 
 /**
  * File System Content Store
@@ -32,9 +38,31 @@
  * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
  * @version $Id: $
  */
-public class FileSystemContentStore implements ContentStore
+public class FileSystemContentStore extends AbstractGraffitoStore implements ContentStore
 {
-
+    
+    private FileSystemServer fileSystemServer;
+    
+    
+    /**
+     * Constructor based on the a server object.
+     * 
+     * @param server
+     *            The server object contains all information to connect to this
+     *            content store
+     * @param cmsAccessController
+     *            The CmsAccesController used to check the permissions
+     *            
+     * @throws CmsInstantiateException
+     *             when it is not possible to instantiate this store
+     */
+    public FileSystemContentStore(Server server, CmsAccessController cmsAccessController)
throws CmsInstantiateException
+    {
+        super(server, cmsAccessController);
+        fileSystemServer = (FileSystemServer) server;
+    }
+    
+    
     /* (non-Javadoc)
      * @see org.apache.portals.graffito.store.ContentStore#getCmsObject(java.lang.String)
      */

Modified: incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/ojb/GraffitoOJBStore.java
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/ojb/GraffitoOJBStore.java?view=diff&rev=126056&p1=incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/ojb/GraffitoOJBStore.java&r1=126055&p2=incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/ojb/GraffitoOJBStore.java&r2=126056
==============================================================================
--- incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/ojb/GraffitoOJBStore.java
(original)
+++ incubator/graffito/trunk/components/src/java/org/apache/portals/graffito/store/impl/ojb/GraffitoOJBStore.java
Sat Jan 22 13:41:33 2005
@@ -41,6 +41,7 @@
 import org.apache.portals.graffito.security.CmsAccessController;
 import org.apache.portals.graffito.security.impl.GraffitoAction;
 import org.apache.portals.graffito.store.ContentStore;
+import org.apache.portals.graffito.store.impl.AbstractGraffitoStore;
 import org.apache.portals.graffito.exception.CmsInstantiateException;
 import org.apache.portals.graffito.exception.CmsPermissionException;
 import org.apache.portals.graffito.model.CmsObject;
@@ -56,17 +57,12 @@
  * 
  *  
  */
-public class GraffitoOJBStore implements ContentStore
+public class GraffitoOJBStore extends AbstractGraffitoStore implements ContentStore
 {
-
-    protected static final Log log = LogFactory.getLog(GraffitoOJBStore.class);
+    
     private OjbFactory ojbFactory;
     private PBKey pbKey;
 
-    /** Server scope associated to this content store */
-    private String scope;
-    private CmsAccessController cmsAccessController;
-
     /**
      * Constructor based on the a server object.
      * 
@@ -75,13 +71,13 @@
      *            content store
      * @param cmsAccessController
      *            The CmsAccesController used to check the permissions
-     *            PersistenceBroker
+     *            
      * @throws CmsInstantiateException
      *             when it is not possible to instantiate this store
      */
     public GraffitoOJBStore(Server server, CmsAccessController cmsAccessController) throws
CmsInstantiateException
     {
-        this.cmsAccessController = cmsAccessController;
+        super(server, cmsAccessController);
 
         // TODO : replace the following lines.
         // * OjbSecureArrayList is an OJB Managable collection used to check the
@@ -132,7 +128,7 @@
         }
         catch (MetadataException e)
         {
-            //Do nothing if the connection already exist
+            // if the connection already exist
             log.error("An error occurs when building a Graffito : " + server.getAlias(),
e);
             throw new CmsInstantiateException("An error occurs when building a GraffitoStore
: "
                     + server.getAlias(), e);
@@ -149,11 +145,11 @@
      * @param cmsAccessController
      *            The CmsAccesController used to check the permissions
      */
-    public GraffitoOJBStore(String storeName, CmsAccessController cmsAccessController)
-    {
-        this.cmsAccessController = cmsAccessController;
-        pbKey = new PBKey(storeName);
-    }
+//    public GraffitoOJBStore(String storeName, CmsAccessController cmsAccessController)
+//    {
+//        this.cmsAccessController = cmsAccessController;
+//        pbKey = new PBKey(storeName);
+//    }
 
     /**
      * @see org.apache.portals.graffito.store.ContentStore#getCmsObject(String)
@@ -468,8 +464,7 @@
         Criteria criteria = ((FilterImpl) filter).getCriteria();
         String filterScope = filter.getScope();
         // if the class is a CmsObject, check the filter scope is defined in
-        // orer to limit the
-        // search on this one
+        // orer to limit the search on this one
         if (clazz.equals(CmsObject.class) && filterScope != null && !filterScope.equals(""))
         {
             criteria.addLike("uri", filterScope + "%");

Modified: incubator/graffito/trunk/components/src/schema/graffitostore-schema.xml
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/components/src/schema/graffitostore-schema.xml?view=diff&rev=126056&p1=incubator/graffito/trunk/components/src/schema/graffitostore-schema.xml&r1=126055&p2=incubator/graffito/trunk/components/src/schema/graffitostore-schema.xml&r2=126056
==============================================================================
--- incubator/graffito/trunk/components/src/schema/graffitostore-schema.xml	(original)
+++ incubator/graffito/trunk/components/src/schema/graffitostore-schema.xml	Sat Jan 22 13:41:33
2005
@@ -1,4 +1,4 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
 <!--
 Copyright 2004 The Apache Software Foundation
 
@@ -13,139 +13,130 @@
 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.
--->
-<!DOCTYPE database SYSTEM "http://db.apache.org/torque/dtd/database_3_1.dtd">
-<!-- Autogenerated by JDBCToXMLSchema! -->
-<database>
-<!--
+-->
+<!DOCTYPE database SYSTEM "http://db.apache.org/torque/dtd/database_3_1.dtd">
+<!-- Autogenerated by JDBCToXMLSchema! -->
+<database>
+	<!--
     	CREATING TABLES FOR GRAFFITO
     	
-    -->    
-    <table name="SERVER">
-    	<column name="SERVER_ID"  primaryKey="true" required="true" type="INTEGER"/>
-        <column name="SCOPE" required="true" size="254" type="VARCHAR"/>
-        <column name="ALIAS" required="true" size="254" type="VARCHAR"/>
-	<column name="DESCRIPTION" required="true" size="254" type="VARCHAR"/>
-	<column name="TITLE" required="true" size="254" type="VARCHAR"/>
-	<column name="PLUGIN_CLASS_NAME" required="true" size="254" type="VARCHAR"/>
-	<unique name="scope">
-		<unique-column name="SCOPE" />
-	</unique>
-	<unique name="alias">
-		<unique-column name="ALIAS" />
-	</unique>
-    </table>
-
-    <table name="WEBDAV_SERVER">
-    	<column name="SERVER_ID"  primaryKey="true" required="true" type="INTEGER"/>
-        <column name="URL" required="true" size="254" type="VARCHAR"/>
-        <column name="IS_SECURE_SERVER" required="true" size="1" type="VARCHAR"/>
-	<column name="USE_CURRENT_LOGIN" required="true" size="1" type="VARCHAR"/>
-	<column name="LOGIN" size="50" type="VARCHAR"/>
-	<column name="PASSWORD" size="50" type="VARCHAR"/>
-       
-       <foreign-key foreignTable="SERVER" onDelete="cascade" >
-            <reference foreign="SERVER_ID" local="SERVER_ID"/>
-        </foreign-key>	
-	
-	<unique name="url">
-		<unique-column name="URL" />
-	</unique>
-    </table>
-
-    <table name="GRAFFITO_DB_SERVER">
-    	<column name="SERVER_ID"  primaryKey="true" required="true" type="INTEGER"/>
-        <column name="PLATEFORM" required="true" size="254" type="VARCHAR"/>
-        <column name="DB_ALIAS" required="true" size="254" type="VARCHAR"/>
-	<column name="JDBC_LEVEL" required="true" size="10" type="VARCHAR"/>
-	<column name="DRIVER" required="true" size="255" type="VARCHAR"/>
-	<column name="PROTOCOL" required="true" size="25" type="VARCHAR"/>
-	<column name="SUBPROTOCOL" required="true" size="25" type="VARCHAR"/>
-	<column name="LOGIN" size="50" type="VARCHAR"/>
-        <column name="PASSWORD" size="50" type="VARCHAR"/>
-	<column name="DATASOURCE" size="100" type="VARCHAR"/>
-	
-       <foreign-key foreignTable="SERVER" onDelete="cascade">
-            <reference foreign="SERVER_ID" local="SERVER_ID"/>
-        </foreign-key>	
-	
-	<unique name="dbalias">
-		<unique-column name="DB_ALIAS" />
-	</unique>
-    </table>    
-    
- <table name="CONTENT">
-    	<column name="CONTENT_ID"  primaryKey="true" required="true" type="INTEGER"/>
-        <column name="CONTENT"  type="BLOB"/>
-	
-  </table>        
-  
-    <table name="CMS_OBJECT">
-    	<column name="OBJECT_ID"  primaryKey="true" required="true" type="INTEGER"/>
-	<column name="PARENT_ID"  type="INTEGER"/>
-        <column name="NAME" required="true" size="254" type="VARCHAR"/>
-        <column name="URI" required="true" size="254" type="VARCHAR"/>
-	<column name="CREATION_DATE" required="true" type="DATE"/>
-	<column name="DELTA" required="true" type="DATE"/>
-	<column name="DESCRIPTION" size="255" type="VARCHAR"/>
-	<column name="TITLE"  size="255" type="VARCHAR"/>
-	<column name="LINK_TARGET_ID" type="INTEGER"/>
-        <column name="VERSION_NUM" size="10" type="VARCHAR"/>
-	<column name="IS_LAST_VERSION" type="INTEGER"/>
-	<column name="CONTENT_ID"  type="INTEGER"/>
-        <column name="CONTENT_SIZE"  type="INTEGER"/>
-	<column name="LANGUAGE" required="true" size="254" type="VARCHAR"/>
-	<column name="OWNER" required="true" size="254" type="VARCHAR"/>
-	<column name="CONTENT_TYPE"  size="254" type="VARCHAR"/>
-	<column name="CLASS_NAME" required="true" size="254" type="VARCHAR"/>
-	
-       <foreign-key foreignTable="CMS_OBJECT" onDelete="cascade">
-            <reference foreign="OBJECT_ID" local="PARENT_ID"/>
-        </foreign-key>	
-
-       <foreign-key foreignTable="CONTENT" onDelete="cascade">
-            <reference foreign="CONTENT_ID" local="CONTENT_ID"/>
-        </foreign-key>		
-	
-	<index name="CMS_OBJECT_IDX1">
-		<index-column name="PARENT_ID" />
-	</index >
-
-	<index name="CMS_OBJECT_IDX2">
-		<index-column name="CONTENT_ID" />
-	</index>
-	
-	<unique name="URI_VERSION_NUM">
-		<unique-column name="URI" />
-		<unique-column name="VERSION_NUM" />
-	</unique>
-    </table>      
-  
-  
-    <table name="VERSION_HISTORY">
-    	<column name="HISTORY_ID"  primaryKey="true" required="true" type="INTEGER"/>
-	<column name="OBJECT_ID"  required="true" type="INTEGER"/>
-	<column name="PREVIOUS_ID"  type="INTEGER"/>
-	
-       <foreign-key foreignTable="CMS_OBJECT" onDelete="cascade">
-            <reference foreign="OBJECT_ID" local="OBJECT_ID"/>
-        </foreign-key>	
-
-       <foreign-key foreignTable="VERSION_HISTORY" onDelete="cascade">
-            <reference foreign="HISTORY_ID" local="PREVIOUS_ID"/>
-        </foreign-key>	
-	
-	<index name="VERSION_HISTORY_IDX1">
-		<index-column name="OBJECT_ID" />
-	</index>
-
-	<index name="VERSION_HISTORY_IDX2">
-		<index-column name="PREVIOUS_ID" />
-	</index>	
-    </table> 
-
-    <table name="SYS_CMS_CLASSES">
-    	<column name="CMS_CLASS_ID"  primaryKey="true" required="true" size="100" type="VARCHAR"/>

-	<column name="CMS_CLASS"  required="true" size="254" type="VARCHAR"/>	
-    </table>     
-</database>
+    -->
+	<table name="SERVER">
+		<column name="SERVER_ID" primaryKey="true" required="true" type="INTEGER"/>
+		<column name="SCOPE" required="true" size="254" type="VARCHAR"/>
+		<column name="ALIAS" required="true" size="254" type="VARCHAR"/>
+		<column name="DESCRIPTION" required="true" size="254" type="VARCHAR"/>
+		<column name="TITLE" required="true" size="254" type="VARCHAR"/>
+		<column name="PLUGIN_CLASS_NAME" required="true" size="254" type="VARCHAR"/>
+		<unique name="scope">
+			<unique-column name="SCOPE" />
+		</unique>
+		<unique name="alias">
+			<unique-column name="ALIAS" />
+		</unique>
+	</table>
+	<table name="WEBDAV_SERVER">
+		<column name="SERVER_ID" primaryKey="true" required="true" type="INTEGER"/>
+		<column name="URL" required="true" size="254" type="VARCHAR"/>
+		<column name="IS_SECURE_SERVER" required="true" size="1" type="VARCHAR"/>
+		<column name="USE_CURRENT_LOGIN" required="true" size="1" type="VARCHAR"/>
+		<column name="LOGIN" size="50" type="VARCHAR"/>
+		<column name="PASSWORD" size="50" type="VARCHAR"/>
+		<foreign-key foreignTable="SERVER" onDelete="cascade" >
+			<reference foreign="SERVER_ID" local="SERVER_ID"/>
+		</foreign-key>
+		<unique name="url">
+			<unique-column name="URL" />
+		</unique>
+	</table>
+	<table name="GRAFFITO_DB_SERVER">
+		<column name="SERVER_ID" primaryKey="true" required="true" type="INTEGER"/>
+		<column name="PLATEFORM" required="true" size="254" type="VARCHAR"/>
+		<column name="DB_ALIAS" required="true" size="254" type="VARCHAR"/>
+		<column name="JDBC_LEVEL" required="true" size="10" type="VARCHAR"/>
+		<column name="DRIVER" required="true" size="255" type="VARCHAR"/>
+		<column name="PROTOCOL" required="true" size="25" type="VARCHAR"/>
+		<column name="SUBPROTOCOL" required="true" size="25" type="VARCHAR"/>
+		<column name="LOGIN" size="50" type="VARCHAR"/>
+		<column name="PASSWORD" size="50" type="VARCHAR"/>
+		<column name="DATASOURCE" size="100" type="VARCHAR"/>
+		<foreign-key foreignTable="SERVER" onDelete="cascade">
+			<reference foreign="SERVER_ID" local="SERVER_ID"/>
+		</foreign-key>
+		<unique name="dbalias">
+			<unique-column name="DB_ALIAS" />
+		</unique>
+	</table>
+	<table name="GRAFFITO_FS_SERVER">
+		<column name="SERVER_ID" primaryKey="true" required="true" type="INTEGER"/>
+		<column name="ROOT" required="true" size="254" type="VARCHAR"/>
+		<foreign-key foreignTable="SERVER" onDelete="cascade">
+			<reference foreign="SERVER_ID" local="SERVER_ID"/>
+		</foreign-key>
+		<unique name="root">
+			<unique-column name="ROOT" />
+		</unique>
+	</table>
+	
+	
+	<table name="CONTENT">
+		<column name="CONTENT_ID" primaryKey="true" required="true" type="INTEGER"/>
+		<column name="CONTENT" type="BLOB"/>
+	</table>
+	<table name="CMS_OBJECT">
+		<column name="OBJECT_ID" primaryKey="true" required="true" type="INTEGER"/>
+		<column name="PARENT_ID" type="INTEGER"/>
+		<column name="NAME" required="true" size="254" type="VARCHAR"/>
+		<column name="URI" required="true" size="254" type="VARCHAR"/>
+		<column name="CREATION_DATE" required="true" type="DATE"/>
+		<column name="DELTA" required="true" type="DATE"/>
+		<column name="DESCRIPTION" size="255" type="VARCHAR"/>
+		<column name="TITLE" size="255" type="VARCHAR"/>
+		<column name="LINK_TARGET_ID" type="INTEGER"/>
+		<column name="VERSION_NUM" size="10" type="VARCHAR"/>
+		<column name="IS_LAST_VERSION" type="INTEGER"/>
+		<column name="CONTENT_ID" type="INTEGER"/>
+		<column name="CONTENT_SIZE" type="INTEGER"/>
+		<column name="LANGUAGE" required="true" size="254" type="VARCHAR"/>
+		<column name="OWNER" required="true" size="254" type="VARCHAR"/>
+		<column name="CONTENT_TYPE" size="254" type="VARCHAR"/>
+		<column name="CLASS_NAME" required="true" size="254" type="VARCHAR"/>
+		<foreign-key foreignTable="CMS_OBJECT" onDelete="cascade">
+			<reference foreign="OBJECT_ID" local="PARENT_ID"/>
+		</foreign-key>
+		<foreign-key foreignTable="CONTENT" onDelete="cascade">
+			<reference foreign="CONTENT_ID" local="CONTENT_ID"/>
+		</foreign-key>
+		<index name="CMS_OBJECT_IDX1">
+			<index-column name="PARENT_ID" />
+		</index >
+		<index name="CMS_OBJECT_IDX2">
+			<index-column name="CONTENT_ID" />
+		</index>
+		<unique name="URI_VERSION_NUM">
+			<unique-column name="URI" />
+			<unique-column name="VERSION_NUM" />
+		</unique>
+	</table>
+	<table name="VERSION_HISTORY">
+		<column name="HISTORY_ID" primaryKey="true" required="true" type="INTEGER"/>
+		<column name="OBJECT_ID" required="true" type="INTEGER"/>
+		<column name="PREVIOUS_ID" type="INTEGER"/>
+		<foreign-key foreignTable="CMS_OBJECT" onDelete="cascade">
+			<reference foreign="OBJECT_ID" local="OBJECT_ID"/>
+		</foreign-key>
+		<foreign-key foreignTable="VERSION_HISTORY" onDelete="cascade">
+			<reference foreign="HISTORY_ID" local="PREVIOUS_ID"/>
+		</foreign-key>
+		<index name="VERSION_HISTORY_IDX1">
+			<index-column name="OBJECT_ID" />
+		</index>
+		<index name="VERSION_HISTORY_IDX2">
+			<index-column name="PREVIOUS_ID" />
+		</index>
+	</table>
+	<table name="SYS_CMS_CLASSES">
+		<column name="CMS_CLASS_ID" primaryKey="true" required="true" size="100" type="VARCHAR"/>
+		<column name="CMS_CLASS" required="true" size="254" type="VARCHAR"/>
+	</table>
+</database>
\ No newline at end of file

Modified: incubator/graffito/trunk/components/src/sql/GraffitoServer/delete-db.sql
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/components/src/sql/GraffitoServer/delete-db.sql?view=diff&rev=126056&p1=incubator/graffito/trunk/components/src/sql/GraffitoServer/delete-db.sql&r1=126055&p2=incubator/graffito/trunk/components/src/sql/GraffitoServer/delete-db.sql&r2=126056
==============================================================================
--- incubator/graffito/trunk/components/src/sql/GraffitoServer/delete-db.sql	(original)
+++ incubator/graffito/trunk/components/src/sql/GraffitoServer/delete-db.sql	Sat Jan 22 13:41:33
2005
@@ -18,6 +18,7 @@
 delete from CONTENT;
 delete from WEBDAV_SERVER;
 delete from GRAFFITO_DB_SERVER; 
+delete from GRAFITTO_FS_SERVER;
 delete from SERVER;
   
   

Modified: incubator/graffito/trunk/components/src/sql/GraffitoServer/mysql/drop-db.sql
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/components/src/sql/GraffitoServer/mysql/drop-db.sql?view=diff&rev=126056&p1=incubator/graffito/trunk/components/src/sql/GraffitoServer/mysql/drop-db.sql&r1=126055&p2=incubator/graffito/trunk/components/src/sql/GraffitoServer/mysql/drop-db.sql&r2=126056
==============================================================================
--- incubator/graffito/trunk/components/src/sql/GraffitoServer/mysql/drop-db.sql	(original)
+++ incubator/graffito/trunk/components/src/sql/GraffitoServer/mysql/drop-db.sql	Sat Jan 22
13:41:33 2005
@@ -19,6 +19,7 @@
 drop table if exists SYS_CMS_CLASSES;
 drop table if exists WEBDAV_SERVER;
 drop table if exists GRAFFITO_DB_SERVER; 
+drop table if exists GRAFFITO_FS_SERVER; 
 drop table if exists SERVER;
 
 

Modified: incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/impl/TestContentServerService.java
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/impl/TestContentServerService.java?view=diff&rev=126056&p1=incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/impl/TestContentServerService.java&r1=126055&p2=incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/impl/TestContentServerService.java&r2=126056
==============================================================================
--- incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/impl/TestContentServerService.java
(original)
+++ incubator/graffito/trunk/components/src/test/org/apache/portals/graffito/impl/TestContentServerService.java
Sat Jan 22 13:41:33 2005
@@ -189,7 +189,7 @@
         server.setScope("/share2");
         server.setTitle("Graffito FS Test Server");
         server.setRoot("/home/dtaylor/shares/two/");
-        
+                                 
         server.setStoreClassName("org.apache.portals.graffito.store.impl.fs.FileSystemContentStore");
         
         log.info("Add FS Store Server");
@@ -201,7 +201,7 @@
         log.info("Get FS server");
         server = (FileSystemServer) serverService.getServer("/share2");
         assertTrue("Incorrect alias for server 'share2", server.getAlias().equals("share2"));
-        assertTrue("Incorrect root for server 'share2", server.getAlias().equals("/home/dtaylor/shares/two/"));
+        assertTrue("Incorrect root for server 'share2", server.getRoot().equals("/home/dtaylor/shares/two/"));
 
         // ---------------------------------------------------------------------------------------
         // Update server

Mime
View raw message