incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r225687 [1/2] - in /incubator/graffito/trunk/api/src/java/org/apache/portals/graffito: ./ context/ model/ model/core/ model/dm/ model/permission/ model/server/ search/ services/ services/core/ services/dm/ services/search/
Date Thu, 28 Jul 2005 05:29:13 GMT
Author: clombart
Date: Wed Jul 27 22:28:56 2005
New Revision: 225687

URL: http://svn.apache.org/viewcvs?rev=225687&view=rev
Log:
Review object model (see GRFT-25)

Added:
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/CmsObject.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/Content.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/Folder.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/HistoryElement.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/Link.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/VersionnedContent.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/dm/
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/dm/Document.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/dm/DocumentStream.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/permission/
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/permission/CmsPermission.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/server/
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/server/FileSystemServer.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/server/GraffitoServer.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/server/Server.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/server/WebdavServer.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/core/
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/core/ContentModelService.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/core/ContentPermissionService.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/core/ContentServerService.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/core/ContentVersionService.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/dm/
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/dm/DocumentModelService.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/search/
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/search/ContentIndexService.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/search/ContentSearchService.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/search/Filter.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/search/SearchResults.java
Removed:
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/ContentIndexService.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/ContentModelService.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/ContentPermissionService.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/ContentSearchService.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/ContentServerService.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/ContentVersionService.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/CmsObject.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/CmsPermission.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/Content.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/Document.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/FileSystemServer.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/Folder.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/GraffitoServer.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/HistoryElement.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/Link.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/Server.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/WebdavServer.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/search/Filter.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/search/SearchResults.java
Modified:
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/context/CmsRequestContext.java
    incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/context/CmsRequestContextManager.java

Modified: incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/context/CmsRequestContext.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/context/CmsRequestContext.java?rev=225687&r1=225686&r2=225687&view=diff
==============================================================================
--- incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/context/CmsRequestContext.java (original)
+++ incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/context/CmsRequestContext.java Wed Jul 27 22:28:56 2005
@@ -1,42 +1,43 @@
-/*
- * 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.context;
-
-import javax.security.auth.Subject;
-
-/**
- * This class keeps information about the current cms request.
- * 
- * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
- * 
- * @version $Id: CmsRequestContext.java,v 1.1 2004/12/22 21:16:13 christophe Exp $
- * 
- */
-public interface CmsRequestContext
-{
-    /**
-     * Get the Subject associated to the request.
-     * 
-     * @return The associated Subject
-     */
-     public Subject getSubject();
-     
-     /**
-      * Set the subject
-      * @param subject The subject to assigned to the request
-      */
-     public void setSubject(Subject subject);
-}
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * 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.context;
+
+import javax.security.auth.Subject;
+
+/**
+ * This class keeps information about the current cms request.
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ * 
+ * @version $Id: CmsRequestContext.java,v 1.1 2004/12/22 21:16:13 christophe Exp $
+ * 
+ */
+public interface CmsRequestContext
+{
+    /**
+     * Get the Subject associated to the request.
+     * 
+     * @return The associated Subject
+     */
+     public Subject getSubject();
+     
+     /**
+      * Set the subject
+      * @param subject The subject to assigned to the request
+      */
+     public void setSubject(Subject subject);
+}

Modified: incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/context/CmsRequestContextManager.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/context/CmsRequestContextManager.java?rev=225687&r1=225686&r2=225687&view=diff
==============================================================================
--- incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/context/CmsRequestContextManager.java (original)
+++ incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/context/CmsRequestContextManager.java Wed Jul 27 22:28:56 2005
@@ -1,41 +1,42 @@
-/*
- * 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.context;
-
-
-
-/**
- * This class manage all {@link org.apache.portals.graffito.context.CmsRequestContext}
- * 
- * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
- * 
- * @version $Id: CmsRequestContextManager.java,v 1.1 2004/12/22 21:16:13 christophe Exp $
- * 
- */
-public interface CmsRequestContextManager
-{
-     /**
-      * Get the CmsRequestContext assigned to the current Thread
-      * @return The CmsRequestContext found
-      */
-      public CmsRequestContext getCurrentCmsRequestContext();
-      
-      /**
-       * Set the CmsRequestContext to the current Thread
-       * @param cmsRequestContext The cms request context to assigned
-       */
-      public void setCurrentCmsRequestContext(CmsRequestContext cmsRequestContext);
-}
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * 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.context;
+
+
+
+/**
+ * This class manage all {@link org.apache.portals.graffito.context.CmsRequestContext}
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ * 
+ * @version $Id: CmsRequestContextManager.java,v 1.1 2004/12/22 21:16:13 christophe Exp $
+ * 
+ */
+public interface CmsRequestContextManager
+{
+     /**
+      * Get the CmsRequestContext assigned to the current Thread
+      * @return The CmsRequestContext found
+      */
+      public CmsRequestContext getCurrentCmsRequestContext();
+      
+      /**
+       * Set the CmsRequestContext to the current Thread
+       * @param cmsRequestContext The cms request context to assigned
+       */
+      public void setCurrentCmsRequestContext(CmsRequestContext cmsRequestContext);
+}

Added: incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/CmsObject.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/CmsObject.java?rev=225687&view=auto
==============================================================================
--- incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/CmsObject.java (added)
+++ incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/CmsObject.java Wed Jul 27 22:28:56 2005
@@ -0,0 +1,147 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * 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.model.core;
+
+import java.sql.Timestamp;
+import java.util.Collection;
+import java.util.Map;
+
+/**
 * The CmsObject interface is the ancestor for all Cms objects present into the content tree (Document, folder, link, ...).
+ *  
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * 
+ * @version $Id: CmsObject.java,v 1.1 2004/12/22 21:16:10 christophe Exp $
 */
