mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Allow Tika powered transformers to customise the ParseContext, eg to enable recursion (which is off by default)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22858 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -150,6 +150,14 @@ public abstract class TikaPoweredContentTransformer extends AbstractContentTrans
|
||||
return handler;
|
||||
}
|
||||
|
||||
/**
|
||||
* By default returns a ParseContent that does not recurse
|
||||
*/
|
||||
protected ParseContext buildParseContext(Metadata metadata, String targetMimeType, TransformationOptions options)
|
||||
{
|
||||
return new ParseContext();
|
||||
}
|
||||
|
||||
public void transformInternal(ContentReader reader, ContentWriter writer, TransformationOptions options)
|
||||
throws Exception
|
||||
{
|
||||
@@ -162,7 +170,8 @@ public abstract class TikaPoweredContentTransformer extends AbstractContentTrans
|
||||
|
||||
Parser parser = getParser();
|
||||
Metadata metadata = new Metadata();
|
||||
ParseContext context = new ParseContext();
|
||||
|
||||
ParseContext context = buildParseContext(metadata, targetMimeType, options);
|
||||
|
||||
ContentHandler handler = getContentHandler(targetMimeType, ow);
|
||||
if(handler == null)
|
||||
|
Reference in New Issue
Block a user