# Note: these pages are not translated package Global _textimagefaq_ {FAQ} ## "faq" ## nav_bar_button ## tfaq ## _httpicontfaqof_ {_httpimg_/tfaqof.gif} _httpicontfaqon_ {_httpimg_/tfaqon.gif} package faq _faqlink_ {
_faqob:faqdefs_
_faqinst:faqdefs_
_faqrun:faqdefs_
_faqbuild:faqdefs_
_faqplugins:faqdefs_
_faqcustomize:faqdefs_ } _greenstonefaq_ {Greenstone FAQ} _headinggeneral_ {General Information} _t171_ {What is Greenstone?} _t172_ {How is Greenstone licensed?} _t173_ {What platforms will Greenstone run on?} _t174_ {Are there any mailing lists concerned with Greenstone?} _t175_ {Are the mailing lists archived anywhere?} _t176_ {How do I contribute to Greenstone?} _headingobtaining_ {Obtaining Greenstone} _t178_ {Where do I get Greenstone from?} _t179_ {Are there binary distributions of Greenstone available?} _t180_ {Is Greenstone available on CD-ROM?} _t181_ {Is the Greenstone source code available via CVS?} _headinginstalling_ {Installing Greenstone} _t183_ {How do I compile Greenstone from a source or CVS distribution?} _t184_ {What is the difference between Greenstone's local library and web library?} _tfaqgliapplettitle_ {How do I install the Greenstone Librarian Interface as an applet?} _headingrunning_ {Running Greenstone} _t186_ {OK, I've installed Greenstone. Now how do I make it go?} _t187_ {What web browser do I need to view Greenstone collections?} _t188_ {When I start the Windows local library there are two buttons in the dialog box, "Enter Library" and "Restricted Version". They both seem to do the same thing, what's the difference?} _t189_ {So when should I use the "Restricted Version" of the local library?} _t190_ {When I start the Windows local library my computer asks me to dial up my Internet Service Provider. Do I really need to be online to run Greenstone?} _t191_ {I'm trying to use the Windows local library. My web browser is starting up as expected but the Greenstone home page never gets loaded or gives an error message. What's wrong?} _t192_ {Where can I get more Greenstone collections?} _t193_ {When I attempt to access certain parts of Greenstone I'm asked for a username and password. What do I enter?} _t194_ {When I use the large query box function I occassionally get a Not Found error.} _headingbuilding_ {Building Greenstone Collections} _tfaqbuildglititle_ {What is the "Greenstone Librarian Interface"?} _t196_ {What is "the Collector"?} _t197_ {How do I build a collection from the command line or DOS prompt?} _t198_ {I built a new Greenstone collection on my Windows machine. Everything appeared to work fine while building, however when I tried to view the collection some of the documents contained no text. Sometimes Greenstone appeared to crash completely. What have I done wrong?} _t199_ {Why won't the Collector's "export to CD-ROM" function work?} _t200_ {I'm trying to use the Collector on Windows 2000 but it's running extremely slowly. Is this normal?} _t201_ {What is "the Organizer"?} _t202_ {Where do I get the Organizer?} _t203_ {I'm attempting to build a collection with the collector but it keeps failing with an error. What am I doing wrong?} _t204_ {Where can I find some example collect.cfg configuration files?} _t205_ {How can I build my collection using MGPP?} _tfaqbuild11title_ {I've added a new type of classification to my collection. How do I create and add the navigation bar images?} _tfaqbuildexpattitle_ {How do I fix XML::Parser errors during import.pl?} _tfaqbuildsizelimittitle_ {Are there any limits to the size of collections?} _headingplugins_ {More About Plugins} _tfaqplugins0title_ {Does Greenstone have a plugin for my data format?} _tfaqplugins1title_ {What metadata is available for each plugin?} _tfaqplugins2title_ {I'm having problems with my PDF files! What's wrong?} _tfaqplugins3title_ {How do I use UnknownPlug to handle my new format?} _headingcustomize_ {Customizing Your Greenstone Library} _tfaqcustomizefrontpagelogotitle_ {How do I change the logo on the front page of my library ("greenstone digital library software")?} _tfaqcustomizemoreinfotitle_ {Where can I get more information about customizing my Greenstone library?} _tfaqcustomizeformattitle_ {What are the formatting options available for my collection?} _tfaqcustomizemetadatalinkingtitle_ {How can I hyperlink individual metadata elements?} _tfaqcustomizenewpagetitle_ {How can I add a new page to my Greenstone library?} _tfaqcustomizenotexttitle_ {How can I hide the dummy text "This document has no text"?} _t207_ {FAQ Main Page} _t372_ {Show entire FAQ on a single page} _t373_ {Show FAQ on multiple pages} ####################################################################### package faqgen _content_ { _pageheading_(_faq:greenstonefaq_ - _faq:headinggeneral_) _faq:faqmainlink_
Please note that the downloadable Windows distribution of Greenstone comes with an installer that will not work on 16 bit Windows. If you need to use Greenstone on Windows 3.1/3.11 please contact us.
} _t211_ { There are two Greenstone mailing lists. You can subscribe to them from the documentation page. } _t212_ { The most popular mailing list (greenstone-users@list.scms.waikato.ac.nz) is archived as a Greenstone collection at www.nzdl.org. Note that this collection is updated only sporadically so may not always be completely up to date. } _t213_ { We welcome contributions or improvements to the Greenstone software!Before beginning work, you should announce what you're doing on the greenstone developer's list to tell us what you plan to do and get some feedback.
} ####################################################################### package faqob _content_ { _pageheading_(_faq:greenstonefaq_ - _faq:headingobtaining_) _faq:faqmainlink_The major difference between the two is that the local library contains it's own built-in webserver. The web library however, requires an external webserver like Apache or Microsoft IIS. This makes the local library much easier to install and configure than the web library.
For this reason, it's recommended that Windows users install the local library unless they're sure that they need the web library. Even if you think you might need the web library, try installing the local library first. You can always uninstall it later and install the web library if you then decide you need it.
A situation where the web library may be preferable is if you plan to serve your Greenstone collections as a full-time service on the web. In this case you'll probably want the added stability that running the web library in conjunction with an external webserver can provide.
Please note that the local library is quite capable of serving Greenstone collections over a local area network or the web (despite its rather misleading name).
} _tfaqgliapplet_ {To get the GLI applet running, please do the following:
Note that the applet transfers a lot of data between the machine it is running on and the server. This makes using the GLI applet impractical if you don't have a high speed connection between your machine and the server.
} ####################################################################### package faqrun _content_ { _pageheading_(_faq:greenstonefaq_ - _faq:headingrunning_) _faq:faqmainlink_If you're using the web library things are a little less obvious however. First make sure your webserver is configured correctly and is running (see the Greenstone Installer's Guide and your webserver's documentation for details). You can then simply open your web browser and point it at the URL of Greenstone's library executable. This is dependant on the way you configured Greenstone and your webserver. Typically it might be something like http://localhost/gsdl/cgi-bin/library.exe.
} _t224_ { Greenstone relies on a web browser that supports tables, javascript, and in some places, frames. Any reasonably modern browser will do. Examples are Microsoft Internet Explorer 4, Netscape 4, and Mozilla. Newer releases of all these browsers will also work.If you find that your favourite web browser does not work with Greenstone, please contact us.
Note that there is an exception to the rule that any modern browser will do when running Greenstone. That is when you're using the restricted version of the Windows local library when you must use Netscape. See the discussion below on the differences between the "Restricted Version" and the standard "Enter Library" version of the local library for details.
} _t225_ { The webserver built into the local library uses the networking software built into your Windows operating system in order to function. If your computer has never been connected to a network this networking software may not be installed however. For this reason Greenstone comes with some networking software of it's own that it will use if it can't find any installed on your computer.When you click the "Enter Library" button, Greenstone first checks to see if your computer has it's own networking software. If it does, it starts up using that, if not it starts up using it's own networking software.
When you click the "Restricted Version" button, Greenstone doesn't bother checking your system for networking software, it just goes ahead and uses it's own.
The catch is that there are several limitations with using the Greenstone supplied networking software. The most important limitations are that the local library won't be accessible from the network if run in this way (that is, it really will be "local" to the machine on which it's running) and that it must use a Netscape web browser. Using your computer's built-in networking software is therefore the prefered option.
} _t226_ { Since Greenstone will automatically use it's own networking software if it can't find any installed on your computer it should not normally be necessary to run the "Restricted Version" explicitly.Times when it may be necessary are.
If this does not solve the problem, try starting the local library by clicking the "Restricted Version" button rather than the "Enter Library" button. See the discussion above on the differences between the standard and restricted versions of the local library for further details.
} _t228_ {If you installed Greenstone using the InstallShield installer on Windows or the Install.sh script on Unix you should have been asked to set a password during the installation procedure.
If you didn't, don't worry, the password defaults to being admin.
So if you don't know what to enter you should try username = admin, password = admin.
} _t231_ { This may be caused by the URL becoming too long for your web browser. Because Greenstone currently stores all state information in the URL, if you do a search for a long phrase the URL can become very long. Different browser's on different platforms have different maximum URL lengths but in general it seems that Netscape can handle longer URLs than can Microsoft Internet Explorer.
There is very little you can do to avoid this problem with the way Greenstone is currently implemented (aside from not searching for long phrases). Future versions of Greenstone may store some state information on the server rather than in the URL but this has yet to be implemented.
} ####################################################################### package faqbuild _content_ { _pageheading_(_faq:greenstonefaq_ - _faq:headingbuilding_) _faq:faqmainlink_If you do not have Norton or disabling Norton does not solve the problem please contact us for further help.
} _t236_ { If you downloaded Greenstone from the web you will not have all the components required to make the "export to CD-ROM" function work. These extra components have been made available in a separate download which you can get from the download page. } _t237_ { Are you using a Netscape web browser with the local library? If so, try using Internet Explorer instead. There are some socket connection problems that show up on Windows 2000 when using Netscape. } _t238_ { The Organizer (also called the "Collection Organizer") is a Windows utility used for automatically generating some of the configuration files (metadata.xml, sub.txt etc.) used by complex Greenstone collections. } _t239_ { From the download page. } _t240_ { There are several reasons that the collector might fail to build a collection and the error messages it produces are not always very helpful.If you changed the default configuration during the configure collection stage you'll need to make sure the changes were valid. For example, if you added a new classify or plugin line you'll need to make sure that the classifier and/or plugin names and arguments are all correct. If they're not the collector will fail. A good test is to build your collection without changing the configuration. If it builds ok with the default configuration but fails after you change the configuration you'll need to look closely at the changes you're making.
Another good thing to do if having problems with the collector is to build your collection from the command line instead. You'll get much more feedback to help debug problems when building in this way. For details on how to build a collection from the command line see the Greenstone developer's guide.
} _t241_ { The collect.cfg files for many of the collections at www.nzdl.org have been made available here. } _t242_ { The MGPP user manual gives some instructions. } _tfaqbuild11body_ { Visit this page and follow the instructions. } _tfaqbuildexpatbody_ { Our prebuilt Linux and Mac OS X Greenstone distributions are built on machines using Perl 5.6, and these distributions contain a few binary perl modules. These cause problems if you are using a recent version of perl like 5.8 or 5.8.1 (you can type "perl -v" from the command line to see the version).On the Mac, our distribution contains modules for both perl 5.6 and 5.8 and the correct one should (hopefully) be installed.
A typical error message during import.pl would be:
Uncaught exception from user code: Can't load '/home/httpd/gsdl/perllib/cpan/auto/XML/Parser/Expat/Expat.so' for module XML::Parser::Expat: /home/httpd/gsdl/perllib/cpan/auto/XML/Parser/Expat/Expat.so: undefined symbol: PL_sv_undef at /usr/lib/perl5/5.8.0/i386-linux-thread-multi/DynaLoader.pm line 229. at /home/httpd/gsdl/perllib/cpan/XML/Parser.pm line 14
To remedy this, you need to remove the "gsdl/perllib/cpan/XML" and "gsdl/perllib/cpan/auto" directories. (For version 2.52, remove gsdl/perllib/cpan/perl-5.8/XML and gsdl/perllib/cpan/perl-5.8/auto.) Then you need to install the perl XML::Parser natively for your system.
On redhat or mandrake, install the .rpm named "perl-XML-Parser", on debian, install the "libxml-parser-perl" package. For other Linuxes, use your distribution's package, or you can get it from http://search.cpan.org/~msergeant/XML-Parser-2.34/.
You may also need to get Expat, available from http://sourceforge.net/projects/expat/. } _tfaqbuildsizelimitbody_ { The largest collections we have built have been 7 Gb of text, and 11 million short documents (about 3 Gb text). These built with no problems. We haven't tried larger amounts of text because we don't have larger amounts of text lying around. It's no good using 7 Gb twice over to make 14 Gb because the vocabulary hasn't grown accordingly, as it would with a real collection.
There are three main limitations:
A test collection was built by "Archivo Digital", an office that depends on the "Archivo Nacional de la Memoria" (National Memory Archive in English), in Argentina. It contained sequences of page images with associated OCR text.
Setup detailsand
, so skip first and last ones # _metadata_ { "Default" means that the metadata fields will be automatically assigned (or extracted if possible), while the "Available fields" lists other items of metadata that the plugin may be able to assign based on any arguments given to that plugin in the collect.cfg file. All plugins are derived from BasPlug, and have following metadata fields:Default fields | Available fields | |
---|---|---|
BasPlug | Language, Encoding, Source | FirstNNNN, Keyphrases, Acronym |
In addition, many plugins have additional fields available:
Plugin name | Default fields | Available fields |
---|---|---|
BibTexPlug | Title, Creator, Abstract, Author, Booktitle, Chapter, Copyright, Date, Edition, Editor, EntryType Journal, Keywords, Month, Note, Number, Pages, Publisher, PublisherAddress, Volume, Year | |
DBPlug | (arbitrary metadata field names based on Database configuration file) | |
EMAILPlug | Date, DateText, From, FromAddr, FromName, Headers, Subject, Title (based on subject, from, and date), To | |
ExcelPlug | (all fields as in HTMLPlug) | |
HTMLPlug | Title, URL | Author, Creator, Email (others as found in the -metadata_fields option) |
ImagePlug | Image, ImageHeight, ImageSize, ImageType, ImageWidth, ScreenHeight, screenicon, ScreenSize, ScreenType, ScreenWidth, Source, srclink, srcicon, Thumb, ThumbHeight, ThumbType, ThumbWidth | |
IndexPlug | as in the index.txt file | (use metadata.xml files instead of using this plugin) |
MARCPlug | Creator, Description, MarcIdentifier, MarcSource, URL, Publisher, Relation, Rights, Subject, Title, Type | (Metadata fields as in the marctodc.txt file) |
OAIPlug | URL, (all metadata in .oai markup file) | |
PagedImgPlug | Image, ImageHeight, ImageSize, ImageType, ImageWidth, ScreenHeight, screenicon, ScreenSize, ScreenType, ScreenWidth, Source, srclink, srcicon, Thumb, ThumbHeight, ThumbType, ThumbWidth | |
PDFPlug | (all fields in HTMLPlug) | |
PPTPlug | (all fields in HTMLPlug) | |
PSPlug | Title | Date, Pages, (all fields in TextPlug) |
ReferPlug | Abstract, BookConfOnly, Booktitle, Copyright, Creator, Date, Editor, Keywords, Journal, JournalsOnly, Number, Pages, Publisher, Publisheraddr, Report, Title, Volume | |
RTFPlug | (all fields in HTMLPlug) | |
SRCPlug | Title, filename, includes, class, classdecl | |
TEXTPlug | Title | |
UnknownPlug | (as given in the -assoc_field plugin argument) | |
WordPlug | (all fields in HTMLPlug) |
See section two of the _docs:developersguide_ for information about options to plugins, or run the pluginfo.pl command on the plugin name after setting up your environment for Greenstone. (For example, "perl -S pluginfo.pl BasPlug".)
In addition, every document can be manually assigned arbitrary metadata fields and values through use of metadata.xml files, as discussed in the manual. } # base puts in surrounding
and
, so skip first and last ones # _pdfproblems_ { PDF is a "page description language". This means that the document contains objects and commands such as "draw this text here" and "draw this image here".Greenstone uses an external program called "pdftohtml" to extract text out of PDF files. Sometimes, there is no text that can be extracted. This often depends on how the PDF was created.
Here's an example where it is useful: A collection has pictures and includes a couple of quicktime movie files with names like DCP_0163.MOV. Rather than write a new plugin for quicktime movies, add this line to the collection configuration file:
A document is created for each movie, with the associated movie file's name in the "movie" metadata field. In the collection's format strings, use the \{If\} macro to output different text for each type of file, like this:
You can also add extra metadata, such as the Title, Subject, and Duration, using the Librarian Interface (or with metadata.xml files and RecPlug).
The -process_exp option is a regular expression that matches filenames which should be processed by UnknownPlug. You can have several UnknownPlugs specified for a collection, each processing a different kind of file.
The -assoc_field option is the name of the metadata field that will hold the associated file's name. This can be used to test for these files. You can also specify the mime type of the files to be processed using the -mime_type option. To display the original file, use [srclink][/srclink] metadata. } ####################################################################### package faqcustomize _content_ { _pageheading_(_faq:greenstonefaq_ - _faq:headingcustomize_) _faq:faqmainlink_
Site-wide formatting options
These should be placed in gsdl/etc/main.cfg.
Syntax: SiteFormat <option-name> <option-value>
Item | Description |
---|---|
HomePageCols int | Set the number of columns used to display collections on the home page. Default: 3 |
HomePageType pulldown | Display the collection list on the home page as a pulldown menu, rather than using the default table of collection images. This alters the html that appears in the dynamically generated _homeextra_ macro. You can then move this macro around in home.dm. Default: not set |
Collection-specific formatting options
These should be placed in gsdl/collect/<collname>/etc/collect.cfg.
Syntax: format <option-name> <option-value>
Item | Description | |
---|---|---|
DocumentImages true/false | If true, display a cover image at the top left of the document page Default: false | |
DocumentTitles true/false | If DocumentImages is false, and this is true, use DocumentHeading to display the title. Default: true | |
DocumentHeading formatstring | This is used for a document heading at the top left if DocumentImages is false and DocumentTitles is true. Default: \{Or\}\{[parent(Top):Title],[Title],untitled\} <br>[Title] | |
DocumentContents true/false | Display table of contents (if document is hierarchical), or next/previous section arrows and "page k of n" text (if document is paged) Default: true | |
DocumentButtons string | Controls the buttons that are displayed on a document page. Valid options are Detach, Highlight, Expand Text, Expand Contents. Should be separated by |. Default: "Detach|Highlight" | |
DocumentText formatstring | Format of the text to be displayed on a document page Default: <center> <table width=537> <tr><td>[Text]</td></tr> </table> </center> | |
DocumentArrowsTop true/false | Display next/previous section arrows at top of document, underneath the navigation bar, on document page Default: false | |
DocumentArrowsBottom true/false | Display next/previous section arrows at bottom of document page Default: true | |
DocumentUseHTML true/false | If true, each document is displayed in a separate frame. The Preferences page will also change slightly, adding options applicable to a collection of HTML documents. Default: false | |
NavigationBar pulldown | If set, provides a drop down list in place of the usual navigation bar (that contains search and classifier options). This alters the html that appears in the dynamically generated _navigationbar_ macro. Default: not set | |
AllowExtendedOptions true/false | This allows the entire content of the document page to be controlled by format statements. Use DocumentHeading and DocumentText to format the document. This option prevents the other hard coded stuff (table of contents, buttons etc) from being output. It effectively disables the DocumentContents, DocumentButtons, DocumentImages format options. New format items are provided for use in format statements if AllowExtendedOptions is true (see table below) Default: false |
Formatting Lists
The standard use of format statements is for the lists in search results, classifiers etc. Here is a list of the various lists available for format, and what they control. Note that classifiers are numbered from 1 upwards, in the order that they appear in the config file.
Item | Description |
---|---|
VList | Applies to all vertical lists, unless overridden by a more specific format item. These include search results, classifier lists, and document table of contents |
HList | Applies to all horizontal lists. Horizontal lists are often used in classifiers, particularly AZ[Compact][Section]Lists |
DateList | Applies to all date lists - these are the vertical lists generated by a DateList classifier. |
SearchVList | The vertical list of search results |
DocumentVList | The document table of contents |
CL1VList | Applies only to the vertical list of classifier 1 |
CL1HList | Applies only to the horizontal list of classifier 1 |
CL1DateList | Applies only to the DateList in classifier 1 |
Formatstring items
Item | Description |
---|---|
[link][/link] | Link to the document (Greenstone version) |
[srclink][/srclink] | Link to the original document (only if the original was converted to another form) |
[icon] | An appropriate icon for a classifier/document node. E.g. bookshelf, book, chapter, page |
[srcicon] | An appropriate icon for the original source document. E.g. Word, PDF, PS icon. |
[num] | The document number (position in the search results - useful for debugging) |
[numleafdocs] | The number of documents below the current classifier node. This is often used as a test for classifier nodes, as numleafdocs will not be set for documents. This allows different formatting for classifier nodes and document nodes in a hierarchy. |
[Text] | The text of the current section |
[RelatedDocuments] | Related Documents info (if available). This is a vertical list of Titles (or Subjects if Titles aren't available) that link to the related documents. It is based on "relation" metadata, which is a space separated list of collection,OID pairs. |
[highlight][/highlight] | These are used for 'highlighting' (actually bolding) the selected section in a hierarchical table of contents, and the selected node in a classifier. Apart from those two cases, this has no effect. If you actually want to highlight/bold/italicise something in a list, and have it apply to all items in the list, then either use actual html tags, like <b></b>, <u></u> and <i></i>, or use the _starthighlight_ and _endhighlight_ macros (defined in macros/base.dm). |
[Summary] | Displays Summary metadata if available, otherwise displays a short summary created on the fly. |
[DocOID] | The internal identifier of the document |
[DocRank] | The rank of the current document - used in search results |
[DocImage] | The URL to the cover image of the document |
[collection] | The directory name of the collection this document is from - useful in cross-collection searching. (version 2.61) |
[collection:meta-name] | A collection metadata for the collection this document is from - useful in cross-collection searching. E.g. [collection:collectionname]. This will display in the current language if an appropriate version is available. (version 2.61) |
[metadata-name] | The value of this metadata element for the document |
Extended metadata names
There are a few options for displaying metadata. The basic way is to specify e.g. [Title] or [dc.Title]: this displays the value of that particular metadata element for the current document/section. Metadata names can be prefixed by parent: or sibling. The following examples all use Title or Subject metadata, but any metadata could be used, including ones with namespaces (e.g. dc.Title). Any metadata name can also be prefixed by "cgisafe:". This results in the value being formatted so that it is safe to put in a URL.
[parent:Title] | The Title of the immediate parent section |
[parent(Top):Title] | The Title of the topmost parent section |
[parent(All):Title] | All Titles of the parent sections, separated by ", " |
[parent(All': '):Title] | All Titles of the parent sections, separated by ": " (or whatever appears inside the ' ') |
[child:Subject] | The Subjects of all child nodes of the current node, separated by ' '. (child modifier avilable from version 2.61) |
[child(All'xxx'):Subject] | The Subjects of all child nodes of the current node, separated by xxx |
[child(2):Subject] | The Subject of the second child of the current node. Child numbering starts from 1. |
[child(last):Subject] | The Subject of the last child of the current node. 'first' is also a valid option. |
[sibling:Subject] | All Subjects of the current section, separated by ", ". This is used for displaying metadata where there is more than one value. [Subject] will just display the first value. |
[sibling(All'<br>'):Subject] | All Subjects of the current section, separated by <br>. |
[sibling(2):Subject] | The second Subject metadata value for the current node. Numbering starts from 1. |
[sibling(last):Subject] | The last Subject metadata value for the current node. 'first' is also a valid option. |
[parent:sibling:Subject] | sibling can be combined with parent to give all (or specific) values for the parent node(s). All parent and sibling qualifiers can be used. (version 2.61) |
[child:sibling:Subject] | sibling can be combined with child to give all (or specific) values for the child node(s). All parent and child qualifiers can be used. (version 2.61) |
[cgisafe:parent(Top):Title] | The Title of the topmost parent section, made safe for URLs. |
[cgisafe:sibling(All'<br>'):Subject] | All Subjects of the current section, separated by <br>, made safe for URLs. |
Extended Formatstring items
These items are only available if AllowExtendedOptions is true.
Item | Description |
---|---|
[DocumentButtonDetach] | The Detach button |
[DocumentButtonHighlight] | The Highlight button |
[DocumentButtonExpandText] | The Expand Text button |
[DocumentButtonExpandContents] | The Expand Contents button |
[DocTOC] | The table of contents for a hierarchical document, or the next/previous and go to page x bits for a paged document. |
Conditional expressions in formatstrings
\{If\}\{[metadata], action-if-non-null, action-if null\} | If there is a value for this metadata element, then output the first clause, otherwise output the second clause. Either clause is optional: if empty, nothing will be done for that case. This is useful for displaying classifier nodes differently to document nodes: \{If\}\{[numleafdocs],format for classifier,format for document\} | |||||||||||||||||||||||||||
\{If\}\{[metadata] op value, action-if-true, action-if-not-true\} | Can do tests on metadata values. These can be string comparisons, or numeric comparisons. Valid operators are:
Note that only eq and ne are available for Greenstone versions 2.60 and earlier. | |||||||||||||||||||||||||||
\{Or\}\{[metadata], [metadata2], [metadata3]...\} | Each metadata is evaluated in turn, and the first one that exists is output Useful for cases where there are different namespaced version of the same metadata, e.g. \{Or\}\{[dc.Title],[dls.Title],[Title],Untitled\}. The last item can be plain text. | |||||||||||||||||||||||||||
nested If/Or | \{Or\} can have another conditional as its final option, eg \{Or\}\{[BookTitle],[Title],\{If\}\{[XXX],aaa,bbb\} \}. The following is not valid: \{Or\}\{[BookTitle],[Title]\{If\}\{[XXX],aaa,bbb\} \}. \{If\} can have nested conditionals at either true/false option. eg. \{If\}\{[numleafdocs],[Title],[BookTitle]\{If\}\{[Subject],[Subject],unclassified\} \} |
Use the format string below in the collect.cfg file (in this case, as part of the "format DocumentText" statement)
\{If\}\{[dc.Creator],
<tr>
<td align=right valign=top><b>Authors:</b></td>
<td align=left valign=bottom><label name=AuthorField id=AuthorField>
\_httpquery\_;[cgisafe:sibling(All:\\' ; \\'):dc.Creator];[sibling(All:\\'\_\\'):dc.Creator]
</label></td>
</tr>\}
This statement includes a label definition with the name "AuthorField". "\_httpquery\_" is a macro which resolves into the http-address of the query page of the collection. "[cgisafe:sibling(All:\\' ; \\'):dc.Creator]" displays all Creators, separated by ; and with any special characters escaped for use within a web address. [sibling(All:\\'\_\\'):dc.Creator] produces a similar string without escaping the special characters. Notice the different separation symbols, these are needed later on.
Additional changes have to be made in order to make this whole thing work. You further need to change the \_header\_ or \_textheader\_ macro in the package of the page the format string will be displayed in (in this case the document package). The change is that \_htmlhead\_ has to be parametrized with
\_htmlhead\_(onload="ExtractAuthors();"), where ExtractAuthors(); is a Javascript function that is called on loading the corresponding page (the document display page). Since you do not want to mess in the standard macro files, create an extra.dm file (in gsdl/collect/<collname>/macros) and override the chosen macro with a collection specific macro. In this example this is done by the code sequence
package document
###document display
###HTML-Page Header
\_textheader\_ [c=exacol] \{\_cgihead\_
\_htmlhead\_(onload="ExtractSubjects();ExtractAuthors();")
<center>
<table width=_pagewidth_><tr><td align=right>
\_icontab\_\_javalinks\_</td></tr></table>
</center>
\}
Now all that is missing is the Javascript function which has to be included into the \_pagescriptextra\_ macro of the same package. Copy this macro out of the corresponding standard macro file and paste it into your extra.dm file. Make the necessary modification which is in this case
### Self-made Javascript functions
\_pagescriptextra\_\{
function ExtractAuthors() \\\{
var res;
a = AuthorField.outerText.split(";");
resolver = a[0]+"&q=";
b = a[1].split("+%3b+");
c = a[2].split("\_");
res = "";
for (i = 0; i < b.length ;i++)
\\{
res = res + "<a href=" + resolver + b[i]+ "&h=dd0&t=0>" + c[i] + "</a><br/>";
\\}
AuthorField.outerHTML = res;
\\}
\}
This Javascript function evaluates the string of the defined label, splits it into several strings and composes a string out of those values, which is then set to the "outerHTML" element of the label. "&h=dd0" indicates which index to search in; dd0 should be replaced with the name of the appropriate index. The file gsdl/collect/<collname>/index/build.cfg gives the names of the various indexes.
}
_tfaqcustomizenewpage_ {
Adding a new static page to Greenstone is relatively simple and involves only customizations to macro files (found in gsdl/macros). (Adding a dynamic page is more difficult and involves adding a new action to the C++ receptionist.)
Lets look at the example of adding a new static page called mypage.
package mypage \_pagetitle\_ \{My New Page\} \_content\_ \{ <h2>My New Page</h2> This is the content of the page. \}The URL for the new page can be specified internally as \_httppagex\_(mypage): this maps to your library address with cgi arguments a=p&p=mypage.
If this is not a page that belongs to a collection, you should modify the 'home help prefs' buttons. You may like to add the following to your mypage.dm.
\_javalinks\_ \{\_imagehome\_ \_imagehelp\_ \_imagepref\_ \}
\_imagehelp\_ \{\_gsimage\_(\_home:httppagehomehelp\_,\_httpiconchelpof\_,\_httpiconchelpon\_,help,\_textimagehelp\_)\}
\_imagepref\_ {\_gsimage\_(\_home:httppagehomepref\_,\_httpiconcprefof\_,\_httpiconcprefon\_,pref,\_textimagepref\_)\}
This will give you the standard home button, and the help and preferences buttons that link to the same pages as those on the home page. Help and preferences are different depending on whether you are in a collection or not.
If you are using the Windows local library server you probably need to restart it for the changes to take effect.
}
_tfaqcustomizenotext_ {
Instead of [Text] in the DocumentText format statement, use
\{If\}\{[Text] ne 'This document has no text. ',[Text]\}
If you have installed Greenstone in a different language, then you need to put the correct language string into the If statement. (Since version 2.62.)
}