Package org.silverpeas.components.whitepages.record

## Class UserTemplate

- java.lang.Object
- - org.silverpeas.components.whitepages.record.UserTemplate

- All Implemented Interfaces:
    `Serializable`, `org.silverpeas.core.contribution.content.form.RecordTemplate`

      public class UserTemplate
      extends Object
      implements org.silverpeas.core.contribution.content.form.RecordTemplate

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `UserTemplate​(String fileName, String language)` | A UserTemplate is built from a file name and a language.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `checkDataRecord​(org.silverpeas.core.contribution.content.form.DataRecord record)` |
    `org.silverpeas.core.contribution.content.form.DataRecord` | `getEmptyRecord()` |
    `int` | `getFieldIndex​(String fieldName)` |
    `String[]` | `getFieldNames()` |
    `org.silverpeas.core.contribution.content.form.FieldTemplate` | `getFieldTemplate​(String fieldName)` |
    `org.silverpeas.core.contribution.content.form.FieldTemplate[]` | `getFieldTemplates()` |
    `UserRecord` | `getRecord​(String idUser)` | Gets a `UserRecord` of the specified user built on this template.
    `org.silverpeas.core.contribution.content.form.Form` | `getViewForm()` | Gets the form dedicated to be rendered to the end users.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### UserTemplate

          public UserTemplate​(String fileName,
                              String language)

      A UserTemplate is built from a file name and a language.
      Parameters:
        `fileName` - the name of a file in which are defined the template of each fields.
        `language` - the ISO-631 code of a language.

  - ### Method Detail

    - #### getFieldNames

          public String[] getFieldNames()

      Specified by:
        `getFieldNames` in interface `org.silverpeas.core.contribution.content.form.RecordTemplate`

    - #### getFieldTemplates

          public org.silverpeas.core.contribution.content.form.FieldTemplate[] getFieldTemplates()

      Specified by:
        `getFieldTemplates` in interface `org.silverpeas.core.contribution.content.form.RecordTemplate`

    - #### getFieldTemplate

          public org.silverpeas.core.contribution.content.form.FieldTemplate getFieldTemplate​(String fieldName)
                                                                                       throws org.silverpeas.core.contribution.content.form.FormException

      Specified by:
        `getFieldTemplate` in interface `org.silverpeas.core.contribution.content.form.RecordTemplate`
      Throws:
        `org.silverpeas.core.contribution.content.form.FormException`

    - #### getFieldIndex

          public int getFieldIndex​(String fieldName)

      Specified by:
        `getFieldIndex` in interface `org.silverpeas.core.contribution.content.form.RecordTemplate`

    - #### getEmptyRecord

          public org.silverpeas.core.contribution.content.form.DataRecord getEmptyRecord()

      Specified by:
        `getEmptyRecord` in interface `org.silverpeas.core.contribution.content.form.RecordTemplate`

    - #### checkDataRecord

          public boolean checkDataRecord​(org.silverpeas.core.contribution.content.form.DataRecord record)

      Specified by:
        `checkDataRecord` in interface `org.silverpeas.core.contribution.content.form.RecordTemplate`

    - #### getViewForm

          public org.silverpeas.core.contribution.content.form.Form getViewForm()

      Gets the form dedicated to be rendered to the end users.
      Returns:
        a `Form` instance.

    - #### getRecord

          public UserRecord getRecord​(String idUser)

      Gets a `UserRecord` of the specified user built on this template.
      Parameters:
        `idUser` - the unique identifier of a user in Silverpeas.
      Returns:
        the `UserRecord` instance for the given user.