AnsweredAssumed Answered

What parameters to pass while using 'compare-mime-type'

Question asked by sanket on Sep 13, 2010
Hi, I want to create a rule programmatically with 1) Condition -> Items with mime-type of Plain Text  2) Tranform to PDF 3) Inbound.

I am not getting how to overcome the 1st step.

ActionCondition actionCondition = getActionService().createActionCondition("compare-mime-type");
        actionCondition.setParameterValue(CompareMimeTypeEvaluator.NAME,ContentModel.TYPE_CONTENT);
        actionCondition.setParameterValue(CompareMimeTypeEvaluator.PARAM_PROPERTY,ContentModel.PROP_CONTENT);
        actionCondition.setParameterValue(CompareMimeTypeEvaluator.PARAM_CONTENT_PROPERTY,MimetypeMap.MIMETYPE_TEXT_PLAIN);
        actionCondition.setParameterValue("type",MimetypeMap.MIMETYPE_TEXT_PLAIN);
        compositeAction.addActionCondition(actionCondition);

I also tried using 'text/plain" instead of MimetypeMap.MIMETYPE_TEXT_PLAIN. But the rule created in my space shows - "Item has a mimetype of null".
Can anyone please help ?
What mistake am I making ?

Thanks in advance,
Sanket.

Outcomes