Clearspace API (2.5.29) Core Javadocs

com.jivesoftware.community
Interface DocumentField

All Superinterfaces:
DocumentTypeElement, JiveObject
All Known Subinterfaces:
MultiOptionDocumentField

public interface DocumentField
extends JiveObject, DocumentTypeElement

The DocumentType interface allows for an arbitrary number of document fields to be created for each document type. There are 7 basic types of document fields which correspond to the field types defined in HTML and the Data Form JEP (http://www.jabber.org/jeps/jep-0004.html#protocol-fieldtypes).


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.jivesoftware.community.DocumentTypeElement
DocumentTypeElement.Type
 
Method Summary
 DocumentFieldAttributes getAttributes()
          Retrieve the document attributes for the document field.
 String getDefaultValue()
          Returns a value that should be used as a default for text based (non select,radio,etc) fields during document creation.
 String getDescription()
          Returns the description of the document field.
 String getDisplayName()
          Returns the display name for this field.
 DocumentFieldType getFieldType()
          Returns the DocumentFieldType associated with this DocumentField.
 int getMaxFieldSize()
          Returns the maximum data size for the field.
 String getName()
          Returns the unique name of the document field.
 void save()
          Persists changes of this object to the database.
 void setDefaultValue(String defaultValue)
          Sets the default value for the document field.
 void setDescription(String description)
          Sets the description of the document field.
 void setDisplayName(String name)
          Sets the display name for this field.
 void setFieldType(DocumentFieldType documentFieldType)
          Associates a DocumentFieldType with this DocumentField.
 void setMaxFieldSize(int maxFieldSize)
          sets the maximum data size for the field.
 void setName(String name)
          Sets the unique name of the document field.
 
Methods inherited from interface com.jivesoftware.community.DocumentTypeElement
getType
 

Method Detail

getName

String getName()
Returns the unique name of the document field.

Returns:
the unique name of the document field.

setName

void setName(String name)
             throws UnauthorizedException
Sets the unique name of the document field.

Parameters:
name - the unique name of the document field.
Throws:
UnauthorizedException - if not an administrator.

getDisplayName

String getDisplayName()
Returns the display name for this field. This is more user friendly than the name.

Returns:
the display name for this field.

setDisplayName

void setDisplayName(String name)
                    throws UnauthorizedException
Sets the display name for this field.

Parameters:
name - the display name to set.
Throws:
UnauthorizedException - if not an admistrator.

getDescription

String getDescription()
Returns the description of the document field. If no description is provided null will be returned.

Returns:
the description of the document field.

setDescription

void setDescription(String description)
                    throws UnauthorizedException
Sets the description of the document field.

Parameters:
description - the description of the document field.
Throws:
UnauthorizedException - if not an administrator.

getDefaultValue

String getDefaultValue()
Returns a value that should be used as a default for text based (non select,radio,etc) fields during document creation.

This method is not supported for multi option fields and will throw an UnsupportedOperationException if called on such a instance.

Returns:
the default getValue for the document field.

setDefaultValue

void setDefaultValue(String defaultValue)
                     throws UnauthorizedException
Sets the default value for the document field. The value is used as the default value in document creation for text based (non select,radio,etc) fields during document creation.

A default getValue should *always* be provided if the document field is not alterable.

Parameters:
defaultValue - the default getValue for the document field
Throws:
UnauthorizedException - if not an administrator.

getFieldType

DocumentFieldType getFieldType()
Returns the DocumentFieldType associated with this DocumentField.

Returns:
the DocumentFieldType associated with this DocumentField.

setFieldType

void setFieldType(DocumentFieldType documentFieldType)
                  throws UnauthorizedException
Associates a DocumentFieldType with this DocumentField.

Parameters:
documentFieldType - DocumentFieldType to set for this DocumentField.
Throws:
UnauthorizedException - if not an administrator

getMaxFieldSize

int getMaxFieldSize()
Returns the maximum data size for the field.

Returns:
the maximum data size for the field.

setMaxFieldSize

void setMaxFieldSize(int maxFieldSize)
                     throws UnauthorizedException
sets the maximum data size for the field. This getValue is used as part of the persistence mechanism to limit the size of the data fields. Some databases limit the amount of data that any single row of a table can contain (for example, sql server 7 & 2000 limit the data size to 8060 bytes). Use this method to reduce the size each field takes up to reduce or eliminate the possibility of running into a db limit.

Note that reducing this getValue from a previous setting with existing data *may* result in data truncation or an error depending on the database. It is recommended to set this getValue when the field is first created and never decrease it afterwards unless the field has never been used.

Parameters:
maxFieldSize - the maximum data size for the field.
Throws:
UnauthorizedException - if not an administrator.

getAttributes

DocumentFieldAttributes getAttributes()
Retrieve the document attributes for the document field. Attributes include document visibility, whether the field is searchable, etc.

Returns:
a DocumentFieldAttributes object.
See Also:
DocumentFieldAttributes

save

void save()
          throws UnauthorizedException
Persists changes of this object to the database.

Throws:
UnauthorizedException - If the user is not allowed to modify this object.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.