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

java.lang.Object
  extended by org.infoglue.cms.controllers.kernel.impl.simple.BaseController
      extended by org.infoglue.cms.controllers.kernel.impl.simple.ContentCategoryController

public class ContentCategoryController
extends BaseController

The ContentCategoryController manages all actions related to persistence and querying for ContentCategory relationships. TODO: When we convert have Hibernate manage all of these relationships, it will pull it TODO: all back with one query and be a helluva lot faster than this basic implementation

Author:
Frank Febbraro (frank@phase2technology.com)

Method Summary
 java.util.List create(java.util.List categoryList, ContentVersion contentVersion, java.lang.String attributeName, org.exolab.castor.jdo.Database db)
          Creates a number of ContentCategories from a list of categories and a contentVersion.
 java.util.List create(java.util.List categoryVOList, ContentVersionVO contentVersionVO, java.lang.String attributeName)
          Creates a number of ContentCategories from a list of categories and a contentVersion.
 ContentCategory createWithDatabase(ContentCategoryVO c, Category category, ContentVersion contentVersion, org.exolab.castor.jdo.Database db)
           
 ContentCategory createWithDatabase(ContentCategoryVO c, org.exolab.castor.jdo.Database db)
           
 void delete(java.lang.Integer id)
          Deletes a ContentCategory
 void deleteByCategory(java.lang.Integer categoryId)
          Deletes all ContentCategories for a particular Category
 void deleteByCategory(java.lang.Integer categoryId, org.exolab.castor.jdo.Database db)
          Deletes all ContentCategories for a particular Category using the provided Database
 void deleteByContentVersion(ContentVersion contentVersion, org.exolab.castor.jdo.Database db)
          Deletes all ContentCategories for a particular ContentVersion
 void deleteByContentVersion(java.lang.Integer versionId)
          Deletes all ContentCategories for a particular ContentVersion
 void deleteByContentVersion(java.lang.Integer versionId, org.exolab.castor.jdo.Database db)
          Deletes all ContentCategories for a particular ContentVersion using the provided Database
 void deleteByContentVersionAttribute(java.lang.String attribute, java.lang.Integer versionId)
          Deletes all content categories with a specific attribute for a specific content version within a single transaction
 void deleteByContentVersionAttribute(java.lang.String attribute, java.lang.Integer versionId, org.exolab.castor.jdo.Database db)
          Deletes all content categories with a specific attribute for a specific content version using the given database
 java.util.List findByCategory(java.lang.Integer categoryId)
          Find a List of ContentCategories for the specific attribute and Content Version.
 java.util.List findByContentVersion(java.lang.Integer versionId)
          Find a List of ContentCategories for a Content Version.
 java.util.List findByContentVersion(java.lang.Integer versionId, org.exolab.castor.jdo.Database db)
          Find a List of ContentCategories for a Content Version.
 java.util.List findByContentVersionAttribute(java.lang.String attribute, java.lang.Integer versionId)
          Find a List of ContentCategories for the specific attribute and Content Version.
 java.util.List findByContentVersionAttribute(java.lang.String attribute, java.lang.Integer versionId, org.exolab.castor.jdo.Database db, boolean readOnly)
          Find a List of ContentCategories for the specific attribute and Content Version.
 ContentCategoryVO findById(java.lang.Integer id)
          Find a ContentCategory by it's identifier.
static ContentCategoryController getController()
           
 BaseEntityVO getNewVO()
          Implemented for BaseController
 ContentCategoryVO save(ContentCategoryVO c)
          Saves a ContentCategoryVO whether it is new or not.
 
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, getLogger, 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
 

Method Detail

getController

public static ContentCategoryController getController()

findById

public ContentCategoryVO findById(java.lang.Integer id)
                           throws SystemException
Find a ContentCategory by it's identifier.

Parameters:
id - The id of the Category to find
Returns:
The CategoryVO identified by the provided id
Throws:
SystemException - If an error happens

findByContentVersionAttribute

public java.util.List findByContentVersionAttribute(java.lang.String attribute,
                                                    java.lang.Integer versionId)
                                             throws SystemException
Find a List of ContentCategories for the specific attribute and Content Version.

Parameters:
attribute - The attribute name of the ContentCategory to find
versionId - The Content Version id of the ContentCategory to find
Returns:
A list of ContentCategoryVO that have the provided content version and attribute
Throws:
SystemException - If an error happens

findByContentVersionAttribute

public java.util.List findByContentVersionAttribute(java.lang.String attribute,
                                                    java.lang.Integer versionId,
                                                    org.exolab.castor.jdo.Database db,
                                                    boolean readOnly)
                                             throws SystemException
Find a List of ContentCategories for the specific attribute and Content Version.

Parameters:
attribute - The attribute name of the ContentCategory to find
versionId - The Content Version id of the ContentCategory to find
Returns:
A list of ContentCategoryVO that have the provided content version and attribute
Throws:
SystemException - If an error happens

findByContentVersion

public java.util.List findByContentVersion(java.lang.Integer versionId)
                                    throws SystemException
Find a List of ContentCategories for a Content Version.

