From a5a311136f0486ad82d2b7076a94f26637df720f Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Sun, 21 Nov 2021 16:01:52 +0100 Subject: [PATCH 01/14] chore: push updates --- w2phtml.update.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/w2phtml.update.xml b/w2phtml.update.xml index 5623331..50f4f29 100644 --- a/w2phtml.update.xml +++ b/w2phtml.update.xml @@ -2,9 +2,9 @@ - + - + From 63de83dad14340b6195cb2a54ecd81786bebbb10 Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Sun, 21 Nov 2021 16:07:36 +0100 Subject: [PATCH 02/14] chore: Gitlab build fix --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9c99e55..0bcd6f4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: gradle:alpine +image: gradle:jdk11-alpine stages: - build From 9fae6961225e814e1ce2e781707d127cbd61b377 Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Thu, 25 Nov 2021 23:28:57 +0100 Subject: [PATCH 03/14] chore: removed unused files --- idl/XBatchConverter.idl | 52 ----------- idl/org/libreoffice/example/Writer2latex.idl | 12 --- idl/org/libreoffice/example/XWriter2latex.idl | 11 --- .../libreoffice/example/XWriter2latex.java | 13 --- .../example/XWriter2latexHelper.java | 85 ------------------ .../example/XWriter2latexHolder.java | 38 -------- .../example/XWriter2latexOperations.java | 13 --- .../example/_XWriter2latexStub.java | 50 ----------- .../writer2latex/XW2LStarMathConverter.class | Bin 557 -> 0 bytes .../da/writer2xhtml/XBatchConverter.class | Bin 564 -> 0 bytes .../da/writer2xhtml/XBatchHandler.class | Bin 734 -> 0 bytes idl/writer2xhtml.rdb | Bin 16384 -> 0 bytes .../writer2latex/XW2LStarMathConverter.idl | 22 ----- src/main/idl/writer2latex/writer2latex.rdb | Bin 8192 -> 0 bytes 14 files changed, 296 deletions(-) delete mode 100644 idl/XBatchConverter.idl delete mode 100644 idl/org/libreoffice/example/Writer2latex.idl delete mode 100644 idl/org/libreoffice/example/XWriter2latex.idl delete mode 100644 idl/org/libreoffice/example/org/libreoffice/example/XWriter2latex.java delete mode 100644 idl/org/libreoffice/example/org/libreoffice/example/XWriter2latexHelper.java delete mode 100644 idl/org/libreoffice/example/org/libreoffice/example/XWriter2latexHolder.java delete mode 100644 idl/org/libreoffice/example/org/libreoffice/example/XWriter2latexOperations.java delete mode 100644 idl/org/libreoffice/example/org/libreoffice/example/_XWriter2latexStub.java delete mode 100644 idl/org/openoffice/da/writer2latex/XW2LStarMathConverter.class delete mode 100644 idl/org/openoffice/da/writer2xhtml/XBatchConverter.class delete mode 100644 idl/org/openoffice/da/writer2xhtml/XBatchHandler.class delete mode 100644 idl/writer2xhtml.rdb delete mode 100644 src/main/idl/writer2latex/XW2LStarMathConverter.idl delete mode 100644 src/main/idl/writer2latex/writer2latex.rdb diff --git a/idl/XBatchConverter.idl b/idl/XBatchConverter.idl deleted file mode 100644 index cd8f72e..0000000 --- a/idl/XBatchConverter.idl +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef __org_openoffice_da_writer2xhtml_XBatchConverter_idl__ -#define __org_openoffice_da_writer2xhtml_XBatchConverter_idl__ -#include -#include - -module org { module openoffice { module da { module writer2xhtml { - -// This interface is an IDL version of the java interface (writer2latex.api.BatchHandler) -interface XBatchHandler : com::sun::star::uno::XInterface -{ - - // method org::openoffice::da::writer2xhtml::XBatchHandler::startConversion - void startConversion (); - - // method org::openoffice::da::writer2xhtml::XBatchHandler::endConversion - void endConversion (); - - // method org::openoffice::da::writer2xhtml::XBatchHandler::startDirectory - void startDirectory ( [in] string sName ); - - // method org::openoffice::da::writer2xhtml::XBatchHandler::endDirectory - void endDirectory ( [in] string sName, [in] boolean bSuccess ); - - // method org::openoffice::da::writer2xhtml::XBatchHandler::startFile - void startFile ( [in] string sName ); - - // method org::openoffice::da::writer2xhtml::XBatchHandler::endFile - void endFile ( [in] string sName, [in] boolean bSuccess ); - - // method org::openoffice::da::writer2xhtml::XBatchHandler::cancel - boolean cancel (); - -}; - -// This interface is an IDL version of the java interface (writer2latex.api.BatchConverter) -interface XBatchConverter : com::sun::star::uno::XInterface -{ - - // method org::openoffice::da::writer2xhtml::XBatchConverter::convert - void convert ( [in] string sSourceURL, - [in] string sTargetURL, - [in] sequence< com::sun::star::beans::PropertyValue > lArguments, - [in] XBatchHandler handler ); - -} ; - - -}; }; }; }; - -#endif - - \ No newline at end of file diff --git a/idl/org/libreoffice/example/Writer2latex.idl b/idl/org/libreoffice/example/Writer2latex.idl deleted file mode 100644 index c93c1b5..0000000 --- a/idl/org/libreoffice/example/Writer2latex.idl +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef __org_libreoffice_example_writer2latex_idl__ -#define __org_libreoffice_example_writer2latex_idl__ - -#include -module org { module libreoffice { module example { - - service Writer2latex : org::libreoffice::example::XWriter2latex { - - }; - - }; }; }; -#endif diff --git a/idl/org/libreoffice/example/XWriter2latex.idl b/idl/org/libreoffice/example/XWriter2latex.idl deleted file mode 100644 index 53f10c7..0000000 --- a/idl/org/libreoffice/example/XWriter2latex.idl +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef __org_libreoffice_example_xwriter2latex_idl__ -#define __org_libreoffice_example_xwriter2latex_idl__ - -module org { module libreoffice { module example { - - interface XWriter2latex { - - }; - - }; }; }; -#endif diff --git a/idl/org/libreoffice/example/org/libreoffice/example/XWriter2latex.java b/idl/org/libreoffice/example/org/libreoffice/example/XWriter2latex.java deleted file mode 100644 index 3ddf6fd..0000000 --- a/idl/org/libreoffice/example/org/libreoffice/example/XWriter2latex.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.libreoffice.example; - - -/** -* org/libreoffice/example/XWriter2latex.java . -* Generated by the IDL-to-Java compiler (portable), version "3.2" -* from XWriter2latex.idl -* Friday, 7 July 2017 12:51:34 o'clock MSK -*/ - -public interface XWriter2latex extends XWriter2latexOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity -{ -} // interface XWriter2latex diff --git a/idl/org/libreoffice/example/org/libreoffice/example/XWriter2latexHelper.java b/idl/org/libreoffice/example/org/libreoffice/example/XWriter2latexHelper.java deleted file mode 100644 index 91f682b..0000000 --- a/idl/org/libreoffice/example/org/libreoffice/example/XWriter2latexHelper.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.libreoffice.example; - - -/** -* org/libreoffice/example/XWriter2latexHelper.java . -* Generated by the IDL-to-Java compiler (portable), version "3.2" -* from XWriter2latex.idl -* Friday, 7 July 2017 12:51:34 o'clock MSK -*/ - -abstract public class XWriter2latexHelper -{ - private static String _id = "IDL:org/libreoffice/example/XWriter2latex:1.0"; - - public static void insert (org.omg.CORBA.Any a, org.libreoffice.example.XWriter2latex that) - { - org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); - a.type (type ()); - write (out, that); - a.read_value (out.create_input_stream (), type ()); - } - - public static org.libreoffice.example.XWriter2latex extract (org.omg.CORBA.Any a) - { - return read (a.create_input_stream ()); - } - - private static org.omg.CORBA.TypeCode __typeCode = null; - synchronized public static org.omg.CORBA.TypeCode type () - { - if (__typeCode == null) - { - __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (org.libreoffice.example.XWriter2latexHelper.id (), "XWriter2latex"); - } - return __typeCode; - } - - public static String id () - { - return _id; - } - - public static org.libreoffice.example.XWriter2latex read (org.omg.CORBA.portable.InputStream istream) - { - return narrow (istream.read_Object (_XWriter2latexStub.class)); - } - - public static void write (org.omg.CORBA.portable.OutputStream ostream, org.libreoffice.example.XWriter2latex value) - { - ostream.write_Object ((org.omg.CORBA.Object) value); - } - - public static org.libreoffice.example.XWriter2latex narrow (org.omg.CORBA.Object obj) - { - if (obj == null) - return null; - else if (obj instanceof org.libreoffice.example.XWriter2latex) - return (org.libreoffice.example.XWriter2latex)obj; - else if (!obj._is_a (id ())) - throw new org.omg.CORBA.BAD_PARAM (); - else - { - org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate (); - org.libreoffice.example._XWriter2latexStub stub = new org.libreoffice.example._XWriter2latexStub (); - stub._set_delegate(delegate); - return stub; - } - } - - public static org.libreoffice.example.XWriter2latex unchecked_narrow (org.omg.CORBA.Object obj) - { - if (obj == null) - return null; - else if (obj instanceof org.libreoffice.example.XWriter2latex) - return (org.libreoffice.example.XWriter2latex)obj; - else - { - org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate (); - org.libreoffice.example._XWriter2latexStub stub = new org.libreoffice.example._XWriter2latexStub (); - stub._set_delegate(delegate); - return stub; - } - } - -} diff --git a/idl/org/libreoffice/example/org/libreoffice/example/XWriter2latexHolder.java b/idl/org/libreoffice/example/org/libreoffice/example/XWriter2latexHolder.java deleted file mode 100644 index c4fb96b..0000000 --- a/idl/org/libreoffice/example/org/libreoffice/example/XWriter2latexHolder.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.libreoffice.example; - -/** -* org/libreoffice/example/XWriter2latexHolder.java . -* Generated by the IDL-to-Java compiler (portable), version "3.2" -* from XWriter2latex.idl -* Friday, 7 July 2017 12:51:34 o'clock MSK -*/ - -public final class XWriter2latexHolder implements org.omg.CORBA.portable.Streamable -{ - public org.libreoffice.example.XWriter2latex value = null; - - public XWriter2latexHolder () - { - } - - public XWriter2latexHolder (org.libreoffice.example.XWriter2latex initialValue) - { - value = initialValue; - } - - public void _read (org.omg.CORBA.portable.InputStream i) - { - value = org.libreoffice.example.XWriter2latexHelper.read (i); - } - - public void _write (org.omg.CORBA.portable.OutputStream o) - { - org.libreoffice.example.XWriter2latexHelper.write (o, value); - } - - public org.omg.CORBA.TypeCode _type () - { - return org.libreoffice.example.XWriter2latexHelper.type (); - } - -} diff --git a/idl/org/libreoffice/example/org/libreoffice/example/XWriter2latexOperations.java b/idl/org/libreoffice/example/org/libreoffice/example/XWriter2latexOperations.java deleted file mode 100644 index b9d88e6..0000000 --- a/idl/org/libreoffice/example/org/libreoffice/example/XWriter2latexOperations.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.libreoffice.example; - - -/** -* org/libreoffice/example/XWriter2latexOperations.java . -* Generated by the IDL-to-Java compiler (portable), version "3.2" -* from XWriter2latex.idl -* Friday, 7 July 2017 12:51:34 o'clock MSK -*/ - -public interface XWriter2latexOperations -{ -} // interface XWriter2latexOperations diff --git a/idl/org/libreoffice/example/org/libreoffice/example/_XWriter2latexStub.java b/idl/org/libreoffice/example/org/libreoffice/example/_XWriter2latexStub.java deleted file mode 100644 index be92938..0000000 --- a/idl/org/libreoffice/example/org/libreoffice/example/_XWriter2latexStub.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.libreoffice.example; - - -/** -* org/libreoffice/example/_XWriter2latexStub.java . -* Generated by the IDL-to-Java compiler (portable), version "3.2" -* from XWriter2latex.idl -* Friday, 7 July 2017 12:51:34 o'clock MSK -*/ - -public class _XWriter2latexStub extends org.omg.CORBA.portable.ObjectImpl implements org.libreoffice.example.XWriter2latex -{ - - // Type-specific CORBA::Object operations - private static String[] __ids = { - "IDL:org/libreoffice/example/XWriter2latex:1.0"}; - - public String[] _ids () - { - return (String[])__ids.clone (); - } - - private void readObject (java.io.ObjectInputStream s) throws java.io.IOException - { - String str = s.readUTF (); - String[] args = null; - java.util.Properties props = null; - org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props); - try { - org.omg.CORBA.Object obj = orb.string_to_object (str); - org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate (); - _set_delegate (delegate); - } finally { - orb.destroy() ; - } - } - - private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException - { - String[] args = null; - java.util.Properties props = null; - org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props); - try { - String str = orb.object_to_string (this); - s.writeUTF (str); - } finally { - orb.destroy() ; - } - } -} // class _XWriter2latexStub diff --git a/idl/org/openoffice/da/writer2latex/XW2LStarMathConverter.class b/idl/org/openoffice/da/writer2latex/XW2LStarMathConverter.class deleted file mode 100644 index 20fc93e303a05aabb57eae701b0e6360924ca8a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 557 zcma)3TT8<*6#ioC+RZuVb>1FDRuCh@H^momP}rO>Z^NgoOS?*!NS1l|S>l7B=nwEm ziCI-d6ftnfcg}a=guJ{yJOfzAGQp-)5tSEQ$S{lpPCJZVsaSJWNtou>^z@`sYig$I zOm}ysxa7)k4hTW|D|DCwaAz5!cikN+thj1#Q=t*vw2m7ULQ2NNzFg3NX-V!cC9`sKyG?;Ync zh3OoMm~oNKV+{E$Mo=Pfw}a%vYn8oY0()0>c!n6(h6y&cFqE55wQK?hE@18~a%Pe< p+@et|8N4xM%vl+ILZM|nqS%_6w5)r~Hd}Vu&Dm*phxyx7i8qB!lV<<` diff --git a/idl/org/openoffice/da/writer2xhtml/XBatchConverter.class b/idl/org/openoffice/da/writer2xhtml/XBatchConverter.class deleted file mode 100644 index a10c1c05ba944a8d7747853b2c80c4cacae2cb1e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 564 zcma)3T}whi6rA;%*RRa1wCJseP>7a#ReDH@E|>xAAKo?=!>|cL1y6YTfFSe3 z_c%_j7Dp1xQ6!LxBZ6oI0jv^)3$Fj(Xl18Q3>IaRhlr^LVO-7Kn99w@13|L|gbj)! jjf|h*WP7ym31*8m|x!d({aZXQVrHhV`z<+ zWD8fw4oh9#72K4$AfVP$WkH&#ROId}4hd%Vw!6E%_iy6u%`QRb!`5HpPrM)2(aloU7Zvj44pC(KZ1ziU%0Fi?VET`Fl_611Ar^7Ffi{*H z>I@BrkfF)YVu(V_;YJ#cCcr$6xyGH`F2ZSfQ|KOY+%N5 zh*=k#Q*KQ;!gcFx;HlNyh1h&jI_)!x=r_#wysv2Y=5Bf3XWZH8`Ht@T71bQwt5p;@ dx*t?T9X+5GF-H$sMNuVv6jj;_JUMqQ@e627v9kaG diff --git a/idl/writer2xhtml.rdb b/idl/writer2xhtml.rdb deleted file mode 100644 index ba0a1894514515a1c5b598f94f9345942352a84e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16384 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 LLC>D$92x%)p)-t- diff --git a/src/main/idl/writer2latex/XW2LStarMathConverter.idl b/src/main/idl/writer2latex/XW2LStarMathConverter.idl deleted file mode 100644 index c66f048..0000000 --- a/src/main/idl/writer2latex/XW2LStarMathConverter.idl +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef __org_openoffice_da_writer2latex_XW2LStarMathConverter_idl__ -#define __org_openoffice_da_writer2latex_XW2LStarMathConverter_idl__ -#include - -module org { module openoffice { module da { module writer2latex { - -interface XW2LStarMathConverter : com::sun::star::uno::XInterface -{ - - // method org::openoffice::da::writer2latex::XW2LStarMathConverter::convertFormula - string convertFormula ( [in] string sStarMathFormula ); - - // method org::openoffice::da::writer2latex::XW2LStarMathConverter::getPreamble - string getPreamble ( ); - -}; - -}; }; }; }; - -#endif - - \ No newline at end of file diff --git a/src/main/idl/writer2latex/writer2latex.rdb b/src/main/idl/writer2latex/writer2latex.rdb deleted file mode 100644 index df61666d3265239b26f3352434e62f5077031fd8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8192 zcmZ<`_Vw88>8{Qo$H2hA1cYe7nSeZ+@=@*(3jrl&$q3Pt6|LZyXL`W!9|}O;P~e-b zcjeOMO0bt$ARcowujY@7E#_d5fberPujzsLdI zU*iJ}1`dS!hmP-37-S%PR@qJMU_KW@K2h{@IfD>{KTA-&2ka&`g#3}8D%%*OApF3) zE7HMy9ta;sg1iM|gXmE{Bs>%tC6ktOJ)g}0ieIJ$jL_%@ht=8r;%DIT4@?fAa2x61 zq>)WKER1MP(<7`w@o%;}(U<|0pU~p}3{S%wczy%Mf2ea1J)AVC?HG>n@4Q&(9=JS4 zi~r0P-i7e;8W{iiMd^b&Zs_5-;TZpygr<}+fa+Vc_;(Ra%7xd*p!hFH&C5?q%S=wC zM@SD&JBDNYD;&!UVF0z4(Bgjy+eR*UdkPr;DT#wKPUz{X;TZoL%U}Fq0JY!I;@{-a z(z)>VJuv>ui!w`6i;Qv-OHwQ78Rmn@uHhK}-5-92GJyJLXz?#*9WMg!zX9VvBHYL) zxFoU2H?btcIX|x~wFsCT22C zGw=YL=lX~yntn>6K5~Jrk3IJaFiTF+VvSt{@)HA-1oHTg5(7_iey)CTX`X&DFxTss z=H=^0c;*4~d|D!;2`CCu0WJsJ@{4jybHMEbUIw1xlA_E!a9;t1BMy{-l^;kNgcx|z zQ%eGhQWJBNa=>W|MHdqTD+4podCWiv8l+$Z@*$zX2NYq44J1K=W0WK@1VH`&N)_gE z@OT|s{txuOxfGQD!Q*$M`5zpz$7R3&p>@88nePX*5tQORA^D%d6Uc_7d?tAQ2Z=B+ zs1nNkKsDF_DE@hD3TA=FbJ5~IS}`>jKHfVT|KI?e$U9{TEPiNBI|6M4#lH Date: Thu, 25 Nov 2021 23:31:24 +0100 Subject: [PATCH 04/14] chore: removed unused files --- build.gradle | 1 - src/main/idl/readme-idl.txt | 30 ---------- .../writer2latex/XW2LStarMathConverter.class | Bin 557 -> 0 bytes src/main/idl/writer2xhtml/XBatchConverter.idl | 52 ------------------ .../da/writer2xhtml/XBatchConverter.class | Bin 564 -> 0 bytes .../da/writer2xhtml/XBatchHandler.class | Bin 734 -> 0 bytes src/main/idl/writer2xhtml/writer2xhtml.rdb | Bin 16384 -> 0 bytes 7 files changed, 83 deletions(-) delete mode 100644 src/main/idl/readme-idl.txt delete mode 100644 src/main/idl/writer2latex/org/openoffice/da/writer2latex/XW2LStarMathConverter.class delete mode 100644 src/main/idl/writer2xhtml/XBatchConverter.idl delete mode 100644 src/main/idl/writer2xhtml/org/openoffice/da/writer2xhtml/XBatchConverter.class delete mode 100644 src/main/idl/writer2xhtml/org/openoffice/da/writer2xhtml/XBatchHandler.class delete mode 100644 src/main/idl/writer2xhtml/writer2xhtml.rdb diff --git a/build.gradle b/build.gradle index 14beeda..25c0b11 100644 --- a/build.gradle +++ b/build.gradle @@ -161,7 +161,6 @@ task oxt(type: Zip){ from ('build/libs/writer2phtml.jar'){ include '*' } - from 'idl/writer2paginatedhtml.rdb' from 'releasenotes.txt' include '*' } diff --git a/src/main/idl/readme-idl.txt b/src/main/idl/readme-idl.txt deleted file mode 100644 index 6fd2f0d..0000000 --- a/src/main/idl/readme-idl.txt +++ /dev/null @@ -1,30 +0,0 @@ -This directory contains idl specifications for the custom uno interfaces -defined by the Writer2LaTeX and Writer2xhtml extensions - -To avoid dependencies on the OOo SDK in the build process, compiled versions -are included here. - -If you need to rebuild it, the complete SDK is required. These are the steps: - -To create the registry database for Writer2LaTeX: - -idlc -I\idl XW2LStarMathConverter.idl -regmerge writer2latex.rdb /UCR XW2LStarMathConverter.urd - -To create the java interface - -javamaker -BUCR -Torg.openoffice.da.writer2latex.XW2LStarMathConverter -nD \program\types.rdb writer2latex.rdb - -and likewise for Writer2xhtml: - -idlc -I\idl XBatchConverter.idl -regmerge writer2xhtml.rdb /UCR XBatchConverter.urd - -To create the java interfaces - -javamaker -BUCR -Torg.openoffice.da.writer2xhtml.XBatchConverter -nD \program\types.rdb writer2xhtml.rdb -javamaker -BUCR -Torg.openoffice.da.writer2xhtml.XBatchHandler -nD \program\types.rdb writer2xhtml.rdb - - -If you need to use the interfaces from C++ you will also need to run cppumaker - diff --git a/src/main/idl/writer2latex/org/openoffice/da/writer2latex/XW2LStarMathConverter.class b/src/main/idl/writer2latex/org/openoffice/da/writer2latex/XW2LStarMathConverter.class deleted file mode 100644 index 20fc93e303a05aabb57eae701b0e6360924ca8a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 557 zcma)3TT8<*6#ioC+RZuVb>1FDRuCh@H^momP}rO>Z^NgoOS?*!NS1l|S>l7B=nwEm ziCI-d6ftnfcg}a=guJ{yJOfzAGQp-)5tSEQ$S{lpPCJZVsaSJWNtou>^z@`sYig$I zOm}ysxa7)k4hTW|D|DCwaAz5!cikN+thj1#Q=t*vw2m7ULQ2NNzFg3NX-V!cC9`sKyG?;Ync zh3OoMm~oNKV+{E$Mo=Pfw}a%vYn8oY0()0>c!n6(h6y&cFqE55wQK?hE@18~a%Pe< p+@et|8N4xM%vl+ILZM|nqS%_6w5)r~Hd}Vu&Dm*phxyx7i8qB!lV<<` diff --git a/src/main/idl/writer2xhtml/XBatchConverter.idl b/src/main/idl/writer2xhtml/XBatchConverter.idl deleted file mode 100644 index cd8f72e..0000000 --- a/src/main/idl/writer2xhtml/XBatchConverter.idl +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef __org_openoffice_da_writer2xhtml_XBatchConverter_idl__ -#define __org_openoffice_da_writer2xhtml_XBatchConverter_idl__ -#include -#include - -module org { module openoffice { module da { module writer2xhtml { - -// This interface is an IDL version of the java interface (writer2latex.api.BatchHandler) -interface XBatchHandler : com::sun::star::uno::XInterface -{ - - // method org::openoffice::da::writer2xhtml::XBatchHandler::startConversion - void startConversion (); - - // method org::openoffice::da::writer2xhtml::XBatchHandler::endConversion - void endConversion (); - - // method org::openoffice::da::writer2xhtml::XBatchHandler::startDirectory - void startDirectory ( [in] string sName ); - - // method org::openoffice::da::writer2xhtml::XBatchHandler::endDirectory - void endDirectory ( [in] string sName, [in] boolean bSuccess ); - - // method org::openoffice::da::writer2xhtml::XBatchHandler::startFile - void startFile ( [in] string sName ); - - // method org::openoffice::da::writer2xhtml::XBatchHandler::endFile - void endFile ( [in] string sName, [in] boolean bSuccess ); - - // method org::openoffice::da::writer2xhtml::XBatchHandler::cancel - boolean cancel (); - -}; - -// This interface is an IDL version of the java interface (writer2latex.api.BatchConverter) -interface XBatchConverter : com::sun::star::uno::XInterface -{ - - // method org::openoffice::da::writer2xhtml::XBatchConverter::convert - void convert ( [in] string sSourceURL, - [in] string sTargetURL, - [in] sequence< com::sun::star::beans::PropertyValue > lArguments, - [in] XBatchHandler handler ); - -} ; - - -}; }; }; }; - -#endif - - \ No newline at end of file diff --git a/src/main/idl/writer2xhtml/org/openoffice/da/writer2xhtml/XBatchConverter.class b/src/main/idl/writer2xhtml/org/openoffice/da/writer2xhtml/XBatchConverter.class deleted file mode 100644 index 3c7d608f9e709c27a0746eb9d87cfba24fcdf0c1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 564 zcma)3TT22#7(L@|uD8stCcX6#3gJMnN)JiVf@PqI($l!k>dHDJ<7oD?qKBZUAJC7A zrW?_f1_lo2JKy=v%=hqka}S`196?d49+e|5r0)kFr(H(RRiL@rnf3KBq^&)sy?#ZC zDOZMdKnOAeHf1zqqDO0;0r#{6i(tc(Lpq)aI@V0liIBAA3e(~?;PmgPj_Q}3`d{84O ze3=mjotNbLV#EXCOWH8NHK0VW^(oD-N(V`T?Z350T=!-7-P^%@3=ToG9Ed>g5@dh) z9@i~2Q^;U3fi#v(82Y zfdqmdz>h*WP7yPrO7QIeloU7Zvj44pFU(M9ziU%0Fi?VEO)6<#5wx$EFpfKWAr^7Ffi{*H z>I@BrkfF)YVu(V_;YJ#cCcr$6xyGH`F2ZSfQ|KOY+%N5 zh*=k#Q*KQ;!gcFx;HlNyh1h&jI_)!x=r_#wysv2Y=5Bf3XWZHD`Ht@T71bQwt5p;@ dx*t?T9X+5GF-H$sMNuVv6jj;_JUMqQ@e5zav9JID diff --git a/src/main/idl/writer2xhtml/writer2xhtml.rdb b/src/main/idl/writer2xhtml/writer2xhtml.rdb deleted file mode 100644 index ba0a1894514515a1c5b598f94f9345942352a84e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16384 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 LLC>D$92x%)p)-t- From f0c43c83e3f8849b657b296100b090d9710908bb Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Thu, 25 Nov 2021 23:41:49 +0100 Subject: [PATCH 05/14] fix: eclipse config --- .project | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/.project b/.project index 96413b0..c892709 100644 --- a/.project +++ b/.project @@ -2,22 +2,21 @@ w2phtml - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.buildship.core.gradleprojectbuilder - - - - + org.eclipse.jdt.core.javanature org.eclipse.buildship.core.gradleprojectnature + + + org.eclipse.jdt.core.javabuilder + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + From 1454d68b4a8d1e08c95cf280dd0bcaa91d20838c Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Fri, 3 Dec 2021 13:03:52 +0100 Subject: [PATCH 06/14] refactoring 1 --- .../w2phtml/gui/ConversionExecutor.java | 2 +- src/main/java/w2phtml/rdf/DocumentPart.java | 6 +- .../{Metadata.java => MetadataContainer.java} | 14 +- ...ocumentStructure.java => RDFDocument.java} | 120 ++++-------------- .../java/w2phtml/rdf/RDFDocumentResult.java | 10 +- src/main/java/w2phtml/util/Package.html | 11 -- .../java/w2phtml/util/Transliteration.java | 41 ++++++ 7 files changed, 83 insertions(+), 121 deletions(-) rename src/main/java/w2phtml/rdf/{Metadata.java => MetadataContainer.java} (94%) rename src/main/java/w2phtml/rdf/{DocumentStructure.java => RDFDocument.java} (84%) delete mode 100644 src/main/java/w2phtml/util/Package.html create mode 100644 src/main/java/w2phtml/util/Transliteration.java diff --git a/src/main/java/pro/litvinovg/w2phtml/gui/ConversionExecutor.java b/src/main/java/pro/litvinovg/w2phtml/gui/ConversionExecutor.java index a46ce5f..a1b4f2d 100644 --- a/src/main/java/pro/litvinovg/w2phtml/gui/ConversionExecutor.java +++ b/src/main/java/pro/litvinovg/w2phtml/gui/ConversionExecutor.java @@ -25,7 +25,7 @@ import org.slf4j.LoggerFactory; import com.sun.star.uno.XComponentContext; import w2phtml.Application; -import w2phtml.rdf.Metadata; +import w2phtml.rdf.MetadataContainer; public class ConversionExecutor { diff --git a/src/main/java/w2phtml/rdf/DocumentPart.java b/src/main/java/w2phtml/rdf/DocumentPart.java index e9fc3de..3ad4eeb 100644 --- a/src/main/java/w2phtml/rdf/DocumentPart.java +++ b/src/main/java/w2phtml/rdf/DocumentPart.java @@ -37,9 +37,9 @@ public class DocumentPart { private String parentPath; private String name = null; private String order = null; - private Metadata metadata = null; + private MetadataContainer metadata = null; - public DocumentPart(XhtmlDocument document,Metadata metadata) { + public DocumentPart(XhtmlDocument document,MetadataContainer metadata) { this.excerptDoc = document; this.metadata = metadata; extractPath(); @@ -50,7 +50,7 @@ public class DocumentPart { extractAnnotationMetadata(); } - public DocumentPart(String path, Metadata metadata) { + public DocumentPart(String path, MetadataContainer metadata) { this.path = path; this.metadata = metadata; this.name = ""; diff --git a/src/main/java/w2phtml/rdf/Metadata.java b/src/main/java/w2phtml/rdf/MetadataContainer.java similarity index 94% rename from src/main/java/w2phtml/rdf/Metadata.java rename to src/main/java/w2phtml/rdf/MetadataContainer.java index 8febdfa..3bce9ff 100644 --- a/src/main/java/w2phtml/rdf/Metadata.java +++ b/src/main/java/w2phtml/rdf/MetadataContainer.java @@ -19,28 +19,28 @@ import org.slf4j.LoggerFactory; import com.opencsv.CSVReaderHeaderAware; import com.opencsv.exceptions.CsvValidationException; -public class Metadata { +public class MetadataContainer { private static final String SUBTITLE = "subtitle"; private static final String FILENAME = "Filename"; private static final String SECTION = "Section"; - private static final Logger logger = LoggerFactory.getLogger(Metadata.class); + private static final Logger logger = LoggerFactory.getLogger(MetadataContainer.class); private HashMap>> sectionsMetadata; - public Metadata() { + public MetadataContainer() { sectionsMetadata = new HashMap>>(); } - public void read(String metadataFilePath) { - if (metadataFilePath == null) { + public void read(String filePath) { + if (filePath == null) { return; } - File file = new File(metadataFilePath); + File file = new File(filePath); if (!file.exists() || !file.canRead()) { return; } - readCSVFile(metadataFilePath); + readCSVFile(filePath); } private void readCSVFile(String filePath) { diff --git a/src/main/java/w2phtml/rdf/DocumentStructure.java b/src/main/java/w2phtml/rdf/RDFDocument.java similarity index 84% rename from src/main/java/w2phtml/rdf/DocumentStructure.java rename to src/main/java/w2phtml/rdf/RDFDocument.java index 61ed2cd..da17130 100644 --- a/src/main/java/w2phtml/rdf/DocumentStructure.java +++ b/src/main/java/w2phtml/rdf/RDFDocument.java @@ -20,6 +20,7 @@ import org.apache.jena.rdf.model.Resource; import org.apache.jena.vocabulary.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import static w2phtml.util.Transliteration.*; import w2phtml.xhtml.XhtmlConfig; import w2phtml.xhtml.XhtmlDocument; @@ -27,36 +28,32 @@ import w2phtml.xhtml.XhtmlDocument; import org.apache.jena.rdf.model.Property; -public class DocumentStructure { +public class RDFDocument { + private static final String FORMAT_RDF = "RDF/XML-ABBREV"; private static final String AFFILIATED_ORGANIZATION_POSTAL_CODE = "affiliated organization postal code"; - private static final String AFFILIATED_ORGANIZATION_ADDRESS = "affiliated organization address"; - private static final String AFFILIATED_ORGANIZATION_OFFICIAL_NAME = "affiliated organization official name"; - private static final String AFFILIATED_ORGANIZATION_NAME = "affiliated organization name"; - private static final String AUTHOR_INITIALS = "author initials"; - private static final String AUTHOR_EMAIL = "author email"; - private static final String AUTHOR_FAMILY = "author family"; - - private static final Logger logger = LoggerFactory.getLogger(DocumentStructure.class); - + private static final Logger logger = LoggerFactory.getLogger(RDFDocument.class); private static final String AUTHOR_GIVEN_NAME = "author given name"; private static final String MODIFICATION_TIME = "modificationTime"; private static final String HTML_EXCERPT_PROPERTY = "htmlExcerpt"; private static final String TOCITEM = "TOCItem"; private static final String TS = "https://litvinovg.pro/text_structures#"; + private static final String POINTS_TO = TS + "pointsTo"; + private static final String ITEM_NUMBER = TS + "itemNumber"; + private static final String HAS_TOC_ITEM = TS + "hasTOCItem"; + private static final String HAS_TEXT = TS + "hasText"; //private static final String PARSERNAME = "w2phtml"; private static final String TEXT_EXCERPT = "textExcerpt"; private static final String TOC_LEVEL = "TOCLevel"; private static final String TABLE_OF_CONTENTS = "TOC"; private static final String PARTICIPANT = "publicationParticipant"; private static final String ORGANIZATION = "organization"; - private static final String PUBLICATION = "publication"; private static final String BOOK = "book"; private static final String JOURNAL = "journal"; @@ -81,10 +78,10 @@ public class DocumentStructure { private HashMap tocLevels; private HashMap inputParts; - private Metadata metadata; + private MetadataContainer metadata; private Date currentTime; - public DocumentStructure(Vector files,String fileName, XhtmlConfig config,Metadata metadata) { + public RDFDocument(Vector files,String fileName, XhtmlConfig config, MetadataContainer metadata) { this.tocLevels = new HashMap(); this.inputParts = new HashMap(); this.m = ModelFactory.createOntologyModel(); @@ -95,10 +92,9 @@ public class DocumentStructure { this.organizationClass = textOntology.createClass(TS + ORGANIZATION); this.participantClass = textOntology.createClass(TS + PARTICIPANT); this.itemClass = textOntology.createClass(TS + TOCITEM); - setDocID(fileName); + formatDocID(fileName); this.currentTime = Calendar.getInstance().getTime(); - String publicationType = config.getRDFType(); - setPublicationType(publicationType); + setPublicationType(config.getRDFType()); this.documentClass = textOntology.createClass(TS + documentType); this.excerptClass = textOntology.createClass(TS + excerptType); for(int i = 0 ; i< files.size();i++) { @@ -108,6 +104,12 @@ public class DocumentStructure { addPart(part); } addEmptyParts(); + createElements(); + createTOCItems(); + } + + public void printModel(OutputStream os) { + m.write(os,FORMAT_RDF); } private void setPublicationType(String publicationType) { @@ -155,30 +157,6 @@ public class DocumentStructure { } return emptyPath.toString(); } - - public void printModel(String fileName) { - File outFile = new File(fileName + ".rdf"); - FileWriter fw = null; - try { - outFile.createNewFile(); - fw = new FileWriter(outFile); - m.write(fw,"RDF/XML-ABBREV"); - - } catch (IOException e) { - System.out.println("File couldn't be created"); - e.printStackTrace(); - } finally { - try { - fw.close(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - } - public void printModel(OutputStream os) { - m.write(os,"RDF/XML-ABBREV"); - } private void addPart(DocumentPart docExcerpt) { inputParts.put(docExcerpt.getPath(), docExcerpt); @@ -273,13 +251,13 @@ public class DocumentStructure { Property initialsProperty = m.createProperty(TS + "participantInitials"); participant.addProperty( initialsProperty, authorInitials.trim()); } - attachOrganization(participant, map, order, postfix); + addOrganization(participant, map, order, postfix); } } } } - private void attachOrganization(Resource participant, Map map, String order, String postfix) { + private void addOrganization(Resource participant, Map map, String order, String postfix) { String orgName = map.get(AFFILIATED_ORGANIZATION_NAME + postfix); if (orgName == null) { System.out.println(orgName + " not found"); @@ -402,19 +380,18 @@ public class DocumentStructure { return true; } private void createTOCItem(DocumentPart docPart) { - String tocItemName = TS + TOCITEM + "/" + docID + docPart.getSafePath(); - Resource tocItem = m.createIndividual(tocItemName,itemClass); + String tocItemUri = TS + TOCITEM + "/" + docID + docPart.getSafePath(); + Resource tocItem = m.createIndividual(tocItemUri,itemClass); tocItem.addProperty( RDFS.label, docPart.getName()); - Property pointsTo = m.createProperty(TS + "pointsTo"); - Property itemNumber = m.createProperty(TS + "itemNumber"); - Property hasTOCItem = m.createProperty(TS + "hasTOCItem"); + Property pointsTo = m.createProperty(POINTS_TO); + Property itemNumber = m.createProperty(ITEM_NUMBER); + Property hasTOCItem = m.createProperty(HAS_TOC_ITEM); tocItem.addLiteral(itemNumber, docPart.getNumber()); m.add(tocItem, pointsTo, tocLevels.get(docPart.getPath())); if (!docPart.getPath().isEmpty()) { Resource parent = tocLevels.get(docPart.getParentPath()); m.add(parent, hasTOCItem, tocItem); } - } private void attachExcerpt(DocumentPart docPart, Resource element) { @@ -426,7 +403,7 @@ public class DocumentStructure { } Resource excerpt = createExcerpt(docPart); excerpt.addProperty( RDFS.label, docPart.getName()); - Property hasText = m.createProperty(TS + "hasText"); + Property hasText = m.createProperty(HAS_TEXT); element.addProperty(hasText, excerpt); if (!docPart.isMasterPart()) { addMetadataProperties(excerpt, docPart); @@ -435,11 +412,6 @@ public class DocumentStructure { } } - public void createTree() { - createElements(); - createTOCItems(); - } - private void createTOCItems() { Set paths = inputParts.keySet(); for (String path : paths) { @@ -462,48 +434,10 @@ public class DocumentStructure { } } - private void setDocID(String fileName) { + private void formatDocID(String fileName) { String identifier = fileName.replaceAll("\\s+", "_"); identifier = transliterateToEn(identifier); identifier = identifier.replaceAll("[^a-zA-Z0-9_.-]", ""); this.docID = identifier; } - - private String transliterateToEn(String fileName) { - return fileName - .replaceAll("[аА]", "a") - .replaceAll("[бБ]", "b") - .replaceAll("[вВ]", "v") - .replaceAll("[гГ]", "g") - .replaceAll("[дД]", "d") - .replaceAll("[еЕ]", "e") - .replaceAll("[ёЁ]", "e") - .replaceAll("[жЖ]", "zh") - .replaceAll("[зЗ]", "z") - .replaceAll("[иИ]", "i") - .replaceAll("[йЙ]", "y") - .replaceAll("[кК]", "k") - .replaceAll("[лЛ]", "l") - .replaceAll("[мМ]", "m") - .replaceAll("[нН]", "n") - .replaceAll("[оО]", "o") - .replaceAll("[пП]", "p") - .replaceAll("[рР]", "r") - .replaceAll("[сС]", "s") - .replaceAll("[тТ]", "t") - .replaceAll("[уУ]", "u") - .replaceAll("[фФ]", "f") - .replaceAll("[хХ]", "kh") - .replaceAll("[цЦ]", "ts") - .replaceAll("[чЧ]", "ch") - .replaceAll("[шШ]", "sh") - .replaceAll("[щЩ]", "sch") - .replaceAll("[ъЪ]", "") - .replaceAll("[ыЫ]", "y") - .replaceAll("[ьЬ]", "") - .replaceAll("[эЭ]", "e") - .replaceAll("[юЮ]", "yu") - .replaceAll("[яЯ]", "ya"); - } - } diff --git a/src/main/java/w2phtml/rdf/RDFDocumentResult.java b/src/main/java/w2phtml/rdf/RDFDocumentResult.java index 09421ef..7dd8c34 100644 --- a/src/main/java/w2phtml/rdf/RDFDocumentResult.java +++ b/src/main/java/w2phtml/rdf/RDFDocumentResult.java @@ -17,17 +17,15 @@ public class RDFDocumentResult implements OutputFile { private ConverterResult xhtmlResult; private String sFileName; private XhtmlConfig config; - private DocumentStructure rdfStructure = null; + private RDFDocument rdfDocument = null; public RDFDocumentResult(Vector outFiles, String fileName, XhtmlConfig config) { this.sFileName = Misc.removeExtension(fileName); this.config = config; - Metadata metadata = new Metadata(); + MetadataContainer metadata = new MetadataContainer(); metadata.read(config.getCSVMetadataFile()); - rdfStructure = new DocumentStructure(outFiles,sFileName,config,metadata); - rdfStructure.createTree(); - + rdfDocument = new RDFDocument(outFiles,sFileName,config,metadata); } @@ -48,7 +46,7 @@ public class RDFDocumentResult implements OutputFile { } @Override public void write(OutputStream os) throws IOException { - rdfStructure.printModel(os); + rdfDocument.printModel(os); } } diff --git a/src/main/java/w2phtml/util/Package.html b/src/main/java/w2phtml/util/Package.html deleted file mode 100644 index 3536243..0000000 --- a/src/main/java/w2phtml/util/Package.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - The package writer2latex.util - - - -

