Changeset 2769 for trunk/gsdl/src


Ignore:
Timestamp:
2001-10-02T14:35:28+12:00 (23 years ago)
Author:
dmm9
Message:

added function define_query_interface for dynamic query interface changes

Location:
trunk/gsdl/src/recpt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/queryaction.cpp

    r2745 r2769  
    576576
    577577  define_form_macros(disp, args, protos, logout);
    578 }
     578
     579 
     580  define_query_interface(disp, args, protos, logout);
     581
     582 
     583
     584 
     585
     586
     587}
     588
     589void queryaction::define_query_interface(displayclass &disp,
     590                     cgiargsclass &args,
     591                     recptprotolistclass * protos,
     592                     ostream &logout){
     593  text_t collection = args["c"];
     594
     595  //check that the protocol is alive
     596  recptproto* colproto = protos->getrecptproto (collection, logout);
     597  if(colproto == NULL) {
     598    logout << "ERROR: Null collection protocol trying to query"
     599       << collection.getcstr() << "\n";
     600    return;
     601  }
     602 
     603  //check the collection is responding/in place
     604  ColInfoResponse_t *colinfo = recpt->get_collectinfo_ptr(colproto, collection,
     605                              logout);
     606  if(colinfo == NULL){
     607    logout << "ERROR: Null returned for get_collectinfo_ptr on "
     608       << collection.getcstr() << "in queryaction::define_query_interface\n";
     609    return;
     610  }
     611 
     612   
     613  text_tmap::iterator check = colinfo->format.find("QueryInterface");
     614  if(check != colinfo->format.end()){
     615    cout<<"format found"<<endl;
     616    if((*check).second=="DateSearch"){
     617      cout<<"datesearch found"<<endl;
     618      text_t current = "_basicqueryform_ _datesearch_";
     619      cout<<current.getcstr()<<endl;
     620      disp.setmacro("queryformcontent","query",current);
     621    }
     622  }
     623}
     624
    579625
    580626// sets the selection box macros _hselection_, _jselection_, and _nselection_.
  • trunk/gsdl/src/recpt/queryaction.h

    r2745 r2769  
    6868  virtual void define_query_macros (cgiargsclass &args, displayclass &disp,
    6969                const FilterResponse_t &response);
     70
     71  void define_query_interface(displayclass &disp, cgiargsclass &args,
     72               recptprotolistclass *protos, ostream &logout);
    7073
    7174  void define_form_macros (displayclass &disp, cgiargsclass &args,
Note: See TracChangeset for help on using the changeset viewer.