org.apache.portals.graffito.store.impl.fs
Class FileSystemContentStore

java.lang.Object
  extended by org.apache.portals.graffito.store.impl.AbstractGraffitoStore
      extended by org.apache.portals.graffito.store.impl.fs.FileSystemContentStore
All Implemented Interfaces:
ContentStore

public class FileSystemContentStore
extends AbstractGraffitoStore
implements ContentStore

File System Content Store

Version:
$Id: $
Author:
David Sean Taylor

Field Summary
 
Fields inherited from class org.apache.portals.graffito.store.impl.AbstractGraffitoStore
cmsAccessController, log, scope
 
Constructor Summary
FileSystemContentStore(org.apache.portals.graffito.model.server.Server server, CmsAccessController cmsAccessController)
          Constructor based on the a server object.
 
Method Summary
 void close()
          Close the connection to this store
 void delete(java.lang.Object object)
          Delete any kind of object (CmsObject, Server, HistoryElement, ...)
 void deleteAll(java.lang.Class clazz, org.apache.portals.graffito.services.search.Filter filter)
          Delete all object matching to a query
 java.util.Collection getChildren(java.lang.String parentUri)
          Get cms object childen found in a folder.
 org.apache.portals.graffito.model.core.CmsObject getCmsObject(java.lang.String uri)
          Get a cms object
 java.util.Collection getCollectionByQuery(java.lang.Class clazz, org.apache.portals.graffito.services.search.Filter filter)
          Get collection of object matching to a query
 java.util.Collection getContents(java.lang.String parentUri)
          Get contents found in a parent folder.
 java.util.Collection getDocuments(java.lang.String parentUri)
           
 java.util.Collection getFolders(java.lang.String parentUri)
          Get folders found in a parent folder.
 org.apache.portals.graffito.model.core.HistoryElement getHistory(org.apache.portals.graffito.model.core.VersionnedContent versionnedContent)
          Get the version history element defined from a content.
 java.util.Iterator getIteratorByQuery(java.lang.Class clazz, org.apache.portals.graffito.services.search.Filter filter)
          Get an iterator of object matching to a query
 java.util.Collection getLinks(java.lang.String parentUri)
          Get links found in a parent folder.
 java.lang.Object getObjectByQuery(java.lang.Class clazz, org.apache.portals.graffito.services.search.Filter filter)
          Get an object matching to a query
 java.lang.String getScope()
          Get the content store scope
 void insert(java.lang.Object object)
          Insert a new object in the content store
 void insertHistoryElement(org.apache.portals.graffito.model.core.HistoryElement historyElement)
          Add a new history element
 boolean isClosed()
          Check if the connection to this store is closed
 org.apache.portals.graffito.services.search.Filter newFilter()
          Instantiate a new empty filter object
 void update(java.lang.Object object)
          Update a new object in the content store
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSystemContentStore

public FileSystemContentStore(org.apache.portals.graffito.model.server.Server server,
                              CmsAccessController cmsAccessController)
                       throws org.apache.portals.graffito.exception.CmsInstantiateException
Constructor based on the a server object.

Parameters:
server - The server object contains all information to connect to this content store
cmsAccessController - The CmsAccesController used to check the permissions
Throws:
org.apache.portals.graffito.exception.CmsInstantiateException - when it is not possible to instantiate this store
Method Detail

getCmsObject

public org.apache.portals.graffito.model.core.CmsObject getCmsObject(java.lang.String uri)
                                                              throws org.apache.portals.graffito.exception.CmsPermissionException
Description copied from interface: ContentStore
Get a cms object

Specified by:
getCmsObject in interface ContentStore
Parameters:
uri - The cms object uri
Returns:
The cms object found or null
Throws:
org.apache.portals.graffito.exception.CmsPermissionException - when the user has not suffisiant privileges

getChildren

public java.util.Collection getChildren(java.lang.String parentUri)
Description copied from interface: ContentStore
Get cms object childen found in a folder.

Specified by:
getChildren in interface ContentStore
Parameters:
parentUri - The parent folder uri from which the cms objects have to be retrieved
Returns:
a collection of cms object found

getFolders

public java.util.Collection getFolders(java.lang.String parentUri)
Description copied from interface: ContentStore
Get folders found in a parent folder.

Specified by:
getFolders in interface ContentStore
Parameters:
parentUri - The parent folder uri from which the folders have to be retrieved
Returns:
a collection of folder children found

getDocuments

public java.util.Collection getDocuments(java.lang.String parentUri)

getLinks

public java.util.Collection getLinks(java.lang.String parentUri)
Description copied from interface: ContentStore
Get links found in a parent folder.

Specified by:
getLinks in interface ContentStore
Parameters:
parentUri - The parent folder uri from which the links have to be retrieved
Returns:
a collection of link children found

insertHistoryElement

public void insertHistoryElement(org.apache.portals.graffito.model.core.HistoryElement historyElement)
                          throws ContentPersistenceException,
                                 org.apache.portals.graffito.exception.CmsPermissionException
Description copied from interface: ContentStore
Add a new history element

Specified by:
insertHistoryElement in interface ContentStore
Throws:
ContentPersistenceException - when it is not possible to insert the object
org.apache.portals.graffito.exception.CmsPermissionException - when the user has not suffisiant privileges

getContents

public java.util.Collection getContents(java.lang.String parentUri)
                                 throws org.apache.portals.graffito.exception.CmsPermissionException
