org.infoglue.cms.controllers.kernel.impl.simple
Class ContentController

java.lang.Object
  extended by org.infoglue.cms.controllers.kernel.impl.simple.BaseController
      extended by org.infoglue.cms.controllers.kernel.impl.simple.ContentController
Direct Known Subclasses:
ContentControllerProxy

public class ContentController
extends BaseController

Author:
Mattias Bogeblad

Constructor Summary
ContentController()
           
 
Method Summary
static void addChildContent(ContentVO parentVO, ContentVO childVO)
           
 ContentVO create(CreateContentWizardInfoBean createContentWizardInfoBean)
          This method finishes what the create content wizard initiated and resulted in.
 Content create(org.exolab.castor.jdo.Database db, java.lang.Integer parentContentId, java.lang.Integer contentTypeDefinitionId, java.lang.Integer repositoryId, ContentVO contentVO)
          This method creates a new content-entity and references the entities it should know about.
 ContentVO create(java.lang.Integer parentContentId, java.lang.Integer contentTypeDefinitionId, java.lang.Integer repositoryId, ContentVO contentVO)
          This method creates a new content-entity and references the entities it should know about.
 void delete(ContentVO contentVO, org.exolab.castor.jdo.Database db, boolean skipRelationCheck, boolean skipServiceBindings, boolean forceDelete, InfoGluePrincipal infogluePrincipal)
          This method deletes a content and also erases all the children and all versions.
 void delete(ContentVO contentVO, InfoGluePrincipal infogluePrincipal)
          This method deletes a content and also erases all the children and all versions.
 void delete(ContentVO contentVO, InfoGluePrincipal infogluePrincipal, org.exolab.castor.jdo.Database db)
          This method deletes a content and also erases all the children and all versions.
 java.util.List getAvailableLanguagesForContentWithId(java.lang.Integer contentId, org.exolab.castor.jdo.Database db)
           
static java.util.List getBoundContents(org.exolab.castor.jdo.Database db, java.lang.Integer serviceBindingId)
          This method returns the bound contents based on a servicebinding.
static java.util.List getBoundContents(java.lang.Integer serviceBindingId)
          This method returns the bound contents based on a servicebinding.
 java.lang.String getContentAttribute(java.lang.Integer contentId, java.lang.Integer languageId, java.lang.String attributeName)
           
 java.util.List getContentChildrenVOList(java.lang.Integer parentContentId)
          This method returns a list of the children a content has.
static ContentController getContentController()
          Factory method
 ContentTypeDefinitionVO getContentTypeDefinition(java.lang.Integer contentId)
          This method returns the contentTypeDefinitionVO which is associated with this content.
 Content getContentWithId(java.lang.Integer contentId, org.exolab.castor.jdo.Database db)
           
 java.util.List getContentVOList()
           
 java.util.List getContentVOList(java.util.HashMap argumentHashMap)
          This method is sort of a sql-query-like method where you can send in arguments in form of a list of things that should match.
 java.util.List getContentVOList(java.util.HashMap argumentHashMap, org.exolab.castor.jdo.Database db)
          This method is sort of a sql-query-like method where you can send in arguments in form of a list of things that should match.
protected  java.util.List getContentVOListByContentTypeNames(java.util.List arguments)
          The input is a list of hashmaps.
protected  java.util.List getContentVOListByContentTypeNames(java.util.List arguments, org.exolab.castor.jdo.Database db)
          The input is a list of hashmaps.
 java.util.List getContentVOWithContentTypeDefinition(java.lang.String contentTypeDefinitionName)
          Returns all Contents having the specified ContentTypeDefintion.
 java.util.List getContentVOWithContentTypeDefinition(java.lang.String contentTypeDefinitionName, org.exolab.castor.jdo.Database db)
          Returns all Contents having the specified ContentTypeDefintion.
 ContentVO getContentVOWithId(java.lang.Integer contentId)
           
 ContentVO getContentVOWithId(java.lang.Integer contentId, org.exolab.castor.jdo.Database db)
           
 java.util.List getContentVOWithParentRecursive(java.lang.Integer contentId)
          Recursive methods to get all contentVersions of a given state under the specified parent content.
 ContentVO getContentVOWithPath(java.lang.Integer repositoryId, java.lang.String path, boolean forceFolders, InfoGluePrincipal creator, org.exolab.castor.jdo.Database db)
          Returns the content belonging to the specified repository and with the specified path.
