org.apache.portals.graffito.services.core
Interface ContentModelService


public interface ContentModelService

CMS Model Service Interface

This service maintains Folder, Content and Links. tied to the CMS that are stored in the repository and used to access the CMS.

Version:
$Id: ContentModelService.java,v 1.1 2004/12/22 21:16:12 christophe Exp $
Author:
David Sean Taylor, Ruchir Gatha, Christophe Lombart

Method Summary
 void addContent(Content content)
          Adds a content to engine's persistent store.
 void addFolder(Folder folder)
          Adds a new folder to engine's persistent store.
 void addLink(Link link)
          Adds a Link to engine's persistent store.
 void addVersionnedContent(VersionnedContent versionnedContent)
          Adds a versionned content to engine's persistent store.
 Content createContent()
          Factory to create a new empty generic content object.
 Content createContent(java.lang.String contentName)
          Factory to create a new empty content object.
 Folder createFolder()
          Factory to create a new Folder object.
 Link createLink()
          Factory to create a new Link object.
 VersionnedContent createVersionnedContent()
          Factory to create a new empty generic versionned content object.
 VersionnedContent createVersionnedContent(java.lang.String contentName)
          Factory to create a new empty versionned content object.
 java.util.Collection getChildren(Folder folder)
          Get all folder children.
 java.util.Collection getChildren(java.lang.String parentUri)
          Get all folder children (documents & folders).
 CmsObject getCmsObject(java.lang.String uri)
          Get a CmsObject from the engine's persistent store.
 Content getContent(java.lang.String uri)
          Get a content from the engine's persistent store by uri.
 java.util.Collection getContents(java.lang.String parentUri)
          Get all contents found in a parent uri.
 Folder getFolder(java.lang.String uri)
          Get a folder from the engine's persistent store.
 java.util.Collection getFolders(java.lang.String parentUri)
          Get all folders found in a parent uri.
 Link getLink(java.lang.String uri)
          Get a Link from the engine's persistent store.
 java.util.Collection getLinks(java.lang.String parentUri)
          Get all links found in a parent uri.
 VersionnedContent getVersionnedContent(java.lang.String uri)
          Get a versionned content from the engine's persistent store by uri.
 VersionnedContent getVersionnedContent(java.lang.String uri, java.lang.String versionNum)
          Get a versionned content from the engine's persistent store by uri.
 void removeAll(java.lang.String[] uris)
          Remove many cms objects
 void removeContent(Content content)
          Remove a content from the engine's persistent store.
 void removeFolder(Folder folder)
          Remove a folder from the engine's persistent store.
 void removeLink(Link link)
          Remove a Link from the engine's persistent store.
 void removeVersionnedContent(VersionnedContent versionnedContent)
          Remove a versionned content from the engine's persistent store.
 void updateContent(Content content)
          Update a content in the engine's persistent store.
 void updateFolder(Folder folder)
          Update a folder in the engine's persistent store.
 void updateLink(Link link)
          Update a link in the engine's persistent store.
 void updateVersionnedContent(VersionnedContent versionnedContent)
          Update a versionned content in the engine's persistent store.
 

Method Detail

createFolder

Folder createFolder()
                    throws ContentManagementException
Factory to create a new Folder object.

Returns:
an empty factory created folder.
Throws:
ContentManagementException

addFolder

void addFolder(Folder folder)
               throws ContentManagementException
Adds a new folder to engine's persistent store.

Parameters:
folder - the folder to add.
Throws:
ContentManagementException

removeFolder

void removeFolder(Folder folder)
                  throws ContentManagementException
Remove a folder from the engine's persistent store.

Parameters:
folder - the folder to be removed.
Throws:
ContentManagementException

removeAll

void removeAll(java.lang.String[] uris)
               throws ContentManagementException
Remove many cms objects

Parameters:
uris - an Array of uri's matching to the Cms Object to remove
Throws:
ContentManagementException

getFolder

Folder getFolder(java.lang.String uri)
                 throws ContentManagementException
Get a folder from the engine's persistent store.

Parameters:
uri - the uri assigned to the folder to retrieve.
Returns:
folder found or null.
Throws:
ContentManagementException

updateFolder

void updateFolder(Folder folder)
                  throws ContentManagementException
Update a folder in the engine's persistent store.

Parameters:
folder - the folder to be updated.
Throws:
ContentManagementException

createLink

Link createLink()
                throws ContentManagementException
Factory to create a new Link object.

Returns:
an empty factory created link.
Throws:
ContentManagementException

addLink

void addLink(Link link)
             throws ContentManagementException
Adds a Link to engine's persistent store.

Parameters:
link - the new Link to add.
Throws:
ContentManagementException

getLink

Link getLink(java.lang.String uri)
             throws ContentManagementException
Get a Link from the engine's persistent store.

Parameters:
uri - the uri assigned to the link to retrieve.
Returns:
link found or null.
Throws:
ContentManagementException

removeLink

void removeLink(Link link)
                throws ContentManagementException
Remove a Link from the engine's persistent store.

Parameters:
link - the Link to remove.
Throws:
ContentManagementException

updateLink

