User Tools

Site Tools


en:user:urls
This version (2016/09/26 23:01) is a draft.
Approvals: 0/1

This is an old revision of the document!


URLs

<TABAREA tabs="Greenstone3,Greenstone2"> <TAB> URL's are greatly simplified in Greenstone3. Using URL rewriting, Greenstone3's URL's are logical, short, and informative. For example, the URL for a document page in a Greenstone2 collection will look something like this:

http://localhost:8283/greenstone/cgi-bin/library.cgi?e=d-01000-00---off-0games--00-1----0-10-0---0---0direct-10---4-------0-1l--11-en-50---20-about---00-3-1-00-00--4--0--0-0-11-10-0utfZz-8-00&a=d&c=games&cl=CL1&d=HASH017893f810ba88942720384e

In Greenstone3, the URL for a document page will look like this:

http://localhost:8383/greenstone3/library/collection/lucene-jdbm-demo/document/ec159e

So, as this example shows, you can easily access any document in any collection in a library simply by navigating to http://localhost:8383/greenstone3/<library-name>/collection/<collection-name>/document/<document-ID>.


Library URL patternsDescription
All URL patterns are preceded by http://localhost:8383/greenstone3/
<library-name>The homepage of the library (the default library name is library)
<library-name>/collection//page/help Help page for library
<library-name>/collection//page/pref or <library-name>/collection/<collection-name>/page/pref Preferences page for library
<library-name>/collection/<collection-name>/page/help Help page for collection
<library-name>/collection/<collection-name>/page/about'About' page for collection
<library-name>/collection/<collection-name>/browse/<classifier-number>Browsing classifiers (classifier numbers look like CL1, CL2.3, CL2.3.5)
<library-name>/collection/<collection-name>/search/<search-type>Search pages (possible search types include AdvancedFieldQuery, TextQuery, and FieldQuery)
<library-name>/collection//search/TextQueryCross-collection search page

<baseurl>/<context>/<servlet>

By default, The Greenstone3 server runs on http://localhost:8383 and Greenstone is located at http://localhost:8383/greenstone3. Every library (and any other servlets) are

context

context 'technically' set by the name of the file in Greenstone3/packages/tomcat/conf/Catlina/localhost, which is, by default greenstone3.xml. HOWEVER, every time you start the server, Greenstone3/build.xml copies this the file from Greenstone3/resources/tomcat into the correct folder.

    <!-- [line 1287] set up the greenstone3 context -->
    <copy file="${basedir}/resources/tomcat/greenstone3.xml" tofile="${packages.home}/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true">
      <filterset>
        <filter token="gsdl3webhome" value="${web.home}"/>
        <filter token="gsdl3webwritablehome" value="${web.writablehome}"/>
	<filter token="privilegedattribute" value ="${privileged.attribute}"/>
      </filterset>
    </copy>

To change the context, change variable in Greenstone3/build.properties.

# The context name of your GS3 digital library. By default this will be "greenstone3". 
# Ensure this has a value. If you change this multiple times, you need to remove the old versions
# of <custom.context>.xml from GS3/packages/tomcat/conf/Catalina/localhost
# does not contain previous 
custom.context=greenstone3

Arguments

descendants=1On hierarchical browse pages, this will display with page with all levels of all sections expanded
o=xmlDisplays the raw information coming from the Message Router.
o=xmlfinalDisplays the information coming from the Message Router after the second config_format pass.
o=skindocSimplified Skin XSL with Expanded GSF statements appended.
o=skinandlibAn XML document with a root element called skinAndLibraryXsl and the two children skinXsl and libraryXsl. The libraryXsl, which already includes util.xsl, is merely appended.
o=skinandlibdocThe result of applying preprocess.xsl to skinandlib produces this stylesheet which is the final XSL document that will be applied to the XML data returned from the message router.
formatedit=onWeb interface editor for editing Greenstone3 format statements.
a=s&sa=cRefresh all the collection configuration files: Reconfigures the whole site. Reads in siteConfig.xml, reloads all the collections.

o is output Find more information on arguments: Greenstone3 → src → java → org → greenstone → gsdl3 → action

Additional Resources

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.

ArgumentDescription
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.

ArgumentDescription
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.

ArgumentDescription
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

ArgumentDescription
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

Handles displaying documents which are external web pages

ArgumentDescription
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???

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

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.

</TAB> </TABAREA>

en/user/urls.1474930875.txt.gz · Last modified: 2016/09/26 23:01 by kjdon