org.liquidsite.core.content
Class ContentDocument

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

public class ContentDocument
extends Content

A content document.


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 ContentDocument(ContentManager manager, ContentData data, DataSource src)
          Creates a new document.
  ContentDocument(ContentManager manager, ContentSection parent)
          Creates a new document with default values.
 
Method Summary
protected  void doValidate()
          Validates the object data before writing to the database.
 java.lang.String getProperty(java.lang.String id)
          Returns an identified document property value.
 java.util.Collection getPropertyIdentifiers()
          Returns all property identfiers in this document.
 int getPropertyType(java.lang.String id)
          Returns an identified document property type.
 void setProperty(java.lang.String id, java.lang.String value)
          Sets a document property value.
 void setPropertyType(java.lang.String id, int type)
          Sets a document property type.
 
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, 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

ContentDocument

public ContentDocument(ContentManager manager,
                       ContentSection parent)
                throws ContentException
Creates a new document 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

ContentDocument

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

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

getPropertyIdentifiers

public java.util.Collection getPropertyIdentifiers()
Returns all property identfiers in this document. Note that this set may differ from what the section specifies, normally due to some properties not being defined in the document. If a document has been moved, however, additional properties may be present.

Returns:
a collection of property identifiers

getProperty

public java.lang.String getProperty(java.lang.String id)
Returns an identified document property value.

Parameters:
id - the document property identifier
Returns:
the document property value, or an empty string if not found

setProperty

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

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

getPropertyType

public int getPropertyType(java.lang.String id)
Returns an identified document property type.

Parameters:
id - the document property identifier
Returns:
the document property type, or STRING_TYPE if not set
See Also:
DocumentProperty.STRING_TYPE, DocumentProperty.TAGGED_TYPE, DocumentProperty.HTML_TYPE

setPropertyType

public void setPropertyType(java.lang.String id,
                            int type)
Sets a document property type.

Parameters:
id - the document property identifier
type - the document property type

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