android:fillViewport="true"
android:layout_above="@id/action_bar"
android:layout_below="@id/header_actionbar"
+ android:padding="5dp"
>
<LinearLayout
android:layout_width="fill_parent"
<include android:id="@+id/header_actionbar" layout="@layout/simple_actionbar"/>
<LinearLayout android:layout_width="fill_parent"
- android:layout_height="wrap_content">
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:padding="5dp"
+ >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="@string/search_result_text"
+ android:text="@string/hold_items"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
+ android:textSize="14sp"
/>
</LinearLayout>
<ListView
android:id="@+id/holds_item_list"
android:layout_width="fill_parent"
- android:layout_height="wrap_content"
+ android:layout_height="fill_parent"
></ListView>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="match_parent" >
+ android:layout_height="match_parent"
+ android:orientation="horizontal"
+ android:paddingLeft="5dp"
+ >
- <TextView
+
+ <ImageView
+ android:id="@+id/hold_resource_icon"
+ android:layout_width="wrap_content"
+ android:layout_height="fill_parent"
+ android:layout_gravity="center"
+ android:background="@color/white"
+ />
+
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical"
+ android:padding="5dp"
+ android:layout_weight="1"
+ >
+
+ <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/hold_title"
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:id="@+id/hold_author"
- android:layout_below="@+id/hold_title"
+ android:id="@+id/hold_author"
style="@style/AuthorSearchStyleList"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/hold_status"
- android:layout_below="@+id/hold_author"
android:textColor="@color/blue"
/>
+
+ </LinearLayout>
+
-</RelativeLayout>
\ No newline at end of file
+</LinearLayout>
\ No newline at end of file
android:fillViewport="true"
android:layout_above="@id/action_bar"
android:layout_below="@id/header_actionbar"
+ android:padding="5dip"
>
<LinearLayout
android:layout_width="fill_parent"
<string name="hold_expire_time_hint">Hold expire time</string>
<string name="hold_thaw_date_hint">Date when the hold is frozen</string>
+ <string name="hold_items">Hold items: </string>
+
<!-- Checkout items -->
<string name="checkout_item_txt">Total items out: </string>
<string name="checkout_overdue_items">/ Overdue items: </string>
Object response;
- Object holdInfo = null;
+ OSRFObject holdInfo = null;
if(holdType.equals("T") || holdType.equals("M")){
if(holdType.equals("M"))
if(holdType.equals("T"))
method = METHOD_FETCH_RMODS;
System.out.println();
- holdInfo = Utils.doRequest(conn,SERVICE_SEARCH, method, cm, new Object[]{holdArhObject.get("target")});
+ holdInfo = (OSRFObject)Utils.doRequest(conn,SERVICE_SEARCH, method, cm, new Object[]{holdArhObject.get("target")});
//System.out.println("Hold here " + holdInfo);
hold.title = ((OSRFObject)holdInfo).getString("title");
hold.author = ((OSRFObject)holdInfo).getString("author");
hold.recordInfo = new RecordInfo((OSRFObject)holdInfo);
-
+ try{
+ hold.types_of_resource= ((List<Object>)holdInfo.get("types_of_resource")).get(0).toString();
+ }catch(Exception e){System.err.println("Can't get types of resurce type" + e.getMessage());};
}
else{
//multiple objects per hold ????
return holdInfo;
}
- private Object holdFetchObjects(OSRFObject hold, HoldRecord holdObj) throws NoNetworkAccessException, NoAccessToServer{
+ private OSRFObject holdFetchObjects(OSRFObject hold, HoldRecord holdObj) throws NoNetworkAccessException, NoAccessToServer{
String type = (String)hold.get("hold_type");
holdObj.title = holdInfo.getString("title");
holdObj.author = holdInfo.getString("author");
holdObj.recordInfo = new RecordInfo((OSRFObject)holdInfo);
+ try{
+ holdObj.types_of_resource= ((List<Object>)holdInfo.get("types_of_resource")).get(0).toString();
+ }catch(Exception e){System.err.println("Can't get types of resurce type" + e.getMessage());};
}
holdObj.title = holdInfo.getString("title");
holdObj.author = holdInfo.getString("author");
holdObj.recordInfo = new RecordInfo((OSRFObject)holdInfo);
+ try{
+ holdObj.types_of_resource= ((List<Object>)holdInfo.get("types_of_resource")).get(0).toString();
+ }catch(Exception e){System.err.println("Can't get types of resurce type" + e.getMessage());};
}
else
if(type.equals("I")){
holdObj.title = holdInfo.getString("title");
holdObj.author = holdInfo.getString("author");
holdObj.recordInfo = new RecordInfo((OSRFObject)holdInfo);
+ try{
+ holdObj.types_of_resource= ((List<Object>)holdInfo.get("types_of_resource")).get(0).toString();
+ }catch(Exception e){System.err.println("Can't get types of resurce type" + e.getMessage());};
}
return null;
public class HoldDetails extends Activity {
- public static final int RESULT_CODE_DELETE_HOLD = 0;
+ public static final int RESULT_CODE_DELETE_HOLD = 5;
- public static final int RESULT_CODE_UPDATE_HOLD = 1;
-
- public static final int RESULT_CODE_CANCEL = 2;
+ public static final int RESULT_CODE_UPDATE_HOLD = 6;
+
+ public static final int RESULT_CODE_CANCEL = 7;
private TextView recipient;
System.out.println("Exception in reAuth");
}
}
-
-
-
-
-
+
runOnUiThread(new Runnable() {
@Override
public void run() {
if (thaw_date != null)
thaw_date_s = GlobalConfigs.getStringDate(thaw_date);
-
-
try {
accountAccess.updateHold(record.ahr, selectedOrgPos,
email_notification.isChecked(), phone_notification
import java.io.Serializable;
import java.util.Date;
+import java.util.List;
import org.evergreen.android.globals.GlobalConfigs;
import org.evergreen.android.searchCatalog.RecordInfo;
public String author = null;
+ public String types_of_resource;
/* Hold status
* holdStatus == 4 => AVAILABLE
this.suspended = true;
pickup_lib = ahr.getInt("pickup_lib");
-
}
//based on status integer field retreive hold status in text
public String getHoldStatus(){
package org.evergreen.android.accountAccess.holds;
+import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import org.evergreen.android.R;
import org.evergreen.android.accountAccess.AccountAccess;
import org.evergreen.android.accountAccess.SessionNotFoundException;
+import org.evergreen.android.globals.GlobalConfigs;
import org.evergreen.android.globals.NoAccessToServer;
import org.evergreen.android.globals.NoNetworkAccessException;
import org.evergreen.android.globals.Utils;
+import org.evergreen.android.searchCatalog.ImageDownloader;
import org.evergreen.android.searchCatalog.SearchCatalogListView;
import org.evergreen.android.views.AccountScreenDashboard;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ImageButton;
+import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
private Button myAccountButton;
private TextView headerTitle;
+
+ private TextView holdsNoText;
private ProgressDialog progressDialog;
+
+ private ImageDownloader imageDownloader;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
});
//end header portion actions
+ holdsNoText = (TextView)findViewById(R.id.holds_number);
+
+ imageDownloader = new ImageDownloader(40, 40, false);
+
lv = (ListView)findViewById(R.id.holds_item_list);
context = this;
accountAccess = AccountAccess.getAccountAccess();
for(int i=0;i<holdRecords.size();i++)
listAdapter.add(holdRecords.get(i));
+ holdsNoText.setText(" "+listAdapter.getCount());
progressDialog.dismiss();
listAdapter.notifyDataSetChanged();
}
};
+
+
if(accountAccess.isAuthenticated()){
progressDialog = new ProgressDialog(context);
progressDialog.setMessage("Loading holds");
case HoldDetails.RESULT_CODE_CANCEL : {
//nothing
+ Log.d(TAG, "Do nothing");
}break;
case HoldDetails.RESULT_CODE_DELETE_HOLD : {
//thread to retrieve holds
Thread getHoldsThread = new Thread(getHoldsRunnable);
getHoldsThread.start();
+ Log.d(TAG, "Update on delete hold");
}break;
case HoldDetails.RESULT_CODE_UPDATE_HOLD : {
//thread to retrieve holds
Thread getHoldsThread = new Thread(getHoldsRunnable);
getHoldsThread.start();
+ Log.d(TAG, "Update on update hold");
}break;
}
private TextView holdTitle;
private TextView holdAuthor;
private TextView status;
+ private ImageView hold_icon;
private List<HoldRecord> records = new ArrayList<HoldRecord>();
}
+
+ hold_icon = (ImageView) row.findViewById(R.id.hold_resource_icon);
+
// Get reference to TextView - title
holdTitle = (TextView) row.findViewById(R.id.hold_title);
status = (TextView) row.findViewById(R.id.hold_status);
//set text
-
- System.out.println("Row" + record.title + " " + record.author + " " + record.getHoldStatus());
+ String imageResourceHref = GlobalConfigs.httpAddress + GlobalConfigs.hold_icon_address +record.types_of_resource +".jpg";
+
+ if(imageResourceHref.contains(" ")){
+ imageResourceHref = imageResourceHref.replace(" ", "%20");
+ }
+
+ imageDownloader.download(imageResourceHref, hold_icon);
+
+ System.out.println("Image " + imageResourceHref + " Row " + record.title + " " + record.author + " " + record.getHoldStatus() );
//set raw information
holdTitle.setText(record.title);
holdAuthor.setText(record.author);
public static boolean loadedOrgTree = false;
+ public static String hold_icon_address = "/opac/images/tor/";
+
//two days notification before checkout expires, this can be modified from preferences
public static int NOTIFICATION_BEFORE_CHECKOUT_EXPIRATION = 2;
private int MIN_IMG_HEIGHT = 75;
+ private int MIN_IMG_WIDTH = 30;
+
private int bitmap_width;
private int bitmap_height;
private boolean scale;
this.bitmap_height = h;
this.bitmap_width = w;
this.scale = scale;
+ MIN_IMG_HEIGHT = h;
}
/**
* Download the specified image from the Internet and binds it to the provided ImageView. The
DownloadedDrawable downloadedDrawable = new DownloadedDrawable(task);
imageView.setImageDrawable(downloadedDrawable);
imageView.setMinimumHeight(MIN_IMG_HEIGHT);
+ imageView.setMinimumWidth(MIN_IMG_WIDTH);
task.execute(url);
break;
}
import android.view.View.OnKeyListener;
import android.view.ViewGroup;
import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.InputMethodManager;
import android.widget.AbsListView;
import android.widget.AbsListView.OnScrollListener;
import android.widget.AdapterView;
@Override
public void run() {
+ InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
+ imm.hideSoftInputFromWindow(searchText.getWindowToken(), 0);
+
searchOptionsMenu.setVisibility(View.GONE);
searchResultsNumber.setVisibility(View.VISIBLE);