static java.util.List getInTransactionBoundContents(org.exolab.castor.jdo.Database db, java.lang.Integer serviceBindingId)
           
 BaseEntityVO getNewVO()
          This is a method that gives the user back an newly initialized ValueObject for this entity that the controller is handling.
static ContentVO getParentContent(java.lang.Integer contentId)
          This method returns the value-object of the parent of a specific content.
 Content getReadOnlyContentWithId(java.lang.Integer contentId, org.exolab.castor.jdo.Database db)
           
 java.util.List getRepositoryContents(java.lang.Integer repositoryId, org.exolab.castor.jdo.Database db)
          This method returns the contents belonging to a certain repository.
 java.util.List getRepositoryLanguages(java.lang.Integer contentId)
          This method reurns a list of available languages for this content.
 Content getRootContent(org.exolab.castor.jdo.Database db, java.lang.Integer repositoryId, java.lang.String userName, boolean createIfNonExisting)
          This method fetches the root content for a particular repository within a transaction.
 Content getRootContent(java.lang.Integer repositoryId, org.exolab.castor.jdo.Database db)
          This method fetches the root content for a particular repository.
 ContentVO getRootContentVO(java.lang.Integer repositoryId, java.lang.String userName)
          This method fetches the root content for a particular repository.
 ContentVO getRootContentVO(java.lang.Integer repositoryId, java.lang.String userName, boolean createIfNonExisting)
          This method fetches the root content for a particular repository.
 ContentVO getSmallContentVOWithId(java.lang.Integer contentId, org.exolab.castor.jdo.Database db)
           
 void moveContent(ContentVO contentVO, java.lang.Integer newParentContentId)
          This method moves a content from one parent-content to another.
 void moveContent(ContentVO contentVO, java.lang.Integer newParentContentId, org.exolab.castor.jdo.Database db)
          This method moves a content from one parent-content to another.
static void removeChildContent(ContentVO parentVO, ContentVO childVO)
           
 ContentVO update(ContentVO contentVO)
           
 ContentVO update(ContentVO contentVO, java.lang.Integer contentTypeDefinitionId)
           
 
Methods inherited from class org.infoglue.cms.controllers.kernel.impl.simple.BaseController
beginTransaction, beginTransaction, closeDatabase, commitTransaction, createEntity, createEntity, createQuery, deleteEntity, deleteEntity, deleteEntity, deleteEntity, executeQuery, executeQuery, executeQuery, executeQuery, getAllObjects, getAllVOObjects, getAllVOObjects, getAllVOObjects, getAllVOObjects, getObjectWithId, getObjectWithId, getObjectWithIdAsReadOnly, getVOWithId, getVOWithId, getVOWithId, getVOWithId, intercept, intercept, rollbackTransaction, toModifiableVOList, toVOList, updateEntity, updateEntity, updateEntity, updateEntity, validateEntity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentController

public ContentController()
Method Detail

getContentController

public static ContentController getContentController()
Factory method


getContentVOWithId

public ContentVO getContentVOWithId(java.lang.Integer contentId)
                             throws SystemException,
                                    Bug
Throws:
SystemException
Bug

getContentVOWithId

public ContentVO getContentVOWithId(java.lang.Integer contentId,
                                    org.exolab.castor.jdo.Database db)
                             throws SystemException,
                                    Bug
Throws:
SystemException
Bug

getSmallContentVOWithId

public ContentVO getSmallContentVOWithId(java.lang.Integer contentId,
                                         org.exolab.castor.jdo.Database db)
                                  throws SystemException,
                                         Bug
