@Component @Scope(value="prototype") public class WebCmsComponentImporter extends AbstractWebCmsDataImporter<WebCmsComponentModel,WebCmsComponentModel>
WebCmsComponent.LOG| Constructor and Description |
|---|
WebCmsComponentImporter() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
applyDataValues(Map<String,Object> values,
WebCmsComponentModel dto)
Apply the data values to the dto object.
|
protected WebCmsComponentModel |
createDto(WebCmsDataEntry data,
WebCmsComponentModel itemToUpdate,
WebCmsDataAction action,
Map<String,Object> dataValues)
Create a DTO object for either a new instance or an existing instance.
|
protected void |
deleteInstance(WebCmsComponentModel instance,
WebCmsDataEntry data)
Perform the delete action on existing instance.
|
protected WebCmsComponentModel |
prepareForSaving(WebCmsComponentModel itemToBeSaved,
WebCmsDataEntry data)
Override if you want to post process an item before saving.
|
protected WebCmsComponentModel |
retrieveExistingInstance(WebCmsDataEntry data)
Get the existing object that this data represents.
|
protected void |
saveDto(WebCmsComponentModel itemToSave,
WebCmsDataAction action,
WebCmsDataEntry data)
Save an updated or created instance.
|
void |
setOwner(WebCmsObject owner)
Set the owner of the objects being created.
|
boolean |
supports(WebCmsDataEntry data) |
protected void |
validate(WebCmsComponentModel itemToBeSaved,
org.springframework.validation.Errors errors)
Perform some custom validation on the item to be saved.
|
addForceUpdateProperty, importData, resolveAction, retrieveDomainForDataEntry, setPropertyDataImportService, validateForSavingpublic final boolean supports(WebCmsDataEntry data)
protected WebCmsComponentModel retrieveExistingInstance(WebCmsDataEntry data)
AbstractWebCmsDataImporternull..retrieveExistingInstance in class AbstractWebCmsDataImporter<WebCmsComponentModel,WebCmsComponentModel>data - entrynullprotected WebCmsComponentModel createDto(WebCmsDataEntry data, WebCmsComponentModel itemToUpdate, WebCmsDataAction action, Map<String,Object> dataValues)
AbstractWebCmsDataImporternull a new instance should be created.
Note that the DTO should not apply the data entry values yet, but the data entry
can be used to determine the initial type of instance that needs to be created.
If the DTO is null, the import will be skipped but properties will still be called.createDto in class AbstractWebCmsDataImporter<WebCmsComponentModel,WebCmsComponentModel>data - entryitemToUpdate - instance or null if a new instance should be createdaction - purpose for which the DTO should be created (create, delete or replace)dataValues - modifiable collection of the data values that will be applied afterwardsprotected void deleteInstance(WebCmsComponentModel instance, WebCmsDataEntry data)
AbstractWebCmsDataImporterdeleteInstance in class AbstractWebCmsDataImporter<WebCmsComponentModel,WebCmsComponentModel>instance - to deletedata - entry that is being importedprotected WebCmsComponentModel prepareForSaving(WebCmsComponentModel itemToBeSaved, WebCmsDataEntry data)
prepareForSaving in class AbstractWebCmsDataImporter<WebCmsComponentModel,WebCmsComponentModel>itemToBeSaved - original item to be saveddata - that was used to build the itemprotected void saveDto(WebCmsComponentModel itemToSave, WebCmsDataAction action, WebCmsDataEntry data)
AbstractWebCmsDataImportersaveDto in class AbstractWebCmsDataImporter<WebCmsComponentModel,WebCmsComponentModel>itemToSave - that should be savedaction - type of save action (create, update or replace)data - entry that is being importedprotected boolean applyDataValues(Map<String,Object> values, WebCmsComponentModel dto)
AbstractWebCmsDataImporterfalse no values have been applied to the DTO and actual updating
might get skipped.applyDataValues in class AbstractWebCmsDataImporter<WebCmsComponentModel,WebCmsComponentModel>values - to apply (key/value pairs)dto - to set the values onpublic void setOwner(WebCmsObject owner)
protected void validate(WebCmsComponentModel itemToBeSaved, org.springframework.validation.Errors errors)
AbstractWebCmsDataImportervalidate in class AbstractWebCmsDataImporter<WebCmsComponentModel,WebCmsComponentModel>itemToBeSaved - item to be savederrors - collection to add validation errors toCopyright © 2020. All rights reserved.