Changeset 37663 for documentation


Ignore:
Timestamp:
2023-04-14T19:05:02+12:00 (13 months ago)
Author:
anupama
Message:
  1. Dr Bainbridge added a template file resources/web/servlets.xml.in (and servlets.xml.svn, which generates it), and this is now the editable servlets XML file. So Jenny's tutorials requiring the user to edit web/WEB-INF/servlets.xml have now been updated to tell them to edit resources/web/servlets.xml.in. 2. In one of the 3 customization tutorials, I noticed in the JS console that the browser could not find loader.gif in the custom interface used by the JavaScript slider when it's still loading. The image is present, but the location is different to what the existing CSS specifies, because the instructions ask folders to get moved about, so I've added an instruction to modify the old location to the new one, so the issue goes away.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • documentation/trunk/tutorials/xml-source/tutorial_en.xml

    r37661 r37663  
    62466246<Text id="dl-c2"><b>Interfaces</b> dictate the presentation -- e.g. the HTML, CSS, Javascript, etc. used to present the content. You can have multiple sites and interfaces. <br/><br/></Text>
    62476247<Text id="dl-c3"><b>Libraries</b> combine content and presentation. To define a library, you select the site and the interface you want it to use. And, of course, you can have multiple libraries, and each site and interface can be used multiple times.  <br/><br/></Text>
    6248 <Text id="dl-c4">In this tutorial, we will become familiar with <b>servlets.xml</b> (where libraries are defined), create a new site, add an interface, and define a new library.</Text>
     6248<Text id="dl-c4">In this tutorial, we will become familiar with <b>servlets.xml.in</b> (where libraries are defined), create a new site, add an interface, and define a new library.<br /><br /></Text>
     6249<Text id="dl-c6"><b>Note:</b> The active version of this file is called <i>servlets.xml</i> and is located in <Path>Greenstone3 &rarr; web &rarr; WEB-INF &rarr; servlets.xml</Path>, but it is not to be manually edited. Each time the Greenstone 3 server is run, this file is automatically re-generated from its template file at <Path>Greenstone3 &rarr; resources &rarr; web &rarr; servlets.xml.in</Path>, which <i>can</i> be edited as we do in this tutorial.</Text>
    62496250</Comment>
    62506251<Heading>
     
    62576258</NumberedItem>
    62586259<NumberedItem>
    6259 <Text id="dl-04">In a Windows Explorer, navigate to the <Path>Greenstone3 &rarr; web &rarr; WEB-INF </Path> folder and open <b>servlets.xml</b> in a text editor. Find the following section:
     6260<Text id="dl-04">In a Windows Explorer, navigate to the <Path>Greenstone3 &rarr; resources &rarr; web </Path> folder and open the template file <b>servlets.xml.in</b> in a text editor. Find the following section:
    62606261</Text>
    62616262
     
    63036304</Heading>
    63046305<NumberedItem>
    6305 <Text id="dl-11">Now, let's define a library that uses this new site. In <b>servlets.xml</b>, add the following (which can be copied from <Path>sample_files &rarr; libraries &rarr; def_libs.txt</Path>);  The exact location doesn't matter, just put it with the other servlets:</Text>
     6306<Text id="dl-11">Now, let's define a library that uses this new site. In <b>servlets.xml.in</b>, add the following (which can be copied from <Path>sample_files &rarr; libraries &rarr; def_libs.txt</Path>);  The exact location doesn't matter, just put it with the other servlets:</Text>
    63066307<Format>
    63076308    <Tab n="1"/>&lt;servlet&gt;<br/>
     
    63416342</NumberedItem>
    63426343<NumberedItem>
    6343 <Text id="dl-13">Save <b>servlets.xml</b>. For the changes to take effect, we must first restart the server. Click the <b>Restart Library</b> button in the Greenstone Server window. When the new browser window opens, navigate to <i>http://localhost:8383/greenstone3/library2</i> to see your newly defined library. Notice that only one collection appears -- the Lucene Demo Collection that we copied into <b>mysite</b>.</Text>
     6344<Text id="dl-13">Save <b>servlets.xml.in</b>. For the changes to take effect, we must first restart the server. Click the <b>Restart Library</b> button in the Greenstone Server window. When the new browser window opens, navigate to <i>http://localhost:8383/greenstone3/library2</i> to see your newly defined library. Notice that only one collection appears -- the Lucene Demo Collection that we copied into <b>mysite</b>.</Text>
    63446345</NumberedItem>
    63456346<Heading>
     
    63476348</Heading>
    63486349<NumberedItem>
    6349 <Text id="dl-14">Now that we know how to create and use a new site, let's add a new interface and define a library that uses it. Creating a new interface takes time (and is a tutorial all its own), so, for this tutorial, we are just going to use a pre-made interface. From the <Path>sample_files &rarr; libraries</Path> folder, copy the folder <b>althor</b> into the <Path>Greenstone3 &rarr; web &rarr; interfaces</Path> folder. In <b>servlets.xml</b>, define a new library that uses the althor interface:</Text>
     6350<Text id="dl-14">Now that we know how to create and use a new site, let's add a new interface and define a library that uses it. Creating a new interface takes time (and is a tutorial all its own), so, for this tutorial, we are just going to use a pre-made interface. From the <Path>sample_files &rarr; libraries</Path> folder, copy the folder <b>althor</b> into the <Path>Greenstone3 &rarr; web &rarr; interfaces</Path> folder. In <b>servlets.xml.in</b>, define a new library that uses the althor interface:</Text>
    63506351<Format>
    63516352    <Tab n="1"/>&lt;servlet&gt;<br/>
     
    63846385</NumberedItem>
    63856386<NumberedItem>
    6386 <Text id="dl-16">Save <b>servlets.xml</b>, restart the server again and navigate to <i>http://localhost:8383/greenstone3/rand</i>, where you will see the <b>rand</b> library, which displays <b>mysite</b> using the <b>althor</b> interface. </Text>
     6387<Text id="dl-16">Save <b>servlets.xml.in</b>, restart the server again and navigate to <i>http://localhost:8383/greenstone3/rand</i>, where you will see the <b>rand</b> library, which displays <b>mysite</b> using the <b>althor</b> interface. </Text>
    63876388<Comment>
    63886389<Text id="dl-c5">The <b>althor</b> interface was created using a free CSS template created by <Link url="http://www.luiszuno.com">luiszuno.com</Link>. If any of your collections have a home page image, an image slider will appear on the home page of your library. (You can add a home page image to a collection in the <b>General</b> section of the <b>Format</b> panel in the GLI.) </Text>
     
    64536454</Heading>
    64546455<NumberedItem>
    6455 <Text id="ni1-07">Now, let's define a library that uses the new interface. In <Path>Greenstone3 &rarr; web &rarr; WEB-INF</Path> open <b>servlets.xml</b>, and add the following (the exact location doesn't matter, just put it with the other servlets). You can copy the following from <Path> sample_files &rarr; interfaces &rarr; aybara &rarr; interface.txt</Path>.</Text>
     6456<Text id="ni1-07">Now, let's define a library that uses the new interface. In <Path>Greenstone3 &rarr; resources &rarr; web</Path> open <b>servlets.xml.in</b>, and add the following (the exact location doesn't matter, just put it with the other servlets). You can copy the following from <Path> sample_files &rarr; interfaces &rarr; aybara &rarr; interface.txt</Path>.</Text>
    64566457<Format>
    64576458    <Tab n="1"/>&lt;servlet&gt;<br/>
     
    64906491</NumberedItem>
    64916492<NumberedItem>
    6492 <Text id="ni1-09">Save servlets.xml. Start up your Greenstone server (<Path>Start &rarr; All Programs &rarr; Greenstone3 &rarr; Greenstone3 Server</Path>) and click the <b>Enter Library</b> button. This will take you to the default library's home page.</Text>
     6493<Text id="ni1-09">Save servlets.xml.in. Start up your Greenstone server (<Path>Start &rarr; All Programs &rarr; Greenstone3 &rarr; Greenstone3 Server</Path>) and click the <b>Enter Library</b> button. This will take you to the default library's home page.</Text>
    64936494<Text id="ni1-10">Navigate to <Path>http://localhost:8383/greenstone3/golden</Path>. This library is using the <i>perrin</i> interface. However, since <i>perrin</i> contains no files except its configuration file, Greenstone is borrowing everything from <i>default</i>, <i>perrin</i>'s base interface.</Text>
    64946495</NumberedItem>
     
    65166517</NumberedItem>
    65176518<NumberedItem>
    6518 <Text id="ni1-18a">Now, from the <Path>sample_files &rarr; interfaces &rarr; aybara</Path> folder, copy the <b>styles</b>, <b>images</b>, and <b>transform</b> folders, as well as the <b>index-GS3.html</b> file into <Path>Greenstone3 &rarr; web &rarr; interfaces &rarr; perrin</Path>. (If a popup window asks whether you want to merge the images and styles folders, select "Yes".)</Text>
     6519<Text id="ni1-18a">Now, from the <Path>sample_files &rarr; interfaces &rarr; aybara</Path> folder, copy the <b>styles</b>, <b>images</b>, and <b>transform</b> folders, as well as the <b>index-GS3.html</b> file into <Path>Greenstone3 &rarr; web &rarr; interfaces &rarr; perrin</Path>. (If a popup window asks whether you want to merge the images and styles folders, select "Yes".)</Text>
     6520<Text id="ni1-17a">In <Path> perrin &rarr; styles</Path>, open featured_slide.css in a text editor and change the following line:</Text>
     6521<Format>.loader{background:url("../scripts/galleryviewthemes/loader.gif") center center no-repeat;}</Format>
     6522<Text id="ni1-17c">to the following, where just the word "scripts" is replaced with the word "images":</Text>
     6523<Format>.loader{background:url("../images/galleryviewthemes/loader.gif") center center no-repeat;}</Format>
     6524<Text id="ni1-17c">Save and close featured_slide.css.</Text>
     6525</NumberedItem>
     6526<NumberedItem>
    65196527<Text id="ni1-18b">Next, copy the two javascript files in <Path>sample_files &rarr; interfaces</Path> (<i>jquery.galleryview-2.1.1.js</i> and especially <i>jquery.galleryview.2.1.1.min.js</i>) to <Path>Greenstone3 &rarr; web &rarr; interfaces &rarr; perrin &rarr; scripts</Path>, replacing any existing files of identical name. These two javascript files are modified versions to cope with an update to jquery. The modified files are necessary for the next tutorial's image slider to show up and work.</Text>
    65206528<Text id="ni1-18c">We have now gathered all of the Javascript, CSS, and images our new interface will use.</Text>
Note: See TracChangeset for help on using the changeset viewer.