Removed another final modifier
parent
0d00794ffb
commit
c3e90a27e1
|
|
@ -45,18 +45,18 @@ public abstract class AbstractAssetImExporter<T extends Asset>
|
|||
@Inject
|
||||
@Any
|
||||
private ItemAttachmentImExporter itemAttachmentImExporter;
|
||||
|
||||
|
||||
@PostConstruct
|
||||
@Override
|
||||
protected final void init() {
|
||||
// ItemAttachmentImExporter requires that all assets to be imported
|
||||
itemAttachmentImExporter.addRequiredEntities(Set.of(getEntityClass()));
|
||||
|
||||
|
||||
initAssetImExporter();
|
||||
}
|
||||
|
||||
|
||||
protected abstract void initAssetImExporter();
|
||||
|
||||
|
||||
@Override
|
||||
protected Optional<T> findExistingEntity(final String uuid) {
|
||||
return assetRepo.findByUuidAndType(uuid, getEntityClass());
|
||||
|
|
@ -67,8 +67,24 @@ public abstract class AbstractAssetImExporter<T extends Asset>
|
|||
assetRepo.save(asset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of
|
||||
* {@link AbstractEntityImExporter#updateExistingEntity(org.libreccm.imexport.Exportable, org.libreccm.imexport.Exportable)}
|
||||
* for {@link Asset}s.
|
||||
*
|
||||
* !!!Warning: ImExporters for assets MUST never override this method.
|
||||
* Instead, they MUST implement
|
||||
* {@link #updateExistingAsset(org.librecms.contentsection.Asset, org.librecms.contentsection.Asset)}.
|
||||
*
|
||||
* Unfortunetly, CDI does not support final methods, therefore we can't make
|
||||
* this method final.
|
||||
*
|
||||
*
|
||||
* @param existingEntity The existing entity.
|
||||
* @param importedEntity The imported entity.
|
||||
*/
|
||||
@Override
|
||||
protected final void updateExistingEntity(
|
||||
protected void updateExistingEntity(
|
||||
final T existingEntity, final T importedEntity
|
||||
) {
|
||||
if (!Objects.equals(
|
||||
|
|
@ -77,7 +93,7 @@ public abstract class AbstractAssetImExporter<T extends Asset>
|
|||
)) {
|
||||
existingEntity.setDisplayName(importedEntity.getDisplayName());
|
||||
}
|
||||
|
||||
|
||||
if (!Objects.equals(
|
||||
existingEntity.getTitle(),
|
||||
importedEntity.getTitle()
|
||||
|
|
|
|||
|
|
@ -100,6 +100,21 @@ public abstract class AbstractContentItemImExporter<T extends ContentItem>
|
|||
itemRepository.save(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of
|
||||
* {@link AbstractEntityImExporter#updateExistingEntity(org.libreccm.imexport.Exportable, org.libreccm.imexport.Exportable)}
|
||||
* for {@link ContentItem}s.
|
||||
*
|
||||
* !!!Warning: Implementations of this abstract class MUST NEVER override
|
||||
* this method. Instead they MUST override
|
||||
* {@link #updateExistingContentItem(org.librecms.contentsection.ContentItem, org.librecms.contentsection.ContentItem)}.
|
||||
*
|
||||
* Unfortunetly, CDI does not support final methods, therefore we can't make
|
||||
* this method final.
|
||||
*
|
||||
* @param existingEntity
|
||||
* @param importedEntity
|
||||
*/
|
||||
@Override
|
||||
protected void updateExistingEntity(
|
||||
final T existingEntity,
|
||||
|
|
@ -205,7 +220,7 @@ public abstract class AbstractContentItemImExporter<T extends ContentItem>
|
|||
importedEntity.getLastModifyingUserName()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
updateExistingContentItem(existingEntity, importedEntity);
|
||||
|
||||
itemRepository.save(existingEntity);
|
||||
|
|
|
|||
Loading…
Reference in New Issue