Some general utility classes.

- - diff --git a/src/main/java/w2phtml/util/Transliteration.java b/src/main/java/w2phtml/util/Transliteration.java new file mode 100644 index 0000000..8137401 --- /dev/null +++ b/src/main/java/w2phtml/util/Transliteration.java @@ -0,0 +1,41 @@ +package w2phtml.util; + +public class Transliteration { + + public static String transliterateToEn(String fileName) { + return fileName + .replaceAll("[аА]", "a") + .replaceAll("[бБ]", "b") + .replaceAll("[вВ]", "v") + .replaceAll("[гГ]", "g") + .replaceAll("[дД]", "d") + .replaceAll("[еЕ]", "e") + .replaceAll("[ёЁ]", "e") + .replaceAll("[жЖ]", "zh") + .replaceAll("[зЗ]", "z") + .replaceAll("[иИ]", "i") + .replaceAll("[йЙ]", "y") + .replaceAll("[кК]", "k") + .replaceAll("[лЛ]", "l") + .replaceAll("[мМ]", "m") + .replaceAll("[нН]", "n") + .replaceAll("[оО]", "o") + .replaceAll("[пП]", "p") + .replaceAll("[рР]", "r") + .replaceAll("[сС]", "s") + .replaceAll("[тТ]", "t") + .replaceAll("[уУ]", "u") + .replaceAll("[фФ]", "f") + .replaceAll("[хХ]", "kh") + .replaceAll("[цЦ]", "ts") + .replaceAll("[чЧ]", "ch") + .replaceAll("[шШ]", "sh") + .replaceAll("[щЩ]", "sch") + .replaceAll("[ъЪ]", "") + .replaceAll("[ыЫ]", "y") + .replaceAll("[ьЬ]", "") + .replaceAll("[эЭ]", "e") + .replaceAll("[юЮ]", "yu") + .replaceAll("[яЯ]", "ya"); + } +} From f5bf88532dabf340923967f95040a1f125bdbe9a Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Wed, 8 Dec 2021 12:51:14 +0100 Subject: [PATCH 07/14] fix: replaced bad boolean conversion calls --- src/main/java/pro/litvinovg/w2phtml/gui/EpubPanel.java | 4 ++-- src/main/java/pro/litvinovg/w2phtml/gui/HTMLPanel.java | 4 ++-- src/main/java/pro/litvinovg/w2phtml/gui/RDFPanel.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/pro/litvinovg/w2phtml/gui/EpubPanel.java b/src/main/java/pro/litvinovg/w2phtml/gui/EpubPanel.java index d3d7ca7..0a44daa 100644 --- a/src/main/java/pro/litvinovg/w2phtml/gui/EpubPanel.java +++ b/src/main/java/pro/litvinovg/w2phtml/gui/EpubPanel.java @@ -263,14 +263,14 @@ public class EpubPanel extends JPanel { JCheckBox addPagination(HashMap configuration, UIPreferences preferences) { cb_Pagination_1 = new JCheckBox(Localizer.get(LABEL_PAGINATION)); - cb_Pagination_1.setSelected(Boolean.getBoolean(preferences.get(PREF_PAGINATION))); + cb_Pagination_1.setSelected(Boolean.valueOf(preferences.get(PREF_PAGINATION))); configuration.put(ARG_PAGINATION, cb_Pagination_1); return cb_Pagination_1; } JCheckBox addConvertToPX(HashMap configuration, UIPreferences preferences) { cb_convertToPx_1 = new JCheckBox(Localizer.get(LABEL_CONVERT_TO_PX)); - cb_convertToPx_1.setSelected(Boolean.getBoolean(preferences.get(PREF_CONVERT_TO_PX))); + cb_convertToPx_1.setSelected(Boolean.valueOf(preferences.get(PREF_CONVERT_TO_PX))); configuration.put(ARG_CONVERT_TO_PX, cb_convertToPx_1); return cb_convertToPx_1; } diff --git a/src/main/java/pro/litvinovg/w2phtml/gui/HTMLPanel.java b/src/main/java/pro/litvinovg/w2phtml/gui/HTMLPanel.java index 0190592..88db5af 100644 --- a/src/main/java/pro/litvinovg/w2phtml/gui/HTMLPanel.java +++ b/src/main/java/pro/litvinovg/w2phtml/gui/HTMLPanel.java @@ -303,14 +303,14 @@ public class HTMLPanel extends JPanel{ JCheckBox addPagination(HashMap configuration, UIPreferences preferences) { cb_Pagination_1 = new JCheckBox(Localizer.get(LABEL_PAGINATION)); - cb_Pagination_1.setSelected(Boolean.getBoolean(preferences.get(PREF_PAGINATION))); + cb_Pagination_1.setSelected(Boolean.valueOf(preferences.get(PREF_PAGINATION))); configuration.put(ARG_PAGINATION, cb_Pagination_1); return cb_Pagination_1; } JCheckBox addConvertToPX(HashMap configuration, UIPreferences preferences) { cb_convertToPx_1 = new JCheckBox(Localizer.get(LABEL_CONVERT_TO_PX)); - cb_convertToPx_1.setSelected(Boolean.getBoolean(preferences.get(PREF_CONVERT_TO_PX))); + cb_convertToPx_1.setSelected(Boolean.valueOf(preferences.get(PREF_CONVERT_TO_PX))); configuration.put(ARG_CONVERT_TO_PX, cb_convertToPx_1); return cb_convertToPx_1; } diff --git a/src/main/java/pro/litvinovg/w2phtml/gui/RDFPanel.java b/src/main/java/pro/litvinovg/w2phtml/gui/RDFPanel.java index a38b4e1..aa63316 100644 --- a/src/main/java/pro/litvinovg/w2phtml/gui/RDFPanel.java +++ b/src/main/java/pro/litvinovg/w2phtml/gui/RDFPanel.java @@ -340,14 +340,14 @@ public class RDFPanel extends JPanel { JCheckBox addPagination(HashMap configuration, UIPreferences preferences) { cb_Pagination_1 = new JCheckBox(Localizer.get(LABEL_PAGINATION)); - cb_Pagination_1.setSelected(Boolean.getBoolean(preferences.get(PREF_PAGINATION))); + cb_Pagination_1.setSelected(Boolean.valueOf(preferences.get(PREF_PAGINATION))); configuration.put(ARG_PAGINATION, cb_Pagination_1); return cb_Pagination_1; } JCheckBox addConvertToPX(HashMap configuration, UIPreferences preferences) { cb_convertToPx_1 = new JCheckBox(Localizer.get(LABEL_CONVERT_TO_PX)); - cb_convertToPx_1.setSelected(Boolean.getBoolean(preferences.get(PREF_CONVERT_TO_PX))); + cb_convertToPx_1.setSelected(Boolean.valueOf(preferences.get(PREF_CONVERT_TO_PX))); configuration.put(ARG_CONVERT_TO_PX, cb_convertToPx_1); return cb_convertToPx_1; } From 56a44ea1fd37991905caa248cf3a63771384c31e Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Wed, 8 Dec 2021 12:51:54 +0100 Subject: [PATCH 08/14] chore: renamed constant --- src/main/java/w2phtml/rdf/RDFDocument.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/w2phtml/rdf/RDFDocument.java b/src/main/java/w2phtml/rdf/RDFDocument.java index da17130..774a42f 100644 --- a/src/main/java/w2phtml/rdf/RDFDocument.java +++ b/src/main/java/w2phtml/rdf/RDFDocument.java @@ -42,7 +42,7 @@ public class RDFDocument { private static final String AUTHOR_GIVEN_NAME = "author given name"; private static final String MODIFICATION_TIME = "modificationTime"; private static final String HTML_EXCERPT_PROPERTY = "htmlExcerpt"; - private static final String TOCITEM = "TOCItem"; + private static final String TOC_ITEM = "TOCItem"; private static final String TS = "https://litvinovg.pro/text_structures#"; private static final String POINTS_TO = TS + "pointsTo"; private static final String ITEM_NUMBER = TS + "itemNumber"; @@ -91,7 +91,7 @@ public class RDFDocument { this.tocClass = textOntology.createClass(TS + TABLE_OF_CONTENTS); this.organizationClass = textOntology.createClass(TS + ORGANIZATION); this.participantClass = textOntology.createClass(TS + PARTICIPANT); - this.itemClass = textOntology.createClass(TS + TOCITEM); + this.itemClass = textOntology.createClass(TS + TOC_ITEM); formatDocID(fileName); this.currentTime = Calendar.getInstance().getTime(); setPublicationType(config.getRDFType()); @@ -380,7 +380,7 @@ public class RDFDocument { return true; } private void createTOCItem(DocumentPart docPart) { - String tocItemUri = TS + TOCITEM + "/" + docID + docPart.getSafePath(); + String tocItemUri = TS + TOC_ITEM + "/" + docID + docPart.getSafePath(); Resource tocItem = m.createIndividual(tocItemUri,itemClass); tocItem.addProperty( RDFS.label, docPart.getName()); Property pointsTo = m.createProperty(POINTS_TO); From 7d03b2a02d1901a14d1407937d36daad96ac1581 Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Wed, 8 Dec 2021 13:52:09 +0100 Subject: [PATCH 09/14] chore: improving build configuration --- build.gradle | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/build.gradle b/build.gradle index 25c0b11..f52f57b 100644 --- a/build.gradle +++ b/build.gradle @@ -23,10 +23,9 @@ sourceSets { } sourceCompatibility = 1.8 configurations{ - bundledLibs regressionTestsCompile.extendsFrom mainCompile regressionTestsRuntime.extendsFrom mainRuntime - regressionTestsRuntime.extendsFrom bundledLibs + regressionTestsRuntime.extendsFrom compileClasspath } dependencies{ regressionTestsImplementation group: 'commons-io', name: 'commons-io', version: '2.8.0' @@ -34,22 +33,21 @@ dependencies{ regressionTestsImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.7.1' regressionTestsRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' - bundledLibs 'org.libreoffice:jurt:5.3.2' - bundledLibs 'org.libreoffice:juh:5.3.2' - bundledLibs 'org.libreoffice:ridl:5.3.2' - bundledLibs 'org.libreoffice:unoil:5.3.2' - bundledLibs 'org.json:json:20190722' - bundledLibs group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3' - bundledLibs group: 'ch.qos.logback', name: 'logback-core', version: '1.2.3' - bundledLibs group: 'com.miglayout', name: 'miglayout-swing', version: '5.2' - bundledLibs group: 'org.apache.jena', name: 'jena-core', version: '3.15.0' - bundledLibs group: 'org.apache.jena', name: 'jena-arq', version: '3.15.0' - bundledLibs group: 'org.slf4j', name: 'slf4j-api', version: '1.7.30' - bundledLibs group: 'com.opencsv', name: 'opencsv', version: '5.1' - bundledLibs group: 'org.imgscalr', name: 'imgscalr-lib', version: '4.2' - bundledLibs group: 'org.apache.commons', name: 'commons-imaging', version: '1.0-alpha2' + compileClasspath 'org.libreoffice:jurt:5.3.2' + compileClasspath 'org.libreoffice:juh:5.3.2' + compileClasspath 'org.libreoffice:ridl:5.3.2' + compileClasspath 'org.libreoffice:unoil:5.3.2' + compileClasspath 'org.json:json:20190722' + compileClasspath group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3' + compileClasspath group: 'ch.qos.logback', name: 'logback-core', version: '1.2.3' + compileClasspath group: 'com.miglayout', name: 'miglayout-swing', version: '5.2' + compileClasspath group: 'org.apache.jena', name: 'jena-core', version: '3.15.0' + compileClasspath group: 'org.apache.jena', name: 'jena-arq', version: '3.15.0' + compileClasspath group: 'org.slf4j', name: 'slf4j-api', version: '1.7.30' + compileClasspath group: 'com.opencsv', name: 'opencsv', version: '5.1' + compileClasspath group: 'org.imgscalr', name: 'imgscalr-lib', version: '4.2' + compileClasspath group: 'org.apache.commons', name: 'commons-imaging', version: '1.0-alpha2' - configurations.compile.extendsFrom(configurations.bundledLibs) } jar { archiveName 'w2phtml.jar' @@ -60,8 +58,9 @@ jar { "Class-Path" : "jasp.jar parser.jar") } + duplicatesStrategy = 'exclude' from { - configurations.bundledLibs.collect { it.isDirectory() ? it : zipTree(it) } + configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) } } from('src/main/java') { include '**/*.properties' @@ -85,9 +84,10 @@ task xhtml(type: Jar) { "RegistrationClassName" : "pro.litvinovg.w2phtml.RegistrationHandler", "Class-Path" : "jasp.jar parser.jar") } + duplicatesStrategy = 'exclude' baseName = "writer2phtml" from { - configurations.bundledLibs.collect { + configurations.compileClasspath.collect { exclude 'module-info.class' exclude '.gradle' exclude '**/LICENSE*' @@ -108,6 +108,7 @@ task xhtml(type: Jar) { include 'etc/*' include 'com/**' include 'com/**/*' + exclude '**/DEPENDENCIES' include 'w2phtml/pageSplitters/**/*.class' include 'pro/litvinovg/**/*.class' include 'pro/litvinovg/**/*.png' @@ -130,6 +131,7 @@ task xhtml(type: Jar) { exclude '.gradle' } from ('src/main/java'){ + exclude '**/DEPENDENCIES' exclude '.gradle' include 'w2phtml/xhtml/**/*.properties' include 'w2phtml/xhtml/**/**/*.properties' @@ -164,6 +166,7 @@ task oxt(type: Zip){ from 'releasenotes.txt' include '*' } + task regressionTests(type: Test) { testClassesDirs = sourceSets.regressionTests.output.classesDirs classpath = sourceSets.regressionTests.runtimeClasspath From 19b17c5b58fff9dab7c7dd84812e086c8dfb923a Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Wed, 8 Dec 2021 14:51:58 +0100 Subject: [PATCH 10/14] chore: improved build configuration --- build.gradle | 7 ++++--- .../w2phtml/regressionTests/PageBreaksBeforeHeading.java | 0 .../java/w2phtml/regressionTests/html5/BreakAfterTest.java | 0 .../java/w2phtml/regressionTests/html5/BulletList.java | 0 .../w2phtml/regressionTests/html5/GreenstoneHeadings.java | 0 .../regressionTests/html5/HardPageBreaksInLists.java | 0 .../w2phtml/regressionTests/html5/HeadingWithSections.java | 0 .../w2phtml/regressionTests/html5/ImageAfterSection.java | 0 .../java/w2phtml/regressionTests/html5/ListAfterText.java | 0 .../java/w2phtml/regressionTests/html5/ListInSection.java | 0 .../java/w2phtml/regressionTests/html5/ListInTable.java | 0 .../w2phtml/regressionTests/html5/ListTableSection.java | 0 .../w2phtml/regressionTests/html5/PageStartWith10.java | 0 .../regressionTests/html5/PageStartWith10InSection.java | 0 .../regressionTests/html5/SoftPageBreakInListTest.java | 0 .../regressionTests/html5/SplitFilesAlignToPages.java | 0 16 files changed, 4 insertions(+), 3 deletions(-) rename src/{r_tests => regressionTests}/java/w2phtml/regressionTests/PageBreaksBeforeHeading.java (100%) rename src/{r_tests => regressionTests}/java/w2phtml/regressionTests/html5/BreakAfterTest.java (100%) rename src/{r_tests => regressionTests}/java/w2phtml/regressionTests/html5/BulletList.java (100%) rename src/{r_tests => regressionTests}/java/w2phtml/regressionTests/html5/GreenstoneHeadings.java (100%) rename src/{r_tests => regressionTests}/java/w2phtml/regressionTests/html5/HardPageBreaksInLists.java (100%) rename src/{r_tests => regressionTests}/java/w2phtml/regressionTests/html5/HeadingWithSections.java (100%) rename src/{r_tests => regressionTests}/java/w2phtml/regressionTests/html5/ImageAfterSection.java (100%) rename src/{r_tests => regressionTests}/java/w2phtml/regressionTests/html5/ListAfterText.java (100%) rename src/{r_tests => regressionTests}/java/w2phtml/regressionTests/html5/ListInSection.java (100%) rename src/{r_tests => regressionTests}/java/w2phtml/regressionTests/html5/ListInTable.java (100%) rename src/{r_tests => regressionTests}/java/w2phtml/regressionTests/html5/ListTableSection.java (100%) rename src/{r_tests => regressionTests}/java/w2phtml/regressionTests/html5/PageStartWith10.java (100%) rename src/{r_tests => regressionTests}/java/w2phtml/regressionTests/html5/PageStartWith10InSection.java (100%) rename src/{r_tests => regressionTests}/java/w2phtml/regressionTests/html5/SoftPageBreakInListTest.java (100%) rename src/{r_tests => regressionTests}/java/w2phtml/regressionTests/html5/SplitFilesAlignToPages.java (100%) diff --git a/build.gradle b/build.gradle index f52f57b..cf4b4b7 100644 --- a/build.gradle +++ b/build.gradle @@ -16,8 +16,8 @@ sourceSets { regressionTests { java { compileClasspath += main.output + test.output - runtimeClasspath += main.output + files('src/main/java') - java.srcDir file('src/r_tests/java') + runtimeClasspath += main.output + test.output + files('src/main/java') + srcDir file('src/r_tests/java') } } } @@ -26,12 +26,13 @@ configurations{ regressionTestsCompile.extendsFrom mainCompile regressionTestsRuntime.extendsFrom mainRuntime regressionTestsRuntime.extendsFrom compileClasspath + regressionTestsImplementation.extendsFrom compileClasspath } dependencies{ regressionTestsImplementation group: 'commons-io', name: 'commons-io', version: '2.8.0' regressionTestsImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.7.1' regressionTestsImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.7.1' - regressionTestsRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' + regressionTestsImplementation 'org.junit.jupiter:junit-jupiter-engine' compileClasspath 'org.libreoffice:jurt:5.3.2' compileClasspath 'org.libreoffice:juh:5.3.2' diff --git a/src/r_tests/java/w2phtml/regressionTests/PageBreaksBeforeHeading.java b/src/regressionTests/java/w2phtml/regressionTests/PageBreaksBeforeHeading.java similarity index 100% rename from src/r_tests/java/w2phtml/regressionTests/PageBreaksBeforeHeading.java rename to src/regressionTests/java/w2phtml/regressionTests/PageBreaksBeforeHeading.java diff --git a/src/r_tests/java/w2phtml/regressionTests/html5/BreakAfterTest.java b/src/regressionTests/java/w2phtml/regressionTests/html5/BreakAfterTest.java similarity index 100% rename from src/r_tests/java/w2phtml/regressionTests/html5/BreakAfterTest.java rename to src/regressionTests/java/w2phtml/regressionTests/html5/BreakAfterTest.java diff --git a/src/r_tests/java/w2phtml/regressionTests/html5/BulletList.java b/src/regressionTests/java/w2phtml/regressionTests/html5/BulletList.java similarity index 100% rename from src/r_tests/java/w2phtml/regressionTests/html5/BulletList.java rename to src/regressionTests/java/w2phtml/regressionTests/html5/BulletList.java diff --git a/src/r_tests/java/w2phtml/regressionTests/html5/GreenstoneHeadings.java b/src/regressionTests/java/w2phtml/regressionTests/html5/GreenstoneHeadings.java similarity index 100% rename from src/r_tests/java/w2phtml/regressionTests/html5/GreenstoneHeadings.java rename to src/regressionTests/java/w2phtml/regressionTests/html5/GreenstoneHeadings.java diff --git a/src/r_tests/java/w2phtml/regressionTests/html5/HardPageBreaksInLists.java b/src/regressionTests/java/w2phtml/regressionTests/html5/HardPageBreaksInLists.java similarity index 100% rename from src/r_tests/java/w2phtml/regressionTests/html5/HardPageBreaksInLists.java rename to src/regressionTests/java/w2phtml/regressionTests/html5/HardPageBreaksInLists.java diff --git a/src/r_tests/java/w2phtml/regressionTests/html5/HeadingWithSections.java b/src/regressionTests/java/w2phtml/regressionTests/html5/HeadingWithSections.java similarity index 100% rename from src/r_tests/java/w2phtml/regressionTests/html5/HeadingWithSections.java rename to src/regressionTests/java/w2phtml/regressionTests/html5/HeadingWithSections.java diff --git a/src/r_tests/java/w2phtml/regressionTests/html5/ImageAfterSection.java b/src/regressionTests/java/w2phtml/regressionTests/html5/ImageAfterSection.java similarity index 100% rename from src/r_tests/java/w2phtml/regressionTests/html5/ImageAfterSection.java rename to src/regressionTests/java/w2phtml/regressionTests/html5/ImageAfterSection.java diff --git a/src/r_tests/java/w2phtml/regressionTests/html5/ListAfterText.java b/src/regressionTests/java/w2phtml/regressionTests/html5/ListAfterText.java similarity index 100% rename from src/r_tests/java/w2phtml/regressionTests/html5/ListAfterText.java rename to src/regressionTests/java/w2phtml/regressionTests/html5/ListAfterText.java diff --git a/src/r_tests/java/w2phtml/regressionTests/html5/ListInSection.java b/src/regressionTests/java/w2phtml/regressionTests/html5/ListInSection.java similarity index 100% rename from src/r_tests/java/w2phtml/regressionTests/html5/ListInSection.java rename to src/regressionTests/java/w2phtml/regressionTests/html5/ListInSection.java diff --git a/src/r_tests/java/w2phtml/regressionTests/html5/ListInTable.java b/src/regressionTests/java/w2phtml/regressionTests/html5/ListInTable.java similarity index 100% rename from src/r_tests/java/w2phtml/regressionTests/html5/ListInTable.java rename to src/regressionTests/java/w2phtml/regressionTests/html5/ListInTable.java diff --git a/src/r_tests/java/w2phtml/regressionTests/html5/ListTableSection.java b/src/regressionTests/java/w2phtml/regressionTests/html5/ListTableSection.java similarity index 100% rename from src/r_tests/java/w2phtml/regressionTests/html5/ListTableSection.java rename to src/regressionTests/java/w2phtml/regressionTests/html5/ListTableSection.java diff --git a/src/r_tests/java/w2phtml/regressionTests/html5/PageStartWith10.java b/src/regressionTests/java/w2phtml/regressionTests/html5/PageStartWith10.java similarity index 100% rename from src/r_tests/java/w2phtml/regressionTests/html5/PageStartWith10.java rename to src/regressionTests/java/w2phtml/regressionTests/html5/PageStartWith10.java diff --git a/src/r_tests/java/w2phtml/regressionTests/html5/PageStartWith10InSection.java b/src/regressionTests/java/w2phtml/regressionTests/html5/PageStartWith10InSection.java similarity index 100% rename from src/r_tests/java/w2phtml/regressionTests/html5/PageStartWith10InSection.java rename to src/regressionTests/java/w2phtml/regressionTests/html5/PageStartWith10InSection.java diff --git a/src/r_tests/java/w2phtml/regressionTests/html5/SoftPageBreakInListTest.java b/src/regressionTests/java/w2phtml/regressionTests/html5/SoftPageBreakInListTest.java similarity index 100% rename from src/r_tests/java/w2phtml/regressionTests/html5/SoftPageBreakInListTest.java rename to src/regressionTests/java/w2phtml/regressionTests/html5/SoftPageBreakInListTest.java diff --git a/src/r_tests/java/w2phtml/regressionTests/html5/SplitFilesAlignToPages.java b/src/regressionTests/java/w2phtml/regressionTests/html5/SplitFilesAlignToPages.java similarity index 100% rename from src/r_tests/java/w2phtml/regressionTests/html5/SplitFilesAlignToPages.java rename to src/regressionTests/java/w2phtml/regressionTests/html5/SplitFilesAlignToPages.java From a6e85d367a55edcc22b5885cc879d222b417e037 Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Wed, 8 Dec 2021 15:41:43 +0100 Subject: [PATCH 11/14] chore: removed dependency --- build.gradle | 1 - .../PageBreaksBeforeHeading.java | 3 +-- .../w2phtml/regressionTests/TestFiles.java | 23 +++++++++++++++++++ .../regressionTests/html5/BreakAfterTest.java | 3 ++- .../regressionTests/html5/BulletList.java | 5 ++-- .../html5/GreenstoneHeadings.java | 5 ++-- .../html5/HardPageBreaksInLists.java | 5 ++-- .../html5/HeadingWithSections.java | 5 ++-- .../html5/ImageAfterSection.java | 5 ++-- .../regressionTests/html5/ListAfterText.java | 5 ++-- .../regressionTests/html5/ListInSection.java | 5 ++-- .../regressionTests/html5/ListInTable.java | 5 ++-- .../html5/ListTableSection.java | 5 ++-- .../html5/PageStartWith10.java | 5 ++-- .../html5/PageStartWith10InSection.java | 5 ++-- .../html5/SoftPageBreakInListTest.java | 5 ++-- .../html5/SplitFilesAlignToPages.java | 7 +++--- 17 files changed, 66 insertions(+), 31 deletions(-) create mode 100644 src/regressionTests/java/w2phtml/regressionTests/TestFiles.java diff --git a/build.gradle b/build.gradle index cf4b4b7..f76f5f6 100644 --- a/build.gradle +++ b/build.gradle @@ -29,7 +29,6 @@ configurations{ regressionTestsImplementation.extendsFrom compileClasspath } dependencies{ - regressionTestsImplementation group: 'commons-io', name: 'commons-io', version: '2.8.0' regressionTestsImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.7.1' regressionTestsImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.7.1' regressionTestsImplementation 'org.junit.jupiter:junit-jupiter-engine' diff --git a/src/regressionTests/java/w2phtml/regressionTests/PageBreaksBeforeHeading.java b/src/regressionTests/java/w2phtml/regressionTests/PageBreaksBeforeHeading.java index 87dfedb..d55a440 100644 --- a/src/regressionTests/java/w2phtml/regressionTests/PageBreaksBeforeHeading.java +++ b/src/regressionTests/java/w2phtml/regressionTests/PageBreaksBeforeHeading.java @@ -6,7 +6,6 @@ import java.util.List; import static org.junit.jupiter.api.Assertions.assertTrue; -import org.apache.commons.io.FileUtils; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -25,6 +24,6 @@ public class PageBreaksBeforeHeading { w2phtml.Application.main(arguments.toArray(new String[0])); File result = new File("./testdocuments/output/heading_with_page_break_before.html"); File model = new File("./testdocuments/model/heading_with_page_break_before.html"); - assertTrue( FileUtils.contentEquals(result, model),"The files differ!"); + assertTrue( TestFiles.equals(result, model),"The files differ!"); } } diff --git a/src/regressionTests/java/w2phtml/regressionTests/TestFiles.java b/src/regressionTests/java/w2phtml/regressionTests/TestFiles.java new file mode 100644 index 0000000..7ce6f9d --- /dev/null +++ b/src/regressionTests/java/w2phtml/regressionTests/TestFiles.java @@ -0,0 +1,23 @@ +package w2phtml.regressionTests; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.util.Arrays; + +public class TestFiles { + public static boolean equals(File file1, File file2) { + byte[] f1; + byte[] f2; + try { + f1 = Files.readAllBytes(file1.toPath()); + f2 = Files.readAllBytes(file2.toPath()); + return Arrays.equals(f1, f2); + } catch (IOException e) { + e.printStackTrace(); + } + return false; + } + + +} diff --git a/src/regressionTests/java/w2phtml/regressionTests/html5/BreakAfterTest.java b/src/regressionTests/java/w2phtml/regressionTests/html5/BreakAfterTest.java index 23a3694..cf0d8a3 100644 --- a/src/regressionTests/java/w2phtml/regressionTests/html5/BreakAfterTest.java +++ b/src/regressionTests/java/w2phtml/regressionTests/html5/BreakAfterTest.java @@ -5,6 +5,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.File; import java.util.ArrayList; import java.util.List; +import w2phtml.regressionTests.TestFiles; import org.apache.commons.io.FileUtils; import org.junit.jupiter.api.DisplayName; @@ -26,6 +27,6 @@ public class BreakAfterTest { w2phtml.Application.main(arguments.toArray(new String[0])); File result = new File("./testdocuments/output/" + name + ".html"); File model = new File("./testdocuments/model/" + name + ".html"); - assertTrue(FileUtils.contentEquals(result, model), "The files differ!"); + assertTrue(TestFiles.equals(result, model), "The files differ!"); } } diff --git a/src/regressionTests/java/w2phtml/regressionTests/html5/BulletList.java b/src/regressionTests/java/w2phtml/regressionTests/html5/BulletList.java index af9fef7..fc860f0 100644 --- a/src/regressionTests/java/w2phtml/regressionTests/html5/BulletList.java +++ b/src/regressionTests/java/w2phtml/regressionTests/html5/BulletList.java @@ -6,10 +6,11 @@ import java.io.File; import java.util.ArrayList; import java.util.List; -import org.apache.commons.io.FileUtils; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import w2phtml.regressionTests.TestFiles; + public class BulletList { @Test @DisplayName("List on multiple pages") @@ -26,6 +27,6 @@ public class BulletList { w2phtml.Application.main(arguments.toArray(new String[0])); File result = new File("./testdocuments/output/" + name + ".html"); File model = new File("./testdocuments/model/" + name + ".html"); - assertTrue(FileUtils.contentEquals(result, model), "The files differ!"); + assertTrue(TestFiles.equals(result, model), "The files differ!"); } } diff --git a/src/regressionTests/java/w2phtml/regressionTests/html5/GreenstoneHeadings.java b/src/regressionTests/java/w2phtml/regressionTests/html5/GreenstoneHeadings.java index 76bc96a..62ac57c 100644 --- a/src/regressionTests/java/w2phtml/regressionTests/html5/GreenstoneHeadings.java +++ b/src/regressionTests/java/w2phtml/regressionTests/html5/GreenstoneHeadings.java @@ -6,10 +6,11 @@ import java.io.File; import java.util.ArrayList; import java.util.List; -import org.apache.commons.io.FileUtils; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import w2phtml.regressionTests.TestFiles; + public class GreenstoneHeadings { @Test @DisplayName("Greenstone3 tags headings") @@ -25,6 +26,6 @@ public class GreenstoneHeadings { w2phtml.Application.main(arguments.toArray(new String[0])); File result = new File("./testdocuments/output/" + testName + ".html"); File model = new File("./testdocuments/model/" + testName + ".html"); - assertTrue(FileUtils.contentEquals(result, model), "The files differ!"); + assertTrue(TestFiles.equals(result, model), "The files differ!"); } } diff --git a/src/regressionTests/java/w2phtml/regressionTests/html5/HardPageBreaksInLists.java b/src/regressionTests/java/w2phtml/regressionTests/html5/HardPageBreaksInLists.java index d51b66a..f177019 100644 --- a/src/regressionTests/java/w2phtml/regressionTests/html5/HardPageBreaksInLists.java +++ b/src/regressionTests/java/w2phtml/regressionTests/html5/HardPageBreaksInLists.java @@ -6,10 +6,11 @@ import java.io.File; import java.util.ArrayList; import java.util.List; -import org.apache.commons.io.FileUtils; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import w2phtml.regressionTests.TestFiles; + public class HardPageBreaksInLists { @Test @DisplayName("Hard page breaks inside list") @@ -26,6 +27,6 @@ public class HardPageBreaksInLists { w2phtml.Application.main(arguments.toArray(new String[0])); File result = new File("./testdocuments/output/" + name + ".html"); File model = new File("./testdocuments/model/" + name + ".html"); - assertTrue(FileUtils.contentEquals(result, model), "The files differ!"); + assertTrue(TestFiles.equals(result, model), "The files differ!"); } } diff --git a/src/regressionTests/java/w2phtml/regressionTests/html5/HeadingWithSections.java b/src/regressionTests/java/w2phtml/regressionTests/html5/HeadingWithSections.java index 1f169f7..a8f3d46 100644 --- a/src/regressionTests/java/w2phtml/regressionTests/html5/HeadingWithSections.java +++ b/src/regressionTests/java/w2phtml/regressionTests/html5/HeadingWithSections.java @@ -6,10 +6,11 @@ import java.io.File; import java.util.ArrayList; import java.util.List; -import org.apache.commons.io.FileUtils; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import w2phtml.regressionTests.TestFiles; + public class HeadingWithSections { @Test @DisplayName("Heading with sections") @@ -24,6 +25,6 @@ public class HeadingWithSections { w2phtml.Application.main(arguments.toArray(new String[0])); File result = new File("./testdocuments/output/"+testName+".html"); File model = new File("./testdocuments/model/"+testName+".html"); - assertTrue( FileUtils.contentEquals(result, model),"The files differ!"); + assertTrue(TestFiles.equals(result, model),"The files differ!"); } } diff --git a/src/regressionTests/java/w2phtml/regressionTests/html5/ImageAfterSection.java b/src/regressionTests/java/w2phtml/regressionTests/html5/ImageAfterSection.java index 4419cbb..e758227 100644 --- a/src/regressionTests/java/w2phtml/regressionTests/html5/ImageAfterSection.java +++ b/src/regressionTests/java/w2phtml/regressionTests/html5/ImageAfterSection.java @@ -6,10 +6,11 @@ import java.io.File; import java.util.ArrayList; import java.util.List; -import org.apache.commons.io.FileUtils; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import w2phtml.regressionTests.TestFiles; + public class ImageAfterSection { @Test @DisplayName("image after section") @@ -24,6 +25,6 @@ public class ImageAfterSection { w2phtml.Application.main(arguments.toArray(new String[0])); File result = new File("./testdocuments/output/" + testName + ".html"); File model = new File("./testdocuments/model/" + testName + ".html"); - assertTrue(FileUtils.contentEquals(result, model), "The files differ!"); + assertTrue(TestFiles.equals(result, model), "The files differ!"); } } diff --git a/src/regressionTests/java/w2phtml/regressionTests/html5/ListAfterText.java b/src/regressionTests/java/w2phtml/regressionTests/html5/ListAfterText.java index d470e25..e522fb8 100644 --- a/src/regressionTests/java/w2phtml/regressionTests/html5/ListAfterText.java +++ b/src/regressionTests/java/w2phtml/regressionTests/html5/ListAfterText.java @@ -6,10 +6,11 @@ import java.io.File; import java.util.ArrayList; import java.util.List; -import org.apache.commons.io.FileUtils; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import w2phtml.regressionTests.TestFiles; + public class ListAfterText { @Test @DisplayName("List after soft page break") @@ -26,6 +27,6 @@ public class ListAfterText { w2phtml.Application.main(arguments.toArray(new String[0])); File result = new File("./testdocuments/output/" + name + ".html"); File model = new File("./testdocuments/model/" + name + ".html"); - assertTrue(FileUtils.contentEquals(result, model), "The files differ!"); + assertTrue(TestFiles.equals(result, model), "The files differ!"); } } diff --git a/src/regressionTests/java/w2phtml/regressionTests/html5/ListInSection.java b/src/regressionTests/java/w2phtml/regressionTests/html5/ListInSection.java index 60e93cb..a9bbdfc 100644 --- a/src/regressionTests/java/w2phtml/regressionTests/html5/ListInSection.java +++ b/src/regressionTests/java/w2phtml/regressionTests/html5/ListInSection.java @@ -6,10 +6,11 @@ import java.io.File; import java.util.ArrayList; import java.util.List; -import org.apache.commons.io.FileUtils; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import w2phtml.regressionTests.TestFiles; + public class ListInSection { @Test @DisplayName("List in section") @@ -26,6 +27,6 @@ public class ListInSection { w2phtml.Application.main(arguments.toArray(new String[0])); File result = new File("./testdocuments/output/" + name + ".html"); File model = new File("./testdocuments/model/" + name + ".html"); - assertTrue(FileUtils.contentEquals(result, model), "The files differ!"); + assertTrue(TestFiles.equals(result, model), "The files differ!"); } } diff --git a/src/regressionTests/java/w2phtml/regressionTests/html5/ListInTable.java b/src/regressionTests/java/w2phtml/regressionTests/html5/ListInTable.java index 9399d78..23dc08b 100644 --- a/src/regressionTests/java/w2phtml/regressionTests/html5/ListInTable.java +++ b/src/regressionTests/java/w2phtml/regressionTests/html5/ListInTable.java @@ -6,10 +6,11 @@ import java.io.File; import java.util.ArrayList; import java.util.List; -import org.apache.commons.io.FileUtils; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import w2phtml.regressionTests.TestFiles; + public class ListInTable { @Test @DisplayName("list in table") @@ -24,6 +25,6 @@ public class ListInTable { w2phtml.Application.main(arguments.toArray(new String[0])); File result = new File("./testdocuments/output/" + testName + ".html"); File model = new File("./testdocuments/model/" + testName + ".html"); - assertTrue(FileUtils.contentEquals(result, model), "The files differ!"); + assertTrue(TestFiles.equals(result, model), "The files differ!"); } } diff --git a/src/regressionTests/java/w2phtml/regressionTests/html5/ListTableSection.java b/src/regressionTests/java/w2phtml/regressionTests/html5/ListTableSection.java index 5e98b01..f6f91da 100644 --- a/src/regressionTests/java/w2phtml/regressionTests/html5/ListTableSection.java +++ b/src/regressionTests/java/w2phtml/regressionTests/html5/ListTableSection.java @@ -6,10 +6,11 @@ import java.io.File; import java.util.ArrayList; import java.util.List; -import org.apache.commons.io.FileUtils; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import w2phtml.regressionTests.TestFiles; + public class ListTableSection { @Test @DisplayName("list in table in section") @@ -24,6 +25,6 @@ public class ListTableSection { w2phtml.Application.main(arguments.toArray(new String[0])); File result = new File("./testdocuments/output/" + testName + ".html"); File model = new File("./testdocuments/model/" + testName + ".html"); - assertTrue(FileUtils.contentEquals(result, model), "The files differ!"); + assertTrue(TestFiles.equals(result, model), "The files differ!"); } } diff --git a/src/regressionTests/java/w2phtml/regressionTests/html5/PageStartWith10.java b/src/regressionTests/java/w2phtml/regressionTests/html5/PageStartWith10.java index 954dfa4..651421e 100644 --- a/src/regressionTests/java/w2phtml/regressionTests/html5/PageStartWith10.java +++ b/src/regressionTests/java/w2phtml/regressionTests/html5/PageStartWith10.java @@ -6,10 +6,11 @@ import java.io.File; import java.util.ArrayList; import java.util.List; -import org.apache.commons.io.FileUtils; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import w2phtml.regressionTests.TestFiles; + public class PageStartWith10 { @Test @DisplayName("start page from 10 in section") @@ -24,6 +25,6 @@ public class PageStartWith10 { w2phtml.Application.main(arguments.toArray(new String[0])); File result = new File("./testdocuments/output/" + testName + ".html"); File model = new File("./testdocuments/model/" + testName + ".html"); - assertTrue(FileUtils.contentEquals(result, model), "The files differ!"); + assertTrue(TestFiles.equals(result, model), "The files differ!"); } } diff --git a/src/regressionTests/java/w2phtml/regressionTests/html5/PageStartWith10InSection.java b/src/regressionTests/java/w2phtml/regressionTests/html5/PageStartWith10InSection.java index 096c42b..5de5b90 100644 --- a/src/regressionTests/java/w2phtml/regressionTests/html5/PageStartWith10InSection.java +++ b/src/regressionTests/java/w2phtml/regressionTests/html5/PageStartWith10InSection.java @@ -6,10 +6,11 @@ import java.io.File; import java.util.ArrayList; import java.util.List; -import org.apache.commons.io.FileUtils; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import w2phtml.regressionTests.TestFiles; + public class PageStartWith10InSection { @Test @DisplayName("start page from 10") @@ -24,6 +25,6 @@ public class PageStartWith10InSection { w2phtml.Application.main(arguments.toArray(new String[0])); File result = new File("./testdocuments/output/" + testName + ".html"); File model = new File("./testdocuments/model/" + testName + ".html"); - assertTrue(FileUtils.contentEquals(result, model), "The files differ!"); + assertTrue(TestFiles.equals(result, model), "The files differ!"); } } diff --git a/src/regressionTests/java/w2phtml/regressionTests/html5/SoftPageBreakInListTest.java b/src/regressionTests/java/w2phtml/regressionTests/html5/SoftPageBreakInListTest.java index 2c363e0..052ca71 100644 --- a/src/regressionTests/java/w2phtml/regressionTests/html5/SoftPageBreakInListTest.java +++ b/src/regressionTests/java/w2phtml/regressionTests/html5/SoftPageBreakInListTest.java @@ -6,10 +6,11 @@ import java.io.File; import java.util.ArrayList; import java.util.List; -import org.apache.commons.io.FileUtils; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import w2phtml.regressionTests.TestFiles; + public class SoftPageBreakInListTest { @Test @DisplayName("Soft page break in list") @@ -26,6 +27,6 @@ public class SoftPageBreakInListTest { w2phtml.Application.main(arguments.toArray(new String[0])); File result = new File("./testdocuments/output/" + name + ".html"); File model = new File("./testdocuments/model/" + name + ".html"); - assertTrue(FileUtils.contentEquals(result, model), "The files differ!"); + assertTrue(TestFiles.equals(result, model), "The files differ!"); } } diff --git a/src/regressionTests/java/w2phtml/regressionTests/html5/SplitFilesAlignToPages.java b/src/regressionTests/java/w2phtml/regressionTests/html5/SplitFilesAlignToPages.java index ed6282d..fe3ddf1 100644 --- a/src/regressionTests/java/w2phtml/regressionTests/html5/SplitFilesAlignToPages.java +++ b/src/regressionTests/java/w2phtml/regressionTests/html5/SplitFilesAlignToPages.java @@ -6,10 +6,11 @@ import java.io.File; import java.util.ArrayList; import java.util.List; -import org.apache.commons.io.FileUtils; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import w2phtml.regressionTests.TestFiles; + public class SplitFilesAlignToPages { @Test @DisplayName("Split files align to pages") @@ -28,8 +29,8 @@ public class SplitFilesAlignToPages { File result2 = new File("./testdocuments/output/" + testName + "1.html"); File model1 = new File("./testdocuments/model/" + testName + ".html"); File model2 = new File("./testdocuments/model/" + testName + "1.html"); - assertTrue(FileUtils.contentEquals(result1, model1), "The files differ!"); - assertTrue(FileUtils.contentEquals(result2, model2), "The files differ!"); + assertTrue(TestFiles.equals(result1, model1), "The files differ!"); + assertTrue(TestFiles.equals(result2, model2), "The files differ!"); } } From ff556c19ddc7a207fbc973d7f4ef209de417f1fb Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Wed, 8 Dec 2021 16:07:51 +0100 Subject: [PATCH 12/14] chore: removed one more dependency --- build.gradle | 1 - src/main/java/w2phtml/pageSplitters/ListSplitter.java | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index f76f5f6..64f772b 100644 --- a/build.gradle +++ b/build.gradle @@ -42,7 +42,6 @@ dependencies{ compileClasspath group: 'ch.qos.logback', name: 'logback-core', version: '1.2.3' compileClasspath group: 'com.miglayout', name: 'miglayout-swing', version: '5.2' compileClasspath group: 'org.apache.jena', name: 'jena-core', version: '3.15.0' - compileClasspath group: 'org.apache.jena', name: 'jena-arq', version: '3.15.0' compileClasspath group: 'org.slf4j', name: 'slf4j-api', version: '1.7.30' compileClasspath group: 'com.opencsv', name: 'opencsv', version: '5.1' compileClasspath group: 'org.imgscalr', name: 'imgscalr-lib', version: '4.2' diff --git a/src/main/java/w2phtml/pageSplitters/ListSplitter.java b/src/main/java/w2phtml/pageSplitters/ListSplitter.java index e4413b2..df7188d 100644 --- a/src/main/java/w2phtml/pageSplitters/ListSplitter.java +++ b/src/main/java/w2phtml/pageSplitters/ListSplitter.java @@ -6,13 +6,11 @@ import static w2phtml.office.XMLString.TEXT_LIST_ITEM; import static w2phtml.office.XMLString.TEXT_LIST; import static w2phtml.office.XMLString.TEXT_SOFT_PAGE_BREAK; -import org.apache.commons.lang3.StringUtils; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import pro.litvinovg.xml.Debug; import w2phtml.office.OfficeReader; public class ListSplitter extends BasicSplitter implements ISplitter { @@ -101,7 +99,7 @@ public class ListSplitter extends BasicSplitter implements ISplitter { while (freeNodes.getLength() > 0) { Node freeNode = freeNodes.item(i); String freeNodeName = freeNode.getNodeName(); - if (StringUtils.equals(TEXT_LIST, freeNodeName)) { + if (TEXT_LIST.equals(freeNodeName)) { break; } parent.insertBefore(freeNode, list); From 0bb7490ac2d53ecc67332d3c289129abc8258267 Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Wed, 8 Dec 2021 16:08:47 +0100 Subject: [PATCH 13/14] chore: new version --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 30e22b3..a364566 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=0.9.27 +version=0.9.29 From 72f2892d30e47ad85174fd15e91b160b8e17e4b5 Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Wed, 8 Dec 2021 16:13:12 +0100 Subject: [PATCH 14/14] chore: new version --- w2phtml.update.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/w2phtml.update.xml b/w2phtml.update.xml index 50f4f29..b5c1867 100644 --- a/w2phtml.update.xml +++ b/w2phtml.update.xml @@ -2,9 +2,9 @@ - + - +