Description copied from interface: ContentStore
Get contents found in a parent folder.

Specified by:
getContents in interface ContentStore
Parameters:
parentUri - The parent folder uri from which the contents have to be retrieved
Returns:
a collection of content children found
Throws:
org.apache.portals.graffito.exception.CmsPermissionException - when the user has not suffisiant privileges
See Also:
ContentStore.getContents(java.lang.String)

getHistory

public org.apache.portals.graffito.model.core.HistoryElement getHistory(org.apache.portals.graffito.model.core.VersionnedContent versionnedContent)
                                                                 throws org.apache.portals.graffito.exception.CmsPermissionException
Description copied from interface: ContentStore
Get the version history element defined from a content. From this history element, it is possible to find previous version history element by calling HistoryElement.getPrevious()

Specified by:
getHistory in interface ContentStore
Parameters:
versionnedContent - The versionned content for which the version history has be found
Returns:
The History element found
Throws:
org.apache.portals.graffito.exception.CmsPermissionException - when the user has not suffisiant privileges
See Also:
ContentStore.getHistory(org.apache.portals.graffito.model.core.VersionnedContent)

newFilter

public org.apache.portals.graffito.services.search.Filter newFilter()
Description copied from interface: ContentStore
Instantiate a new empty filter object

Specified by:
newFilter in interface ContentStore
Returns:
the instantiated filter object

getObjectByQuery

public java.lang.Object getObjectByQuery(java.lang.Class clazz,
                                         org.apache.portals.graffito.services.search.Filter filter)
                                  throws org.apache.portals.graffito.exception.CmsPermissionException
Description copied from interface: ContentStore
Get an object matching to a query

Specified by:
getObjectByQuery in interface ContentStore
Parameters:
clazz - The class on which the query has to be exexuted
filter - The filter used by the query
Returns:
The object found or null
Throws:
org.apache.portals.graffito.exception.CmsPermissionException - when the user has not suffisiant privileges

getCollectionByQuery

public java.util.Collection getCollectionByQuery(java.lang.Class clazz,
                                                 org.apache.portals.graffito.services.search.Filter filter)
Description copied from interface: ContentStore
Get collection of object matching to a query

Specified by:
getCollectionByQuery in interface ContentStore
Parameters:
clazz - The class on which the query has to be exexuted
filter - The filter used by the query
Returns:
a collection of CmsObject

getIteratorByQuery

public java.util.Iterator getIteratorByQuery(java.lang.Class clazz,
                                             org.apache.portals.graffito.services.search.Filter filter)
Description copied from interface: ContentStore
Get an iterator of object matching to a query

Specified by:
getIteratorByQuery in interface ContentStore
Parameters:
clazz - The class on which the query has to be exexuted
filter - The filter used by the query
Returns:
an iterator of of CmsObject

delete

public void delete(java.lang.Object object)
            throws ContentPersistenceException,
                   org.apache.portals.graffito.exception.CmsPermissionException
Description copied from interface: ContentStore
Delete any kind of object (CmsObject, Server, HistoryElement, ...)

Specified by:
delete in interface ContentStore
Parameters:
object - The object to delete
Throws:
ContentPersistenceException - when it is not possible to delete the object
org.apache.portals.graffito.exception.CmsPermissionException - when the user has not suffisiant privileges

deleteAll

public void deleteAll(java.lang.Class clazz,
                      org.apache.portals.graffito.services.search.Filter filter)
               throws ContentPersistenceException,
                      org.apache.portals.graffito.exception.CmsPermissionException
Description copied from interface: ContentStore
Delete all object matching to a query

Specified by:
deleteAll in interface ContentStore
Parameters:
clazz - The class on which the query has to be exexuted
filter - The filter used by the query
Throws:
ContentPersistenceException - when it is not possible to delete the objects
org.apache.portals.graffito.exception.CmsPermissionException - when the user has not suffisiant privileges

insert

public void insert(java.lang.Object object)
            throws ContentPersistenceException,
                   org.apache.portals.graffito.exception.CmsPermissionException
Description copied from interface: ContentStore
Insert a new object in the content store

Specified by:
insert in interface ContentStore
Parameters:
object - The object to insert
Throws:
ContentPersistenceException - when it is not possible to insert the object
org.apache.portals.graffito.exception.CmsPermissionException - when the user has not suffisiant privileges

update

public void update(java.lang.Object object)
            throws ContentPersistenceException,
                   org.apache.portals.graffito.exception.CmsPermissionException
Description copied from interface: ContentStore
Update a new object in the content store

Specified by:
update in interface ContentStore
Parameters:
object - The object to update
Throws:
ContentPersistenceException - when it is not possible to update the object
org.apache.portals.graffito.exception.CmsPermissionException - when the user has not suffisiant privileges

isClosed

public boolean isClosed()
Description copied from interface: ContentStore
Check if the connection to this store is closed

Specified by:
isClosed in interface ContentStore
Returns:
true if the connection is close

close

public void close()
Description copied from interface: ContentStore
Close the connection to this store

Specified by:
close in interface ContentStore

getScope

public java.lang.String getScope()
Description copied from interface: ContentStore
Get the content store scope

Specified by:
getScope in interface ContentStore
Returns:
the content store scope


Copyright © 2004-2006 The Apache Software Foundation. All Rights Reserved.