Highlighted

Custom dam handler for creating thumbnails for DOCs and XLS files

Avatar

Avatar

tarun11011991

Avatar

tarun11011991

tarun11011991

02-05-2018

Hi, i followed the custom dam handler blog and was able to achieve what was mentioned in that. My requirement is that i need to get thumbnails created for Doc and Xls files when any dam asset is uploaded. I have gone through the DAM UPDATE ASSET workflow and the steps in that just work fine for TXT, IMAGES and PDF files.

i have tried adding application/vnd.ms-excel and  application/msword MIME types but didnt work. May i know what i am missing and where i am missing ? in custom handler what code do i need to write to get thumbnails to be created ?

02.05.2018 20:22:52.025 *INFO* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/dam-parse-word-documents_22:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.word.process.ExtractImagesProcess Extracting images from: /content/dam/geometrixx-instore/Hello  test doc file.docx

02.05.2018 20:22:52.100 *INFO* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/dam-parse-word-documents_22:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.word.process.ExtractImagesProcess Done extracting images from: /content/dam/geometrixx-instore/Hello  test doc file.docx

02.05.2018 20:22:52.112 *INFO* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/dam-parse-word-documents_22:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.word.extraction.WordExtractionHandler Beginning page extraction from: /content/dam/geometrixx-instore/Hello  test doc file.docx

02.05.2018 20:22:52.180 *INFO* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.adobe.granite.asset.core.impl.metadata.xmpjcr.XmpToJcrVisitor No custom schema available, using default XMP schema service

02.05.2018 20:22:52.267 *INFO* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/dam-parse-word-documents_22:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.word.extraction.WordExtractionHandler Page extraction from: /content/dam/geometrixx-instore/Hello  test doc file.docx has completed successfully.

02.05.2018 20:22:52.397 *INFO* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.video.FFMpegThumbnailProcess execute: asset [/content/dam/geometrixx-instore/Hello  test doc file.docx] is not of a video mime type, asset ignored.

02.05.2018 20:22:52.405 *INFO* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.core.process.CommandLineProcess execute: mime type [application/vnd.openxmlformats-officedocument.wordprocessingml.document] of asset [/content/dam/geometrixx-instore/Hello  test doc file.docx] is not in list of accepted mime types [[image/eps, image/x-eps, application/postscript, application/eps, application/x-eps, application/vnd.ms-excel]], ignoring.

02.05.2018 20:22:52.545 *INFO* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.video.FFMpegTranscodeProcess execute: asset [/content/dam/geometrixx-instore/Hello  test doc file.docx] is not of a video mime type, asset ignored.

02.05.2018 20:22:52.665 *WARN* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.handler.standard.ooxml.OpenOfficeHandler Failed to retrieve thumbnail for /content/dam/geometrixx-instore/Hello  test doc file.docx

02.05.2018 20:22:52.665 *WARN* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.core.impl.gfx.CommonsGfxRenderer gfx: cannot get image for rendition: /content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original

02.05.2018 20:22:52.665 *INFO* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.core.impl.RenditionMakerImpl cannot generate rendition. stream not found  [cq5dam.thumbnail.140.100.png]

02.05.2018 20:22:52.692 *WARN* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.handler.standard.ooxml.OpenOfficeHandler Failed to retrieve thumbnail for /content/dam/geometrixx-instore/Hello  test doc file.docx

02.05.2018 20:22:52.695 *WARN* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.core.impl.gfx.CommonsGfxRenderer gfx: cannot get image for rendition: /content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original

02.05.2018 20:22:52.695 *INFO* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.core.impl.RenditionMakerImpl cannot generate rendition. stream not found  [cq5dam.thumbnail.48.48.png]

02.05.2018 20:22:52.725 *WARN* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.handler.standard.ooxml.OpenOfficeHandler Failed to retrieve thumbnail for /content/dam/geometrixx-instore/Hello  test doc file.docx

02.05.2018 20:22:52.725 *WARN* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.core.impl.gfx.CommonsGfxRenderer gfx: cannot get image for rendition: /content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original

02.05.2018 20:22:52.725 *INFO* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.core.impl.RenditionMakerImpl cannot generate rendition. stream not found  [cq5dam.thumbnail.319.319.png]

