cancel
Showing results for 
Search instead for 
Did you mean: 

How to make new RuntimeExecutableContentTransformer visible?

oneporter
Champ in-the-making
Champ in-the-making
Hi,

I've created a new -context.xml file that registers a new RuntimeExecutableContentTransformer for mimetype application/acp -> application/zip.  However, the wiki is very fuzzy regarding how to make this visible to the end user on the web client.  Does anyone have experience or insight that they could share with me on this?

Thanks!
5 REPLIES 5

jpotts
World-Class Innovator
World-Class Innovator
I think as long as you've registered the transformer bean you're good. Here's an example from the Alfresco Developer Guide that registers a Microsoft Project to Plain Text transformer:

<bean id="transformer.Project"
         class="com.someco.transformer.ProjectToPlainText"
         parent="baseContentTransformer" />

The transformer should be invoked properly when you run one of the "transform content" actions against a document that matches the mime type for which the transformer is registered.

You don't invoke a transformer directly–you tell Alfresco, "Here is a PNG file. I want this as a PDF," and Alfresco figures out which transformer can do that, then runs it.

Jeff

oneporter
Champ in-the-making
Champ in-the-making
Hey Jeff,

Thanks for your reply.  I've actually read a good portion of your guide, and I tried to refer to that section for my purposes, but I don't think it applies directly.  I'm using the org.alfresco.repo.content.transform.RuntimeExecutableContentTransformer class to call a script on the server to run the transformation, and I've written a *-context.xml file that configures a bean "transformer.dita.PDF".  I turned on debugging so I can see Alfresco registering my transformation as it loads.  However, when I go to Run Action -> Transform and Copy Content to a Specific Space -> Set Values, there is no option to transform to a Zip file. 

So, do you (or anyone else) know of a way to set the mime types that show up in that list or am I going about it from the wrong direction?  I think I might need to create a new Action to run the transformation.  If anyone has a better thought there, I'm open to suggestions.

Thanks
-Rich

jpotts
World-Class Innovator
World-Class Innovator
Rich,

There's a list of transformers in web-client-config.xml:

 
     <!– The list of transformers to show in the transform actions –>
     <transformers>
         <transformer name="application/vnd.oasis.opendocument.text"/>
         <transformer name="application/vnd.oasis.opendocument.presentation"/>
         <transformer name="application/vnd.oasis.opendocument.spreadsheet"/>
         <transformer name="application/rtf"/>
         <transformer name="text/html"/>
         <transformer name="application/pdf"/>
         <transformer name="text/plain"/>
         <transformer name="text/xml"/>
         <transformer name="application/x-shockwave-flash"/>
         <transformer name="image/gif"/>
         <transformer name="image/jpeg"/>
         <transformer name="application/msword"/>
         <transformer name="application/vnd.excel"/>
         <transformer name="application/vnd.powerpoint"/>
      </transformers>

Have you tried extending this list?

Jeff

oneporter
Champ in-the-making
Champ in-the-making
No, I hadn't, but that was exactly what I was looking for.  I'm having to rethink the problem now though because my solution didn't work out the way I thought it would.  Anyway, thanks for your help, Jeff – I have a better understanding of Alfresco after working on this problem. 

Also, good work on the DoCASU interface.  It's very simple and fast, which is what I think most users would prefer.

almer_bolatov
Champ in-the-making
Champ in-the-making
No, I hadn't, but that was exactly what I was looking for.  I'm having to rethink the problem now though because my solution didn't work out the way I thought it would.  Anyway, thanks for your help, Jeff – I have a better understanding of Alfresco after working on this problem. 

Also, good work on the DoCASU interface.  It's very simple and fast, which is what I think most users would prefer.

Sorry, but can you write your *-context.xml where you've extended your  X -> application/zip transformer ?

I' ve some, but unfortunately it won't work. Alfresco cannot find my transformer, it replaces by it's default one.
source mimetype: text/plain
target mimetype: application/zip
transformers: []
———————————–
source mimetype: text/plain
target mimetype: text/plain