Hi every body , I have some problem with my custom extractor : This is my code : One class MyExtracter :
public class MyExtracter extends AbstractMappingMetadataExtracter {
private static final String KEY_CUSTOM = "N_CMDE";
public static String[] SUPPORTED_MIMETYPES = new String[] {
MimetypeMap.MIMETYPE_TEXT_PLAIN
};
public BWTExtracter() {
super(new HashSet<String>(Arrays.asList(SUPPORTED_MIMETYPES)));
}
@Override
protected Map<String, Serializable> extractRaw(ContentReader reader)
throws Throwable {
Map<String, Serializable> rawProperties = newRawMap();
InputStream in=reader.getContentInputStream();
String myString = IOUtils.toString(in, "UTF-8");
putRawValue(KEY_CUSTOM, myString, rawProperties);
in.close();
return rawProperties;
}
}
My properties file :
# Namespaces
namespace.prefix.company=http://www.company.com/model/content/1.0
# Mappings
N_CMDE=company:N_CMDE
Change the <WEB-INF>/classes/alfresco/content-services-context.xml file :
<bean id="fr.company.MyExtracter"
class="fr.company.MyExtracter"
parent="baseMetadataExtracter" />
when i run this and add a custom content that correspond this extraction , the method extractRaw are executed (I verify this with a debugger from eclipse) and the method return a Map with the custom properties and here value .But the value of custom property in the screen is always blanc ..Do you have any idea ??Thanks