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.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 aPair
ofForm
and existingDataRecord
of the given publication if any or initializes a newDataRecord
otherwise.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 ofFileItem
andFileField
about the given publication and language.String
getXmlFormShortNameFromItems()
Gets from the context the shot name of the Xml Form.boolean
isBatchProcessing()
boolean
isForceUpdatePublication()
-
-
-
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.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 ofFileItem
andFileField
about the given publication and language.- Parameters:
pub
- a publication.language
- a language.- Returns:
- a list of couple of
FileItem
andFileField
.
-
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 aPair
ofForm
and existingDataRecord
of the given publication if any or initializes a newDataRecord
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
ofForm
andDataRecord
. - Throws:
KmeliaRuntimeException
- in case of publication template service error or in case of form management error.
-
-