09-11-2007 05:23 PM
02-12-2010 07:39 AM
02-16-2010 04:21 AM
if (this.options.mimeType.match(/^image\/\w+/))if (this.options.mimeType.match(/^image\/\w+/) && !this.options.mimeType.match(/image\/x-dwg/))02-16-2010 05:01 AM
02-16-2010 07:21 AM
02-18-2010 06:14 AM
02-18-2010 10:34 AM
log4j.logger.org.alfresco.util.exec.RuntimeExec=DEBUG
log4j.logger.org.alfresco.repo.content.transform.ContentTransformerRegistry=DEBUG
log4j.logger.org.alfresco.repo.content.transform.AbstractContentTransformer2=DEBUG
log4j.logger.org.alfresco.repo.thumbnail.ThumbnailServiceImpl=DEBUG<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<!– TRASFORMA DWG IN PDF –>
<bean id="transformer.worker.dwg2pdf" class="org.alfresco.repo.content.transform.RuntimeExecutableContentTransformerWorker">
<property name="mimetypeService">
<ref bean="mimetypeService" />
</property>
<property name="checkCommand">
<bean class="org.alfresco.util.exec.RuntimeExec">
<property name="commandsAndArguments">
<map>
<entry key=".*">
<list>
<value>C:\Alfresco\bin\IrfanView\i_view32.exe</value>
<value>C:\Alfresco\bin\IrfanView\jtp.gif</value>
<value>/convert=C:\Alfresco\bin\IrfanView\jtp.png</value>
</list>
</entry>
</map>
</property>
</bean>
</property>
<property name="transformCommand">
<bean class="org.alfresco.util.exec.RuntimeExec">
<property name="commandsAndArguments">
<map>
<entry key=".*">
<list>
<value>C:\Alfresco\bin\IrfanView\i_view32.exe</value>
<value>${source}</value>
<value>/convert=${target}</value>
</list>
</entry>
</map>
</property>
<property name="errorCodes">
<value>1,2</value>
</property>
</bean>
</property>
<property name="explicitTransformations">
<list>
<bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
<property name="sourceMimetype"><value>image/x-dwg</value></property>
<property name="targetMimetype"><value>application/pdf</value></property>
</bean>
</list>
</property>
</bean>
<bean id="transformer.dwg2pdf" class="org.alfresco.repo.content.transform.ProxyContentTransformer" parent="baseContentTransformer">
<property name="worker">
<ref bean="transformer.worker.dwg2pdf" />
</property>
</bean>
<!– TRASFORMA DWG IN PNG (miniature) –>
<bean id="transformer.complex.dwg2pdf.Image"
class="org.alfresco.repo.content.transform.ComplexContentTransformer"
parent="baseContentTransformer" >
<property name="transformers">
<list>
<ref bean="transformer.dwg2pdf" />
<ref bean="transformer.complex.PDF.Image" />
</list>
</property>
<property name="intermediateMimetypes">
<list>
<value>application/pdf</value>
</list>
</property>
</bean>
<!– TRASFORMA DWG IN SWF (complex) –>
<bean id="transformer.complex.dwg2pdf.Pdf2swf"
class="org.alfresco.repo.content.transform.ComplexContentTransformer"
parent="baseContentTransformer" >
<property name="transformers">
<list>
<ref bean="transformer.dwg2pdf" />
<ref bean="transformer.Pdf2swf" />
</list>
</property>
<property name="intermediateMimetypes">
<list>
<value>application/pdf</value>
</list>
</property>
<property name="explicitTransformations">
<list>
<bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails" >
<property name="sourceMimetype"><value>image/x-dwg</value></property>
<property name="targetMimetype"><value>application/x-shockwave-flash</value></property>
</bean>
</list>
</property>
</bean>
</beans>
if (this.options.mimeType.match(/^image\/\w+/))if (this.options.mimeType.match(/^image\/\w+/) && !this.options.mimeType.match(/image\/x-dwg/))02-19-2010 06:08 AM
02-22-2010 09:39 AM
AutoCAD file mimetype is "image/x-dwg".
To avoid dwg files being treated as image types (causing a failure of WebPreviewer.swf), you need to modify the file tomcat\webapps\share\components\preview\web-preview.js
on line 279 (in Alfresco 3.0) you need to change:if (this.options.mimeType.match(/^image\/\w+/))
withif (this.options.mimeType.match(/^image\/\w+/) && !this.options.mimeType.match(/image\/x-dwg/))
This should be done for each "image/*" file format that ImageMagick can't read.
The same procedure can be followed for each custom file type that you want to be previewed by Share.
I apologize if I've made something that's not perfectly in line with the Alfresco specifications. BTW, it works!
02-23-2010 04:29 AM
Nice to see that my example is already used! (I added it to the wiki).
AutoCAD file mimetype is "image/x-dwg".
To avoid dwg files being treated as image types (causing a failure of WebPreviewer.swf), you need to modify the file tomcat\webapps\share\components\preview\web-preview.js…
I didn't do this, and it works as expected. I don't know what causes this inconvenience for you, but when there's a converter to SWF available I don't think you need to change it… Anyway, I also made a converter that uses the same approach as the DWG to SWF converter as outlined on the wiki, but converting to thumbnail in last step, so I also have thumbnails generated from the DWGs.
Also, if you want to offer your PDF files to customers or anything I'd suggest using a converter that generates vector PDF files. One way of doing this is by chaining cad2svg (http://etc.nkadesign.com/Download/Cad2svg) and the Apache Batik Rasterizer (http://xmlgraphics.apache.org/batik/).
02-23-2010 06:17 AM
This one: http://wiki.alfresco.com/wiki/Content_Transformations#RuntimeExecutableContentTransformerWorker_.28A.... I was under the impression you used that as base for the latest transformer you posted.Nice to see that my example is already used! (I added it to the wiki).
Which example? I can't find it!
I don't know why, that could be because I'm still using Alfresco 3.0 Stable, without this modification, the preview couldn't be displayed. BTW, good for you!I'm on Community Edition 3.2r2, might be the difference.
Great! Thank you very much, I did not find any DWG converter in Linux, that's why I was using Windows apps…Depending on the type of business you are in (or your company is in) it might be worth the money to join the OpenDesign alliance (http://www.opendwg.org/), they offer a library which you can use to read DWG files and included is also a PDF export library (including partial source). Cad2Svg is based on an older version of the same library, meanwhile compatibility between the library and AutoCAD DWG files has improved a bit, so if you have any DWG files that you can't convert well with cad2svg this could be very appealing.
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.