Package org.silverpeas.components.kmelia.service

## Class KmeliaXmlFormUpdateContext

- java.lang.Object
- - org.silverpeas.components.kmelia.service.KmeliaXmlFormUpdateContext

-     public class KmeliaXmlFormUpdateContext
      extends Object

  Handles the context of an Xml Form update.

  It permits to manage some useful caches.

  Author:
    silveryocha

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `KmeliaXmlFormUpdateContext​(List<org.apache.commons.fileupload.FileItem> items, boolean forceUpdatePublication)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `KmeliaXmlFormUpdateContext` | `batchProcessing()` |
    `List<org.apache.commons.fileupload.FileItem>` | `getItems()` |
    `org.silverpeas.kernel.util.Pair<org.silverpeas.core.contribution.template.publication.PublicationTemplate,​org.silverpeas.core.contribution.content.form.DataRecord>` | `getOrInitializePublicationDataRecordOf​(org.silverpeas.core.contribution.publication.model.PublicationDetail pub, String language)` | Gets a `Pair` of `Form` and existing `DataRecord` of the given publication if any or initializes a new `DataRecord` otherwise.
    `List<org.silverpeas.kernel.util.Pair<org.apache.commons.fileupload.FileItem,​org.silverpeas.core.contribution.content.form.field.FileField>>` | `getPublicationFileFields​(org.silverpeas.core.contribution.publication.model.PublicationDetail pub, String language)` | Gets the list of couples of `FileItem` and `FileField` about the given publication and language.
    `String` | `getXmlFormShortNameFromItems()` | Gets from the context the shot name of the Xml Form.
    `boolean` | `isBatchProcessing()` |
    `boolean` | `isForceUpdatePublication()` |

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

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

- - ### Constructor Detail

    - #### KmeliaXmlFormUpdateContext

          public KmeliaXmlFormUpdateContext​(List<org.apache.commons.fileupload.FileItem> items,
                                            boolean forceUpdatePublication)

  - ### Method Detail

    - #### batchProcessing

          public KmeliaXmlFormUpdateContext batchProcessing()

    - #### getItems

          public List<org.apache.commons.fileupload.FileItem> getItems()

    - #### isForceUpdatePublication

          public boolean isForceUpdatePublication()

    - #### isBatchProcessing

          public boolean isBatchProcessing()

    - #### getXmlFormShortNameFromItems

          public String getXmlFormShortNameFromItems()

      Gets from the context the shot name of the Xml Form.
      Returns:
        a name as string.

    - #### getPublicationFileFields

          public List<org.silverpeas.kernel.util.Pair<org.apache.commons.fileupload.FileItem,​org.silverpeas.core.contribution.content.form.field.FileField>> getPublicationFileFields​(org.silverpeas.core.contribution.publication.model.PublicationDetail pub,
                                                                                                                                                                                            String language)

      Gets the list of couples of `FileItem` and `FileField` about the given publication and language.
      Parameters:
        `pub` - a publication.
        `language` - a language.
      Returns:
        a list of couple of `FileItem` and `FileField`.

    - #### getOrInitializePublicationDataRecordOf

          public org.silverpeas.kernel.util.Pair<org.silverpeas.core.contribution.template.publication.PublicationTemplate,​org.silverpeas.core.contribution.content.form.DataRecord> getOrInitializePublicationDataRecordOf​(org.silverpeas.core.contribution.publication.model.PublicationDetail pub,
                                                                                                                                                                                                                                  String language)

      Gets a `Pair` of `Form` and existing `DataRecord` of the given publication if any or initializes a new `DataRecord` otherwise.

      Searched elements are cached in order to improve the treatment processing.

      Parameters:
        `pub` - the aimed publication.
        `language` - the current managed language.
      Returns:
        a `Pair` of `Form` and `DataRecord`.
      Throws:
        `KmeliaRuntimeException` - in case of publication template service error or in case of form management error.