# this file must be UTF-8 encoded package query ####################################################################### # Macros whose values are set from within the server at runtime. These # are here only for reference and to set default values if required. ####################################################################### _quotedquery_ {} _freqmsg_ {} _stopwordsmsg_ {} _resultline_ {} _thisfirst_ {} _thislast_ {} _nextfirst_ {} _nextlast_ {} _prevfirst_ {} _prevlast_ {} _searchhistorylist_ {} #_histvalue0_ to _histvalue19_ _advformlist_ {} _regformlist_ {} _sqladvformlist_ {} _sqlregformlist_ {} #_fqfselection_ {} ####################################################################### # icons ####################################################################### _queryresultsbar_ {
} _searchhistorybar_ {
} # _iconnext_ and _iconprev_ are overridden in this package as we # don't want alt text here _iconnext_{} _iconnext_ [v=1] {} _iconprev_{} _iconprev_ [v=1] {} # the small squares for search history ## " " ## handmade ## mstds ## _httpiconmstdsqrof_ {_httpimg_/mstdsof.gif} _httpiconmstdsqron_ {_httpimg_/mstdson.gif} _widthmstdsqrx_ {13} _heightmstdsqrx_ {13} ####################################################################### # images ####################################################################### # _imagethispage_ set in nav_css/nav_ns4 macro files #the buttons for the search history entries # takes one arg - the entry number (0-num entries) _imagehistbutton_ {_textusequery_} ####################################################################### # scripts (and some macros for the scripts) ####################################################################### _pagescriptextra_ {_If_("_cgiargqt_" ge "1", _formpagescriptextra_, _selectpagescriptextra_) _If_("_cgiarghd_" ne "0",_historypagescriptextra_) } _selectpagescriptextra_{_If_("_cgiargqto_" eq "2", _formpagescriptextra_,_dummypagescriptextra_)} _dummypagescriptextra_{function initialize() \{ \} } _formpagescriptextra_ { // query scripts generated by \_query:pagescriptextra\_ _standardfunctions_ _formfunctions_ _searchfunctions_ function getsearchargs () \{ var args=""; args = "&fqa=0&fqv="+argfqv+"&fqf="+argfqf; _If_(_cgiargb_, args += "&fqk="+argfqk+"&fqs="+argfqs+"&fqc="+argfqc; ) _If_("_cgiarga_" eq "sqlq",args += "&sqlfqf="+argsqlfqf + "&sqlfqc="+argsqlfqc;) return args; \} function getqueryargs () \{ var args = "&fqa=1"+"&q="+argq+"&fqv="+argfqv+"&fqf="+argfqf+ "&fqk="+argfqk+"&fqs="+argfqs+"&fqc="+argfqc; _If_("_cgiarga_" eq "sqlq",args += "&sqlfqf="+argsqlfqf + "&sqlfqc="+argsqlfqc;) return args; \} } _historypagescriptextra_{ var histvalue0='_histvalue0_'; var histvalue1='_histvalue1_'; var histvalue2='_histvalue2_'; var histvalue3='_histvalue3_'; var histvalue4='_histvalue4_'; var histvalue5='_histvalue5_'; var histvalue6='_histvalue6_'; var histvalue7='_histvalue7_'; var histvalue8='_histvalue8_'; var histvalue9='_histvalue9_'; var histvalue10='_histvalue10_'; var histvalue11='_histvalue11_'; var histvalue12='_histvalue12_'; var histvalue13='_histvalue13_'; var histvalue14='_histvalue14_'; var histvalue15='_histvalue15_'; var histvalue16='_histvalue16_'; var histvalue17='_histvalue17_'; var histvalue18='_histvalue18_'; var histvalue19='_histvalue19_'; function inputQuery(value) \{ if ("_cgiargqt_" == "0") \{ // text search document.QueryForm.q.value += " "+value; document.QueryForm.q.focus(); \} else \{ if ("_cgiargb_" == "1") \{ // advanced query document.QueryForm.q.value += " "+value; document.QueryForm.q.focus(); updateq(); \} else \{ // simple form search // do something here, what?? \} \} \} } _standardfunctions_{ function getstdargs() \{ stdarg = ""; _If_(_gselection_,_getgarg_) _If_(_jselection_,_getjarg_) _If_(_nselection_,_getnarg_) _If_(_sqlsfselection_,_getsqlsfarg_) _If_(_sfselection_,_getsfarg_) if (document.QueryForm.t != null) \{ value = document.QueryForm.t.options[document.QueryForm.t.selectedIndex].value; if (value != "_cgiargt_") stdarg += "&t="+value; \} stdarg += "&r=1&hs=1"; return stdarg; \} } _getgarg_{ if (document.QueryForm.g!= null) \{ value = document.QueryForm.g.options[document.QueryForm.g.selectedIndex].value; if (value != "_cgiargg_") stdarg += "&g="+value; \} } _getjarg_{ value = document.QueryForm.j.options[document.QueryForm.j.selectedIndex].value; if (value != "_cgiargj_") stdarg += "&j="+value; } _getnarg_{ value = document.QueryForm.n.options[document.QueryForm.n.selectedIndex].value; if (value != "_cgiargn_") stdarg += "&n="+value; } # currently only supported in lucene _getsfarg_{ _If_("_cgiarga__cgiargct_" eq "q2", value = document.QueryForm.sf.options[document.QueryForm.sf.selectedIndex].value; if (value != "_cgiargsf_") stdarg += "&sf="+value; ) } # only when in sql mode _getsqlsfarg_{ _If_("_cgiarga__cgiargqt_" eq "sqlq2", value = document.QueryForm.sqlsf.options[document.QueryForm.sqlsf.selectedIndex].value; if (value != "_cgiargsqlsf_") stdarg += "&sqlsf="+value; ) } _formfunctions_{ argfqf="_cgiargfqf_"; argfqv="_cgiargfqv_"; argfqk="_cgiargfqk_"; argfqs="_cgiargfqs_"; argfqc="_cgiargfqc_"; _If_("_cgiarga_" eq "sqlq", argsqlfqf="_cgiargsqlfqf_"; argsqlfqc="_cgiargsqlfqc_"; ) argq = ""; function initialize () \{ if (document.QueryForm.fqf != null) \{initfqf(); \} if (document.QueryForm.fqv != null) \{initfqv(); \} if (document.QueryForm.fqs != null) \{initfqs(); \} if (document.QueryForm.fqk != null) \{initfqk(); \} if (document.QueryForm.fqc != null) \{initfqc(); \} _If_("_cgiarga_" eq "sqlq", if (document.QueryForm.sqlfqf != null) \{initsqlfqf(); \} if (document.QueryForm.sqlfqc != null) \{initsqlfqc(); \} ) if (document.QueryForm.q != null) \{initq(); \} \} // makes a form submit itself when enter is pressed in a text field function entersubmit(event) \{ if (window.event && window.event.keyCode == 13) \{ beginSearch(); \} else \{ if (event && event.which == 13) \{ beginSearch(); \} else \{ return true; \} \} \} // fqf - the field selection box function initfqf() \{ var i; fqf = argfqf.split(","); num_opts = document.QueryForm.fqf[0].options.length; // assumes all have the same options for (i=0; i= num_opts) \{ z = z-(num_opts); \} document.QueryForm.fqf[i].options[z].selected = true; \} \} updatefqf(); \} function updatefqf() \{ var i; argfqf = ""; var j = document.QueryForm.fqf[0].selectedIndex; argfqf += document.QueryForm.fqf[0].options[j].value; for (i=1; i= document.QueryForm.fqf[i].options.length) z = z-document.QueryForm.fqf[i].options.length; document.QueryForm.fqf[i].options[z].selected = true; \} updatefqf(); \} // sqlfqf - the field selection box function initsqlfqf() \{ var i; sqlfqf = argsqlfqf.split(","); num_opts = document.QueryForm.sqlfqf[0].options.length; // assumes all have the same options for (i=0; i= num_opts) \{ z = z-(num_opts); \} document.QueryForm.sqlfqf[i].options[z].selected = true; \} \} updatesqlfqf(); \} function updatesqlfqf() \{ var i; argsqlfqf = ""; var j = document.QueryForm.sqlfqf[0].selectedIndex; argsqlfqf += document.QueryForm.sqlfqf[0].options[j].value; for (i=1; i= document.QueryForm.sqlfqf[i].options.length) z = z-document.QueryForm.sqlfqf[i].options.length; document.QueryForm.sqlfqf[i].options[z].selected = true; \} updatesqlfqf(); \} // fqc - the boolean operator selection box function initfqc() \{ var i,j; fqc = argfqc.split(","); if (_cgiargfqn_ == 2) \{ // there will only be one fqc element for (j=0;j tag of this page - for mgpp, form search pages ####################################################################### #copied from prefs _header_ {_cgihead_ _htmlhead_(class="bgimage" onLoad="initialize();")_startspacer__pagebanner_ } # this declaration ends up being the same as style=restrict, never mind _header_[v=1] {_cgihead_ _htmlhead_(onLoad="initialize();")_pagebanner_ } ####################################################################### # page content ####################################################################### _pagetitle_ {_If_(_cgiargq_,_textquerytitle_,_textnoquerytitle_)} _content_ { _optnavigationbar_
_If_("_cgiarga_" eq "sqlq", _If_("_cgiargqt_" eq "2",_sqlfieldqueryform_,_sqlqueryform_) , _If_(_cgiargct_,_selectqueryform_,_queryform_) )
_If_(_searchhistorylist_,
_searchhistorybar_

_searchhistorylist_
) _If_(_cgiargq_,_queryresultsbar_ _freqmsg_ _textpostprocess_ _If_(_stopwordsmsg_,(_stopwordsmsg_))
_resultline_ ,
 
) } _selectqueryform_{_If_("_cgiargqt_" ge "1",_fieldqueryform_,_queryform_)} _queryform_ {

_queryformcontent_ _optdatesearch_

} _sqlqueryform_ {

_sqlqueryformcontent_

} _ifeellucky_ {
_textifeellucky_ } _useifeellucky_ { } # Set this to _ifeellucky_ if you want this functionality available _allowformbreak_{ } _queryformcontent_{ _textselect_ _If_(_cgiargqb_,_largequerybox_,_smallquerybox_) _useifeellucky_ } _sqlqueryformcontent_ { _If_(_cgiargqb_,_query:largequerybox_,_query:smallquerybox_) _query:useifeellucky_ } # Automatically set by receptionist if config file switches # date searching on _optdatesearch_ { } _datesearch_ {
_textstartdate_ _textenddate_
_textexplaineras_
} _smallquerybox_ { } _largequerybox_ {
} _fieldqueryform_ {
_textformselect_
_If_(_cgiargb_,_advancedforms_,_simpleforms_)
_If_(_cgiargb_,
 
_advancedformextra_)
} _sqlfieldqueryform_ {
_textformselect_
_If_(_cgiargb_,_sqladvancedforms_,_sqlsimpleforms_)
_If_(_cgiargb_,
 
_advancedformextra_)
} _advancedforms_{ _If_("_cgiargct_" eq "1",) _advformlist_
_textwordphrase__textfoldstem_  _textinfield_
} _sqladvancedforms_{ _sqladvformlist_
_textfieldphrase_   _textinwords_
} _advancedformextra_{
_textadvquery_
_If_("_cgiarga_" eq "sqlq",

For example:
element in (\'dc.Keywords\') AND value=\'Farming\'
element in (\'dls.Title\') AND value LIKE \'F%\'
element in (\'dls.Title\') AND value<\'F%\'
) } _simpleforms_{ _regformlist_
_textwordphrase_  _textinfield_
} _sqlsimpleforms_{ _sqlregformlist_
_textfieldphrase_   _textinwords_
} # # Full-text versions # _regformelement_{ _fqfselection_} #has no and/or/not selection box _firstadvformelement_{ _If_("_cgiargct_" eq "1", ) _fqfselection_} _advformelement_{ _fqcselection_ _If_("_cgiargct_" eq "1", ) _fqfselection_} _fqcselection_ { } _andorfqcselection_ { } # # SQL versions of regformelement, firstsqladvformelement, advformelement # _sqlregformelement_{ _sqlfqfselection_ _sqlfqcselection_ } _firstsqladvformelement_{ _sqlfqfselection_ _sqlfqcselection_ } _sqladvformelement_{ _andorfqcselection_ _sqlfqfselection_ _sqlfqcselection_ } _sqlfqcselection_ { } # # end of SQL version # _textselect_ {_If_(_cgiargb_,_chooseadvancedsearch_,_choosesimplesearch_)} _choosesimplesearch_ {_If_("_cgiargqt_" eq "2",_textsimplesqlsearch_,_textsimplesearch_)} _chooseadvancedsearch_ {_If_("_cgiarqt_" eq "2",_textadvancedsqlsearch_,_chooseadvancedsearchct_)} _chooseadvancedsearchct_ {_If_(_cgiargct_,_If_("_cgiargct_" eq "2",_textadvancedlucenesearch_,_textadvancedmgppsearch_),_textadvancedsearch_} # formed based versions _textformselect_ {_If_(_cgiargb_,_chooseformadvancedsearch_,_chooseformsimplesearch_)} _chooseformsimplesearch_ {_If_("_cgiargqt_" eq "2",_textformsimplesearchsql_,_textformsimplesearch_)} _chooseformadvancedsearch_ {_If_("_cgiargqt_" eq "2",_textformadvancedsearchsql_,_chooseformadvancedsearchct_)} _chooseformadvancedsearchct_ {_If_("_cgiargct_" eq "1",_textformadvancedsearchmgpp_)_If_("_cgiargct_" eq "2",_textformadvancedsearchlucene_)} # mg uses hselection for index, mgpp uses fqfselection _indexselection_{_If_(_cgiargct_,_fqfselection_,_hselection_)} # we want to put the links to previous/next pages of results # in the footer _pagefooterextra_ {

_If_(_prevfirst_,_iconprev__textmatches__prevfirst_ - _prevlast_) _If_(_nextfirst_,_textmatches__nextfirst_ - _nextlast__iconnext_)
} _querytypeselection_ { } _formquerytypesimpleselection_ { } _formquerytypeadvancedselection_ { } # this one is not used by english.dm any more. But I have added it back for the other languages that haven't updated the translations for their form search macros. _formquerytypeselection_ { }