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 a file with a 7z (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 http://convertio.co/uz-zip/. Click the red From computer button. In the file browser dialog that appears, navigate to where you downloaded the 7zip file. Select this file and confirm to close the file browser dialog. Once the file has finished uploading, the online service will say "ready" and a red Convert button will appear. Click that button and wait until the convertio.co site has converted your 7z file to zip. When it's done, it will say "finished" and a small green button marked Download will appear. Click this button to download the zip version of the file. (After downloading has finished, you can press the close button, marked with a cross next to the download button, which will presumably clear your uploaded files from the convertio.co's server.)On Windows, your converted zip version of the template will have been saved 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 on the downloaded zip file containing the template, 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.