cancel
Showing results for 
Search instead for 
Did you mean: 

Where does configuration to generate various previews of document is done?

ratik_singhal
Star Contributor
Star Contributor
I have search a lot  into the code base but did not able to identify where does it configured to execute action of the respective transformation for generation of different previews like imagepreview, webprevew and doclib preview? More specifically Where it configured that on going to document detail page in share alfresco needs to generate webpreview and doclib?


Thanks in Advance,
5 REPLIES 5

ratik_singhal
Star Contributor
Star Contributor
Alfresco 4.2 Enterprise

Actually When I am uploading any document in Gallery view, thumbnail is not generating for DWG file but it is creating for office documents.

I have noticed that one child is created with properties

child Name : cm:imgpreivew
childType : cm:thumbnail
AssociationTypeL rn:rendition


Its is the same as webpreview and doclib is created in Alfresco earlier version. So I have searched a lot but no solution found.

How can I add "cm:imgpreview" for dwg type documents.

rjohnson
Star Contributor
Star Contributor
You need a custom thumbnail generator and transformer. There has been something done for DWG - do a google search on it. A good general starting point on webpreviews is

https://devcon.alfresco.com/sanjose/sessions/configuring-and-extending-share-document-previews

but there are lots more good articles from the Alfresco gliterati on this.

Be prepared for a fair bit of reading. Its not complicated, but it is "involved".

Thanks for replaying !

I am already using CADConverter for DWG and DXF file and configuration that I am using as:

id="transformer.worker.dwg2png"
id="transformer.worker.dwg2pdf"
id="transformer.worker.dwg2swf"

I have verified that PNG and SWF file is being created. Also 'webpreview' and 'doclib' is added as Association with document.


rjohnson
Star Contributor
Star Contributor
Sorry but I have never used the Gallery view so I can't directly help. The generation of the image preview is likely to end up being on the Gallery URL for the image with the extra parameter force=true. Now this requires that there is a XML config for generating the image preview from the base file mimetype which will be a different config to the doclib and web preview. If nothing else, the Gallery preview is a different size.

Off the top of my head I can't remember how this works, but you could do worse than to see how it does it for a JPEG and try and replicate that for your DWG and DXF files.

ratik_singhal
Star Contributor
Star Contributor
Thanks Johnson,

I have found a solution by modifying 'thumbnail-service-context.xml' file in bean id="thumbnailDefinitionImgpreview" . There was a mimetype set "image/jpeg" that I replace it to "image/png". Its working fine.

I think I need to create one more conversion id="transformer.worker.dwg2jpeg" like others

id="transformer.worker.dwg2png"
id="transformer.worker.dwg2pdf"
id="transformer.worker.dwg2swf"