cancel
Showing results for 
Search instead for 
Did you mean: 

[SOLVED] DWG transformation

tsafarog
Champ on-the-rise
Champ on-the-rise
Hello thank you for reading this

I am trying to use the transformer capabilities of alfresco to get a preview of dwg files.

My sources were:
1)http://wiki.alfresco.com/wiki/Content_Transformations
and the conversation below eventhout it seems a bit outdated.
2)https://forums.alfresco.com/forum/general/non-technical-alfresco-discussion/autocad-dwg-pdf-transfor...

I am using Community version 5

I have tried the pdf transformation using Irfanview. Irfanview has BabaCAD4Image.dll and i can preview there my DWG documents but i also purchased a licence for CS_DWG.dll to test. Nothing works for me i either get a spining cycle when Alfresco share tried to do the preview or i get :

An error has occured in the Share component: /share/service/components/dashlets/my-sites.
It responded with a status of 500 - Internal Error.
Error Code Information: 500 - An error inside the HTTP server which prevented it from fulfilling the request.
Error Message: 06290003 Failed to execute script 'classpath*:alfresco/site-webscripts/org/alfresco/components/dashlets/my-sites.get.js': 06290002 06290003 Failed during processing of IMAP server status configuration from Alfresco: 06290002 Unable to retrieve IMAP server status from Alfresco: 404
Server: Alfresco Spring WebScripts - v1.2.0 (Release 1549) schema 1,000

this is what i have done so far:

I added the mimetype image/x-dwg unders mimetypes-extension-map.xml

Transform to pdf (dwg2pdf-context.xml)


?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>

<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>E:\ECM\bin\IrfanView\i_view32.exe</value>
                  <value>E:\ECM\bin\IrfanView\jtp.gif</value>
                  <value>/convert=E:\ECM\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>E:\ECM\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>


<!– DWG to SWF –>

<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 i add the DGW to PNG transform in the script i cant even get alfresco to load

After doing alterations with no success i tried to make transformer from DWG to PNG and DWG to GIF altering the above script with no success. I am not interested in detailed preview.

Any help would be greatly appreciated to get this working

Thanks in advance

Chris


(Edit by AFaust 2014/08/07: As per the latest comment I have moved the entire thread into "Developer Discussions" => "Repository Services")
26 REPLIES 26

kaynezhang
World-Class Innovator
World-Class Innovator
I have checke alfresco transform souce code ,there is nothing wrong with it.
And I also test it ,you should write it like mine

AcmeCADConverter /r /ad /f 105 /d ${target} ${source}

yeah the /d switch came to my mind also after your first post … i will try tomorrow morning and let you know

Thank you very much for your usefull input Kaynezhang Smiley Happy

kaynezhang
World-Class Innovator
World-Class Innovator
You should also use /105 instead of /104.
good luck.

and that was it

Transformation works really nice now

Thank you for your help guys especialy Kaynezhang for his inputs

kaynezhang
World-Class Innovator
World-Class Innovator
Ok,good luck

xiaoqunhua
Champ in-the-making
Champ in-the-making
Hi,tsafarog. Can you paste all you detailed config? I want to try it with AcmeCadconverter.
Thanks advance!

xiaoqunhua
Champ in-the-making
Champ in-the-making
I solved it, thanks.