Clearspace API (1.7.0) Core Javadocs

com.jivesoftware.community
Interface DocumentFieldAttributes


public interface DocumentFieldAttributes

Document field attributes consist of properties which control how the field is used throughout the system. For example, the searchable attribute defines whether the document field will be added to the search index.


Method Summary
 boolean isAlterable()
          Returns true if the associated document field is an alterable document field or not.
 boolean isFilterable()
          Returns the filterability of the associated document field.
 boolean isRequired()
          Returns true if the associated document field is required.
 boolean isSearchable()
          Returns whether the associated document field is searchable or not.
 boolean isVisible()
          Returns the visibility of the associated document field.
 void setAlterable(boolean alterable)
          Sets whether the associated document field is alterable or not.
 void setFilterable(boolean filterable)
          Sets the filterability of the associated document field.
 void setRequired(boolean required)
          Sets whether the associated document field is required or not.
 void setSearchable(boolean searchable)
          Sets whether the associated document field can be searched.
 void setVisible(boolean visible)
          Sets the visibility of the associated document field.
 

Method Detail

isAlterable

boolean isAlterable()
Returns true if the associated document field is an alterable document field or not. A alterable document field is one which authors may change as part of the document creation process, an unalterable document field cannot be changed but rather is just used for information purposes. The default value is true.

Returns:
true if the associated document field is alterable, false otherwise (Default is true).

setAlterable

void setAlterable(boolean alterable)
                  throws UnauthorizedException
Sets whether the associated document field is alterable or not.

As part of the contract of this method any field that has the alterable attribute set to true must also have a default getValue defined. If this condition is not met this method will throw an IllegalStateException.

Parameters:
alterable - true is the field is to be alterable, false otherwise.
Throws:
UnauthorizedException - if not an administrator.

isSearchable

boolean isSearchable()
Returns whether the associated document field is searchable or not. The default getValue is true.

Searchability does not override moderation or permissions - a user will only be able to see the document in search results (even if it has a document field marked as searchable) only if the document is moderated appropriately and the user has the proper permissions to view the document.

Returns:
true if the associated document field is searchable (Default is true).

setSearchable

void setSearchable(boolean searchable)
                   throws UnauthorizedException
Sets whether the associated document field can be searched. If not specified, document fields will be searchable.

Searchability does not override moderation or permissions - a user will only be able to see the document in search results (even if it has a document field marked as searchable) only if the document is moderated appropriately and the user has the proper permissions to view the document.

Parameters:
searchable - true if the associated document field should be marked as searchable, false otherwise.
Throws:
UnauthorizedException - if not an administrator.

isRequired

boolean isRequired()
Returns true if the associated document field is required. A required document field is one which must be provided before the document's state can be changed out of the DocumentState.INCOMPLETE state. This means that documents can be created and saved in a draft state and later on completed and submitted. The default getValue is false.

Returns:
true if the associated document field is required, false otherwise (Default is false).

setRequired

void setRequired(boolean required)
                 throws UnauthorizedException
Sets whether the associated document field is required or not.

Parameters:
required - true if the associated document field is required, false otherwise
Throws:
UnauthorizedException - if not an administrator.

isVisible

boolean isVisible()
Returns the visibility of the associated document field. Document fields are visible by default however if a document field is marked as not visible it should not be displayed as part of any presentation template nor be visible in any way to anyone not able to modify the document.

Document field visibility is primarily aimed at solving the problem where you want document authors to provide information as part of the document creation process (say "Internal issue #") but do not want that information displayed to the public.

Returns:
the visibility of the associated document field (Default is visible).

setVisible

void setVisible(boolean visible)
                throws UnauthorizedException
Sets the visibility of the associated document field.

Document field visibility is primarily aimed at solving the problem where you want document authors to provide information as part of the document creation process (say "Internal issue #") but do not want that information displayed to the public.

Parameters:
visible - true if the associated document field should be visible, false otherwise.
Throws:
UnauthorizedException - if not an administrator.

isFilterable

boolean isFilterable()
Returns the filterability of the associated document field. A document field which is filterable will be displayed to end users in any place where filtering on a document field makes sense such as during guided searches.

Note that document fields of the DocumentFieldType.DataType.LIST_MULTI are explicitly disallowed from being filterable.

Returns:
the filterability of the associated document field (Default is false).

setFilterable

void setFilterable(boolean filterable)
                   throws UnauthorizedException
Sets the filterability of the associated document field. A document field which is filterable will be displayed to end users in any place where filtering on a document field makes sense such as during guided searches.

Note that document fields of the DocumentFieldType.DataType.LIST_MULTI are explicitly disallowed from being filterable. Attempting to set such a document field to filterable will do nothing.

Parameters:
filterable - true if the document field should be filterable, false otherwise.
Throws:
UnauthorizedException - if not an administrator.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.