+public interface CmsObject
+{
+    /** URI Path Separator */
+    public final static String URI_SEPARATOR = "/";
+
+	/**
+	 * Get the Name
+	 * 
+	 * @return String
+	 */
+	String getName();
+
+	/**
+	 * Set the value of Name
+	 * 
+	 * @param v new value
+	 */
+	void setName(String v);
+
+	/**
+	 * Get the object's URI, a unique resource identifier
+	 * 
+	 * @return String the URI value
+	 * 
+	 */
+	String getUri();
+
+	/**
+	 * Set the object's URI, a unique resource identifier
+	 * @param uri The uri to set
+	 */
+	void setUri(String uri);
+
+	/**
+	 * Get the parent folder
+	 * 
+	 * @return Folder the folder which contains this object
+	 * 
+	 */
+	Folder getParentFolder();
+
+	/**
+	 * Set the parent folder
+	 * 
+	 * @param parentFolder the folder which contains this object
+	 * 
+	 */
+	void setParentFolder(Folder parentFolder);
+
+	/**
+	 * Get the last modified date for this document
+	 * 
+	 * @return Date
+	 * 
+	 */
+	Timestamp getLastModified();
+
+	/**
+	 * Set the last modified date for this document
+	 * 
+	 * @param lastModified the new last modified date value
+	 * 
+	 */
+	void setLastModified(Timestamp lastModified);
+
+	/**
+	 * Get the document's creation date
+	 * 
+	 * @return Date
+	 * 
+	 */
+	Timestamp getCreationDate();
+
+	/**
+	 * Set the creation date for this document
+	 * 
+	 * @param creationDate The new creation date value
+	 * 
+	 */
+	void setCreationDate(Timestamp creationDate);
+
+    /**
+     * Return the splitted uri
+     * @return an array of String matching to the cms object path
+     */
+    String[] getPath();
+
+	/**
+	 * Get a collection of all non standard properties for this object
+	 * 
+	 * @return a collection of properties
+	 */
+	Collection getProperties();
+
+	/**
+	 * Set the properties
+	 * @param properties the new properties to set 
+	 */
+	void setProperties(Collection properties);
+
+    /**
+     * Get a named property for this object
+     *
+     * @param name of the property
+     * @return the property as an string
+     */
+    String getProperty(String name);
+
+    /**
+     * Sets a named property for this string
+     *
+     * @param name
+     * @param property
+     */
+    void setProperty(String name, String property);
+    
+    
+
+    
+}

Added: incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/Content.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/Content.java?rev=225687&view=auto
==============================================================================
--- incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/Content.java (added)
+++ incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/Content.java Wed Jul 27 22:28:56 2005
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * 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.model.core;
+
+/**
 * CMS Content interface. Ancestor class for all kind of content (document/binary, articles, news, ...)
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ * 
+ * @version $Id: Document.java,v 1.1 2004/12/22 21:16:11 christophe Exp $
 */
+public interface Content extends CmsObject, Cloneable
+{
+
+   
+}

Added: incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/Folder.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/Folder.java?rev=225687&view=auto
==============================================================================
--- incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/Folder.java (added)
+++ incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/Folder.java Wed Jul 27 22:28:56 2005
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * 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.model.core;
+
+
+import java.util.List;
+
+/**
 * CMS Folder interface. A folder is a collection of CmsObject within a Server.
+ * 
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * 
+ * @version $Id: Folder.java,v 1.1 2004/12/22 21:16:10 christophe Exp $
 */
+public interface Folder extends CmsObject
+{
+
+	/**
+	 * Get the folder contents.
+	 * @return a List of content which are located into this folder.
+	 */
+	public List getContents();
+
+	/**
+	 * Get the folder subfolders.
+	 * @return a List of Folder which are located into this folder.
+	 */
+	public List getFolders();
+
+}
+

Added: incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/HistoryElement.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/HistoryElement.java?rev=225687&view=auto
==============================================================================
--- incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/HistoryElement.java (added)
+++ incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/HistoryElement.java Wed Jul 27 22:28:56 2005
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * 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.model.core;
+
+
+/**
 * CMS History Element interface. This is an element defined in the version graph.
+ * Each element is associated to a Versionned Element and has an optional previous history element.
+ * 
+ * TODO : review the version management in order to support more advance features. 
 */
+public interface HistoryElement 
+{
+
+	/**
+	 * Gets the VersionnedContent associated to this history element
+	 * 
+	 * @return the associated VersionnedContent
+	 * 
+	 */
+	 VersionnedContent getVersionnedContent();
+
+	/**
+	 * Get the previous history element
+	 * 
+	 * @return the previous object
+	 * 
+	 */
+	HistoryElement getPrevious();
+
+	/**
+	 * Set the versionned content into this history element
+	 * 
+	 * @param versionnedContent The content to set
+	 * 
+	 */
+	void setVersionnedContent(VersionnedContent versionnedContent);
+
+	/**
+	 * Set the previous history element
+	 * 
+	 * @param historyElement the previous element to set into the history
+	 * 
+	 * @uml.property name="previous"
+	 */
+	void setPrevious(HistoryElement historyElement);
+
+    
+    
+}

Added: incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/Link.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/Link.java?rev=225687&view=auto
==============================================================================
--- incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/Link.java (added)
+++ incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/Link.java Wed Jul 27 22:28:56 2005
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * 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.model.core;
+
+/**
 * Cms link object. Similar to a unix link<br>. By this way, a CmsObject can be linked to different uris
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
 */
+public interface Link extends CmsObject
+{
+
+	/**
+	 * Set the link target 
+	 * @param cmsObject The target cms object
+	 * 
+	 */
+	public void setTargetCmsObject(CmsObject cmsObject);
+
+	/**
+	 * Get the target cms object
+	 * @return the target cms object
+	 * 
+	 */
+	public CmsObject getTargetCmsObject();
+
+}

Added: incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/VersionnedContent.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/VersionnedContent.java?rev=225687&view=auto
==============================================================================
--- incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/VersionnedContent.java (added)
+++ incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/core/VersionnedContent.java Wed Jul 27 22:28:56 2005
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * 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.model.core;
+
+/**
 * CMS Content interface. Ancestor class for all kind of content (document/binary, articles, news, ...)
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ * 
+ * @version $Id: Document.java,v 1.1 2004/12/22 21:16:11 christophe Exp $
 */
+public interface VersionnedContent extends Content, Comparable, Cloneable
+{
+
+   
+	/**
+	 * Gets the version number
+	 * 
+	 * @return version number is a string composed of point separated digit
+	 */
+	String getVersionNumber();
+
+    
+    /**
+     * Check if the current document is the last version
+     * 
+     * @return the last version attribute value
+     */
+    boolean isLastVersion();
+    
+    /**
+     * Makes the current document the last version for the associated uri
+     * 
+     * @param isLastVersion
+     */
+    void setLastVersion(boolean isLastVersion);
+
+	/**
+	 * Sets the version number
+	 * 
+	 * @param versionNumber version number is a string composed of point separated digit
+	 */
+	void setVersionNumber(String versionNumber);
+
+	/**
+	 * 
+	 * @return the clonned object
+	 * @throws CloneNotSupportedException when it is not possible to clone the object
+	 */
+	Object clone() throws CloneNotSupportedException;	
+
+}

Added: incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/dm/Document.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/dm/Document.java?rev=225687&view=auto
==============================================================================
--- incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/dm/Document.java (added)
+++ incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/dm/Document.java Wed Jul 27 22:28:56 2005
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * 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.model.dm;
+
+import org.apache.portals.graffito.model.core.VersionnedContent;
+
+/**
 * CMS Document interface. This interface is used to any kind of binary content (pdf, Ms Office, Open office, ...). 
+ * 
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ * 
+ * @version $Id: Document.java,v 1.1 2004/12/22 21:16:11 christophe Exp $
 */
