Page History
...
Uploading a new file into an asset will change its node path
Alternative 4 - Subnode on Asset
When an asset is edited, copy the resource subnode to a new subnode on the Asset.
Concept:
- /jcr:content-original node can save the original resource on the same asset node.
- On saving an edit, check if /jcr:content-original exists, if not: copy /jcr-content to it before saving edit.
- On uploading a new file, delete /jcr:content-original node
- On duplicating an asset - be sure /jcr:content-original is also duplicated (I guess everything is)(Of course this wastes space (duplication of original).)
- On "Revert to original" click, copy /jcr:content-original to /jcr:content and delete /jcr:content-original
Questions/Problems:
- What about the "asset family" - How could you find all variants of the original? Do you need to be able to? Probably yes -this could be implemented by storing an extra reference when things are duplicated.
- If implementation changes later, how messy would it be to have this implementation? Migration? Some nodes use once technique, some nodes use the other technique?
Implementation Notes:
- Resource node of asset is updated after upload and edit in FileItemWrapperImpl.populateJcrItemProperty() This could be the place to check if an original exists yet, and copy the resource there if not, before saving the changes.
- Upload saving happens in AbstactUploadFileField.uploadFinished() with fileItem.updateProperties() and fileItem.populateJcrItemProperty()
Node types
The original and the asset will use different node types.
...
Overview
Content Tools