mirror of
https://github.com/Alfresco/alfresco-transform-core.git
synced 2025-08-21 18:08:37 +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);
|
||||
}
|
||||
else if(arg.startsWith(NOT_EXTRACT_BOOKMARKS_TEXT))
|
||||
else if (arg.startsWith(NOT_EXTRACT_BOOKMARKS_TEXT))
|
||||
{
|
||||
getValue(arg, false, notExtractBookmarksText, NOT_EXTRACT_BOOKMARKS_TEXT);
|
||||
notExtractBookmarksText = true;
|
||||
getValue(arg, false, notExtractBookmarksText, NOT_EXTRACT_BOOKMARKS_TEXT);
|
||||
notExtractBookmarksText = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -564,7 +564,7 @@ public class Tika
|
||||
includeContents = includeContents == null ? false : includeContents;
|
||||
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)
|
||||
@@ -801,14 +801,9 @@ public class Tika
|
||||
context.set(DocumentSelector.class, documentSelector);
|
||||
}
|
||||
|
||||
if (pdfParserConfig != null)
|
||||
if (notExtractBookmarksText.equals(true))
|
||||
{
|
||||
|
||||
if (notExtractBookmarksText != null)
|
||||
{
|
||||
pdfParserConfig.setExtractBookmarksText(!notExtractBookmarksText);
|
||||
}
|
||||
|
||||
pdfParserConfig.setExtractBookmarksText(false);
|
||||
// pdfParserConfig is set to override default settings
|
||||
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">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></td><td><input type="submit" value="Transform" /></td></tr>
|
||||
<tr><td></td><td><input type="submit" value="Transform" /></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
@@ -345,7 +345,6 @@ public class TikaControllerTest extends AbstractTransformerControllerTest
|
||||
@Test
|
||||
public void pdfToTxtExtractBookmarksTest() throws Exception
|
||||
{
|
||||
|
||||
super.mockTransformCommand(controller, PDF, TXT, MIMETYPE_PDF, true);
|
||||
mockMvc.perform(mockMvcRequest("/transform", sourceFile, "targetExtension", targetExtension).param("notExtractBookmarksText", "true"))
|
||||
.andExpect(status().is(200))
|
||||
|
Reference in New Issue
Block a user