Class KmeliaXmlFormUpdateContext


  • public class KmeliaXmlFormUpdateContext
    extends Object
    Handles the context of an Xml Form update.

    It permits to manage some useful caches.

    Author:
    silveryocha
    • Constructor Detail

      • KmeliaXmlFormUpdateContext

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

      • 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.core.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.core.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.