Throws:
SystemException
Bug

getContentWithId

public Content getContentWithId(java.lang.Integer contentId,
                                org.exolab.castor.jdo.Database db)
                         throws SystemException,
                                Bug
Throws:
SystemException
Bug

getReadOnlyContentWithId

public Content getReadOnlyContentWithId(java.lang.Integer contentId,
                                        org.exolab.castor.jdo.Database db)
                                 throws SystemException,
                                        Bug
Throws:
SystemException
Bug

getContentVOList

public java.util.List getContentVOList()
                                throws SystemException,
                                       Bug
Throws:
SystemException
Bug

create

public ContentVO create(CreateContentWizardInfoBean createContentWizardInfoBean)
                 throws ConstraintException,
                        SystemException
This method finishes what the create content wizard initiated and resulted in.

Throws:
ConstraintException
SystemException

create

public ContentVO create(java.lang.Integer parentContentId,
                        java.lang.Integer contentTypeDefinitionId,
                        java.lang.Integer repositoryId,
                        ContentVO contentVO)
                 throws ConstraintException,
                        SystemException
This method creates a new content-entity and references the entities it should know about. As castor is lousy at this in my opinion we also add the new entity to the surrounding entities.

Throws:
ConstraintException
SystemException

create

public Content create(org.exolab.castor.jdo.Database db,
                      java.lang.Integer parentContentId,
                      java.lang.Integer contentTypeDefinitionId,
                      java.lang.Integer repositoryId,
                      ContentVO contentVO)
               throws ConstraintException,
                      SystemException,
                      java.lang.Exception
This method creates a new content-entity and references the entities it should know about. As castor is lousy at this in my opinion we also add the new entity to the surrounding entities.

Throws:
ConstraintException
SystemException
java.lang.Exception

delete

public void delete(ContentVO contentVO,
                   InfoGluePrincipal infogluePrincipal)
            throws ConstraintException,
                   SystemException
This method deletes a content and also erases all the children and all versions.

Throws:
ConstraintException
SystemException

delete

public void delete(ContentVO contentVO,
                   InfoGluePrincipal infogluePrincipal,
                   org.exolab.castor.jdo.Database db)
            throws ConstraintException,
                   SystemException,
                   java.lang.Exception
This method deletes a content and also erases all the children and all versions.

Throws:
ConstraintException
SystemException
java.lang.Exception

delete

public void delete(ContentVO contentVO,
                   org.exolab.castor.jdo.Database db,
                   boolean skipRelationCheck,
                   boolean skipServiceBindings,
                   boolean forceDelete,
                   InfoGluePrincipal infogluePrincipal)
            throws ConstraintException,
                   SystemException,
                   java.lang.Exception
This method deletes a content and also erases all the children and all versions.

Throws:
ConstraintException
SystemException
java.lang.Exception

update

public ContentVO update(ContentVO contentVO)
                 throws ConstraintException,
                        SystemException
Throws:
ConstraintException
SystemException

update

public ContentVO update(ContentVO contentVO,
                        java.lang.Integer contentTypeDefinitionId)
                 throws ConstraintException,
                        SystemException
Throws:
ConstraintException
SystemException

getAvailableLanguagesForContentWithId

public java.util.List getAvailableLanguagesForContentWithId(java.lang.Integer contentId,
                                                            org.exolab.castor.jdo.Database db)
                                                     throws ConstraintException,
                                                            SystemException,
                                                            java.lang.Exception
Throws:
ConstraintException
SystemException
java.lang.Exception

getParentContent

public static ContentVO getParentContent(java.lang.Integer contentId)
                                  throws SystemException,
                                         Bug
This method returns the value-object of the parent of a specific content.

Throws:
SystemException
Bug

addChildContent

public static void addChildContent(ContentVO parentVO,
                                   ContentVO childVO)
                            throws ConstraintException,
                                   SystemException
Throws:
ConstraintException
SystemException

removeChildContent

