AnsweredAssumed Answered

Creating new rule for document transformation

Question asked by swithun on May 25, 2010
Latest reply on May 27, 2010 by swithun
I want to be able to use FITS - a technical metadata extractor, on documents that I've ingested into Alfresco. I managed to get this working as a 'Transform and copy content' action. This used a custom class which wrapped a call to the FITS library. It works fine, but I had to create a dummy mimetype of text/fits, and do a transform from whatever mimetype the original was to this dummy text/fits (actually XML).

I wasn't very happy with this, and I found this topic, which describes another way to get something similar to what I want. I created a class which extends TransformActionExecuter, and then calls my transform class. The trouble is that Alfresco complains that I haven't set the mandatory mime-type parameter:

Failed to run Actions due to error: 04250001 A value for the mandatory parameter mime-type has not been set on the rule item fits-transform

My class has a method doTransform, which is given an Action object. This Action object should have a mime-type property set before it gets passed to doTransform. In org.alfresco.repo.action.executer.execute(), the Action object is checked for mandatory properties, so setting the mime-type property has to be done before that.

How would I set the mimetype property (to text/xml)? Is it in an XML document or in my Java class?