+public interface Document extends VersionnedContent
+{
+
+	/**
+	 * Get the content type of this document
+	 * 
+	 * @return String representation of the document's type
+	 */
+	String getContentType();
+
+	/**
+	 * Set the content type for this document
+	 * 
+	 * @param type the new document type
+	 */
+	void setContentType(String type);
+
+    
+    /**
+     * Get the size of the document
+     * 
+     * @return long
+     */
+    long getSize();
+
+    /**
+     * Set the size of the document
+     * @param size the size to set
+     */
+    void setSize(long size);
+
+	/**
+	 * Get the document stream
+	 * @return the document stream
+	 */
+	DocumentStream getDocumentStream();
+
+	/**
+	 * Set the document stream
+	 * @param documentStream the document stream to set
+	 */
+	void setDocumentStream(DocumentStream documentStream);
+
+}

Added: incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/dm/DocumentStream.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/dm/DocumentStream.java?rev=225687&view=auto
==============================================================================
--- incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/dm/DocumentStream.java (added)
+++ incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/dm/DocumentStream.java Wed Jul 27 22:28:56 2005
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * 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.model.dm;
+
+import java.io.InputStream;
+
+/**
 * CMS content interface.
 * 
 * @author <a href="mailto:christophe.lombart">Christophe Lombart</a>
 * @version $Id: Content.java,v 1.1 2004/12/22 21:16:10 christophe Exp $
 */
+public interface DocumentStream extends Cloneable
+{
+
+	/**
+	 * @return Returns the content.
+	 * 
+	 */
+	public InputStream getContentStream();
+   
+    
+    /**
+     * @return Returns the content.
+     */
+    public byte[] getContentByte();
+
+	/**
+	 * @return Returns the content in the String format
+	 * 
+	 */
+	public String getContentAsString();
+
+    
+    /**
+     * @param stream The content to set.
+     */    
+    public void setContent(InputStream stream);
+    
+    
+    /**
+     * @param content The content to set.
+     */
+    public void setContent(byte[] content);
+
+	/**
+	 * @return Returns the encoding.
+	 * 
+	 */
+	public String getEncoding();
+
+	/**
+	 * @param encoding The encoding to set.
+	 * 
+	 */
+	public void setEncoding(String encoding);
+
+	/**
+	 * Get the isoCode
+	 * @return the isocode
+	 */
+	public String getIsoCode();
+	
+	/**
+	 * Set the iso cocde
+	 * @param isoCode The new iso code to set
+	 */
+	public void setIsoCode(String isoCode);
+	
+	/**
+	 * 
+	 * @return the clonned object
+	 * @throws CloneNotSupportedException when it is not possible to clone the object
+	 */
+	Object clone() throws CloneNotSupportedException;	
+	
+
+}
+

Added: incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/permission/CmsPermission.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/permission/CmsPermission.java?rev=225687&view=auto
==============================================================================
--- incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/permission/CmsPermission.java (added)
+++ incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/permission/CmsPermission.java Wed Jul 27 22:28:56 2005
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * 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.model.permission;
+
+import java.util.Collection;
+
+/**
 * Permission apply to a cms object like view, update, delete, ... 
 * The permission can be apply :
 * 	- Only on the cms object itself
 *  - on the object and its children
 *  - Recursively on all children and subfolders   
 * 
 * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
 * @version $Id: Exp $
 */
+public interface CmsPermission 
+{
+    
+    /** View a cms object */
+    static public final String VIEW = "view";
+    /** Edit a cms object */    
+    static public final String EDIT = "edit";
+    /** Lock a cms object */
+    static public final String LOCK = "lock";
+    /** Unlock a cms object */
+    static public final String UNLOCK = "unlock";
+    /** Delete a cms object */
+    static public final String DELETE = "delete";
+    /** Insert a cms object */
+    static public final String INSERT = "insert";
+    /** Update a cms object */
+    static public final String UPDATE = "update";    
+    /** All action authorized on a cms object */
+    static public final String ALL = "all";
+
+	/**
+	 * Get the permission name. 
+	 * The name match to the cms object uri. 
+	 * The name contains an "*" if this permission has to be apply on children
+	 * The name contains an "-" if this permission has to be apply recusively
+	 * @return The permission name
+	 * 
+	 */
+	public String getName();
+
+	/**
+	 * Get the action allowed by this permission (view, delete, ...)
+	 * "all" can be used to apply all permission on the cms object
+	 * @return the allowed actions
+	 * 
+	 */
+	public String getActions();
+
+	/**
+	 * Get all principals assigned to this permissions 
+	 * @return the the principal full paths (eg. /users/christophe, /groups/admin, ...)
+	 * 
+	 */
+	public Collection getPrincipalFullPaths();
+
+    
+    /**
+     * Check if the permission is applying recursivly on all subfolder & content children
+     * @return true if the permission is applying on all subfolder & content children 
+     */
+    public boolean isRecursive();
+    
+    /**
+     * Check if the permission is applying only on the document children (not on the subfolder)
+     * @return true if the permission is applying only on content children
+     */
+    public boolean isApplyToChildren();
+    
+}

Added: incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/server/FileSystemServer.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/server/FileSystemServer.java?rev=225687&view=auto
==============================================================================
--- incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/server/FileSystemServer.java (added)
+++ incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/server/FileSystemServer.java Wed Jul 27 22:28:56 2005
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * 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.model.server;
+
+/**
 * File System Server
 * 
 * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
 * @version $Id: $
 */
+public interface FileSystemServer extends Server
+{
+
+	/**
+	 * Returns the root path of the file system in the format
+	 * of the file system's native operating system.
+	 * Examples: /home/david/share/, c:/stage/website1/
+	 *   
+	 * @return the root path of the file system.
+	 * 
+	 */
+	String getRoot();
+
+	/**
+	 * Sets the root path of the file system in the format
+	 * of the file system's native operating system.
+	 * Examples: /home/david/share/, c:/stage/website1/
+	 *   
+	 * @param root the root path of the file system.
+	 * 
+	 */
+	void setRoot(String root);
+
+    
+}

Added: incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/server/GraffitoServer.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/server/GraffitoServer.java?rev=225687&view=auto
==============================================================================
--- incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/server/GraffitoServer.java (added)
+++ incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/server/GraffitoServer.java Wed Jul 27 22:28:56 2005
@@ -0,0 +1,159 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * 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.model.server;
+
+/**
 * Graffito Server interface is the default content store for Graffito.
+ * GraffitoServer is a db server with a predefined schema (see in the component subproject to see this schema).
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ * 
+ * @version $Id: GraffitoServer.java,v 1.1 2004/12/22 21:16:10 christophe Exp $
 */
