small fop changes
This commit is contained in:
@@ -32,17 +32,17 @@ import org.w3c.dom.Document;
|
||||
|
||||
public class ApacheFOPHeroldTest {
|
||||
private String[] inputUrls = {// @formatter:off
|
||||
"http://www.baeldung.com/2011/10/20/bootstraping-a-web-application-with-spring-3-1-and-java-based-configuration-part-1/",
|
||||
"http://www.baeldung.com/2011/10/20/bootstraping-a-web-application-with-spring-3-1-and-java-based-configuration-part-1/",
|
||||
// "http://www.baeldung.com/2011/10/25/building-a-restful-web-service-with-spring-3-1-and-java-based-configuration-part-2/",
|
||||
// "http://www.baeldung.com/2011/10/31/securing-a-restful-web-service-with-spring-security-3-1-part-3/",
|
||||
"http://www.baeldung.com/spring-security-basic-authentication",
|
||||
// "http://www.baeldung.com/2011/10/31/securing-a-restful-web-service-with-spring-security-3-1-part-3/",
|
||||
// "http://www.baeldung.com/spring-security-basic-authentication",
|
||||
// "http://www.baeldung.com/spring-security-digest-authentication",
|
||||
//"http://www.baeldung.com/2011/11/20/basic-and-digest-authentication-for-a-restful-service-with-spring-security-3-1/",
|
||||
//"http://www.baeldung.com/spring-httpmessageconverter-rest",
|
||||
//"http://www.baeldung.com/2011/11/06/restful-web-service-discoverability-part-4/",
|
||||
//"http://www.baeldung.com/2011/11/13/rest-service-discoverability-with-spring-part-5/",
|
||||
//"http://www.baeldung.com/2013/01/11/etags-for-rest-with-spring/",
|
||||
"http://www.baeldung.com/2012/01/18/rest-pagination-in-spring/",
|
||||
// "http://www.baeldung.com/2012/01/18/rest-pagination-in-spring/",
|
||||
//"http://inprogress.baeldung.com/?p=1430",
|
||||
//"http://www.baeldung.com/2013/01/31/exception-handling-for-rest-with-spring-3-2/",
|
||||
//"http://www.baeldung.com/rest-versioning",
|
||||
@@ -68,7 +68,7 @@ public class ApacheFOPHeroldTest {
|
||||
|
||||
// UTIL
|
||||
|
||||
private void fromHTMLTOXMLUsingHerold(final String input, boolean append) throws Exception {
|
||||
private void fromHTMLTOXMLUsingHerold(final String input, final boolean append) throws Exception {
|
||||
Script script;
|
||||
final TrafoScriptManager mgr = new TrafoScriptManager();
|
||||
final File profileFile = new File("src/test/resources/default.her");
|
||||
@@ -87,7 +87,7 @@ public class ApacheFOPHeroldTest {
|
||||
return (Document) result.getNode();
|
||||
}
|
||||
|
||||
private void fromFODocumentToPDF(Document fo, final String outputFile) throws Exception {
|
||||
private void fromFODocumentToPDF(final Document fo, final String outputFile) throws Exception {
|
||||
final FopFactory fopFactory = FopFactory.newInstance();
|
||||
final OutputStream outStream = new BufferedOutputStream(new FileOutputStream(new File(outputFile)));
|
||||
|
||||
@@ -112,10 +112,10 @@ public class ApacheFOPHeroldTest {
|
||||
final URL url = new URL(input);
|
||||
return url.openStream();
|
||||
}
|
||||
|
||||
private void fixXML(String input, String output) throws IOException{
|
||||
BufferedReader reader = new BufferedReader(new FileReader(input));
|
||||
FileWriter writer = new FileWriter(output);
|
||||
|
||||
private void fixXML(final String input, final String output) throws IOException{
|
||||
final BufferedReader reader = new BufferedReader(new FileReader(input));
|
||||
final FileWriter writer = new FileWriter(output);
|
||||
String line = reader.readLine();
|
||||
int count = 0;
|
||||
while(line != null){
|
||||
@@ -124,9 +124,9 @@ public class ApacheFOPHeroldTest {
|
||||
}
|
||||
else if(!((line.startsWith("<?xml") || line.startsWith("<article") || line.startsWith("</article")) && count > 4)){
|
||||
writer.write(line.replaceAll("xml:id=\"", "xml:id=\""+count));
|
||||
}
|
||||
}
|
||||
writer.write("\n");
|
||||
|
||||
|
||||
line = reader.readLine();
|
||||
count++;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user