import android.os.Bundle;
import android.os.Looper;
import android.text.TextUtils;
+import android.util.Log;
import org.evergreen.android.R;
import org.evergreen.android.accountAccess.bookbags.BookBag;
import org.evergreen.android.accountAccess.bookbags.BookBagItem;
private String httpAddress = "http://ulysses.calvin.edu";
/** The TAG. */
- private String TAG = "AccountAccess";
+ private final String TAG = AccountAccess.class.getName();
/**
* The auth token. Sent with every request that needs authentication
*/
private AccountAccess(String httpAddress) {
- System.out.println("AccountAccess ctor: "+httpAddress);
+ Log.d(TAG, "AccountAccess ctor: " + httpAddress);
this.httpAddress = httpAddress;
try {
// configure the connection
-
- System.out.println("Connection with " + httpAddress);
+ Log.d(TAG, "Connection with " + httpAddress);
conn = new HttpConnection(httpAddress + "/osrf-gateway-v1");
} catch (Exception e) {
- System.err.println("Exception in establishing connection "
- + e.getMessage());
+ Log.d(TAG, "Exception in establishing connection", e);
}
}
if (accountAccess == null) {
accountAccess = new AccountAccess(httpAddress);
}
- System.out.println(" Addresses " + httpAddress + " "
- + accountAccess.httpAddress);
if (!httpAddress.equals(accountAccess.httpAddress))
accountAccess.updateHttpAddress(httpAddress);
* @param httpAddress the http address
*/
public void updateHttpAddress(String httpAddress) {
- System.out.println("update http address of account access to "
+ Log.d(TAG, "update http address of account access to "
+ httpAddress);
try {
// configure the connection
this.httpAddress = httpAddress;
- System.out.println("Connection with " + httpAddress);
+ Log.d(TAG, "Connection with " + httpAddress);
conn = new HttpConnection(httpAddress + "/osrf-gateway-v1");
} catch (Exception e) {
circRecord);
circRecords.add(circRecord);
- // System.out.println(out.get(i).get("target_copy"));
+ // Log.d(TAG, out.get(i).get("target_copy"));
// fetchInfoForCheckedOutItem(out.get(i).get("target_copy")+"");
}
}
// TODO are we using this too? In the opac they are not used
/*
- * for(int i=0;i<lost_id.size();i++){ //System.out.println(out.get(i));
+ * for(int i=0;i<lost_id.size();i++){ //Log.d(TAG, out.get(i));
* lost.add(retrieveCircRecord(lost_id.get(i))); } for(int
- * i=0;i<claims_returned.size();i++){ //System.out.println(out.get(i));
+ * i=0;i<claims_returned.size();i++){ //Log.d(TAG, out.get(i));
* claims_returned.add(retrieveCircRecord(claims_returned_id.get(i))); }
* for(int i=0;i<long_overdue_id.size();i++){
- * //System.out.println(out.get(i));
+ * //Log.d(TAG, out.get(i));
* long_overdue.add(retrieveCircRecord(long_overdue_id.get(i))); }
*/
return null;
OSRFObject result;
- System.out.println("Mods from copy");
+ Log.d(TAG, "Mods from copy");
OSRFObject info_mvr = fetchModsFromCopy(target_copy);
// if title or author not inserted, request acp with copy_target
result = info_mvr;
// the logic to establish mvr or acp is copied from the opac
if (info_mvr.getString("title") == null
|| info_mvr.getString("author") == null) {
- System.out.println("Asset");
+ Log.d(TAG, "Asset");
info_acp = fetchAssetCopy(target_copy);
result = info_acp;
circRecord.acp = info_acp;
Object resp = Utils.doRequest(conn, SERVICE_CIRC, METHOD_FETCH_HOLDS,
authToken, new Object[] { authToken, userID });
if (resp == null) {
- System.out.println("Result: null");
+ Log.d(TAG, "Result: null");
return holds;
}
method = METHOD_FETCH_MRMODS;
if (holdType.equals("T"))
method = METHOD_FETCH_RMODS;
- System.out.println();
holdInfo = (OSRFObject) Utils.doRequest(conn, SERVICE_SEARCH,
method, cm, new Object[] { holdArhObject.get("target") });
- // System.out.println("Hold here " + holdInfo);
+ // Log.d(TAG, "Hold here " + holdInfo);
hold.title = ((OSRFObject) holdInfo).getString("title");
hold.author = ((OSRFObject) holdInfo).getString("author");
hold.recordInfo = new RecordInfo((OSRFObject) holdInfo);
String type = (String) hold.get("hold_type");
- System.out.println("Hold Type " + type);
+ Log.d(TAG, "Hold Type " + type);
if (type.equals("C")) {
/*
// part label
holdObj.part_label = volume.getString("label");
- System.out.println("Record " + record);
+ Log.d(TAG, "Record " + record);
OSRFObject holdInfo = (OSRFObject) Utils.doRequest(conn,
SERVICE_SEARCH, METHOD_FETCH_RMODS, cm,
new Object[] { record });
// part label
holdObj.part_label = volume.getString("label");
- System.out.println("Record " + record);
+ Log.d(TAG, "Record " + record);
OSRFObject holdInfo = (OSRFObject) Utils.doRequest(conn,
SERVICE_SEARCH, METHOD_FETCH_RMODS, cm,
new Object[] { record });
resp[2] = ((Map<String, String>) map).get("desc");
}
- System.out.println("Result " + resp[1] + " " + resp[2]);
+ Log.d(TAG, "Result " + resp[1] + " " + resp[2]);
// else we return false
return resp;
new Object[] { param });
Object obj = response.get("metarecord");
- System.out.println(obj);
+ Log.d(TAG, "metarecord="+obj);
Integer metarecordID = Integer.parseInt(obj.toString());
HashMap<String, Integer> map = new HashMap<String, Integer>();
public class BookBagDetails extends Activity {
- private String TAG = "BookBags";
+ private final String TAG = BookBagDetails.class.getName();
public static final int RESULT_CODE_UPDATE = 1;
public class BookbagsListView extends Activity {
- private String TAG = "BookBags";
+ private final String TAG = BookbagsListView.class.getName();
private AccountAccess accountAccess = null;
if (accountAccess.reauthenticate(BookbagsListView.this))
accountAccess.createBookbag(name);
} catch (Exception eauth) {
- System.out.println("Exception in reAuth");
+ Log.d(TAG, "Exception in reAuth");
}
}
if (accountAccess.reauthenticate(BookbagsListView.this))
accountAccess.retrieveBookbags();
} catch (Exception eauth) {
- System.out.println("Exception in reAuth");
+ Log.d(TAG, "Exception in reAuth");
}
}
bookBags = accountAccess.getBookbags();
this.circ_type = circ_type;
this.circ_id = circ_id;
- // parse due date
- parseDate(circ);
+ this.circ_due_date = GlobalConfigs.parseDate(circ.getString("due_date"));
}
public CircRecord(OSRFObject circ, int circ_type, int circ_id) {
this.circ = circ;
this.circ_type = circ_type;
this.circ_id = circ_id;
- // parse due date
- parseDate(circ);
+ this.circ_due_date = GlobalConfigs.parseDate(circ.getString("due_date"));
}
public String getAuthor() {
return null;
}
- private void parseDate(OSRFObject circ) {
-
- this.circ_due_date = GlobalConfigs
- .parseDate(circ.getString("due_date"));
- System.out.println(this.circ_due_date);
-
- }
-
}
public class ItemsCheckOutListView extends Activity {
- private String TAG = ItemsCheckOutListView.class.getName();
+ private final String TAG = ItemsCheckOutListView.class.getName();
private AccountAccess accountAccess = null;
import java.util.Calendar;
import java.util.Date;
+import android.util.Log;
import org.evergreen.android.R;
import org.evergreen.android.accountAccess.AccountAccess;
import org.evergreen.android.accountAccess.SessionNotFoundException;
public class HoldDetails extends Activity {
+ private final String TAG = HoldDetails.class.getName();
+
public static final int RESULT_CODE_DELETE_HOLD = 5;
public static final int RESULT_CODE_UPDATE_HOLD = 6;
final HoldRecord record = (HoldRecord) getIntent()
.getSerializableExtra("holdRecord");
- System.out.println("Record " + record + " " + record.title + " "
+ Log.d(TAG, "Record " + record + " " + record.title + " "
+ record.ahr);
accountAccess = AccountAccess.getAccountAccess();
if (record.thaw_date == null)
disableView(thaw_date_edittext);
- System.out.println(record.title + " " + record.author);
+ Log.d(TAG, record.title + " " + record.author);
back.setOnClickListener(new OnClickListener() {
@Override
public void onClick(DialogInterface dialog,
int which) {
- System.out.println("Remove hold with id"
+ Log.d(TAG, "Remove hold with id"
+ record.ahr.getInt("id"));
progressDialog = ProgressDialog.show(context,
accountAccess
.cancelHold(record.ahr);
} catch (Exception eauth) {
- System.out
- .println("Exception in reAuth");
+ Log.d(TAG, "Exception in reAuth");
}
}
suspendHold.isChecked(), expire_date_s,
thaw_date_s);
} catch (Exception eauth) {
- System.out.println("Exception in reAuth");
+ Log.d(TAG, "Exception in reAuth");
}
}
public class HoldsListView extends Activity {
- private String TAG = "HoldsListView";
+ private final String TAG = HoldsListView.class.getName();
private AccountAccess accountAccess = null;
if (accountAccess.reauthenticate(HoldsListView.this))
holdRecords = accountAccess.getHolds();
} catch (Exception eauth) {
- System.out.println("Exception in reauth");
+ Log.d(TAG, "Exception in reauth");
}
}
import java.util.Calendar;
import java.util.Date;
+import android.util.Log;
import org.evergreen.android.R;
import org.evergreen.android.accountAccess.AccountAccess;
import org.evergreen.android.accountAccess.SessionNotFoundException;
public class PlaceHold extends Activity {
+ private final String TAG = PlaceHold.class.getName();
+
private TextView recipient;
private TextView title;
if (thaw_date != null)
thaw_date_s = GlobalConfigs.getStringDate(thaw_date);
- System.out.println("date expire: " + expire_date_s + " "
+ Log.d(TAG, "date expire: " + expire_date_s + " "
+ expire_date);
int selectedOrgID = -1;
if (globalConfigs.organisations.size() > selectedOrgPos)
try {
date = sdf.parse(dateString);
- //System.out.println(date);
} catch (ParseException e) {
e.printStackTrace();
}
public String getOrganizationName(int id) {
for (int i = 0; i < organisations.size(); i++) {
- //System.out.println("Id " + organisations.get(i).id + " " + i);
if (organisations.get(i).id == id)
return organisations.get(i).name;
}
HttpGet request = new HttpGet(url);
response = client.execute(request);
} catch (Exception e) {
- System.out.println("Exception to GET page " + url);
+ Log.d(TAG, "Exception to GET page " + url);
}
StringBuilder str = null;
HttpGet request = new HttpGet(url);
response = client.execute(request);
} catch (Exception e) {
- System.out.println("Exception to GET page " + url);
+ Log.d(TAG, "Exception to GET page " + url);
}
try {
Method method = new Method(methodName);
- System.out.println("doRequest Method :" + methodName + ":");
+ Log.d(TAG, "doRequest Method :" + methodName + ":");
for (int i = 0; i < params.length; i++) {
method.addParam(params[i]);
- System.out.println("Param " + i + ": " + params[i]);
+ Log.d(TAG, "Param " + i + ": " + params[i]);
}
// sync request
Object resp;
while ((resp = req.recv()) != null) {
- System.out.println("Sync Response: " + resp);
+ Log.d(TAG, "Sync Response: " + resp);
Object response = (Object) resp;
return response;
}
Method method = new Method(methodName);
- System.out.println("doRequestSimple Method :" + methodName);
+ Log.d(TAG, "doRequestSimple Method :" + methodName);
for (int i = 0; i < params.length; i++) {
method.addParam(params[i]);
- System.out.println("Param " + i + ":" + params[i]);
+ Log.d(TAG, "Param " + i + ":" + params[i]);
}
// sync request
Object resp;
while ((resp = req.recv()) != null) {
- System.out.println("Sync Response: " + resp);
+ Log.d(TAG, "Sync Response: " + resp);
Object response = (Object) resp;
return response;
public class AdvancedSearchActivity extends Activity {
- private String TAG = "AdvancedSearchActivity";
+ private final String TAG = AdvancedSearchActivity.class.getName();
private AccountAccess accountAccess = null;
*/
package org.evergreen.android.searchCatalog;
+import android.util.Log;
+
import java.io.Serializable;
import java.util.Map;
public class CopyCountInformation implements Serializable {
- /**
- *
- */
+ private final String TAG = CopyCountInformation.class.getName();
private static final long serialVersionUID = 12343248767867L;
public Integer org_id;
public Integer count;
this.depth = ((Map<String, Integer>) map).get("depth");
this.unshadow = ((Map<String, Integer>) map).get("unshadow");
- System.out.println(org_id + " " + available + " " + count);
+ Log.d(TAG, org_id + " " + available + " " + count);
}
}
*/
package org.evergreen.android.searchCatalog;
+import android.util.Log;
+
import java.io.Serializable;
import java.util.HashMap;
import java.util.Iterator;
public class CopyInformation implements Serializable {
- /**
- *
- */
private static final long serialVersionUID = -7269334218707079463L;
+ private final String TAG = CopyInformation.class.getName();
+
public Integer org_id = -1;
public String call_number_sufix;
if (hashValCopy.containsKey(entry.getKey())) {
statusInformation.put(entry.getValue(),
hashValCopy.get(entry.getKey()) + "");
- System.out.println("Added " + entry.getKey() + " "
+ Log.d(TAG, "Added " + entry.getKey() + " "
+ entry.getValue() + " "
+ hashValCopy.get(entry.getKey()));
}
import java.util.Map;
import java.util.Map.Entry;
+import android.util.Log;
import org.opensrf.util.OSRFObject;
public class RecordInfo implements Serializable {
// {"title","author","doc_id","doc_type","pubdate","isbn","publisher","tcn","subject","type_of_resources","call_numbers","edition","online_loc","synopsis","physical_description","toc","copy_count","series","serials","foreign_copy_maps"});
- /**
- *
- */
private static final long serialVersionUID = 10123L;
+ private final String TAG = RecordInfo.class.getName();
+
public String title = null;
public String author = null;
this.image = info.getString("tcn");
this.doc_type = info.getString("doc_type");
} catch (Exception e) {
- System.out.println("Exception basic info " + e.getMessage());
+ Log.d(TAG, "Exception basic info " + e.getMessage());
}
;
try {
this.isbn = (String) info.get("isbn");
} catch (Exception e) {
- System.out.println("Exception isbn " + e.getMessage());
+ Log.d(TAG, "Exception isbn " + e.getMessage());
}
;
}
} catch (Exception e) {
- System.out.println("Exception subject " + e.getMessage());
+ Log.d(TAG, "Exception subject " + e.getMessage());
}
;
try {
this.online_loc = ((List) info.get("online_loc")).get(0).toString();
} catch (Exception e) {
- System.out.println("Exception online_loc " + e.getMessage());
+ Log.d(TAG, "Exception online_loc " + e.getMessage());
}
;
try {
this.physical_description = (String) info
.get("physical_description");
} catch (Exception e) {
- System.out.println("Exception physical_description "
+ Log.d(TAG, "Exception physical_description "
+ e.getMessage());
}
;
else
this.series += seriesList.get(i);
} catch (Exception e) {
- System.out.println("Exception series " + e.getMessage());
+ Log.d(TAG, "Exception series " + e.getMessage());
}
;
*/
} catch (Exception e) {
- System.out.println("Exception in JSON " + e.getMessage());
+ Log.d(TAG, "Exception in JSON " + e.getMessage());
}
// do request and check for connectivity
ArrayList<String> ids = new ArrayList<String>();
- System.out.println("Sync Response: " + resp);
+ Log.d(TAG, "Sync Response: " + resp);
if (resp == null)
return resultsRecordInfo; // search failed or server crashed
Map<String, ?> response = (Map<String, ?>) resp;
- System.out.println(" ids : " + response.get("ids") + " ");
+ Log.d(TAG, " ids : " + response.get("ids") + " ");
List<List<String>> result_ids;
result_ids = (List<List<String>>) response.get("ids");
- System.out.println("length:"+result_ids.size());
+ Log.d(TAG, "length:"+result_ids.size());
// sometimes count is an int ("count":0) and sometimes string ("count":"1103")
visible = Integer.parseInt(response.get("count").toString());
ids.add(result_ids.get(i).get(0));
}
- System.out.println("Ids " + ids);
+ Log.d(TAG, "Ids " + ids);
// request other info based on ids
record.copyInformationList.add(copyInfo);
}
- System.out.println("Title " + record.title + " Author "
+ Log.d(TAG, "Title " + record.title + " Author "
+ record.author + " Pub date" + record.pubdate
+ " Publisher" + record.publisher);
}
HttpRequest req = new GatewayRequest(conn, SERVICE, method).send();
Object resp;
while ((resp = req.recv()) != null) {
- System.out.println("Sync Response: " + resp);
+ Log.d(TAG, "Sync Response: " + resp);
return (OSRFObject) resp;
}
CopyInformation.availableOrgStatuses.put(
ccs_obj.getInt("id") + "",
ccs_obj.getString("name"));
- //System.out.println("Add status "+ccs_obj.getString("name"));
+ //Log.d(TAG, "Add status "+ccs_obj.getString("name"));
}
}
}
public class SearchCatalogListView extends Activity {
- private String TAG = "SearchCatalogListView";
+ private final String TAG = SearchCatalogListView.class.getName();
private ArrayList<RecordInfo> recordList;
// don't clear record list
// recordList.clear();
- System.out.println("Returned "
+ Log.d(TAG, "Returned "
+ searchResults.size()
+ " elements from search");
if (searchResults.size() > 0) {
homeLibrary = AccountAccess.getAccountAccess().getHomeLibraryID();
}
ArrayList<String> list = new ArrayList<String>();
- Log.d("kcxxx", "Org scanning ...");
+ Log.d(TAG, "Org scanning ...");
if (globalConfigs.organisations != null) {
for (int i = 0; i < globalConfigs.organisations.size(); i++) {
Organisation org = globalConfigs.organisations.get(i);
selectedPos = i;
}
}
- Log.d("kcxxx", "Org scanning ...done");
+ Log.d(TAG, "Org scanning ...done");
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
layout.spinner_layout, list);
choseOrganisation = (Spinner) findViewById(R.id.chose_organisation);
public class NotificationReceiver extends BroadcastReceiver {
- private String TAG = "NotificationManager";
+ private final String TAG = NotificationReceiver.class.getName();
public static final int NOTIFICATION_ID = 1;
@Override
List<NotificationAlert> alarms = daoNotifications.fetchAll("");
for (int i = 0; i < alarms.size(); i++) {
- System.out.println("notification " + alarms.get(i));
Log.d(TAG, "Notification " + alarms.get(i));
}
for (int i = 0; i < circRecords.size(); i++) {
import java.util.Map.Entry;
import java.util.Set;
+import android.util.Log;
import org.evergreen.android.R;
import org.evergreen.android.accountAccess.AccountAccess;
import org.evergreen.android.accountAccess.SessionNotFoundException;
public class BasicDetailsFragment extends Fragment {
+ private final String TAG = BasicDetailsFragment.class.getName();
+
private RecordInfo record;
private Integer position;
private Integer total;
if (search != null)
current_org = search.selectedOrganization.id;
- System.out.println("Size " + record.copyCountListInfo.size());
+ Log.d(TAG, "Size " + record.copyCountListInfo.size());
for (int i = 0; i < record.copyCountListInfo.size(); i++) {
- System.out.println(current_org + " "
+ Log.d(TAG, current_org + " "
+ record.copyCountListInfo.get(i).org_id + " "
+ record.copyCountListInfo.get(i).count);
if (record.copyCountListInfo.get(i).org_id == current_org) {
public class ApplicationPreferences extends PreferenceActivity implements
OnSharedPreferenceChangeListener {
- private String TAG = ApplicationPreferences.class.getSimpleName();
+ private final String TAG = ApplicationPreferences.class.getName();
private ProgressDialog progressDialog;
*
*/
public class LoadingTask {
- private String TAG = "LoadingTask";
+ private final String TAG = LoadingTask.class.getName();
public static final String TASK_OK = "OK";
public class AccountAuthenticator extends AbstractAccountAuthenticator {
- private final String TAG = "eg.auth";
+ private final String TAG = AccountAuthenticator.class.getName();
private Context context;
public AccountAuthenticator(Context context) {
public class AuthenticatorActivity extends AccountAuthenticatorActivity {
- private final String TAG = "eg.auth";
+ private final String TAG = AuthenticatorActivity.class.getName();
public final static String ARG_ACCOUNT_TYPE = "ACCOUNT_TYPE";
public final static String ARG_AUTH_TYPE = "AUTH_TYPE";
// parse response
String textcode = ((Map<String, String>) resp).get("textcode");
- System.out.println("textcode: " + textcode);
+ Log.d(TAG, "textcode: " + textcode);
if (textcode.equals("SUCCESS")) {
Object payload = ((Map<String, String>) resp).get("payload");
- System.out.println("payload: " + payload);
+ Log.d(TAG, "payload: " + payload);
String authtoken = ((Map<String, String>) payload).get("authtoken");
- System.out.println("authtoken: " + authtoken);
+ Log.d(TAG, "authtoken: " + authtoken);
Integer authtime = ((Map<String, Integer>) payload).get("authtime");
- System.out.println("authtime: " + authtime);
+ Log.d(TAG, "authtime: " + authtime);
return authtoken;
} else if (textcode.equals("LOGIN_FAILED")) {
String desc = ((Map<String, String>) resp).get("desc");
- System.out.println("desc: "+desc);
+ Log.d(TAG, "desc: "+desc);
if (!TextUtils.isEmpty(desc)) {
throw new AuthenticationException(desc);
}
HashMap fields = current.getFields();
String fieldNames[] = new String[fields.size()];
- if (current.getIDLClass().equals("payments_combined_detail") || current.getIDLClass().equals("ahr")) {
- System.out.println("kcxxx");
- }
for(Iterator itr = fields.keySet().iterator(); itr.hasNext(); ) {
String key = (String) itr.next();
IDLField field = (IDLField) fields.get(key);
String idlFile = "fm_IDL.xml";
IDLParser parser = new IDLParser(idlFile);
parser.parse();
- //System.out.print(parser.toXML());
OSRFObject bre = new OSRFObject("bre");
bre.put("id", new Integer(1));