====== Greenstone2 URLs====== ===== Actions and Arguments ===== CGI arguments encode the parameters of each page, for instance, what kind of page to display, what query to carry out etc. This page describes the common actions and arguments used by the Greenstone library server. ''a'' is the main cgi argument and determines which action is used to dipslay the page. You can set the default value of any cgi argument in the Greenstone\etc\main.cfg file. Add a line like cgiarg shortname=a argdefault=p This will set the default value of argument 'a' to 'p'. ==== a=p: Page action==== Displays 'static' pages, such as home, about, help and preferences pages. ^Argument^Description^ | p | page type: home, about, help, preferences| ==== a=q: Query action==== Displays search form and results, and optionally search history. Many of the options are set from the preferences page. ^Argument^Description^ |q | query string| |c | current collection| |h | index to search (MG collections only)| |j | subcollection index (if collection has been partitioned)| |n | language index (if collection has been partitioned based on language)| |t | search type - if b=0, 0=all, 1=some. if b=1, 0=boolean, 1=ranked| |b | search mode - 0=simple, 1=advanced| |k | casefolding - 0=off (case must match), 1=on (ignore case)| |s | stemming - 0=off (whole word must match), 1=on (ignore word endings)| |m | max number of documents to return in search results| |o | how many documents to display per page of search results| |r | which result number to start from for the current page of results| |ccs | cross collection searching - 0=off, 1=on| |cc | comma separated list of collections to search if cross collection search is enabled| |hd | display X number of search history records. if set to 0, search history is not displayed| |qb | query box type - 0=regular, 1=large| |ifl | I feel lucky - go directly to the first matching document instead of displaying the search results| |ct | collection type - 0=MG, 1=MGPP, 2=Lucene| The following arguments are only available for MGPP and Lucene collections, which provide form searching. ^Argument^Description^ |g | granularity, or level of search (Doc, Sec, Para)| |fqf | index to search in. used instead of h arg for MGPP and Lucene plain searching| |qt | current query type - 0=plain, 1=form| |qto | available query types - 1=plain only, 2=form only, 3=both plain and form| |qf | query form type - 0=simple, 1=advanced| |fqn | query form number - number of boxes to display in the form| |fqf | query form fields - comma separated list of field selections| |fqv | query form values - comma separated list of query values| |fqs | query form stemming - comma separated list of stem settings (advanced form only)| |fqk | query form casefolding - comma separated list of casefold settings (advanced form only)| |fqc | query form combiners - comma separated list of boolean operators which are used to combine the query terms (AND,OR,NOT)| |fqa | query form advanced query - run the query specified by the q argument instead of generating the query based on the fq- arguments (advanced query)| ====a=d: Document action==== Used for displaying documents and classifiers ^Argument^Description^ |d | the document identifier to display| |cl | the classifier identifier - will be displayed if d is empty, otherwise it is used to record where in a classifier the document was entered from| |gc | expand/contract document contents - 0=contracted (normal view), 1=expanded| |gt | expand/contract document text - 0=contracted, 1=expand unless there are more than 10 sections, 2=expand all| |gp | goto page - used by page type document navigation| |hl | search term highlighting - 0=off, 1=on| |x | detach - x=1 means that the page will open in a new window| |xx | all document pages should be detached| |dm | date metadata - indicates the metadata type (e.g. ex.Date, dc.Date) that has been used to build a Date classifier - this is used in the special DateList formatting| ====a=extlink: External Link action==== Handles displaying documents which are external web pages ^Argument^Description^ |el | external link preference - prompt=indicate to the user that they are about to leave the library, direct=go straight to the page| |d | document ID - of page that the link is in| |href | the external URL to go to| |rl | link is relative - what does this mean???| ===== Remove External Link page ===== Clicking on a link to an external resource from a Greenstone document takes the user to an intermediate page that says something like the following: "External Link The link you have selected is external to any of your currently selected collections. If you still wish to view this link and your browser has access to the Web, you can go forward to this page; otherwise use your browsers "back" button to return to the previous document.” To get rid of this intermediate page, add the following to greenstone/etc/main.cfg cgiarg shortname=el argdefault=direct ===== Redirecting a link to Greenstone ===== You may want to redirect a more convenient URL to your Greenstone cgi program. For example, on our system the URL // http:%%//%%nzdl.org // (which is shorthand for // http:%%//%%nzdl.org/index.html) // is redirected to // http:%%//%%nzdl.org/cgi-bin/library //. The Apache webserver accomplishes this with the //Redirect// directive. Along with other directives, this goes into the //C:\Program Files\Apache Group\Apache\conf\httpd.conf// configuration file. To redirect the URL // http:%%//%%www.yourserver.com // to // http:%%//%%www.yourserver.com/cgi-bin/library //, put this line into //httpd.conf//: Redirect /index.html http://www.yourserver.com/cgi-bin/library Then you will reach your digital library system directly from the URL // http:%%//%%www.yourserver.com //. Instead, if you wanted a URL like // http:%%//%%www.yourserver.com/greenstone // to be redirected to // http:%%//%%www.yourserver.com/cgi-bin/library //, include in the //httpd.conf// file Redirect /greenstone http://www.yourserver.com/cgi-bin/library If your computer doesn't have a domain name (like the “www.yourserver.com” above), just replace // www.yourserver.com // by // localhost // in the lines above. So long as the browser is running on the same machine as the webserver—which it surely is if your computer doesn't have a domain name—this has the same effect as the above redirections. Instead of putting redirect directives into the file //httpd.conf//, you can equally well put them into a file called //.htaccess// within your server's document root directory. In fact, doing so has two advantages. First, changes to //.htaccess// take effect immediately, whereas you have to restart the Apache webserver to see the effect of changes to //httpd.conf//. Second, on Unix systems you usually have to be logged in as the “root” user to edit //httpd.conf//, whereas you don't to edit //.htaccess//.