org.apache.portals.graffito.store
Interface ContentStore

All Known Implementing Classes:
AbstractGraffitoStore, FileSystemContentStore, GraffitoOJBStore

public interface ContentStore

Graffito content store. This interface can be used to plug any kind of content server into Graffito. Depending on the content server type, the implementation has to manage the permissions.


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

Method Detail

getCmsObject

org.apache.portals.graffito.model.core.CmsObject getCmsObject(java.lang.String uri)
                                                              throws org.apache.portals.graffito.exception.CmsPermissionException
Get a cms object

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

java.util.Collection getChildren(java.lang.String parentUri)
                                 throws org.apache.portals.graffito.exception.CmsPermissionException
Get cms object childen found in a folder.

Parameters:
parentUri - The parent folder uri from which the cms objects have to be retrieved
Returns:
a collection of cms object found
Throws:
org.apache.portals.graffito.exception.CmsPermissionException - when the user has not suffisiant privileges

getFolders

java.util.Collection getFolders(java.lang.String parentUri)
                                throws org.apache.portals.graffito.exception.CmsPermissionException
Get folders found in a parent folder.

Parameters:
parentUri - The parent folder uri from which the folders have to be retrieved
Returns:
a collection of folder children found
Throws:
org.apache.portals.graffito.exception.CmsPermissionException - when the user has not suffisiant privileges

getContents

java.util.Collection getContents(java.lang.String parentUri)
                                 throws org.apache.portals.graffito.exception.CmsPermissionException
Get contents found in a parent folder.

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

getLinks

java.util.Collection getLinks(java.lang.String parentUri)
                              throws org.apache.portals.graffito.exception.CmsPermissionException
Get links found in a parent folder.

Parameters:
parentUri - The parent folder uri from which the links have to be retrieved
Returns:
a collection of link children found
Throws:
org.apache.portals.graffito.exception.CmsPermissionException - when the user has not suffisiant privileges

insertHistoryElement

void insertHistoryElement(org.apache.portals.graffito.model.core.HistoryElement historyElement)
                          throws ContentPersistenceException,
                                 org.apache.portals.graffito.exception.CmsPermissionException
Add a new history element

Parameters:
historyElement -
Throws:
ContentPersistenceException - when it is not possible to insert the object
org.apache.portals.graffito.exception.CmsPermissionException - when the user has not suffisiant privileges

getHistory

org.apache.portals.graffito.model.core.HistoryElement getHistory(org.apache.portals.graffito.model.core.VersionnedContent versionnedContent)
                                                                 throws org.apache.portals.graffito.exception.CmsPermissionException
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()

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

newFilter

org.apache.portals.graffito.services.search.Filter newFilter()
Instantiate a new empty filter object

Returns:
the instantiated filter object

getObjectByQuery

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

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

java.util.Collection getCollectionByQuery(java.lang.Class clazz,
                                          org.apache.portals.graffito.services.search.Filter filter)
                                          throws org.apache.portals.graffito.exception.CmsPermissionException
Get collection of object matching to a query

Parameters:
clazz - The class on which the query has to be exexuted
filter - The filter used by the query
Returns:
a collection of CmsObject
Throws:
org.apache.portals.graffito.exception.CmsPermissionException - when the user has not suffisiant privileges

getIteratorByQuery

java.util.Iterator getIteratorByQuery(java.lang.Class clazz,
                                      org.apache.portals.graffito.services.search.Filter filter)
                                      throws org.apache.portals.graffito.exception.CmsPermissionException
Get an iterator of object matching to a query

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
Throws:
org.apache.portals.graffito.exception.CmsPermissionException - when the user has not suffisiant privileges

delete

void delete(java.lang.Object object)
            throws ContentPersistenceException,
                   org.apache.portals.graffito.exception.CmsPermissionException
Delete any kind of object (CmsObject, Server, HistoryElement, ...)

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

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

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

void insert(java.lang.Object object)
            throws ContentPersistenceException,
                   org.apache.portals.graffito.exception.CmsPermissionException
Insert a new object in the content store

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

void update(java.lang.Object object)
            throws ContentPersistenceException,
                   org.apache.portals.graffito.exception.CmsPermissionException
Update a new object in the content store

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

boolean isClosed()
Check if the connection to this store is closed

Returns:
true if the connection is close

close

void close()
Close the connection to this store


getScope

java.lang.String getScope()
Get the content store scope

Returns:
the content store scope


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