Parameters:
versionId - The Content Version id of the ContentCategory to find
Returns:
A list of ContentCategoryVO that have the provided content version and attribute
Throws:
SystemException - If an error happens

findByContentVersion

public java.util.List findByContentVersion(java.lang.Integer versionId,
                                           org.exolab.castor.jdo.Database db)
                                    throws SystemException
Find a List of ContentCategories for a Content Version.

Parameters:
versionId - The Content Version id of the ContentCategory to find
Returns:
A list of ContentCategoryVO that have the provided content version and attribute
Throws:
SystemException - If an error happens

findByCategory

public java.util.List findByCategory(java.lang.Integer categoryId)
                              throws SystemException
Find a List of ContentCategories for the specific attribute and Content Version.

Parameters:
categoryId - The Category id of the ContentCategory to find
Returns:
A list of ContentCategoryVO that have the provided category id
Throws:
SystemException - If an error happens

save

public ContentCategoryVO save(ContentCategoryVO c)
                       throws SystemException
Saves a ContentCategoryVO whether it is new or not.

Parameters:
c - The ContentCategoryVO to save
Returns:
The saved ContentCategoryVO
Throws:
SystemException - If an error happens

createWithDatabase

public ContentCategory createWithDatabase(ContentCategoryVO c,
                                          org.exolab.castor.jdo.Database db)
                                   throws SystemException,
                                          org.exolab.castor.jdo.PersistenceException
Throws:
SystemException
org.exolab.castor.jdo.PersistenceException

create

public java.util.List create(java.util.List categoryVOList,
                             ContentVersionVO contentVersionVO,
                             java.lang.String attributeName)
                      throws SystemException
Creates a number of ContentCategories from a list of categories and a contentVersion.

Throws:
SystemException

create

public java.util.List create(java.util.List categoryList,
                             ContentVersion contentVersion,
                             java.lang.String attributeName,
                             org.exolab.castor.jdo.Database db)
                      throws SystemException,
                             java.lang.Exception
Creates a number of ContentCategories from a list of categories and a contentVersion.

Throws:
SystemException
java.lang.Exception

createWithDatabase

public ContentCategory createWithDatabase(ContentCategoryVO c,
                                          Category category,
                                          ContentVersion contentVersion,
                                          org.exolab.castor.jdo.Database db)
                                   throws SystemException,
                                          org.exolab.castor.jdo.PersistenceException
Throws:
SystemException
org.exolab.castor.jdo.PersistenceException

delete

public void delete(java.lang.Integer id)
            throws SystemException
Deletes a ContentCategory

Parameters:
id - The id of the ContentCategory to delete
Throws:
SystemException - If an error happens

deleteByContentVersion

public void deleteByContentVersion(java.lang.Integer versionId)
                            throws SystemException
Deletes all ContentCategories for a particular ContentVersion

Parameters:
versionId - The id of the ContentCategory to delete
Throws:
SystemException - If an error happens

deleteByContentVersion

public void deleteByContentVersion(ContentVersion contentVersion,
                                   org.exolab.castor.jdo.Database db)
                            throws SystemException,
                                   java.lang.Exception
Deletes all ContentCategories for a particular ContentVersion

Parameters:
versionId - The id of the ContentCategory to delete
Throws:
SystemException - If an error happens
java.lang.Exception

deleteByContentVersion

public void deleteByContentVersion(java.lang.Integer versionId,
                                   org.exolab.castor.jdo.Database db)
                            throws SystemException
Deletes all ContentCategories for a particular ContentVersion using the provided Database

Parameters:
versionId - The id of the ContentCategory to delete
db - The Database instance to use
Throws:
SystemException - If an error happens

deleteByCategory

public void deleteByCategory(java.lang.Integer categoryId)
                      throws SystemException
Deletes all ContentCategories for a particular Category

Parameters:
categoryId - The id of the ContentCategory to delete
Throws:
SystemException - If an error happens

deleteByCategory

public void deleteByCategory(java.lang.Integer categoryId,
                             org.exolab.castor.jdo.Database db)
                      throws SystemException
Deletes all ContentCategories for a particular Category using the provided Database

Parameters:
categoryId - The id of the Category to delete
db - The Database instance to use
Throws:
SystemException - If an error happens

deleteByContentVersionAttribute

public void deleteByContentVersionAttribute(java.lang.String attribute,
                                            java.lang.Integer versionId)
                                     throws SystemException
Deletes all content categories with a specific attribute for a specific content version within a single transaction

Parameters:
attribute - the desired attribute
versionId - the ID of the desired content version
Throws:
SystemException - if a database error occurs

deleteByContentVersionAttribute

public void deleteByContentVersionAttribute(java.lang.String attribute,
                                            java.lang.Integer versionId,
                                            org.exolab.castor.jdo.Database db)
                                     throws SystemException
Deletes all content categories with a specific attribute for a specific content version using the given database

Parameters:
attribute - the desired attribute
versionId - the ID of the desired content version
db - the database defining the transaction context for this delete
Throws:
SystemException - if a database error occurs

getNewVO

public BaseEntityVO getNewVO()
Implemented for BaseController

Specified by:
getNewVO in class BaseController


Copyright © 2005 InfoGlue.org All Rights Reserved.