mirror of
https://github.com/Alfresco/alfresco-transform-core.git
synced 2025-08-14 17:58:27 +00:00
REPO-3626: changes after review.
This commit is contained in:
@@ -527,10 +527,10 @@ public class Tika
|
|||||||
{
|
{
|
||||||
targetMimetype = getValue(arg, true, targetMimetype, TARGET_MIMETYPE);
|
targetMimetype = getValue(arg, true, targetMimetype, TARGET_MIMETYPE);
|
||||||
}
|
}
|
||||||
else if(arg.startsWith(NOT_EXTRACT_BOOKMARKS_TEXT))
|
else if (arg.startsWith(NOT_EXTRACT_BOOKMARKS_TEXT))
|
||||||
{
|
{
|
||||||
getValue(arg, false, notExtractBookmarksText, NOT_EXTRACT_BOOKMARKS_TEXT);
|
getValue(arg, false, notExtractBookmarksText, NOT_EXTRACT_BOOKMARKS_TEXT);
|
||||||
notExtractBookmarksText = true;
|
notExtractBookmarksText = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -564,7 +564,7 @@ public class Tika
|
|||||||
includeContents = includeContents == null ? false : includeContents;
|
includeContents = includeContents == null ? false : includeContents;
|
||||||
notExtractBookmarksText = notExtractBookmarksText == null ? false : notExtractBookmarksText;
|
notExtractBookmarksText = notExtractBookmarksText == null ? false : notExtractBookmarksText;
|
||||||
|
|
||||||
transform(transform, includeContents, notExtractBookmarksText,sourceFilename, targetFilename, targetMimetype, targetEncoding);
|
transform(transform, includeContents, notExtractBookmarksText, sourceFilename, targetFilename, targetMimetype, targetEncoding);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getValue(String arg, boolean valueExpected, Object value, String optionName)
|
private String getValue(String arg, boolean valueExpected, Object value, String optionName)
|
||||||
@@ -801,14 +801,9 @@ public class Tika
|
|||||||
context.set(DocumentSelector.class, documentSelector);
|
context.set(DocumentSelector.class, documentSelector);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pdfParserConfig != null)
|
if (notExtractBookmarksText.equals(true))
|
||||||
{
|
{
|
||||||
|
pdfParserConfig.setExtractBookmarksText(false);
|
||||||
if (notExtractBookmarksText != null)
|
|
||||||
{
|
|
||||||
pdfParserConfig.setExtractBookmarksText(!notExtractBookmarksText);
|
|
||||||
}
|
|
||||||
|
|
||||||
// pdfParserConfig is set to override default settings
|
// pdfParserConfig is set to override default settings
|
||||||
context.set(PDFParserConfig.class, pdfParserConfig);
|
context.set(PDFParserConfig.class, pdfParserConfig);
|
||||||
}
|
}
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
<tr><td><div style="text-align:right">timeout</div></td><td><input type="text" name="timeout" value="" /></td></tr>
|
<tr><td><div style="text-align:right">timeout</div></td><td><input type="text" name="timeout" value="" /></td></tr>
|
||||||
<tr><td><div style="text-align:right">testDelay</div></td><td><input type="text" name="testDelay" value="" /></td></tr>
|
<tr><td><div style="text-align:right">testDelay</div></td><td><input type="text" name="testDelay" value="" /></td></tr>
|
||||||
<tr><td><div style="text-align:right">notExtractBookmarksText</div></td><td><input type="checkbox" name="notExtractBookmarksText" value="true" /></td></tr>
|
<tr><td><div style="text-align:right">notExtractBookmarksText</div></td><td><input type="checkbox" name="notExtractBookmarksText" value="true" /></td></tr>
|
||||||
<tr><td></td><td><input type="submit" value="Transform" /></td></tr>
|
<tr><td></td><td><input type="submit" value="Transform" /></td></tr>
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -345,7 +345,6 @@ public class TikaControllerTest extends AbstractTransformerControllerTest
|
|||||||
@Test
|
@Test
|
||||||
public void pdfToTxtExtractBookmarksTest() throws Exception
|
public void pdfToTxtExtractBookmarksTest() throws Exception
|
||||||
{
|
{
|
||||||
|
|
||||||
super.mockTransformCommand(controller, PDF, TXT, MIMETYPE_PDF, true);
|
super.mockTransformCommand(controller, PDF, TXT, MIMETYPE_PDF, true);
|
||||||
mockMvc.perform(mockMvcRequest("/transform", sourceFile, "targetExtension", targetExtension).param("notExtractBookmarksText", "true"))
|
mockMvc.perform(mockMvcRequest("/transform", sourceFile, "targetExtension", targetExtension).param("notExtractBookmarksText", "true"))
|
||||||
.andExpect(status().is(200))
|
.andExpect(status().is(200))
|
||||||
|
Reference in New Issue
Block a user