public static void removeChildContent(ContentVO parentVO,
                                      ContentVO childVO)
                               throws ConstraintException,
                                      SystemException
Throws:
ConstraintException
SystemException

moveContent

public void moveContent(ContentVO contentVO,
                        java.lang.Integer newParentContentId)
                 throws ConstraintException,
                        SystemException
This method moves a content from one parent-content to another. First we check so no illegal actions are in process. For example the target folder must not be the item to be moved or a child to the item. Such actions would result in model-errors.

Throws:
ConstraintException
SystemException

moveContent

public void moveContent(ContentVO contentVO,
                        java.lang.Integer newParentContentId,
                        org.exolab.castor.jdo.Database db)
                 throws ConstraintException,
                        SystemException
This method moves a content from one parent-content to another. First we check so no illegal actions are in process. For example the target folder must not be the item to be moved or a child to the item. Such actions would result in model-errors.

Throws:
ConstraintException
SystemException

getContentVOWithContentTypeDefinition

public java.util.List getContentVOWithContentTypeDefinition(java.lang.String contentTypeDefinitionName)
                                                     throws SystemException
Returns all Contents having the specified ContentTypeDefintion.

Throws:
SystemException

getContentVOWithContentTypeDefinition

public java.util.List getContentVOWithContentTypeDefinition(java.lang.String contentTypeDefinitionName,
                                                            org.exolab.castor.jdo.Database db)
                                                     throws SystemException
Returns all Contents having the specified ContentTypeDefintion.

Throws:
SystemException

getContentVOList

public java.util.List getContentVOList(java.util.HashMap argumentHashMap)
                                throws SystemException,
                                       Bug
This method is sort of a sql-query-like method where you can send in arguments in form of a list of things that should match. The input is a Hashmap with a method and a List of HashMaps.

Throws:
SystemException
Bug

getContentVOList

public java.util.List getContentVOList(java.util.HashMap argumentHashMap,
                                       org.exolab.castor.jdo.Database db)
                                throws SystemException,
                                       java.lang.Exception
This method is sort of a sql-query-like method where you can send in arguments in form of a list of things that should match. The input is a Hashmap with a method and a List of HashMaps.

Throws:
SystemException
java.lang.Exception

getContentVOListByContentTypeNames

protected java.util.List getContentVOListByContentTypeNames(java.util.List arguments)
                                                     throws SystemException,
                                                            Bug
The input is a list of hashmaps.

Throws:
SystemException
Bug

getContentVOListByContentTypeNames

protected java.util.List getContentVOListByContentTypeNames(java.util.List arguments,
                                                            org.exolab.castor.jdo.Database db)
                                                     throws SystemException,
                                                            java.lang.Exception
The input is a list of hashmaps.

Throws:
SystemException
java.lang.Exception

getRootContentVO

public ContentVO getRootContentVO(java.lang.Integer repositoryId,
                                  java.lang.String userName)
                           throws ConstraintException,
                                  SystemException
This method fetches the root content for a particular repository. If there is no such content we create one as all repositories need one to work.

Throws:
ConstraintException
SystemException

getRootContentVO

public ContentVO getRootContentVO(java.lang.Integer repositoryId,
                                  java.lang.String userName,
                                  boolean createIfNonExisting)
                           throws ConstraintException,
                                  SystemException
This method fetches the root content for a particular repository. If there is no such content we create one as all repositories need one to work.

Throws:
ConstraintException
SystemException

getRootContent

public Content getRootContent(org.exolab.castor.jdo.Database db,
                              java.lang.Integer repositoryId,
                              java.lang.String userName,
                              boolean createIfNonExisting)
                       throws ConstraintException,
                              SystemException,
                              java.lang.Exception
This method fetches the root content for a particular repository within a transaction. If there is no such content we create one as all repositories need one to work.

Throws:
ConstraintException
SystemException
java.lang.Exception

getRootContent

public Content getRootContent(java.lang.Integer repositoryId,
                              org.exolab.castor.jdo.Database db)
                       throws ConstraintException,
                              SystemException,
                              java.lang.Exception
