From ca06262bbebc24653041e4f9ab8097c9784a5212 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Meier?= Date: Mon, 18 Nov 2024 16:07:32 +0100 Subject: [PATCH] Rename fileUploadListener to listener for p:fileUpload and fix an error in readCandidatesFromFile for SDF files. --- .../de/ipbhalle/metfraglib/database/LocalSDFDatabase.java | 4 +++- .../src/main/webapp/includes/candidateFiltersPrime.xhtml | 2 +- .../src/main/webapp/includes/candidateScoresPrime.xhtml | 4 ++-- MetFragWeb/src/main/webapp/includes/databasePrime.xhtml | 2 +- MetFragWeb/src/main/webapp/includes/uploadParameters.xhtml | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/MetFragLib/src/main/java/de/ipbhalle/metfraglib/database/LocalSDFDatabase.java b/MetFragLib/src/main/java/de/ipbhalle/metfraglib/database/LocalSDFDatabase.java index 9075134e..f5dff390 100644 --- a/MetFragLib/src/main/java/de/ipbhalle/metfraglib/database/LocalSDFDatabase.java +++ b/MetFragLib/src/main/java/de/ipbhalle/metfraglib/database/LocalSDFDatabase.java @@ -121,7 +121,9 @@ protected void readCandidatesFromFile() throws Exception { while(keys.hasNext()) { String curKey = keys.next(); if(!this.candidates.get(i).hasDefinedProperty(curKey)) this.candidates.get(i).setProperty(curKey, "-"); - if(((String)this.candidates.get(i).getProperty(curKey)).equals("")) this.candidates.get(i).setProperty(curKey, "-"); + Object property = this.candidates.get(i).getProperty(curKey); + if (property instanceof String && ((String) property).isEmpty()) + this.candidates.get(i).setProperty(curKey, "-"); } } diff --git a/MetFragWeb/src/main/webapp/includes/candidateFiltersPrime.xhtml b/MetFragWeb/src/main/webapp/includes/candidateFiltersPrime.xhtml index 90b9ab94..86623867 100644 --- a/MetFragWeb/src/main/webapp/includes/candidateFiltersPrime.xhtml +++ b/MetFragWeb/src/main/webapp/includes/candidateFiltersPrime.xhtml @@ -388,7 +388,7 @@ cellspacing="4" cellpadding="4" styleClass="subPanel" rendered="#{metFragWebBean.suspectListInclusionFilterEnabled}"> diff --git a/MetFragWeb/src/main/webapp/includes/candidateScoresPrime.xhtml b/MetFragWeb/src/main/webapp/includes/candidateScoresPrime.xhtml index 8d546db6..d4ac0621 100644 --- a/MetFragWeb/src/main/webapp/includes/candidateScoresPrime.xhtml +++ b/MetFragWeb/src/main/webapp/includes/candidateScoresPrime.xhtml @@ -146,7 +146,7 @@ @@ -245,7 +245,7 @@ cellspacing="4" cellpadding="4" styleClass="subPanel" rendered="#{metFragWebBean.suspectListInclusionScoreEnabled}"> diff --git a/MetFragWeb/src/main/webapp/includes/databasePrime.xhtml b/MetFragWeb/src/main/webapp/includes/databasePrime.xhtml index 32a58071..d3912044 100644 --- a/MetFragWeb/src/main/webapp/includes/databasePrime.xhtml +++ b/MetFragWeb/src/main/webapp/includes/databasePrime.xhtml @@ -57,7 +57,7 @@