02.05.2018 20:22:52.740 *WARN* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.handler.standard.ooxml.OpenOfficeHandler Failed to retrieve thumbnail for /content/dam/geometrixx-instore/Hello  test doc file.docx

02.05.2018 20:22:52.740 *WARN* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.core.impl.gfx.CommonsGfxRenderer gfx: cannot get image for rendition: /content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original

02.05.2018 20:22:52.740 *INFO* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.core.impl.RenditionMakerImpl cannot generate rendition. stream not found  [cq5dam.web.1280.1280.jpeg]

02.05.2018 20:22:52.752 *INFO* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.pim.impl.sourcing.upload.process.ProductAssetsUploadProcess payload path :/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original

02.05.2018 20:22:52.815 *ERROR* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.adobe.granite.workflow.core.job.JobHandler OakState0001: Unresolved conflicts in /content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content

javax.jcr.InvalidItemStateException: OakState0001: Unresolved conflicts in /content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content

at org.apache.jackrabbit.oak.api.CommitFailedException.asRepositoryException(CommitFailedException.java:237)

at org.apache.jackrabbit.oak.api.CommitFailedException.asRepositoryException(CommitFailedException.java:212)

at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.newRepositoryException(SessionDelegate.java:670)

at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.save(SessionDelegate.java:496)

at org.apache.jackrabbit.oak.jcr.session.SessionImpl$8.performVoid(SessionImpl.java:419)

at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.performVoid(SessionDelegate.java:274)

at org.apache.jackrabbit.oak.jcr.session.SessionImpl.save(SessionImpl.java:416)

at com.adobe.granite.workflow.core.WorkflowSessionImpl.persist(WorkflowSessionImpl.java:1256)

at com.adobe.granite.workflow.core.job.JobHandler.process(JobHandler.java:363)

at org.apache.sling.event.impl.jobs.JobConsumerManager$JobConsumerWrapper.process(JobConsumerManager.java:500)

at org.apache.sling.event.impl.jobs.queues.JobQueueImpl.startJob(JobQueueImpl.java:291)

at org.apache.sling.event.impl.jobs.queues.JobQueueImpl.access$100(JobQueueImpl.java:58)

at org.apache.sling.event.impl.jobs.queues.JobQueueImpl$1.run(JobQueueImpl.java:227)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:745)

Caused by: org.apache.jackrabbit.oak.api.CommitFailedException: OakState0001: Unresolved conflicts in /content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content

at org.apache.jackrabbit.oak.plugins.commit.ConflictValidator.failOnMergeConflict(ConflictValidator.java:115)

at org.apache.jackrabbit.oak.plugins.commit.ConflictValidator.propertyAdded(ConflictValidator.java:84)

at org.apache.jackrabbit.oak.spi.commit.CompositeEditor.propertyAdded(CompositeEditor.java:83)

at org.apache.jackrabbit.oak.spi.commit.EditorDiff.propertyAdded(EditorDiff.java:82)

at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeState.compareProperties(SegmentNodeState.java:592)

at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:456)

at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:148)

at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:531)

at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:148)

at org.apache.jackrabbit.oak.plugins.segment.MapRecord.compare(MapRecord.java:414)

at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:583)

at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:148)

at org.apache.jackrabbit.oak.plugins.segment.MapRecord.compare(MapRecord.java:414)

at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:583)

at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:148)

at org.apache.jackrabbit.oak.plugins.segment.MapRecord.compare(MapRecord.java:414)

at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:583)

at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:148)

at org.apache.jackrabbit.oak.plugins.segment.MapRecord.compare(MapRecord.java:414)

at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:583)

at org.apache.jackrabbit.oak.spi.commit.EditorDiff.process(EditorDiff.java:52)

at org.apache.jackrabbit.oak.spi.commit.EditorHook.processCommit(EditorHook.java:54)

at org.apache.jackrabbit.oak.spi.commit.CompositeHook.processCommit(CompositeHook.java:61)

at org.apache.jackrabbit.oak.spi.commit.CompositeHook.processCommit(CompositeHook.java:61)

at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStore$Commit.prepare(SegmentNodeStore.java:496)

