Greenstone tutorial exercise
Designing a new interface: Part 1
Creating a new interface
- In a file browser, navigate to the interfaces folder of your Greenstone3 installation (C: → Users → <user-name> → Greenstone3 → web → interfaces). Create a new folder (in the right-click menu, select New → Folder) and call it perrin. The name of this folder (perrin) determines the name of your new interface.
• we will end up with duplicates of a large number of files
• there are many files in the default interface that we won't need
• it will be difficult to keep track of which files are different/unique to our new interface
A better solution is to base our new interface on the default interface. A base interface is used by Greenstone as a kind of backup. If Greenstone can't find a file in our interface, it will then try to find it in the base interface. To assign default as base interface, in perrin → interfaceConfig.xml, change the second line from this:
- Save and close interfaceConfig.xml.
Defining a new library
- Now, let's define a library that uses the new interface. In Greenstone3 → web → WEB-INF open servlets.xml, and add the following (the exact location doesn't matter, just put it with the other servlets):
This defines a new library called "golden" that uses "localsite" and our new "perrin" interface. Now, near the bottom of the file, add in a servlet mapping to tell the server where our new library should be located:
<description>A new library with my new interface!</description>
- Save servlets.xml. Start up your Greenstone server (Start → All Programs → Greenstone3 → Greenstone3 Server) and click the Enter Library button. This will take you to the default library's home page.Navigate to http://localhost:8383/greenstone3/golden. This library is using the perrin interface. However, since perrin contains no files except its configuration file, Greenstone is borrowing everything from default, perrin's base interface.
- Visit http://www.os-templates.com/free-website-templates/news-magazine and click the Download This Template button. In the popup window, select Save File and click OK. This will download the file news-magazine.7z, which has a 7zip extension. If you have 7zip installed, then you can extract the file in place. If not, you can either download the free utility, 7zip, from the web, or alternatively use an online service to convert it to a zip file that Windows can extract.To do the latter, visit wobzip.org. Click the Browse from computer button, and in the file browser dialog that appears, navigate to where you downloaded the news-magazine.7z file, select the file and confirm to close the file browser dialog. Next, click the Uncompress button at wobzip.org and wait until the site has extracted the 7z file and takes you to its download page. When that page now loads, click the Download as zip button. (After downloading has finished, you can press the Delete Upload button to clear all your files from WOBZIP's server.) On Windows, this will save the file news-magazine.zip in your Downloads folder. This template is free to use and modify, but the Copyright and link information must remain intact in files and in the footer of every page. The template cannot be distributed (modified or otherwise) without express permission from OS-Templates. (The full license is provided in the license.txt file included with the template).
In an Explorer window, navigate to your Downloads folder (C:\Users\<user-name>\Downloads). Right-click news-magazine.zip, select Extract All... and, in the popup window, click Extract.
- In the perrin → styles folder, open layout.css in a text editor and delete the following line:
Save and close layout.css.