org.apache.portals.graffito.store.impl.ojb
Class GraffitoOJBStore

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

public class GraffitoOJBStore
extends AbstractGraffitoStore
implements ContentStore

Implementation for an OJB (Persistence Broker) Store


Field Summary
 
Fields inherited from class org.apache.portals.graffito.store.impl.AbstractGraffitoStore
cmsAccessController, log, scope
 
Constructor Summary
GraffitoOJBStore(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 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 content)
          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 setOjbFactory(OjbFactory ojbFactory)
          Initialise the Ojb factory to use with this PB content store.
 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

GraffitoOJBStore

public GraffitoOJBStore(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
See Also:
ContentStore.getCmsObject(String)

getChildren

public java.util.Collection getChildren(java.lang.String parentUri)
                                 throws org.apache.portals.graffito.exception.CmsPermissionException
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
Throws:
org.apache.portals.graffito.exception.CmsPermissionException - when the user has not suffisiant privileges
See Also:
ContentStore.getChildren(java.lang.String)

getLinks

public java.util.Collection getLinks(java.lang.String parentUri)
                              throws org.apache.portals.graffito.exception.CmsPermissionException
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
Throws:
org.apache.portals.graffito.exception.CmsPermissionException - when the user has not suffisiant privileges
See Also:
ContentStore.getLinks(java.lang.String)

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)

getFolders

public java.util.Collection getFolders(java.lang.String parentUri)
                                throws org.apache.portals.graffito.exception.CmsPermissionException
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
Throws:
org.apache.portals.graffito.exception.CmsPermissionException - when the user has not suffisiant privileges
See Also:
ContentStore.getFolders(java.lang.String)

getHistory

public org.apache.portals.graffito.model.core.HistoryElement getHistory(org.apache.portals.graffito.model.core.VersionnedContent content)
                                                                 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:
content - 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)

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
See Also:
ContentStore.insertHistoryElement(org.apache.portals.graffito.model.core.HistoryElement)

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
See Also:
ContentStore.newFilter()

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
See Also:
ContentStore.getObjectByQuery(Class, Filter)

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
See Also:
ContentStore.getCollectionByQuery(Class, Filter)

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
See Also:
ContentStore.getIteratorByQuery(Class, Filter)

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
See Also:
ContentStore.delete(Object)

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
See Also:
ContentStore.deleteAll(Class, Filter)

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
See Also:
ContentStore.insert(java.lang.Object)

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
See Also:
ContentStore.update(java.lang.Object)

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
See Also:
ContentStore.isClosed()

close

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

Specified by:
close in interface ContentStore
See Also:
ContentStore.close()

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
See Also:
ContentStore.getScope()

setOjbFactory

public void setOjbFactory(OjbFactory ojbFactory)
Initialise the Ojb factory to use with this PB content store.

Parameters:
ojbFactory - The ojbFactory to set.


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