Changeset 37663 for documentation
- Timestamp:
- 2023-04-14T19:05:02+12:00 (13 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
documentation/trunk/tutorials/xml-source/tutorial_en.xml
r37661 r37663 6246 6246 <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> 6247 6247 <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 → web → WEB-INF → 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 → resources → web → servlets.xml.in</Path>, which <i>can</i> be edited as we do in this tutorial.</Text> 6249 6250 </Comment> 6250 6251 <Heading> … … 6257 6258 </NumberedItem> 6258 6259 <NumberedItem> 6259 <Text id="dl-04">In a Windows Explorer, navigate to the <Path>Greenstone3 → web → 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 → resources → web </Path> folder and open the template file <b>servlets.xml.in</b> in a text editor. Find the following section: 6260 6261 </Text> 6261 6262 … … 6303 6304 </Heading> 6304 6305 <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 → libraries → 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 → libraries → def_libs.txt</Path>); The exact location doesn't matter, just put it with the other servlets:</Text> 6306 6307 <Format> 6307 6308 <Tab n="1"/><servlet><br/> … … 6341 6342 </NumberedItem> 6342 6343 <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> 6344 6345 </NumberedItem> 6345 6346 <Heading> … … 6347 6348 </Heading> 6348 6349 <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 → libraries</Path> folder, copy the folder <b>althor</b> into the <Path>Greenstone3 → web → 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 → libraries</Path> folder, copy the folder <b>althor</b> into the <Path>Greenstone3 → web → interfaces</Path> folder. In <b>servlets.xml.in</b>, define a new library that uses the althor interface:</Text> 6350 6351 <Format> 6351 6352 <Tab n="1"/><servlet><br/> … … 6384 6385 </NumberedItem> 6385 6386 <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> 6387 6388 <Comment> 6388 6389 <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> … … 6453 6454 </Heading> 6454 6455 <NumberedItem> 6455 <Text id="ni1-07">Now, let's define a library that uses the new interface. In <Path>Greenstone3 → web → 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 → interfaces → aybara → interface.txt</Path>.</Text>6456 <Text id="ni1-07">Now, let's define a library that uses the new interface. In <Path>Greenstone3 → resources → 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 → interfaces → aybara → interface.txt</Path>.</Text> 6456 6457 <Format> 6457 6458 <Tab n="1"/><servlet><br/> … … 6490 6491 </NumberedItem> 6491 6492 <NumberedItem> 6492 <Text id="ni1-09">Save servlets.xml. Start up your Greenstone server (<Path>Start → All Programs → Greenstone3 → 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 → All Programs → Greenstone3 → Greenstone3 Server</Path>) and click the <b>Enter Library</b> button. This will take you to the default library's home page.</Text> 6493 6494 <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> 6494 6495 </NumberedItem> … … 6516 6517 </NumberedItem> 6517 6518 <NumberedItem> 6518 <Text id="ni1-18a">Now, from the <Path>sample_files → interfaces → 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 → web → interfaces → 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 → interfaces → 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 → web → interfaces → 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 → 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> 6519 6527 <Text id="ni1-18b">Next, copy the two javascript files in <Path>sample_files → interfaces</Path> (<i>jquery.galleryview-2.1.1.js</i> and especially <i>jquery.galleryview.2.1.1.min.js</i>) to <Path>Greenstone3 → web → interfaces → perrin → 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> 6520 6528 <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.