This method fetches the root content for a particular repository. If there is no such content we create one as all repositories need one to work.

Throws:
ConstraintException
SystemException
java.lang.Exception

getContentChildrenVOList

public java.util.List getContentChildrenVOList(java.lang.Integer parentContentId)
                                        throws ConstraintException,
                                               SystemException
This method returns a list of the children a content has.

Throws:
ConstraintException
SystemException

getContentTypeDefinition

public ContentTypeDefinitionVO getContentTypeDefinition(java.lang.Integer contentId)
                                                 throws ConstraintException,
                                                        SystemException
This method returns the contentTypeDefinitionVO which is associated with this content.

Throws:
ConstraintException
SystemException

getRepositoryLanguages

public java.util.List getRepositoryLanguages(java.lang.Integer contentId)
                                      throws ConstraintException,
                                             SystemException
This method reurns a list of available languages for this content.

Throws:
ConstraintException
SystemException

getBoundContents

public static java.util.List getBoundContents(java.lang.Integer serviceBindingId)
                                       throws SystemException,
                                              java.lang.Exception
This method returns the bound contents based on a servicebinding.

Throws:
SystemException
java.lang.Exception

getBoundContents

public static java.util.List getBoundContents(org.exolab.castor.jdo.Database db,
                                              java.lang.Integer serviceBindingId)
                                       throws SystemException,
                                              java.lang.Exception
This method returns the bound contents based on a servicebinding.

Throws:
SystemException
java.lang.Exception

getInTransactionBoundContents

public static java.util.List getInTransactionBoundContents(org.exolab.castor.jdo.Database db,
                                                           java.lang.Integer serviceBindingId)
                                                    throws SystemException,
                                                           java.lang.Exception
Throws:
SystemException
java.lang.Exception

getRepositoryContents

public java.util.List getRepositoryContents(java.lang.Integer repositoryId,
                                            org.exolab.castor.jdo.Database db)
                                     throws SystemException,
                                            java.lang.Exception
This method returns the contents belonging to a certain repository.

Throws:
SystemException
java.lang.Exception

getContentVOWithPath

public ContentVO getContentVOWithPath(java.lang.Integer repositoryId,
                                      java.lang.String path,
                                      boolean forceFolders,
                                      InfoGluePrincipal creator,
                                      org.exolab.castor.jdo.Database db)
                               throws SystemException,
                                      java.lang.Exception
Returns the content belonging to the specified repository and with the specified path. Note! If a folder contains more than one child with a requested name, then one of the children will be used (non-deterministic). Example: If we have the following repository (id=100): then: getContentVOWithPath(100, "", true, db) => returns content "1" getContentVOWithPath(100, "news", true, db) => returns content "2" getContentVOWithPath(100, "news/imported", true, db) => returns content "3" getContentVOWithPath(100, "news/other", true, db) => will create a new content with the name "other" with content "2" as parent getContentVOWithPath(100, "news/other", false, db) => will throw an exception

Parameters:
repositoryId - the repository identifier
path - the path of the content starting from the root of the repository
forceFolders - if true then non-existing folders will be created; otherwise an exception will be thrown
db - the database to use
Throws:
SystemException
java.lang.Exception

getContentVOWithParentRecursive

public java.util.List getContentVOWithParentRecursive(java.lang.Integer contentId)
                                               throws ConstraintException,
                                                      SystemException
Recursive methods to get all contentVersions of a given state under the specified parent content.

Throws:
ConstraintException
SystemException

getContentAttribute

public java.lang.String getContentAttribute(java.lang.Integer contentId,
                                            java.lang.Integer languageId,
                                            java.lang.String attributeName)
                                     throws java.lang.Exception
Throws:
java.lang.Exception

getNewVO

public BaseEntityVO getNewVO()
This is a method that gives the user back an newly initialized ValueObject for this entity that the controller is handling.

Specified by:
getNewVO in class BaseController


Copyright © 2005 InfoGlue.org All Rights Reserved.