mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
MNT-16181 transformations for application/dita+xml
- StringExtractor is now able to extract text so searching is now working, which was the main reason for this Customer issue. - PdfBox.TextToPdf is now able to transform .dita fiels to .pdf. As a result it is also possible to preview the files (although the xml tags are visible) and to generate .png thumbnails using the complex.Text.Image transformer (which has an intermediate .pdf stage). - As expected TikaAuto (or our patched 1.6 version) does not know about the DITA mimetype application/dita+xml so is not claiming to transform this type even though it is just an XML file. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@130609 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -71,7 +71,8 @@ public class StringExtractingContentTransformer extends AbstractContentTransform
|
||||
// conversions from any plain text format are very reliable
|
||||
return true;
|
||||
}
|
||||
else if (sourceMimetype.startsWith(PREFIX_TEXT))
|
||||
else if (sourceMimetype.startsWith(PREFIX_TEXT) ||
|
||||
sourceMimetype.equals(MimetypeMap.MIMETYPE_DITA))
|
||||
{
|
||||
// the source is text, but probably with some kind of markup
|
||||
return true;
|
||||
@@ -88,7 +89,7 @@ public class StringExtractingContentTransformer extends AbstractContentTransform
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(super.getComments(available));
|
||||
sb.append("# Only supports transformation of js and mimetypes starting with \"");
|
||||
sb.append("# Only supports transformation of js, dita and mimetypes starting with \"");
|
||||
sb.append(PREFIX_TEXT);
|
||||
sb.append("\" to txt.\n");
|
||||
return sb.toString();
|
||||
|
@@ -113,6 +113,7 @@ public class TextToPdfContentTransformer extends AbstractContentTransformer2
|
||||
{
|
||||
if ( (!MimetypeMap.MIMETYPE_TEXT_PLAIN.equals(sourceMimetype) &&
|
||||
!MimetypeMap.MIMETYPE_TEXT_CSV.equals(sourceMimetype) &&
|
||||
!MimetypeMap.MIMETYPE_DITA.equals(sourceMimetype) &&
|
||||
!MimetypeMap.MIMETYPE_XML.equals(sourceMimetype) ) ||
|
||||
!MimetypeMap.MIMETYPE_PDF.equals(targetMimetype))
|
||||
{
|
||||
@@ -129,7 +130,8 @@ public class TextToPdfContentTransformer extends AbstractContentTransformer2
|
||||
public String getComments(boolean available)
|
||||
{
|
||||
return getCommentsOnlySupports(
|
||||
Arrays.asList(new String[] {MimetypeMap.MIMETYPE_TEXT_PLAIN, MimetypeMap.MIMETYPE_TEXT_CSV, MimetypeMap.MIMETYPE_XML}),
|
||||
Arrays.asList(new String[] {MimetypeMap.MIMETYPE_TEXT_PLAIN, MimetypeMap.MIMETYPE_TEXT_CSV,
|
||||
MimetypeMap.MIMETYPE_DITA, MimetypeMap.MIMETYPE_XML}),
|
||||
Arrays.asList(new String[] {MimetypeMap.MIMETYPE_PDF}), available);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user