Skip to content

Commit

Permalink
add new letsencrypt root cert and libraries
Browse files Browse the repository at this point in the history
The LetsEncrypt root certificate was not pushed for some reason in the
last release, it was only in the local project and not added to the
repository. For this reason the plugin was not working correctly on a
new machine when the source files were pulled from the repository and
compiled+run. Since letsencrypt just updated their root certificates, I
just added the new root certificate to the project, and it will be valid
until 2040. Also, the necessary libraries were not pushed to the
repository, so now adding and pushing those also.
  • Loading branch information
JohnRDOrazio committed Oct 8, 2020
1 parent 260d7e7 commit 0e67d11
Show file tree
Hide file tree
Showing 14 changed files with 683 additions and 289 deletions.
Binary file added libraries/commons-lang3-3.11.jar
Binary file not shown.
Binary file added libraries/commons-text-1.9.jar
Binary file not shown.
Binary file added libraries/glazedlists-1.11.0.jar
Binary file not shown.
Binary file added libraries/javax.json-1.1.4.jar
Binary file not shown.
699 changes: 524 additions & 175 deletions nbproject/build-impl.xml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions nbproject/genfiles.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=d5b6853a
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=ee5af6e4
nbproject/build-impl.xml.script.CRC32=3c8001e6
nbproject/build-impl.xml.stylesheet.CRC32=05530350@1.79.1.48
nbproject/build-impl.xml.script.CRC32=97a3bf9d
nbproject/build-impl.xml.stylesheet.CRC32=f89f7d21@1.96.0.48
34 changes: 24 additions & 10 deletions nbproject/project.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
debug.modulepath=\
${run.modulepath}
debug.test.modulepath=\
${run.test.modulepath}
file.reference.commons-lang3-3.11.jar=libraries/commons-lang3-3.11.jar
file.reference.commons-text-1.9.jar=libraries/commons-text-1.9.jar
file.reference.glazedlists-1.11.0.jar=libraries/glazedlists-1.11.0.jar
javac.modulepath=
javac.processormodulepath=
javac.test.modulepath=\
${javac.modulepath}
javadoc.html5=false
jlink.launcher=false
jlink.launcher.name=BibleGetIO_OpenOffice
#Sat Mar 02 19:50:39 CET 2019
jnlp.offline-allowed=false
javadoc.splitindex=true
Expand All @@ -15,6 +29,10 @@ jnlp.descriptor=application
build.dir=build
javac.deprecation=true
jnlp.signed=false
run.modulepath=\
${javac.modulepath}
run.test.modulepath=\
${javac.test.modulepath}
test.src.dir=test
junit.selected.version=4
jar.archive.disabled=${jnlp.enabled}
Expand All @@ -40,22 +58,20 @@ jnlp.signing=
javadoc.notree=false
dist.jar=${dist.dir}/BibleGetIO_OpenOffice.jar
manifest.custom.caller.allowable.codebase=
platform.active=JDK_1.8_x86
file.reference.commons-lang3-3.8.1.jar=../../commons-lang3-3.8.1-bin/commons-lang3-3.8.1.jar
platform.active=JDK_1.8
manifest.custom.application.library.allowable.codebase=
annotation.processing.enabled=true
main.class=io.bibleget.BibleGetIO
dist.javadoc.dir=${dist.dir}/javadoc
javadoc.additionalparam=
auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml
javac.classpath=\
${libs.JAVADB_DRIVER_LABEL.classpath}:\
${file.reference.commons-text-1.6.jar}:\
${file.reference.glazedlists-1.11.0.jar}:\
${libs.beans-binding.classpath}:\
${libs.Java-EE-GlassFish-v3-Prelude.classpath}:\
${file.reference.commons-lang3-3.8.1.jar}:\
${libs.OpenOffice 4.1.6.classpath}
${libs.OpenOffice 4.1.7.classpath}:\
${file.reference.commons-lang3-3.11.jar}:\
${file.reference.commons-text-1.9.jar}:\
${libs.JAVADB_DRIVER_LABEL.classpath}:\
${libs.Java-EE-GlassFish-v3-Prelude.classpath}
javadoc.noindex=false
manifest.custom.codebase=
annotation.processing.enabled.in.editor=false
Expand All @@ -73,8 +89,6 @@ annotation.processing.run.all.processors=true
excludes=
application.title=BibleGetIO_OpenOffice
jnlp.codebase.type=no.codebase
file.reference.glazedlists-1.11.0.jar=../../glazedlists-1.11.0.jar
file.reference.commons-text-1.6.jar=../../commons-text-1.6/commons-text-1.6.jar
javac.processorpath=\
${javac.classpath}
build.test.results.dir=${build.dir}/test/results
Expand Down
14 changes: 7 additions & 7 deletions src/description.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,33 @@
<high-contrast xlink:href="images/holy-bible-x256.png"/>
</icon>
<display-name>
<name lang="fr">BibleGet I/O</name>
<name lang="it">BibleGet I/O</name>
<name lang="es">BibleGet I/O</name>
<name lang="en">BibleGet I/O</name>
<name lang="de">BibleGet I/O</name>
<name lang="es">BibleGet I/O</name>
<name lang="fr">BibleGet I/O</name>
</display-name>
<publisher>
<name lang="es" xlink:href="https://www.bibleget.io">John R. D'Orazio, Giovanni Gregori, Simone Urbinati</name>
<name lang="fr" xlink:href="https://www.bibleget.io">John R. D'Orazio, Giovanni Gregori, Simone Urbinati</name>
<name lang="en" xlink:href="https://www.bibleget.io">John R. D'Orazio, Giovanni Gregori, Simone Urbinati</name>
<name lang="it" xlink:href="https://www.bibleget.io">John R. D'Orazio, Giovanni Gregori, Simone Urbinati</name>
<name lang="en" xlink:href="https://www.bibleget.io">John R. D'Orazio, Giovanni Gregori, Simone Urbinati</name>
<name lang="es" xlink:href="https://www.bibleget.io">John R. D'Orazio, Giovanni Gregori, Simone Urbinati</name>
<name lang="de" xlink:href="https://www.bibleget.io">John R. D'Orazio, Giovanni Gregori, Simone Urbinati</name>
</publisher>
<extension-description>
<src lang="fr" xlink:href="description/desc_fr.txt"/>
<src lang="it" xlink:href="description/desc_it.txt"/>
<src lang="es" xlink:href="description/desc_es.txt"/>
<src lang="en" xlink:href="description/desc_en.txt"/>
<src lang="de" xlink:href="description/desc_de.txt"/>
<src lang="es" xlink:href="description/desc_es.txt"/>
<src lang="fr" xlink:href="description/desc_fr.txt"/>
</extension-description>
<registration>
<simple-license accept-by="user" default-license-id="en">
<license-text lang="en" license-id="en" xlink:href="licenses/license.TXT"/>
<license-text lang="de" xlink:href="licenses/license.TXT"/>
<license-text lang="fr" xlink:href="licenses/license.TXT"/>
<license-text lang="it" xlink:href="licenses/license.TXT"/>
<license-text lang="es" xlink:href="licenses/license.TXT"/>
<license-text lang="de" xlink:href="licenses/license.TXT"/>
</simple-license>
</registration>
</description>
32 changes: 19 additions & 13 deletions src/io/bibleget/BibleGetDB.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.sql.DatabaseMetaData;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Types;
Expand Down Expand Up @@ -50,7 +51,7 @@ private BibleGetDB() throws ClassNotFoundException {
try {
setDBSystemDir();
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
} catch (Exception ex) {
} catch (ClassNotFoundException ex) {
Logger.getLogger(BibleGetDB.class.getName()).log(Level.SEVERE, null, ex);
}
}
Expand Down Expand Up @@ -324,10 +325,10 @@ else if(SystemUtils.IS_OS_LINUX){
try (ResultSet rs3 = dbMeta.getTables(null, null, "METADATA", null)) {
if(rs3.next())
{
//System.out.println("Table "+rs3.getString("TABLE_NAME")+" already exists !!");
System.out.println("Table "+rs3.getString("TABLE_NAME")+" already exists !!");
}
else{
//System.out.println("Table METADATA does not exist, now attempting to create...");
System.out.println("Table METADATA does not exist, now attempting to create...");
try (Statement stmt = instance.conn.createStatement()) {
String tableCreate = "CREATE TABLE METADATA (";
tableCreate += "ID INT, ";
Expand All @@ -348,17 +349,20 @@ else if(SystemUtils.IS_OS_LINUX){
}
else{
//this is our expected behaviour: 0 rows affected
//System.out.println("The Table Creation statement produced results: "+count+" rows affected.");
System.out.println("The Table Creation statement produced results: "+count+" rows affected.");
//Insert a dummy row, because you cannot update what has not been inserted!
try ( Statement stmtX = instance.conn.createStatement()) {
stmtX.execute("INSERT INTO METADATA (ID) VALUES (0)");
stmtX.close();
}

HTTPCaller myHTTPCaller = new HTTPCaller();
System.out.println(this.getClass().getSimpleName() + " >> We should now have an instance of the HTTPCaller class.");
String myResponse;
myResponse = myHTTPCaller.getMetaData("biblebooks");
if(myResponse != null){
System.out.println(this.getClass().getSimpleName() + " >> response from myHTTPCaller.getMetaData(\"biblebooks\") call is:");
System.out.println(myResponse);
JsonReader jsonReader = Json.createReader(new StringReader(myResponse));
JsonObject json = jsonReader.readObject();
JsonArray arrayJson = json.getJsonArray("results");
Expand All @@ -372,7 +376,7 @@ else if(SystemUtils.IS_OS_LINUX){
JsonArray currentJson = (JsonArray) pIterator.next();
//TODO: double check that JsonArray.toString is working as intended!
String biblebooks_str = currentJson.toString(); //.replaceAll("\"", "\\\\\"");
System.out.println("BibleGetDB line 267: BIBLEBOOKS"+Integer.toString(index)+"='"+biblebooks_str+"'");
System.out.println("BibleGetDB line 379: BIBLEBOOKS"+Integer.toString(index)+"='"+biblebooks_str+"'");
String stmt_str = "UPDATE METADATA SET BIBLEBOOKS"+Integer.toString(index)+"='"+biblebooks_str+"' WHERE ID=0";
try{
//System.out.println("executing update: "+stmt_str);
Expand Down Expand Up @@ -400,6 +404,8 @@ else if(SystemUtils.IS_OS_LINUX){
stmt2.close();
}
}
} else {
System.out.println(this.getClass().getSimpleName() + " >> myResponse is null!!!!");
}

myResponse = myHTTPCaller.getMetaData("bibleversions");
Expand Down Expand Up @@ -642,21 +648,21 @@ public String getMetaData(String dataOption){
dataOption = StringUtils.upperCase(dataOption);
String metaDataStr = "";
if(dataOption.startsWith("BIBLEBOOKS") || dataOption.equals("LANGUAGES") || dataOption.equals("VERSIONS") || dataOption.endsWith("IDX")){
//System.out.println("getMetaData received a valid request for "+dataOption);
System.out.println("getMetaData received a valid request for "+dataOption);
if(instance.connect()){
if(instance.conn == null){
//System.out.println("What is going on here? Why is connection null?");
System.out.println("What is going on here? Why is connection null?");
}else{
//System.out.println("getMetaData has connected to the database...");
System.out.println("getMetaData has connected to the database...");
}
String sqlexec = "SELECT "+dataOption+" FROM METADATA WHERE ID=0";
try(Statement stmt = instance.conn.createStatement()){
try (ResultSet rsOps = stmt.executeQuery(sqlexec)) {
//System.out.println("query seems to have been successful...");
//ResultSetMetaData rsMD = rsOps.getMetaData();
//int cols = rsMD.getColumnCount();
//String colnm = rsMD.getColumnName(cols);
//System.out.println("there are "+Integer.toString(cols)+" columns in this resultset and name is: "+colnm+"(requested "+dataOption+")");
System.out.println("query seems to have been successful...");
ResultSetMetaData rsMD = rsOps.getMetaData();
int cols = rsMD.getColumnCount();
String colnm = rsMD.getColumnName(cols);
System.out.println("there are "+Integer.toString(cols)+" columns in this resultset and name is: "+colnm+"(requested "+dataOption+")");
while(rsOps.next()){
metaDataStr = rsOps.getString(dataOption);
}
Expand Down
87 changes: 46 additions & 41 deletions src/io/bibleget/BibleGetFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,51 +107,56 @@ public static BibleGetFrame getInstance(XController xController) throws ClassNot
private void prepareDynamicInformation() throws ClassNotFoundException, SQLException{
biblegetDB = BibleGetDB.getInstance();
String bibleVersionsStr = biblegetDB.getMetaData("VERSIONS");
JsonReader jsonReader = Json.createReader(new StringReader(bibleVersionsStr));
JsonObject bibleVersionsObj = jsonReader.readObject();
Set<String> versionsabbrev = bibleVersionsObj.keySet();
bibleVersions = new BasicEventList<>();
if(!versionsabbrev.isEmpty()){
for(String s:versionsabbrev) {
String versionStr = bibleVersionsObj.getString(s); //store these in an array
String[] array;
array = versionStr.split("\\|");
bibleVersions.add(new BibleVersion(s,array[0],array[1],StringUtils.capitalize(new Locale(array[2]).getDisplayLanguage())));
System.out.println(this.getClass().getSimpleName() + " -> prepareDynamicInformation -> bibleVersionsStr = " + bibleVersionsStr);
if(null == bibleVersionsStr){
System.out.println("We have a problem Watson!");
} else{
JsonReader jsonReader = Json.createReader(new StringReader(bibleVersionsStr));
JsonObject bibleVersionsObj = jsonReader.readObject();
Set<String> versionsabbrev = bibleVersionsObj.keySet();
bibleVersions = new BasicEventList<>();
if(!versionsabbrev.isEmpty()){
for(String s:versionsabbrev) {
String versionStr = bibleVersionsObj.getString(s); //store these in an array
String[] array;
array = versionStr.split("\\|");
bibleVersions.add(new BibleVersion(s,array[0],array[1],StringUtils.capitalize(new Locale(array[2]).getDisplayLanguage())));
}
}
}

List<String> preferredVersions = new ArrayList<>();
String retVal = (String)biblegetDB.getOption("PREFERREDVERSIONS");
if(null==retVal){
//System.out.println("Attempt to retrieve PREFERREDVERSIONS from the Database resulted in null value");
}
else{
//System.out.println("Retrieved PREFERREDVERSIONS from the Database. Value is:"+retVal);
String[] favoriteVersions = StringUtils.split(retVal,',');
preferredVersions = Arrays.asList(favoriteVersions);
}
if(preferredVersions.isEmpty()){
preferredVersions.add("NVBSE");
}
List<Integer> preferredVersionsIndices = new ArrayList<>();

versionsByLang = new SeparatorList<>(bibleVersions, new VersionComparator(),1, 1000);
int listLength = versionsByLang.size();
enabledFlags = new boolean[listLength];
ListIterator itr = versionsByLang.listIterator();
while(itr.hasNext()){
int idx = itr.nextIndex();
Object next = itr.next();
enabledFlags[idx] = !(next.getClass().getSimpleName().equals("GroupSeparator"));
if(next.getClass().getSimpleName().equals("BibleVersion")){
BibleVersion thisBibleVersion = (BibleVersion)next;
if(preferredVersions.contains(thisBibleVersion.getAbbrev())){
preferredVersionsIndices.add(idx);

List<String> preferredVersions = new ArrayList<>();
String retVal = (String)biblegetDB.getOption("PREFERREDVERSIONS");
if(null==retVal){
//System.out.println("Attempt to retrieve PREFERREDVERSIONS from the Database resulted in null value");
}
else{
//System.out.println("Retrieved PREFERREDVERSIONS from the Database. Value is:"+retVal);
String[] favoriteVersions = StringUtils.split(retVal,',');
preferredVersions = Arrays.asList(favoriteVersions);
}
if(preferredVersions.isEmpty()){
preferredVersions.add("NVBSE");
}
List<Integer> preferredVersionsIndices = new ArrayList<>();

versionsByLang = new SeparatorList<>(bibleVersions, new VersionComparator(),1, 1000);
int listLength = versionsByLang.size();
enabledFlags = new boolean[listLength];
ListIterator itr = versionsByLang.listIterator();
while(itr.hasNext()){
int idx = itr.nextIndex();
Object next = itr.next();
enabledFlags[idx] = !(next.getClass().getSimpleName().equals("GroupSeparator"));
if(next.getClass().getSimpleName().equals("BibleVersion")){
BibleVersion thisBibleVersion = (BibleVersion)next;
if(preferredVersions.contains(thisBibleVersion.getAbbrev())){
preferredVersionsIndices.add(idx);
}
}
}
indices = ArrayUtils.toPrimitive(preferredVersionsIndices.toArray(new Integer[preferredVersionsIndices.size()]));
//System.out.println("value of indices array: "+Arrays.toString(indices));
}
indices = ArrayUtils.toPrimitive(preferredVersionsIndices.toArray(new Integer[preferredVersionsIndices.size()]));
//System.out.println("value of indices array: "+Arrays.toString(indices));

}

Expand Down
2 changes: 1 addition & 1 deletion src/io/bibleget/BibleGetIO.java
Original file line number Diff line number Diff line change
Expand Up @@ -506,4 +506,4 @@ public com.sun.star.frame.XController getController()
public static void main(String args[]) {
}
*/
}
}
Loading

0 comments on commit 0e67d11

Please sign in to comment.