+public abstract interface GraffitoServer extends Server
+{
+
+	/**
+	 * Get the DB plateform name (MySql, Oracle, ...).
+	 * @return the DB plateform
+	 * 
+	 */
+	public String getPlateform();
+
+	/**
+	 * Set the DB plateform name (MySql, Oracle, ...).
+	 * 
+	 * @param plateform The new plateform value
+	 * 
+	 */
+	public void setPlateform(String plateform);
+
+	/**
+	 * Get the Db alias used to connect to the DB
+	 * @return the Db alias
+	 * 
+	 */
+	public String getDbAlias();
+
+	/**
+	 * Set the Db alias used to connect to the DB
+	 * 
+	 * @param dbAlias the new db alias value
+	 * 
+	 */
+	public void setDbAlias(String dbAlias);
+
+	/**
+	 * Get the JDBC level
+	 * @return the jdbc level
+	 * 
+	 */
+	public String getJdbcLevel();
+
+	/**
+	 * Set the jdbc level
+	 * @param jdbcLevel
+	 * 
+	 */
+	public void setJdbcLevel(String jdbcLevel);
+
+	/**
+	 * Get the datasource
+	 * @return the datasource
+	 * 
+	 */
+	public String getDatasource();
+
+	/**
+	 * Set the datasource
+	 * @param datasource The new datasource value
+	 * 
+	 */
+	public void setDatasource(String datasource);
+
+	/**
+	 * Get the jdbc driver 
+	 * @return the driver
+	 * 
+	 */
+	public String getDriver();
+
+	/**
+	 * Set the jdbc driver
+	 * @param driver The new jdbc driver
+	 * 
+	 */
+	public void setDriver(String driver);
+
+	/**
+	 * Get the protocol
+	 * @return the protocal
+	 * 
+	 */
+	public String getProtocol();
+
+	/**
+	 * Set the protocol. It should be 'jdbc'
+	 * @param protocol
+	 * 
+	 */
+	public void setProtocol(String protocol);
+
+	/**
+	 * Get the subprotocol used to build the connection url
+	 * @return thhe subprotocol
+	 * 
+	 */
+	public String getSubProtocol();
+
+	/**
+	 * Set the subprotocol used to build the connection url 
+	 * @param subProtocol The new subprotocol value
+	 * 
+	 */
+	public void setSubProtocol(String subProtocol);
+
+	/**
+	 * Get the login 
+	 * @return The login
+	 * 
+	 */
+	public String getLogin();
+
+	/**
+	 * Set the login
+	 * @param login The new login value
+	 * 
+	 */
+	public void setLogin(String login);
+
+	/**
+	 * Get the password
+	 * @return the password
+	 * 
+	 */
+	public String getPassword();
+
+	/**
+	 * Set the password
+	 * @param password The new password value
+	 * 
+	 */
+	public void setPassword(String password);
+
+	
+	
+	
+}
\ No newline at end of file

Added: incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/server/Server.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/server/Server.java?rev=225687&view=auto
==============================================================================
--- incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/server/Server.java (added)
+++ incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/server/Server.java Wed Jul 27 22:28:56 2005
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * 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.model.server;
+
+/**
 * The Server interface is the ancestor for all kind of content servers (DB, Webdav, ...).
+ * A Server is a collection of {@link org.apache.portals.graffito.model.core.Folder}.
+ * 
+ * Each Server is associated to a plugin class name (see org.apache.portals.graffito.store in the component subproject).
+ * 
+ * In the Graffito context, there is a mandatary server called "Graffito Master Server" which contains server metadatas.
+ * By this way, the Graffito engine can mount all referenced servers into the same content tree.
+ *  
+ * 
+ * Each server has scope which is an uri prefix. Each cms object with the same uri prefix will be stores in this server.
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ * 
+ * @version $Id: Server.java,v 1.1 2004/12/22 21:16:10 christophe Exp $
 */
+public abstract interface Server
+{
+
+	/**
+	 * The scope is the uri prefix assigned to this server (eg. "/myserver")
+	 * @return the server scope
+	 */
+	public String getScope();
+
+	/**
+	 * Set the server scope
+     * @param scope the new scope to set
+	 */
+	public void setScope(String scope);
+
+	/**
+	 * Set the server alias. This ia an unique id 
+	 * @param alias the new alias to set 
+	 */
+	public void setAlias(String alias);
+	
+	/**	
+	 * @return the server alias
+	 */
+	public String getAlias();
+
+	/**
+	 * Set the description 
+	 * @param description the new description to set
+	 */
+	public void setDescription(String description);
+
+	/**
+	 * @return the server description
+	 * 
+	 */
+	public String getDescription();
+
+
+	/**
+	 * @return the server title
+	 * 
+	 */
+	public String getTitle();
+
+	/**
+	 * Set the server title 
+	 * @param title the new server title to set
+	 */
+	public void setTitle(String title);
+
+	/**
+	 * set the store class name.
+	 * @param pluginClassName the content class store to set
+	 * 
+	 */
+	public void setStoreClassName(String pluginClassName);
+	
+	
+	/**
+	 * @return the store class name
+	 * 
+	 */
+	public String getStoreClassName();
+
+	
+	    
+}

Added: incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/server/WebdavServer.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/server/WebdavServer.java?rev=225687&view=auto
==============================================================================
--- incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/server/WebdavServer.java (added)
+++ incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/model/server/WebdavServer.java Wed Jul 27 22:28:56 2005
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * 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.model.server;
+
+/**
 * This is the interface for a WEBDAV server reference.
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ * 
+ * @version $Id: WebdavServer.java,v 1.1 2004/12/22 21:16:11 christophe Exp $
 */
+public abstract interface WebdavServer extends Server
+{
+
+	/**
+	 * @return the webdav server url reference
+	 * 
+	 */
+	public String getUrl();
+
+	/**
+	 * Set the webdav server url reference
+	 * @param url the new url to set
+	 */
+	public void setUrl(String url);
+
+	/**
+	 * Check if the server is protected (secure) 
+	 * @return true id the server is secure
+	 */
+	public boolean isSecureServer();
+	
+	/**
+	 * Set the secure server flag 
+	 * @param secureServer the flag value
+	 */
+	public void setSecureServer(boolean secureServer);
+	
+	/**
+	 * Check if the current login has to be used to connect to the server
+	 * @return true if the current login has to be used
+	 */
+	public boolean isUsingCurrentLogin();
+	
+	/**
+	 * Set the flag "current login"
+	 * @param useCurrentLogin the new flag value
+	 */
+	public void setUseCurrentLogin(boolean useCurrentLogin);
+
+	/**
+	 * @return the login used to connect to the server (unused when the flag isUsingCurrentLogin is true)
+	 * 
+	 */
+	public String getLogin();
+
+	/**
+	 * Set the login use to connect to the server
+	 * @param login the login to set
+	 */
+	public void setLogin(String login);
+
+	/**
+	 * @return the password used to connect to the server (unused when the flag isUsingCurrentLogin is true)
+	 */
+	public String getPassword();
+
+	/**
+	 * Set the password use to connect to the server
+	 * @param password the password to set
+	 */
+	public void setPassword(String password);
+
+	
+}
\ No newline at end of file

