Details
Description
Any image with all capital letters in the filename is incorrectly auto-exported. The case is removed for each variant image filename, see the example below:
The bootstrap YAML entry is looking for the variant filename to match the original variant (all caps), and throws the following exception:
[INFO] [talledLocalContainer] javax.jcr.RepositoryException: org.onehippo.cm.model.parser.ParserException: [basedemo/basedemo/basedemo-repository-data-content: content/gallery/abc/bios.yaml] Cannot find resource '/content/gallery/abc/bios/adancantobio1448140645400x0.jpg/ADANCANTOBIO1448140645400x0_thumbnail.jpg' in 'reader', line 24, column 21:
Root cause
The problem turned out to be caused by a timing/race-condition between the image-upload process invoking the repository GalleryWorkflow and autoexport change monitoring.
The image-upload process invokes the GalleryWorkflow to create and save a new hippogallery:imageset node in the repository, and thereafter set (and save) the hippogallery:filename property on that node.
If the autoexport change monitor checks for current changes between the above two steps, it will see the hippogallery:imageset node, but not (yet) the hippogallery:filename property as input for determining the resource file name to be exported.
Solution
The GalleryWorkflow API (interface) didn't allow specifying a (optional) filename to be stored as property when creating a new gallery item, hence the need for the image-upload process to do so separately in a second step.
To solve this limitation and (now) causing an autoexport processing problem, the GalleryWorkflow API for creating a new gallery item has been extended to allow (optionally) providing the hippogallery:filename property value:
/** * @deprecated Replaced by {@link #createGalleryItem(String, String, String)} */ @Deprecated Document createGalleryItem(String name, String type) throws RemoteException, RepositoryException, WorkflowException; /** * Create gallery item * @param nodeName Name of the node to create * @param type Type of the node to create * @param hippoGalleryImageSetFileName Optional filename of the original file for hippogallery:imageset type, * will be written to hippogallery:filename property */ Document createGalleryItem(String nodeName, String type, String hippoGalleryImageSetFileName) throws RemoteException, RepositoryException, WorkflowException;
Note: the hippogallery:filename property will only be set when the provided node type is hippogallery:imageset, or a subtype thereof.
The changed usage of this API is covered by CMS-10898, which thereafter also solve the reported problem with autoexport.
Attachments
Issue Links
- causes
-
CMS-10898 Update from deprecated to extended GalleryWorkflow.createGalleryItem API to set the gallery:imageset filename property on create
- Closed