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 KmeliaXmlFormUpdateContextbatchProcessing()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 aPairofFormand existingDataRecordof the given publication if any or initializes a newDataRecordotherwise.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 ofFileItemandFileFieldabout the given publication and language.StringgetXmlFormShortNameFromItems()Gets from the context the shot name of the Xml Form.booleanisBatchProcessing()booleanisForceUpdatePublication()
-
-
-
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 ofFileItemandFileFieldabout the given publication and language.- Parameters:
pub- a publication.language- a language.- Returns:
- a list of couple of
FileItemandFileField.
-
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 aPairofFormand existingDataRecordof the given publication if any or initializes a newDataRecordotherwise.Searched elements are cached in order to improve the treatment processing.
- Parameters:
pub- the aimed publication.language- the current managed language.- Returns:
- a
PairofFormandDataRecord. - Throws:
KmeliaRuntimeException- in case of publication template service error or in case of form management error.
-
-