cancel
Showing results for 
Search instead for 
Did you mean: 

Another transformer conflicts with OpenOffice

swithun
Champ in-the-making
Champ in-the-making
I have developed a transform action, which will 'transform' any document into an XML document containing technical metadata (see the fitsinalfresco project on AlfrescoForge). This works fine (no errors in the log). But I found that it is now preventing OpenOffice from being used to transform documents for preview in Flash.

I'm guessing that my transformer is taking precedence over OpenOffice (it will transform anything). It will generate an XML file, but this is not what the Flash player is expecting, so the timer just spins indefinitely.

Is there a way to specify the order of precedence for transform actions? I only want my action to be run when explicitly instructed, and not to be the default transform. It is packaged as an AMP. Is there anything I can do to stop it being run instead of the OpenOffice transform?
2 REPLIES 2

swithun
Champ in-the-making
Champ in-the-making
I seem to have fixed this. Before, my isTransformable method just returned true for everything. By only returning true if the target mimetype is for XML, this stops my custom transformer from overriding OpenOffice.

public boolean isTransformable(String sourceMimetype, String targetMimetype, TransformationOptions options)
     {
        return targetMimetype.equals(MimetypeMap.MIMETYPE_XML);
     }

This works for the moment. But if I have another bit of code that transforms files to XML, then how could I choose between the two transformers?

Ideally, my first transformer would not be a transformer, as it generates a document containing technical metadata about the first document, rather than being a more normal transform. I couldn't find another kind of action that would give me a target node into which I could dump output from an action. Is there a better choice of action?

mrogers
Star Contributor
Star Contributor
Perhaps you should be creating renditions rather than using the transformation framework.

Or you could just have two actions.  Convert to A, Convert to B. that are kicked off either manually or automatically ?  

It sounds like you are abusing the transformation framework which should be used for converstion between different mime types.

Does your source document change from time to time and if it does what do you expect to happen?