12-01-2013 01:56 PM
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>
12-02-2013 02:03 AM
12-02-2013 05:06 AM
<bean id="defaultTransformer-messages" class="org.alfresco.i18n.ResourceBundleBootstrapComponent">
<property name="resourceBundles">
<list>
<value>org.test.defaultTransformer</value>
</list>
</property>
</bean>
12-03-2013 09:23 AM
12-03-2013 12:20 PM
public class CustomTransformer extends AbstractContentTransformer2 {
private static final String NAME = "transformer.sXML";
Logger log = Logger.getLogger(CustomTransformer.class);
@Override
protected void transformInternal(ContentReader reader, ContentWriter writer,
TransformationOptions options) throws Exception {
// TODO Auto-generated method stub
}
@Override
public boolean isTransformableMimetype(String sourceMimetype, String targetMimetype, TransformationOptions options) {
return true;
}
}
<alfresco-config area="mimetype-map">
<config evaluator="string-compare" condition="Mimetype Map">
<mimetypes>
<mimetype mimetype="application/sxml" display="sXML Mimetype">
<extension>sxml</extension>
</mimetype>
</mimetypes>
</config>
</alfresco-config>
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="transformer.sXML" class="org.test.CustomTransformer" parent="baseContentTransformer" />
</beans>
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.