AnsweredAssumed Answered

Custom Transformer

Question asked by enkidu on Dec 1, 2013
Latest reply on Dec 3, 2013 by enkidu
hi mates.. need some help.. i want to write a transfomer who converts from xml to xml using xslt.. so i wrote a transformer shown below.. and i register it in an *-context.xml file also shown below. but it didnt show up in the alfresco explorer? what im missing?


package org.test;

import java.util.Map;

import org.alfresco.repo.content.transform.AbstractContentTransformer2;
import org.alfresco.service.cmr.repository.ContentReader;
import org.alfresco.service.cmr.repository.ContentWriter;
import org.alfresco.service.cmr.repository.TransformationOptions;

public class DefaultTransformer extends AbstractContentTransformer2 {

   private static final String NAME = "transformer.defaultTransformer";

   @Override
   public boolean isTransformable(String arg0, String arg1,
         TransformationOptions arg2) {
      // TODO Auto-generated method stub
      return true;
   }

   @Override
   protected void transformInternal(ContentReader arg0, ContentWriter arg1,
         TransformationOptions arg2) throws Exception {
      // TODO Auto-generated method stub
      
   }


}



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

<beans>
     
    <!– Logger Action Bean –>

    <bean id="transformer.defaultTransformer" class="org.test.DefaultTransformer" parent="baseContentTransformer" />
     
</beans>

Outcomes