*/
public static String METHOD_COPY_LOCATION_COUNTS = "open-ils.search.biblio.copy_location_counts.summary.retrieve";
-
+ public static SearchCatalog searchCatalogSingleton = null;
/** The conn. */
public HttpConnection conn;
//the org on witch the searches will be made
/** The selected organization. */
- private Organisation selectedOrganization = null;
-
- private Context context;
-
+ public Organisation selectedOrganization = null;
+
public Integer offset;
public Integer visible;
public Integer searchLimit = 10;
+
+
+ public static SearchCatalog getInstance(){
+
+ if(searchCatalogSingleton == null){
+ searchCatalogSingleton = new SearchCatalog();
+ }
+
+ return searchCatalogSingleton;
+ }
/**
* Instantiates a new search catalog.
*
* @param httpAddress the http address
* @param locale the locale
*/
- public SearchCatalog(Context context) {
+ private SearchCatalog() {
super();
- this.context = context;
try{
// configure the connection
conn = new HttpConnection(GlobalConfigs.httpAddress+"/osrf-gateway-v1");
}
+ public Object getLocationCount(Integer recordID, Integer orgID, Integer orgDepth){
+
+ List<?> list = (List<?>)Utils.doRequest(conn, SERVICE, METHOD_COPY_LOCATION_COUNTS, new Object[]{recordID, orgID, orgDepth});
+
+ return list;
+ }
+
/**
* Select organisation.
*
globalConfigs = GlobalConfigs.getGlobalConfigs(this);
context = this;
- search = new SearchCatalog(this);
+ search = SearchCatalog.getInstance();
recordList= new ArrayList<RecordInfo>();
Intent intent = new Intent(getBaseContext(),TabsView.class);
//serialize object and pass it to next activity
intent.putExtra("recordInfo", info);
-
+ intent.putExtra("orgID",search.selectedOrganization.id);
+ intent.putExtra("depth",(search.selectedOrganization.level-1));
startActivity(intent);
}
}
private static final String[] CONTENT = new String[] { "Details", "Advanced"};
+ private SearchCatalog search;
+
private RecordInfo record;
@Override
protected void onCreate(Bundle savedInstanceState) {
record = (RecordInfo) getIntent().getSerializableExtra("recordInfo");
+ Integer orgID = getIntent().getIntExtra("orgID", -1);
+ Integer orgDepth = getIntent().getIntExtra("depth", -1);
mAdapter = new SearchFragmentAdapter(getSupportFragmentManager());
+ search = SearchCatalog.getInstance();
+ search.getLocationCount(record.doc_id, orgID, orgDepth);
+
+
//mAdapter.getItem(0).