Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.4.4 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jivesoftware.openfire.forms
Interface DataForm

    public interface DataForm

Represents a form that could be use for gathering data as well as for reporting data returned from a search.

The form could be of the following types:

- form -> Indicates a form to fill out.
- submit -> The form is filled out, and this is the data that is being returned from the form.
- cancel -> The form was cancelled. Tell the asker that piece of information.
- result -> Data results being returned from a search, or some other query.

In case the form represents a search, the report will be structured in columns and rows. Use `addReportedField(FormField)` to set the columns of the report whilst the report's rows can be configured using `addItemFields(ArrayList)`.

Author:
  gdombiak

Field Summary
`static String` | `TYPE_CANCEL`
`static String` | `TYPE_FORM`
`static String` | `TYPE_RESULT`
`static String` | `TYPE_SUBMIT`

Method Summary
`void` | `addField(FormField field)` Adds a new field as part of the form.
`void` | `addInstruction(String instruction)` Adds a new instruction to the list of instructions that explain how to fill out the form and what the form is about.
`void` | `addItemFields(ArrayList itemFields)` Adds a new row of items of reported data.
`void` | `addReportedField(FormField field)` Adds a field to the list of fields that will be returned from a search.
`FormField` | `getField(String variable)` Returns the field of the form whose variable matches the specified variable.
`Iterator` | `getFields()` Returns an Iterator for the fields that are part of the form.
`int` | `getFieldsSize()` Returns the number of fields included in the form.
`Iterator` | `getInstructions()` Returns an Iterator for the list of instructions that explain how to fill out the form and what the form is about.
`String` | `getTitle()` Returns the description of the data.
`String` | `getType()` Returns the meaning of the data within the context.
`void` | `setInstructions(List instructions)` Sets the list of instructions that explain how to fill out the form and what the form is about.
`void` | `setTitle(String title)` Sets the description of the data.

Field Detail

### TYPE_FORM

    static final String TYPE_FORM

See Also:
  Constant Field Values

### TYPE_SUBMIT

    static final String TYPE_SUBMIT

See Also:
  Constant Field Values

### TYPE_CANCEL

    static final String TYPE_CANCEL

See Also:
  Constant Field Values

### TYPE_RESULT

    static final String TYPE_RESULT

See Also:
  Constant Field Values

Method Detail

### setTitle

    void setTitle(String title)

  Sets the description of the data. It is similar to the title on a web page or an X window. You can put a on either a form to fill out, or a set of data results.

  Parameters:
    `title` - description of the data.

### setInstructions

    void setInstructions(List instructions)

  Sets the list of instructions that explain how to fill out the form and what the form is about. The dataform could include multiple instructions since each instruction could not contain newlines characters.

  Parameters:
    `instructions` - list of instructions that explain how to fill out the form.

### getType

    String getType()

  Returns the meaning of the data within the context. The data could be part of a form to fill out, a form submission or data results.

  Possible form types are:
  - form -> This packet contains a form to fill out. Display it to the user (if your program can).
  - submit -> The form is filled out, and this is the data that is being returned from the form.
  - cancel -> The form was cancelled. Tell the asker that piece of information.
  - result -> Data results being returned from a search, or some other query.

  Returns:
    the form's type.

### getTitle

    String getTitle()

  Returns the description of the data. It is similar to the title on a web page or an X window. You can put a on either a form to fill out, or a set of data results.

  Returns:
    description of the data.

### getInstructions

    Iterator getInstructions()

  Returns an Iterator for the list of instructions that explain how to fill out the form and what the form is about. The dataform could include multiple instructions since each instruction could not contain newlines characters. Join the instructions together in order to show them to the user.

  Returns:
    an Iterator for the list of instructions that explain how to fill out the form.

### getField

    FormField getField(String variable)

  Returns the field of the form whose variable matches the specified variable. The fields of type FIXED will never be returned since they do not specify a variable.

  Parameters:
    `variable` - the variable to look for in the form fields.
  Returns:
    the field of the form whose variable matches the specified variable.

### getFields

    Iterator getFields()

  Returns an Iterator for the fields that are part of the form.

  Returns:
    an Iterator for the fields that are part of the form.

### getFieldsSize

    int getFieldsSize()

  Returns the number of fields included in the form.

  Returns:
    the number of fields included in the form.

### addInstruction

    void addInstruction(String instruction)

  Adds a new instruction to the list of instructions that explain how to fill out the form and what the form is about. The dataform could include multiple instructions since each instruction could not contain newlines characters.

  Parameters:
    `instruction` - the new instruction that explain how to fill out the form.

### addField

    void addField(FormField field)

  Adds a new field as part of the form.

  Parameters:
    `field` - the field to add to the form.

### addReportedField

    void addReportedField(FormField field)

  Adds a field to the list of fields that will be returned from a search. Each field represents a column in the report. The order of the columns in the report will honor the sequence in which they were added.

  Parameters:
    `field` - the field to add to the list of fields that will be returned from a search.

### addItemFields

    void addItemFields(ArrayList itemFields)

  Adds a new row of items of reported data. The list of items to add will be formed by FormFields. Each FormField variable must be valid (i.e. the variable must be defined by the FormFields added as ReportedField.

  Parameters:
    `itemFields` - list of FormFields to add as a row in the report.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.4.4 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2007 Jive Software.