org.liquidsite.core.content
Class ContentSection

java.lang.Object
  extended byorg.liquidsite.core.content.PersistentObject
      extended byorg.liquidsite.core.content.Content
          extended byorg.liquidsite.core.content.ContentSection

public class ContentSection
extends Content

A content section.


Field Summary
 
Fields inherited from class org.liquidsite.core.content.Content
DOCUMENT_CATEGORY, FILE_CATEGORY, FOLDER_CATEGORY, FORUM_CATEGORY, NAME_CHARS, PAGE_CATEGORY, POST_CATEGORY, SECTION_CATEGORY, SITE_CATEGORY, TEMPLATE_CATEGORY, TOPIC_CATEGORY, TRANSLATOR_CATEGORY
 
Fields inherited from class org.liquidsite.core.content.PersistentObject
BINDERS, LOWER_CASE, NUMBERS, UPPER_CASE
 
Constructor Summary
protected ContentSection(ContentManager manager, ContentData data, DataSource src)
          Creates a new section.
  ContentSection(ContentManager manager, ContentSection parent)
          Creates a new section with default values.
  ContentSection(ContentManager manager, Domain domain)
          Creates a new root section with default values.
 
Method Summary
protected  void doValidate()
          Validates the object data before writing to the database.
 DocumentProperty[] getAllDocumentProperties()
          Returns all document properties for this section.
 java.lang.String getDescription()
          Returns the section description.
 DocumentProperty getDocumentProperty(java.lang.String id)
          Returns an identified document property.
 void setDescription(java.lang.String description)
          Sets the section description.
 void setDocumentProperty(java.lang.String id, DocumentProperty property)
          Sets a document property.
 
Methods inherited from class org.liquidsite.core.content.Content
deleteRevision, doDelete, doInsert, doUpdate, equals, equals, getAllRevisions, getAttribute, getAttributeNames, getAuthor, getAuthorName, getCategory, getComment, getDomain, getDomainName, getId, getLock, getMaxRevisionNumber, getModifiedDate, getName, getOfflineDate, getOnlineDate, getParent, getParent, getParentId, getPermissions, getRevision, getRevisionNumber, isLatestRevision, isOnline, isPublishedRevision, setAttribute, setAuthorName, setComment, setId, setModifiedDate, setName, setOfflineDate, setOnlineDate, setParent, setParentId, setRevisionNumber, toString
 
Methods inherited from class org.liquidsite.core.content.PersistentObject
decodeMap, delete, delete, encodeMap, getContentManager, hasAdminAccess, hasPublishAccess, hasReadAccess, hasWriteAccess, isPersistent, restore, restore, save, save, validateChars, validateSize
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContentSection

public ContentSection(ContentManager manager,
                      Domain domain)
Creates a new root section with default values.

Parameters:
manager - the content manager to use
domain - the domain

ContentSection

public ContentSection(ContentManager manager,
                      ContentSection parent)
               throws ContentException
Creates a new section with default values.

Parameters:
manager - the content manager to use
parent - the parent content section
Throws:
ContentException - if the database couldn't be accessed properly

ContentSection

protected ContentSection(ContentManager manager,
                         ContentData data,
                         DataSource src)
                  throws ContentException
Creates a new section.

Parameters:
manager - the content manager to use
data - the content data object
src - the data source to use
Throws:
ContentException - if the database couldn't be accessed properly
Method Detail

getDescription

public java.lang.String getDescription()
Returns the section description.

Returns:
the section description, or an empty string if not set

setDescription

public void setDescription(java.lang.String description)
Sets the section description.

Parameters:
description - the new section description

getAllDocumentProperties

public DocumentProperty[] getAllDocumentProperties()
Returns all document properties for this section. The document properties define the available properties for any document created in this section. If this array does contain any properties at all, the parent section properties should be used. The document properties array is ordered by increasing positions.

Returns:
an array of all document properties for this section

getDocumentProperty

public DocumentProperty getDocumentProperty(java.lang.String id)
Returns an identified document property. The document properties define the available properties for any document created in this section. Note that a given document does not have to specify any of the properties specified in it's parent section, as documents can be moved between sections.

Parameters:
id - the document property identifier
Returns:
the document property, or null if not found

setDocumentProperty

public void setDocumentProperty(java.lang.String id,
                                DocumentProperty property)
Sets a document property. If the document property specified is null, the specified document property will be removed.

Parameters:
id - the document property identifier
property - the document property, or null

doValidate

protected void doValidate()
                   throws ContentException
Validates the object data before writing to the database.

Overrides:
doValidate in class Content
Throws:
ContentException - if the object data wasn't valid