* Fixed bug switching between accounts at different libraries; you need a new HTTP...
authorkenstir <kenstir@gmail.com>
Thu, 19 Nov 2015 02:14:09 +0000 (21:14 -0500)
committerkenstir <kenstir@gmail.com>
Thu, 19 Nov 2015 02:14:09 +0000 (21:14 -0500)
Open-ILS/src/Android/core/src/org/evergreen_ils/accountAccess/checkout/ItemsCheckOutListView.java
Open-ILS/src/Android/core/src/org/evergreen_ils/globals/GlobalConfigs.java
Open-ILS/src/Android/eg_app/res/values/ou.xml
Open-ILS/src/Android/kenstir_parse_logcat.pl
Open-ILS/src/Android/opensrf/src/org/opensrf/net/http/GatewayRequest.java

index ec6ce8b..5524e30 100644 (file)
@@ -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;
         }
index d749092..43b6fa6 100644 (file)
@@ -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();
index 9b68742..f0fbe38 100644 (file)
@@ -5,6 +5,7 @@
     <string name="ou_account_label">Evergreen Library</string>
     <string name="ou_account_sign_in_message">Sign in to your library account</string>
     <string name="ou_choose_library_label">Location:</string>
+    <string name="ou_sign_in_label">Login:</string>
     <string name="ou_account_type">org.evergreen-ils.eg_app</string>
     <string name="ou_app_label">Evergreen</string>
     <string name="ou_library_name"></string>
index 3691d15..ccb30ef 100644 (file)
@@ -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);
index b308739..26066e9 100644 (file)
@@ -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);