void updateLink(Link link)
                throws ContentManagementException
Update a link in the engine's persistent store.

Parameters:
link - the link to be updated.
Throws:
ContentManagementException

addContent

void addContent(Content content)
                throws ContentManagementException
Adds a content to engine's persistent store.

Parameters:
content - the new content
Throws:
ContentManagementException

createContent

Content createContent()
                      throws ContentManagementException
Factory to create a new empty generic content object.

Returns:
an empty factory created content
Throws:
ContentManagementException

createContent

Content createContent(java.lang.String contentName)
                      throws ContentManagementException
Factory to create a new empty content object.

Parameters:
contentName - The content class name (News, Article, ...). This name is used by ht persistence service in order to instantiate the correct class
Returns:
an empty factory created content
Throws:
ContentManagementException

getContent

Content getContent(java.lang.String uri)
                   throws ContentManagementException
Get a content from the engine's persistent store by uri.

Parameters:
uri - uri assigned to the content.
Returns:
Content found or null
Throws:
ContentManagementException

removeContent

void removeContent(Content content)
                   throws ContentManagementException
Remove a content from the engine's persistent store.

Parameters:
content - the content to remove.
Throws:
ContentManagementException

updateContent

void updateContent(Content content)
                   throws ContentManagementException
Update a content in the engine's persistent store.

Parameters:
content - the content to update.
Throws:
ContentManagementException

addVersionnedContent

void addVersionnedContent(VersionnedContent versionnedContent)
                          throws ContentManagementException
Adds a versionned content to engine's persistent store.

Parameters:
versionnedContent - the new content
Throws:
ContentManagementException

createVersionnedContent

VersionnedContent createVersionnedContent()
                                          throws ContentManagementException
Factory to create a new empty generic versionned content object.

Returns:
an empty factory created versionned content
Throws:
ContentManagementException

createVersionnedContent

VersionnedContent createVersionnedContent(java.lang.String contentName)
                                          throws ContentManagementException
Factory to create a new empty versionned content object.

Parameters:
contentName - The content class name (News, Article, ...). This name is used by the persistence service in order to instantiate the correct class
Returns:
an empty factory created versionned content
Throws:
ContentManagementException

getVersionnedContent

VersionnedContent getVersionnedContent(java.lang.String uri)
                                       throws ContentManagementException
Get a versionned content from the engine's persistent store by uri. This method return the lastest version.

Parameters:
uri - uri assigned to the content.
Returns:
Content found or null
Throws:
ContentManagementException

getVersionnedContent

VersionnedContent getVersionnedContent(java.lang.String uri,
                                       java.lang.String versionNum)
                                       throws ContentManagementException
Get a versionned content from the engine's persistent store by uri.

Parameters:
uri - uri assigned to the document.
versionNum - the desired version number assigned to the content to retrieve
Returns:
content found or null
Throws:
ContentManagementException

removeVersionnedContent

void removeVersionnedContent(VersionnedContent versionnedContent)
                             throws ContentManagementException
Remove a versionned content from the engine's persistent store.

Parameters:
versionnedContent - the content to remove.
Throws:
ContentManagementException

updateVersionnedContent

void updateVersionnedContent(VersionnedContent versionnedContent)
                             throws ContentManagementException
Update a versionned content in the engine's persistent store.

Parameters:
versionnedContent - the content to update.
Throws:
ContentManagementException

getChildren

java.util.Collection getChildren(Folder folder)
                                 throws ContentManagementException
Get all folder children. It is a collection of CmsObject instances.

Parameters:
folder - the parent folder.
Returns:
the folder children (collection of CmsObject).
Throws:
ContentManagementException

getChildren

java.util.Collection getChildren(java.lang.String parentUri)
                                 throws ContentManagementException
Get all folder children (documents & folders).

Parameters:
parentUri - the uri from which the children have to be retrieved. It can be an server scope or a folder uri.
Returns:
the folder children (collection of CmsObject).
Throws:
ContentManagementException

getContents

java.util.Collection getContents(java.lang.String parentUri)
                                 throws ContentManagementException
Get all contents found in a parent uri.

Parameters:
parentUri - The uri from which the documents have be retrieved. It can be an server scope or a folder uri.
Returns:
a collection of Content
Throws:
ContentManagementException

getLinks

java.util.Collection getLinks(java.lang.String parentUri)
                              throws ContentManagementException
Get all links found in a parent uri.

Parameters:
parentUri - The uri from which the links have be retrieved. It can be an server scope or a folder uri.
Returns:
a collection of Link
Throws:
ContentManagementException

getFolders

java.util.Collection getFolders(java.lang.String parentUri)
                                throws ContentManagementException
Get all folders found in a parent uri.

Parameters:
parentUri - The uri from which the folders have be retrieved. It can be an server scope or a folder uri.
Returns:
a collection of Folder
Throws:
ContentManagementException

getCmsObject

CmsObject getCmsObject(java.lang.String uri)
                       throws ContentManagementException
Get a CmsObject from the engine's persistent store.

Parameters:
uri - the uri assigned to the cms object to retrieve.
Returns:
The cms object found or null.
Throws:
ContentManagementException


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