Added: incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/core/ContentModelService.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/core/ContentModelService.java?rev=225687&view=auto
==============================================================================
--- incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/core/ContentModelService.java (added)
+++ incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/core/ContentModelService.java Wed Jul 27 22:28:56 2005
@@ -0,0 +1,317 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * 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.services.core;
+
+import java.util.Collection;
+
+import org.apache.portals.graffito.exception.ContentManagementException;
+import org.apache.portals.graffito.model.core.CmsObject;
+import org.apache.portals.graffito.model.core.Content;
+import org.apache.portals.graffito.model.core.Folder;
+import org.apache.portals.graffito.model.core.Link;
+import org.apache.portals.graffito.model.core.VersionnedContent;
+
+/**
+ * <P>CMS Model Service Interface</P>
+ *
+ * This service maintains Folder, Content and Links.
+ * tied to the CMS that are stored in the repository and used to access the CMS.
+ *
+ * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>
+ * @author <a href="mailto:ruchi@bluesunrise.com">Ruchir Gatha</a>
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ * 
+ * @version $Id: ContentModelService.java,v 1.1 2004/12/22 21:16:12 christophe Exp $
+ *
+ */
+public interface ContentModelService
+{
+
+    /**
+     * Factory to create a new Folder object.
+     *
+     * @return an empty factory created folder.
+     * @throws ContentManagementException
+     */
+    public Folder createFolder() throws ContentManagementException;
+
+    /**
+     * Adds a new folder to engine's persistent store.
+     *
+     * @param folder the folder to add.
+     * @throws ContentManagementException
+     */
+    public void addFolder(Folder folder) throws ContentManagementException;
+
+    /**
+     * Remove a folder from the engine's persistent store.
+     *
+     * @param folder the folder to be removed.
+     * @throws ContentManagementException
+     */
+    public void removeFolder(Folder folder) throws ContentManagementException;
+
+    /**
+     * Remove many cms objects
+     *
+     * @param uris an Array of uri's matching to the Cms Object to remove
+     * @throws ContentManagementException
+     */
+    public void removeAll(String[] uris) throws ContentManagementException;    
+    
+    /**
+     * Get a folder from the engine's persistent store.
+     *
+     * @param uri  the uri assigned to the folder to retrieve.
+     * @return folder found or null.
+     * @throws ContentManagementException
+     */
+    public Folder getFolder(String uri) throws ContentManagementException;
+
+    /**
+     * Update a folder in the engine's persistent store.
+     *
+     * @param folder the folder to be updated.
+     * @throws ContentManagementException
+     */
+    public void updateFolder(Folder folder) throws ContentManagementException;
+
+    /**
+     * Factory to create a new Link object.
+     *
+     * @return an empty factory created link.
+     * @throws ContentManagementException
+     */
+    public Link createLink() throws ContentManagementException;
+
+    /**
+     * Adds a Link to engine's persistent store.
+     *
+     * @param link the new Link to add.
+     *
+     * @throws ContentManagementException
+     */
+    public void addLink(Link link) throws ContentManagementException;
+
+    /**
+     * Get a Link from the engine's persistent store.
+     *
+     * @param uri  the uri assigned to the link to retrieve.
+     * @return link found or null.
+     * @throws ContentManagementException
+     */
+    public Link getLink(String uri) throws ContentManagementException;
+
+    /**
+     * Remove a Link from the engine's persistent store.
+     *
+     * @param link the Link to remove.
+     *
+     * @throws ContentManagementException
+     */
+    public void removeLink(Link link) throws ContentManagementException;
+
+    /**
+     * Update a link in the engine's persistent store.
+     *
+     * @param link the link to be updated.
+     * @throws ContentManagementException
+     */
+    public void updateLink(Link link) throws ContentManagementException;
+
+    /**
+     * Adds a content to engine's persistent store.
+     *
+     * @param content the new content
+     *
+     * @throws ContentManagementException
+     */
+    public void addContent(Content content) throws ContentManagementException;
+
+    
+    /**
+     * Factory to create a new empty generic content object.
+     *
+     *  
+     * @return an empty factory created content
+     * 
+     * @throws ContentManagementException
+     */
+    public Content createContent() throws ContentManagementException;
+    
+    /**
+     * Factory to create a new empty content object.
+     *
+     * @param contentName The content class name (News, Article, ...). This name is used by ht persistence service in order to instantiate the correct class 
+     * @return an empty factory created content
+     * 
+     * @throws ContentManagementException
+     */
+    public Content createContent(String contentName) throws ContentManagementException;
+
+    /**
+     * Get a content from the engine's persistent store by uri.
+     *
+     * @param uri uri assigned to the content.
+     * @return Content found or null
+     *
+     * @throws ContentManagementException
+     */
+    public Content getContent(String uri) throws ContentManagementException;
+   
+    /**
+     * Remove a content from the engine's persistent store.
+     *
+     * @param  content the content to remove.
+     *
+     * @throws ContentManagementException
+     */
+    public void removeContent(Content content) throws ContentManagementException;
+
+    /**
+     * Update a content in the engine's persistent store.
+     *
+     * @param content the content to update.
+     *
+     * @throws ContentManagementException
+     */
+    public void updateContent(Content content) throws ContentManagementException;
+
+    /**
+     * Adds a versionned content to engine's persistent store.
+     *
+     * @param versionnedContent the new content
+     *
+     * @throws ContentManagementException
+     */
+    public void addVersionnedContent(VersionnedContent versionnedContent) throws ContentManagementException;
+
+    /**
+     * Factory to create a new empty generic versionned content object.
+     *
+     * @return an empty factory created versionned content
+     * 
+     * @throws ContentManagementException
+     */
+    public VersionnedContent createVersionnedContent() throws ContentManagementException;
+    
+    /**
+     * Factory to create a new empty versionned content object.
+     * 
+     * @param contentName The content class name (News, Article, ...). This name is used by the persistence service in order to instantiate the correct class
+     * @return an empty factory created versionned content
+     * 
+     * @throws ContentManagementException
+     */
+    public VersionnedContent createVersionnedContent(String contentName) throws ContentManagementException;
+
+    /**
+     * Get a versionned content from the engine's persistent store by uri.
+     * This method return the lastest version.
+     *
+     * @param uri uri assigned to the content.
+     * @return Content found or null
+     *
+     * @throws ContentManagementException
+     */
+    public VersionnedContent getVersionnedContent(String uri) throws ContentManagementException;
+
+    /**
+     * Get a versionned content from the engine's persistent store by uri.
+     *
+     * @param uri uri assigned to the document.
+     * @param versionNum the desired version number assigned to the content to retrieve
+     * @return content found or null
+     *
+     * @throws ContentManagementException
+     */
+    public VersionnedContent getVersionnedContent(String uri, String versionNum) throws ContentManagementException;
+    
+    /**
+     * Remove a versionned content from the engine's persistent store.
+     *
+     * @param  versionnedContent the content to remove.
+     *
+     * @throws ContentManagementException
+     */
+    public void removeVersionnedContent(VersionnedContent versionnedContent) throws ContentManagementException;
+
+    /**
+     * Update a versionned content in the engine's persistent store.
+     *
+     * @param versionnedContent the content to update.
+     *
+     * @throws ContentManagementException
+     */
+    public void updateVersionnedContent(VersionnedContent versionnedContent) throws ContentManagementException;
+    
+
+    /**
+     * Get all folder children. It is a collection of CmsObject instances.
+     * 
+     * @param folder the parent folder.
+     * @return the folder children (collection of CmsObject).
+     * @throws ContentManagementException
+     */
+    public Collection getChildren(Folder folder) throws ContentManagementException;
+
+    /**
+     * Get all folder children (documents & folders).
+     * 
+     * @param parentUri the uri from which the children have to be retrieved. It can be an server scope or a folder uri.
+     * @return the folder children (collection of CmsObject).
+     * @throws ContentManagementException
+     */
+    public Collection getChildren(String parentUri) throws ContentManagementException;
+
+    /**
+     * Get all contents found in a parent uri. 
+     * 
+     * @param parentUri The uri from which the documents have be retrieved. It can be an server scope or a folder uri.
+     * @return a collection of {@link Content}
+     * @throws ContentManagementException
+     */
+    public Collection getContents(String parentUri) throws ContentManagementException;
+
+    /**
+     * Get all links found in a parent uri. 
+     * 
+     * @param parentUri The uri from which the links have be retrieved. It can be an server scope or a folder uri.
+     * @return a collection of {@link Link}
+     * @throws ContentManagementException
+     */
+    public Collection getLinks(String parentUri) throws ContentManagementException;
+    
+    /**
+     * Get all folders found in a parent uri. 
+     * 
+     * @param parentUri The uri from which the folders have be retrieved. It can be an server scope or a folder uri.
+     * @return a collection of {@link Folder}
+     * @throws ContentManagementException
+     */
+    public Collection getFolders(String parentUri) throws ContentManagementException;
+    
+    /**
+     * Get a CmsObject from the engine's persistent store.
+     *
+     * @param uri  the uri assigned to the cms object to retrieve.
+     * @return The cms object found or null.
+     * @throws ContentManagementException
+     */
+    public CmsObject getCmsObject(String uri) throws ContentManagementException;
+
+}
\ No newline at end of file

