cancel
Showing results for 
Search instead for 
Did you mean: 

Document Preview

ghernando
Champ in-the-making
Champ in-the-making
Share has a great document Preview capability.
I have a few of questions about it.

- I can't find any user or developer documentation for this component.  Any pointers about where to look?
- I do see in the source code some javascript for the preview component of the slingshot project.
     I don't see the on-the-fly conversion of the document to flash that seems to happen.
     Any pointers of where to look for that?
- Is there a list of file formats currently supported?
- How can I extend the preview mechanism to a format that isn't currently supported?

Thanks
4 REPLIES 4

pqr
Champ in-the-making
Champ in-the-making
Hi

preview component has been included in document-detail page. you can find its template webapps\share\WEB-INF\classes\alfresco\templates\org\alfresco

and that preview component has been defined in \webapps\share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\preview folder.

to preview, share is using YUI component - shockwave flash object which is defined in tomcat\webapps\share\components\preview

thanks

fast3r
Champ on-the-rise
Champ on-the-rise
Hi,
I really can't figure how to do this:

- How can I extend the preview mechanism to a format that isn't currently supported?

I'd be really interested in a short explanation on how to do that…

Thank you!

fast3r
Champ on-the-rise
Champ on-the-rise
Is it possible that "image/*" mimetypes are automatically handled by ImageMagick?
If I'm not wrong, the web preview is generated using the thumbnail service and the transformation options available in the transform xml configuration files.
By the way, I've configured a new transformation from DWG format (autoCAD) to SWF passing through PDF, but it seems that the web previewer looks for a png preview and fails.
However, if I use the transform option in the Alfresco web client actions, the file is converted correctly.
What's wrong with web preview?
Enabling debug logging for the transformation registry, it seems like the service looks for transformations between dwg and png (not found) and dwg and swf (found, ComplexContentTransformer) but it does nothing. Nor the intermediate pdf file isn't created and the preview fails.

fast3r
Champ on-the-rise
Champ on-the-rise
I answer myself.
To enable previews of image types not supported by ImageMagick and SwfPreviewer, you need to modify the file tomcat\webapps\share\components\preview\web-preview.js

on line 279 (in Alfresco 3.0):

if (this.options.mimeType.match(/^image\/\w+/))

to

if (this.options.mimeType.match(/^image\/\w+/) && !this.options.mimeType.match(/image\/x-dwg/))

Eventually specifying each type of image you want to be converted to swf before previewing.

Hope this is helpful.