at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStore$Commit.optimisticMerge(SegmentNodeStore.java:519)

at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStore$Commit.execute(SegmentNodeStore.java:575)

at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStore.merge(SegmentNodeStore.java:238)

at org.apache.jackrabbit.oak.spi.state.ProxyNodeStore.merge(ProxyNodeStore.java:43)

at org.apache.jackrabbit.oak.core.MutableRoot.commit(MutableRoot.java:247)

at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.commit(SessionDelegate.java:347)

at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.save(SessionDelegate.java:494)

... 12 common frames omitted

02.05.2018 20:22:54.878 *INFO* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.adobe.granite.asset.core.impl.metadata.xmpjcr.XmpToJcrVisitor No custom schema available, using default XMP schema service

02.05.2018 20:22:54.923 *INFO* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.video.FFMpegThumbnailProcess execute: asset [/content/dam/geometrixx-instore/Hello  test doc file.docx] is not of a video mime type, asset ignored.

02.05.2018 20:22:54.928 *INFO* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.core.process.CommandLineProcess execute: mime type [application/vnd.openxmlformats-officedocument.wordprocessingml.document] of asset [/content/dam/geometrixx-instore/Hello  test doc file.docx] is not in list of accepted mime types [[image/eps, image/x-eps, application/postscript, application/eps, application/x-eps, application/vnd.ms-excel]], ignoring.

02.05.2018 20:22:54.930 *INFO* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.video.FFMpegTranscodeProcess execute: asset [/content/dam/geometrixx-instore/Hello  test doc file.docx] is not of a video mime type, asset ignored.

02.05.2018 20:22:54.948 *WARN* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.handler.standard.ooxml.OpenOfficeHandler Failed to retrieve thumbnail for /content/dam/geometrixx-instore/Hello  test doc file.docx

02.05.2018 20:22:54.948 *WARN* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.core.impl.gfx.CommonsGfxRenderer gfx: cannot get image for rendition: /content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original

02.05.2018 20:22:54.948 *INFO* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.core.impl.RenditionMakerImpl cannot generate rendition. stream not found  [cq5dam.thumbnail.140.100.png]

02.05.2018 20:22:54.953 *WARN* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.handler.standard.ooxml.OpenOfficeHandler Failed to retrieve thumbnail for /content/dam/geometrixx-instore/Hello  test doc file.docx

02.05.2018 20:22:54.953 *WARN* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.core.impl.gfx.CommonsGfxRenderer gfx: cannot get image for rendition: /content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original

02.05.2018 20:22:54.953 *INFO* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.core.impl.RenditionMakerImpl cannot generate rendition. stream not found  [cq5dam.thumbnail.48.48.png]

02.05.2018 20:22:54.958 *WARN* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.handler.standard.ooxml.OpenOfficeHandler Failed to retrieve thumbnail for /content/dam/geometrixx-instore/Hello  test doc file.docx

02.05.2018 20:22:54.958 *WARN* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.core.impl.gfx.CommonsGfxRenderer gfx: cannot get image for rendition: /content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original

02.05.2018 20:22:54.958 *INFO* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.core.impl.RenditionMakerImpl cannot generate rendition. stream not found  [cq5dam.thumbnail.319.319.png]

02.05.2018 20:22:54.963 *WARN* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.handler.standard.ooxml.OpenOfficeHandler Failed to retrieve thumbnail for /content/dam/geometrixx-instore/Hello  test doc file.docx

02.05.2018 20:22:54.963 *WARN* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.core.impl.gfx.CommonsGfxRenderer gfx: cannot get image for rendition: /content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original

02.05.2018 20:22:54.963 *INFO* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.core.impl.RenditionMakerImpl cannot generate rendition. stream not found  [cq5dam.web.1280.1280.jpeg]

02.05.2018 20:22:54.970 *INFO* [JobHandler: /etc/workflow/instances/server0/2018-05-02_1/update_asset_21:/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original] com.day.cq.dam.pim.impl.sourcing.upload.process.ProductAssetsUploadProcess payload path :/content/dam/geometrixx-instore/Hello  test doc file.docx/jcr:content/renditions/original

thanks,

Tarun P Singh