Added: incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/core/ContentPermissionService.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/core/ContentPermissionService.java?rev=225687&view=auto
==============================================================================
--- incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/core/ContentPermissionService.java (added)
+++ incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/core/ContentPermissionService.java Wed Jul 27 22:28:56 2005
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * 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.services.core;
+
+import java.security.Permissions;
+
+import org.apache.jetspeed.security.PermissionManager;
+import org.apache.portals.graffito.exception.ContentManagementException;
+import org.apache.portals.graffito.model.core.CmsObject;
+import org.apache.portals.graffito.model.permission.CmsPermission;
+
+
+
+/**
+ * Extends the Jetspeed 2 Permission manager in order to manager permission on cms objects
+ *
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
+ * @version $Id: Exp $
+ */
+public interface ContentPermissionService extends PermissionManager
+{
+
+    /**
+     * Factory to create a new cms permission object.
+     * 
+     * @param name the permission name
+     * @param actions The authorised actions
+     * @return an empty factory created permission.
+     * @throws ContentManagementException
+     */
+    public CmsPermission createPermission(String name, String actions) throws ContentManagementException;
+    
+    /**
+     * Get all permissions defined for a cms objects
+     * @param cmsObject the cms object 
+     * @return the permissions found
+     */
+    Permissions getPermissions(CmsObject cmsObject);
+
+    /**
+     * Get all permissions defined for a cms objects
+     * @param uri the cms object uri
+     * @return the permissions found
+     */   
+    Permissions getPermissions(String uri);    
+
+    /**
+     * Grant a CmsPermission to a principal
+     * @param principalFullPath the principal full path (eg. /roles/admin)
+     * @param permission The permission to set 
+     * @throws ContentManagementException
+     */    
+    public void grantPermission(String principalFullPath, CmsPermission permission) throws ContentManagementException;
+
+}
\ No newline at end of file

Added: incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/core/ContentServerService.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/core/ContentServerService.java?rev=225687&view=auto
==============================================================================
--- incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/core/ContentServerService.java (added)
+++ incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/core/ContentServerService.java Wed Jul 27 22:28:56 2005
@@ -0,0 +1,119 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * 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.services.core;
+
+import java.util.Collection;
+
+import org.apache.portals.graffito.exception.ContentManagementException;
+import org.apache.portals.graffito.model.server.FileSystemServer;
+import org.apache.portals.graffito.model.server.GraffitoServer;
+import org.apache.portals.graffito.model.server.Server;
+import org.apache.portals.graffito.model.server.WebdavServer;
+
+
+/**
+ * <P>Content Server Interface</P>
+ *
+ * This service maintains server references and their integration into the virtual content tree.
+ * 
+ * In this version, all servers are plugged on the root content tree level.
+ * Later, we plan to "mount" external servers anywhere in the content tree.
+ *
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ *
+ * @version $Id: ContentServerService.java,v 1.1 2004/12/22 21:16:12 christophe Exp $
+ *
+ *
+ */
+
+public interface ContentServerService
+{
+    /**
+     * Factory to create a new WEBDAV server reference object
+     *
+     * @return an empty factory created WEBDAV server reference
+     * 
+     * @throws ContentManagementException
+     */
+    public WebdavServer createWebdavServer() throws ContentManagementException;
+
+    
+    /**
+     * Factory to create a new Graffito server reference object
+     *
+     * @return an empty factory created Graffito server 
+     * @throws ContentManagementException
+     */
+    public GraffitoServer createGraffitoServer() throws ContentManagementException;
+
+    /**
+     * Factory to create a new File System server reference object
+     *
+     * @return an empty factory created File System server 
+     * @throws ContentManagementException
+     */
+    public FileSystemServer createFileSystemServer() throws ContentManagementException;
+    
+    /**
+     * Adds a new server to engine's persistent store.
+     *
+     * @param server the server to add
+     * 
+     * @throws ContentManagementException
+     */
+    public void addServer(Server server) throws ContentManagementException;
+
+    /**
+     * Remove a server from the engine's persistent store.
+     * 
+     * This method delete only the server reference (not its associated content tree).
+     *
+     * @param server the server reference to remove.
+     * 
+     * @throws ContentManagementException
+     */
+    public void removeServer(Server server) throws ContentManagementException;
+
+    /**
+     * Get a server reference from the engine's persistent store.
+     *
+     * @param scope the scope assigned to the server to retrieve.
+     * @return server found or null.
+     * 
+     * @throws ContentManagementException
+     */
+    public Server getServer(String scope) throws ContentManagementException;
+
+    /**
+     * Update a server reference into the engine's persistent store.
+     *
+     * @param server the server to be updated.
+     * @throws ContentManagementException
+     */
+    public void updateServer(Server server) throws ContentManagementException;
+    
+    /**
+     * Get all server references defined into the engine's persistence store.
+     * 
+     * @return a collection of {@link Server}
+     * 
+     * @throws ContentManagementException
+     */
+    public Collection getAllServers()  throws ContentManagementException;
+
+
+}

