From 6630f6d023ae6af78c56238dff5746a1e3033ead Mon Sep 17 00:00:00 2001 From: kenstir Date: Wed, 18 Nov 2015 21:14:09 -0500 Subject: [PATCH] * Fixed bug switching between accounts at different libraries; you need a new HTTP connection when you switch URLs. Duh. --- .../checkout/ItemsCheckOutListView.java | 23 +++++++++++----------- .../org/evergreen_ils/globals/GlobalConfigs.java | 2 ++ Open-ILS/src/Android/eg_app/res/values/ou.xml | 1 + Open-ILS/src/Android/kenstir_parse_logcat.pl | 2 +- .../src/org/opensrf/net/http/GatewayRequest.java | 2 +- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Open-ILS/src/Android/core/src/org/evergreen_ils/accountAccess/checkout/ItemsCheckOutListView.java b/Open-ILS/src/Android/core/src/org/evergreen_ils/accountAccess/checkout/ItemsCheckOutListView.java index ec6ce8b31c..5524e3059f 100644 --- a/Open-ILS/src/Android/core/src/org/evergreen_ils/accountAccess/checkout/ItemsCheckOutListView.java +++ b/Open-ILS/src/Android/core/src/org/evergreen_ils/accountAccess/checkout/ItemsCheckOutListView.java @@ -49,7 +49,7 @@ import org.w3c.dom.Text; public class ItemsCheckOutListView extends ActionBarActivity { - private final String TAG = ItemsCheckOutListView.class.getName(); + private final String TAG = ItemsCheckOutListView.class.getSimpleName(); private AccountAccess accountAccess = null; @@ -209,8 +209,7 @@ public class ItemsCheckOutListView extends ActionBarActivity { @Override public void run() { boolean refresh = true; - AccountAccess ac = AccountAccess - .getAccountAccess(); + AccountAccess ac = AccountAccess.getAccountAccess(); runOnUiThread(new Runnable() { @Override @@ -223,6 +222,13 @@ public class ItemsCheckOutListView extends ActionBarActivity { try { ac.renewCirc(record.getTargetCopy()); + } catch (SessionNotFoundException e1) { + try { + if (accountAccess.reauthenticate(ItemsCheckOutListView.this)) + ac.renewCirc(record.getTargetCopy()); + } catch (Exception eauth) { + Log.d(TAG, "Exception in reauth", eauth); + } } catch (MaxRenewalsException e1) { runOnUiThread(new Runnable() { @@ -248,13 +254,6 @@ public class ItemsCheckOutListView extends ActionBarActivity { Toast.LENGTH_LONG).show(); } }); - } catch (SessionNotFoundException e1) { - try { - if (accountAccess.reauthenticate(ItemsCheckOutListView.this)) - ac.renewCirc(record.getTargetCopy()); - } catch (Exception eauth) { - Log.d(TAG, "Exception in reauth", eauth); - } } runOnUiThread(new Runnable() { @Override @@ -301,8 +300,8 @@ public class ItemsCheckOutListView extends ActionBarActivity { recordDueDate.setText(getString(R.string.due) + " " + record.getDueDate()); recordIsOverdue.setText(record.isOverdue() ? getString(R.string.overdue) : ""); Log.d(TAG, "title: \"" + record.getTitle() + "\"" - + "due: " + record.getDueDate() - + "renewals: " + record.getRenewals()); + + " due: " + record.getDueDate() + + " renewals: " + record.getRenewals()); return row; } diff --git a/Open-ILS/src/Android/core/src/org/evergreen_ils/globals/GlobalConfigs.java b/Open-ILS/src/Android/core/src/org/evergreen_ils/globals/GlobalConfigs.java index d749092e20..43b6fa6277 100644 --- a/Open-ILS/src/Android/core/src/org/evergreen_ils/globals/GlobalConfigs.java +++ b/Open-ILS/src/Android/core/src/org/evergreen_ils/globals/GlobalConfigs.java @@ -24,6 +24,7 @@ import android.net.ConnectivityManager; import android.provider.Settings; import android.text.TextUtils; import android.util.Log; +import org.evergreen_ils.auth.Const; import org.evergreen_ils.searchCatalog.Organisation; import org.evergreen_ils.searchCatalog.SearchCatalog; import org.open_ils.idl.IDLParser; @@ -106,6 +107,7 @@ public class GlobalConfigs { private boolean initialize(String library_url) { if (!TextUtils.equals(library_url, httpAddress)) { httpAddress = library_url; + conn = null; // must come before loadXXX() loadIDL(); loadOrganizations(); loadCopyStatusesAvailable(); diff --git a/Open-ILS/src/Android/eg_app/res/values/ou.xml b/Open-ILS/src/Android/eg_app/res/values/ou.xml index 9b68742414..f0fbe387bc 100644 --- a/Open-ILS/src/Android/eg_app/res/values/ou.xml +++ b/Open-ILS/src/Android/eg_app/res/values/ou.xml @@ -5,6 +5,7 @@ Evergreen Library Sign in to your library account Location: + Login: org.evergreen-ils.eg_app Evergreen diff --git a/Open-ILS/src/Android/kenstir_parse_logcat.pl b/Open-ILS/src/Android/kenstir_parse_logcat.pl index 3691d15ec2..ccb30efb96 100644 --- a/Open-ILS/src/Android/kenstir_parse_logcat.pl +++ b/Open-ILS/src/Android/kenstir_parse_logcat.pl @@ -17,7 +17,7 @@ my $logcat = `adb logcat -d -v printable`; my @lines = split(/\r\n/, $logcat); foreach my $line (@lines) { print "line: $line\n" if $debug; - if ($line =~ /org.opensrf.net.http.GatewayRequest: ([^:]+):(.+)/) { + if ($line =~ /GatewayRequest: ([^:]+):(.+)/) { my($key,$val) = ($1,$2); if ($key eq 'result') { my $obj = decode_json($val); diff --git a/Open-ILS/src/Android/opensrf/src/org/opensrf/net/http/GatewayRequest.java b/Open-ILS/src/Android/opensrf/src/org/opensrf/net/http/GatewayRequest.java index b308739152..26066e9b37 100644 --- a/Open-ILS/src/Android/opensrf/src/org/opensrf/net/http/GatewayRequest.java +++ b/Open-ILS/src/Android/opensrf/src/org/opensrf/net/http/GatewayRequest.java @@ -24,7 +24,7 @@ import java.util.concurrent.ConcurrentLinkedQueue; public class GatewayRequest extends HttpRequest { private boolean readComplete; - private String TAG = GatewayRequest.class.getName(); + private String TAG = GatewayRequest.class.getSimpleName(); public GatewayRequest(HttpConnection conn, String service, Method method) { super(conn, service, method); -- 2.11.0