Clearspace API (2.5.29) Core Javadocs

com.jivesoftware.community
Interface MultiOptionDocumentField

All Superinterfaces:
DocumentField, DocumentTypeElement, JiveObject

public interface MultiOptionDocumentField
extends DocumentField

An extension of the document field interface to support multi optioned field types such as radio and selection lists.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.jivesoftware.community.DocumentTypeElement
DocumentTypeElement.Type
 
Method Summary
 DocumentFieldOption addOption(String option)
          Adds an option to this document field.
 void deleteOption(DocumentFieldOption option)
          Deletes an option.
 DocumentFieldOption getOption(long optionID)
          Returns a DocumentFieldOption by its id.
 List<DocumentFieldOption> getOptions()
          Returns an iterator of DocumentFieldOption objects.
 void setOptionIndex(int index, DocumentFieldOption option)
          Sets a particular option at the given index.
 
Methods inherited from interface com.jivesoftware.community.DocumentField
getAttributes, getDefaultValue, getDescription, getDisplayName, getFieldType, getMaxFieldSize, getName, save, setDefaultValue, setDescription, setDisplayName, setFieldType, setMaxFieldSize, setName
 
Methods inherited from interface com.jivesoftware.community.DocumentTypeElement
getType
 

Method Detail

getOptions

List<DocumentFieldOption> getOptions()
Returns an iterator of DocumentFieldOption objects.

Returns:
an iterator of DocumentFieldOption objects.

setOptionIndex

void setOptionIndex(int index,
                    DocumentFieldOption option)
                    throws UnauthorizedException
Sets a particular option at the given index. If the option exists it will be moved, if the option does not exist it will be created.

Parameters:
index - the index of the option to change.
option - the new option to set at the specified index.
Throws:
UnauthorizedException - if not an administrator.
IndexOutOfBoundsException - if the index is out of bounds.

addOption

DocumentFieldOption addOption(String option)
                              throws UnauthorizedException
Adds an option to this document field. The newly created option object will be returned. The option object will have a valid id that is greater than zero.

The returned option object can be used for things such as setting this option to be a default option.

Parameters:
option - the option to add.
Returns:
Option object created.
Throws:
UnauthorizedException - if not an administrator.
IllegalArgumentException - If null is passed in.

deleteOption

void deleteOption(DocumentFieldOption option)
                  throws UnauthorizedException
Deletes an option.

Parameters:
option - the option to delete
Throws:
UnauthorizedException - if not an administrator.
IllegalArgumentException - if the option doesn't exist in the document field.

getOption

DocumentFieldOption getOption(long optionID)
                              throws DocumentObjectNotFoundException
Returns a DocumentFieldOption by its id.

Parameters:
optionID - id of the DocumentFieldOption
Returns:
DocumentFieldOption matching the id
Throws:
DocumentObjectNotFoundException - thrown if the option does not exist
IllegalArgumentException - thrown if the option does not belong to this DocumentField

Clearspace Project Page

Copyright © 1999-2007 Jive Software.