Added: incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/core/ContentVersionService.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/core/ContentVersionService.java?rev=225687&view=auto
==============================================================================
--- incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/core/ContentVersionService.java (added)
+++ incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/core/ContentVersionService.java Wed Jul 27 22:28:56 2005
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * 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.services.core;
+
+import org.apache.portals.graffito.exception.CmsInstantiateException;
+import org.apache.portals.graffito.exception.ContentManagementException;
+import org.apache.portals.graffito.model.core.HistoryElement;
+import org.apache.portals.graffito.model.core.VersionnedContent;
+
+
+/**
+ * <P>CMS Version Service Interface</P>
+ *
+ * This service maintains content versions and history.
+ * The version number is composed of a Major & minor section like the following structure : "majorNum.minorNum"
+ * TODO : Later we will add branch management with content merge, content comparaison, ...
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ * 
+ * @version $Id: ContentVersionService.java,v 1.1 2004/12/22 21:16:12 christophe Exp $
+ */
+public interface ContentVersionService 
+{  
+   /**
+    * Get the last history element associated to an uri
+    * 
+    * @param uri The uri assigned to the versioned content
+    * 
+    * @return The last history element
+    * @exception ContentManagementException when it is impossible to get the history
+    */ 
+   public HistoryElement getHistory(String uri)  throws ContentManagementException;;
+   
+   /**
+    * Get the history element associated to a specific versionned content
+    * 
+    * @param versionnedContent The versionned content for which the history element is required
+    * 
+    * @return The last history element
+    * @exception ContentManagementException when it is impossible to get the history
+    */
+   public HistoryElement getHistory(VersionnedContent versionnedContent) throws ContentManagementException;
+   
+   /**
+    * Create a new major versionned content. 
+    * @param uri The content uri
+    * @return The new versionned content
+    * @throws CmsInstantiateException
+    */
+   public VersionnedContent createMajorVersion(String uri) throws CmsInstantiateException;
+  
+   /**
+    * Create a new minor versionned content. 
+    * @param uri The content uri
+    * @return The new versionned conntent
+    * @throws CmsInstantiateException
+    */   
+   public VersionnedContent createMinorVersion(String uri) throws CmsInstantiateException;
+   
+   /**
+    * Add a new version in the Document history
+    * @param uri The uri for wich the history has to be modified
+    * @param previousContent The versionned content before the new one to add
+    * @param newContent The new versionned content to insert into the history
+    * @throws CmsInstantiateException
+    */
+   void addInHistory(String uri, VersionnedContent previousContent, VersionnedContent newContent) throws CmsInstantiateException;
+}

Added: incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/dm/DocumentModelService.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/dm/DocumentModelService.java?rev=225687&view=auto
==============================================================================
--- incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/dm/DocumentModelService.java (added)
+++ incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/dm/DocumentModelService.java Wed Jul 27 22:28:56 2005
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * 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.services.dm;
+
+import org.apache.portals.graffito.exception.ContentManagementException;
+import org.apache.portals.graffito.model.dm.Document;
+
+/**
+ * <P>Document Model Service Interface</P>
+ *
+ * This service maintains Document & DocumentStream objects.
+ *
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ * 
+ * @version $Id: ContentModelService.java,v 1.1 2004/12/22 21:16:12 christophe Exp $
+ *
+ */
+public interface DocumentModelService
+{
+
+
+    /**
+     * Adds a document to engine's persistent store.
+     *
+     * @param document the document to add
+     *
+     * @throws ContentManagementException
+     */
+    public void addDocument(Document document) throws ContentManagementException;
+
+    /**
+     * Factory to create a new empty document object.
+     *
+     * @return an empty factory created document
+     * 
+     * @throws ContentManagementException
+     */
+    public Document createDocument() throws ContentManagementException;
+
+    /**
+     * Get a document from the engine's persistent store by uri.
+     * This methods returns the lastes version.
+     *
+     * @param uri uri assigned to the document.
+     * @return Document found or null
+     *
+     * @throws ContentManagementException
+     */
+    public Document getDocument(String uri) throws ContentManagementException;
+
+    /**
+     * Get a document from the engine's persistent store by uri.
+     *
+     * @param uri uri assigned to the document.
+     * @param versionNum the desired version number assigned to the document to retrieve
+     * @return Document found or null
+     *
+     * @throws ContentManagementException
+     */
+    public Document getDocument(String uri, String versionNum) throws ContentManagementException;
+
+    /**
+     * Remove a document from the engine's persistent store.
+     *
+     * @param document the document to remove.
+     *
+     * @throws ContentManagementException
+     */
+    public void removeDocument(Document document) throws ContentManagementException;
+
+    /**
+     * Update a document in the engine's persistent store.
+     *
+     * @param document the document to update.
+     *
+     * @throws ContentManagementException
+     */
+    public void updateDocument(Document document) throws ContentManagementException;
+
+
+}
\ No newline at end of file

Added: incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/search/ContentIndexService.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/search/ContentIndexService.java?rev=225687&view=auto
==============================================================================
--- incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/search/ContentIndexService.java (added)
+++ incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/search/ContentIndexService.java Wed Jul 27 22:28:56 2005
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * 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.services.search;
+
+import java.util.Collection;
+
+import org.apache.portals.graffito.model.core.CmsObject;
+
+
+/**
+ * Cms Index Service. This service can be used to add, remove or update CmsObjects into a index
+ *
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ * 
+ * @version $Id: ContentIndexService.java,v 1.1 2004/12/22 21:16:12 christophe Exp $
+ */
+public interface ContentIndexService
+{
+   
+    /**
+     * Add a CmsObject entry
+     * 
+     * @param cmsObject The CmsObject to add into the index
+     * @return true if the object is correclty added
+     */
+    public boolean add(CmsObject cmsObject);
+
+    /**
+     * Add a collection of CmsObject entries
+     * 
+     * @param cmsObjects the CmsObject collection to add into the index
+     * @return true if the collection is correctly added
+     */
+    public boolean add(Collection cmsObjects);
+
+    /**
+     * Remove a CmsObject entry
+     * 
+     * @param cmsObject the CmsObject to remove from the index
+     * @return true if the object is correctly removed
+     */
+    public boolean remove(CmsObject cmsObject);
+
+    /**
+     * Remove a collection of CmsObject entries
+     * 
+     * @param cmsObjects the CmsObject collection to remove from the index
+     * @return true if the collection is correctly removed
+     */
+    public boolean remove(Collection cmsObjects);
+
+    /**
+     * Update a CmsObject entry
+     * 
+     * @param cmsObject the CmsObject to update from the index
+     * @return  true if the CmsObject is correctly removed
+     */
+    public boolean update(CmsObject cmsObject);
+
+    /**
+     * Update a CmsObject entries
+     * 
+     * @param cmsObjects the CmsObject collection to update from the index
+     * @return True if the object is correctly updated in the index
+     */
+    public boolean update(Collection cmsObjects);
+
+}

Added: incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/search/ContentSearchService.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/search/ContentSearchService.java?rev=225687&view=auto
==============================================================================
--- incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/search/ContentSearchService.java (added)
+++ incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/search/ContentSearchService.java Wed Jul 27 22:28:56 2005
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * 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.services.search;
+
+import org.apache.portals.graffito.exception.ContentManagementException;
+
+
+/**
+ * Cms Search Service.
+ *
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ * 
+ * @version $Id: ContentSearchService.java,v 1.1 2004/12/22 21:16:12 christophe Exp $
+ */
+public interface ContentSearchService
+{
+
+    /**
+     * Search on CmsObjects
+     * 
+     * @param filter Filter used to search CmsObject
+     * @return result wich match to the search criteria
+     * 
+     * @throws ContentManagementException
+     */
+    public SearchResults searchCmsObjects(Filter filter) throws ContentManagementException;
+
+    /**
+     * Search on CmsObjects
+     * 
+     * @param filter Filter used to search CmsObject
+     * @param cmsObjectClass The cms object class (Content, folder, ...) 
+     * @return result wich match to the search criteria
+     * 
+     * @throws ContentManagementException
+     */
+    public SearchResults searchCmsObjects(Class cmsObjectClass, Filter filter) throws ContentManagementException;
+    
+    /**
+     * Create a new Filter
+     * 
+     * @return a new Filter instance
+     */
+    public Filter newFilter();    
+}

Added: incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/search/Filter.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/search/Filter.java?rev=225687&view=auto
==============================================================================
--- incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/search/Filter.java (added)
+++ incubator/graffito/trunk/api/src/java/org/apache/portals/graffito/services/search/Filter.java Wed Jul 27 22:28:56 2005
@@ -0,0 +1,143 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * 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.services.search;
+
+import java.util.Collection;
+
+/**
+ * 
+ * Graffito Filter interface.
+ *
+ * @version $Ip:  Exp $
+ *
+ */
+public interface Filter
+{
+    
+    /**
+     * Set the filter scope. The scope is an URI prefix specifying where to search in the content tree.
+     * For example, if the scope is '/myserver1/myfolder', the search engine will search all objects
+     * which are located below '/myserver1/myfolder'.
+     * 
+     * @param scope The filter scope
+     *  
+     */
+    public void setScope(String scope);
+    
+    /**
+     * Get the filter scope.
+     * 
+     * @return The filter scope
+     */
+    public String getScope();
+    
+    /**
+     * Search content based on a fullTextSearch. 
+     * Depending on the full text search engine, you can also filter on properties.
+     * 
+     * @param fullTextSearch The full text search string  
+     */
+    public void addFullTextSearch(String fullTextSearch);
+
+    /**
+     * Search content based on a fullTextSearch. 
+     * Depending on the full text search engine, you can also filter on properties.
+     * 
+     * @param fullTextSearch The full text search string
+     * @param field The field to be searched  
+     */    
+    public void addFullTextSearch(String fullTextSearch, String field);
+    
+    /**
+     * @return the full text search field
+     * 
+     */
+    public String getSearchField();
+    
+	/**
+	 * @see org.apache.ojb.broker.query.Criteria#addBetween(java.lang.String, java.lang.Object, java.lang.Object)
+	 */
+	public void addBetween(String arg0, Object arg1, Object arg2);
+
+	/**
+	 * @see org.apache.ojb.broker.query.Criteria#addEqualTo(java.lang.String, java.lang.Object)
+	 */
+	public void addEqualTo(String arg0, Object arg1);
+
+	/**
+	 * @see org.apache.ojb.broker.query.Criteria#addGreaterOrEqualThan(java.lang.String, java.lang.Object)
+	 */
+	public void addGreaterOrEqualThan(String arg0, Object arg1);
+
+	/**
+	 * @see org.apache.ojb.broker.query.Criteria#addGreaterThan(java.lang.String, java.lang.Object)
+	 */
+	public void addGreaterThan(String arg0, Object arg1);
+
+	/**
+	 * @see org.apache.ojb.broker.query.Criteria#addIn(java.lang.String, java.util.Collection)
+	 */      
+	public void addIn(String attribute, Collection values);
+
+	/**
+	 * @see org.apache.ojb.broker.query.Criteria#addLessOrEqualThan(java.lang.String, java.lang.Object)
+	 */
+	public void addLessOrEqualThan(String arg0, Object arg1);
+
+	/**
+	 * @see org.apache.ojb.broker.query.Criteria#addLike(java.lang.Object, java.lang.Object)
+	 */
+	public void addLike(Object arg0, Object arg1);
+
+	/**
+	 * @see org.apache.ojb.broker.query.Criteria#addNotBetween(java.lang.String, java.lang.Object, java.lang.Object)
+	 */
+	public abstract void addNotBetween(String arg0, Object arg1, Object arg2);
+
+	/**
+	 * @see org.apache.ojb.broker.query.Criteria#addNotEqualTo(java.lang.String, java.lang.Object)
+	 */
+	public void addNotEqualTo(String arg0, Object arg1);
+
+	/**
+	 * @see org.apache.ojb.broker.query.Criteria#addNotLike(java.lang.String, java.lang.Object)
+	 */
+	public void addNotLike(String arg0, Object arg1);
+
+	/**
+	 * @see org.apache.ojb.broker.query.Criteria#addNotNull(java.lang.String)
+	 */
+	public void addNotNull(String arg0);
+
+	public void addIsNull(String arg0);
+	
+	/**
+	 * @see org.apache.ojb.broker.query.Criteria#addOrCriteria(org.apache.ojb.broker.query.Criteria)
+	 */
+	public void addOrFilter(Filter arg0);
+
+	/**
+	 * @see org.apache.ojb.broker.query.Criteria#addOrderByAscending(java.lang.String)
+	 */
+	public void addOrderByAscending(String arg0);
+
+	/**
+	 * @see org.apache.ojb.broker.query.Criteria#addOrderByDescending(java.lang.String)
+	 */
+	public void addOrderByDescending(String arg0);
+
+}



Mime
View raw message