Changeset 26058 for documentation/trunk/tutorials
- Timestamp:
- 2012-08-01T22:03:18+12:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
documentation/trunk/tutorials/xml-source/tutorial_en.xml
r26050 r26058 2054 2054 </Heading> 2055 2055 <NumberedItem> 2056 <MajorVersion number="2"> 2056 2057 <Text id="0531a">Now let's look at fielded searching. In the browser, go to the <AutoText key="coredm::_Global:linktextPREFERENCES_" type="italics"/> page. You will notice that there is a <AutoText key="coredm::_preferences:textsearchtype_" /> option which enables you to switch between "normal" and "fielded" search. Change to fielded search now, press the <AutoText key="coredm::_preferences:textsetprefs_"/>, and click on the <AutoText key="coredm::_Global:labelSearch_"/> button to go back to the Search page. The search form has changed to a fielded form.</Text> 2057 </NumberedItem> 2058 <NumberedItem> 2059 <Text id="0531b">You can specify which search form types are available for a particular collection, and which one is the default, using the <AutoText text="SearchTypes"/> format statement. In the <AutoText key="glidict::GUI.Format"/> panel select <AutoText key="glidict::CDM.GUI.Formats"/> from the left-hand list. Select the <AutoText text="SearchTypes"/> format statement from the list of assigned formats, and set the contents to <AutoText text="form"/>. This will make only fielded searching available for this collection.</Text> 2060 <Comment> 2061 <Text id="0531c">Search type options include <AutoText text="form"/> and <AutoText text="plain"/>. You can specify one or both separated by a comma. If both are specified, the first one is used as the default: this is the one that the user will see when they first enter the collection.</Text> 2062 </Comment> 2063 </NumberedItem> 2064 <NumberedItem> 2065 <Text id="0533"><b>Preview</b> the collection again. Notice that the collection's home page no longer includes a query box. (This is because the search form is too big to fit here nicely.) To search, you have to click <AutoText key="coredm::_Global:labelSearch_"/> in the navigation bar. Note that the <AutoText key="coredm::_Global:linktextPREFERENCES_" type="italics"/> page has changed so that the "normal" query style is no longer offered.</Text> 2058 </MajorVersion> 2059 <MajorVersion number="3"> 2060 <Text id="0531a-3">Now let's look at fielded searching. In the browser, press the <AutoText text="form search"/> button below the usual search form. This will present a fielded search form.</Text> 2061 </MajorVersion> 2062 </NumberedItem> 2063 <NumberedItem> 2064 <Text id="0531b">You can specify which search form types are available for a particular collection, and which one is the default, using the <AutoText text="SearchTypes"/> format statement. In the <AutoText key="glidict::GUI.Format"/> panel select <AutoText key="glidict::CDM.GUI.Formats"/> from the left-hand list. Select the <AutoText text="SearchTypes"/> format statement from the list of assigned formats, and set the contents to <MajorVersion number="2"><AutoText text="form"/></MajorVersion><MajorVersion number="3">just <AutoText text="simpleform"/></MajorVersion>. This will make only fielded searching available for this collection.</Text> 2065 <Comment> 2066 <MajorVersion number="2"><Text id="0531d">Search type options include <AutoText text="form"/> and <AutoText text="plain"/>. You can specify one or both separated by a comma. If both are specified, the first one is used as the default: this is the one that the user will see when they first enter the collection.</Text></MajorVersion> 2067 <MajorVersion number="3"><Text id="0531d">Search type options include <AutoText text="plain"/>, <AutoText text="simpleform"/> (for fielded searching) and <AutoText text="advancedform"/> (for fielded searching with boolean operations). You can specify any combination of these, separated by a comma. If the <AutoText text="plain"/> search type is specified, it will be available in the search area at the top of each page of the collection.</Text></MajorVersion> 2068 </Comment> 2069 </NumberedItem> 2070 <NumberedItem> 2071 <Text id="0533"><b>Preview</b> the collection again. Notice that the collection's <MajorVersion number="2">home page</MajorVersion><MajorVersion number="3">pages</MajorVersion> no longer includes a query box. (This is because the search form is too big to fit here nicely.) To search, you have to click <MajorVersion number="2"><AutoText key="coredm::_Global:labelSearch_"/></MajorVersion><MajorVersion number="3"><AutoText text="form search"/></MajorVersion> in the navigation bar. Note that <MajorVersion number="2">the <AutoText key="coredm::_Global:linktextPREFERENCES_" type="italics"/> page has changed so that the "normal" query style</MajorVersion><MajorVersion number="3"><AutoText text="text search"/></MajorVersion> is no longer offered.</Text> 2066 2072 </NumberedItem> 2067 2073 <NumberedItem> … … 2100 2106 <NumberedItem> 2101 2107 <Text id="0533-11"><b>Rebuild</b> and <b>preview</b> the collection. You will notice that the <AutoText key="coredm::_Global:labelSubject_" type="italics"/> classifier is empty, searching no longer returns any results, and the document display is useless.</Text> 2102 <Text id="0533-11b">Although the <AutoText key="coredm::_Global:labelTitle_" type="italics"/> classifier was built on <AutoText key="metadata::ex.Title"/>, it still displays the correct titles, but in the <AutoText key="glidict::GUI.Enrich"/> panel you can see the <AutoText key="metadata::ex.Title"/> metadata are actually the filenames rather than titles of the MARC records. This is because the default <AutoText text="VList"/> format uses the <AutoText key="metadata::exp.Title"/> metadata. In the <AutoText key="glidict::CDM.GUI.Formats"/> section of the <AutoText key="glidict::GUI.Format"/> panel, select <AutoText text="VList"/> in the list of assigned format statements. The format statement looks like:</Text> 2108 <Text id="0533-11b">Although the <AutoText key="coredm::_Global:labelTitle_" type="italics"/> classifier was built on <AutoText key="metadata::ex.Title"/>, it still displays the correct titles, but in the <AutoText key="glidict::GUI.Enrich"/> panel you can see the <AutoText key="metadata::ex.Title"/> metadata are actually the filenames rather than titles of the MARC records. This is because the default <MajorVersion number="2"><AutoText text="VList"/></MajorVersion><MajorVersion number="3"><AutoText text="browse"/></MajorVersion> format uses the <AutoText key="metadata::exp.Title"/> metadata. In the <AutoText key="glidict::CDM.GUI.Formats"/> section of the <AutoText key="glidict::GUI.Format"/> panel, select <MajorVersion number="2"><AutoText text="VList"/></MajorVersion><MajorVersion number="3"><AutoText text="global"/></MajorVersion> in the list of assigned format statements. The format statement looks like:</Text> 2109 <MajorVersion number="2"> 2103 2110 <Format> 2104 2111 <td valign="top">[link][icon][/link]</td><br/> … … 2108 2115 [/highlight]{If}{[ex.Source],<br><i>([ex.Source])</i>}</td> 2109 2116 </Format> 2110 <Text id="0533-11c">Since there is no <AutoText key="metadata::dc.Title"/> metadata and <AutoText key="metadata::exp.Title"/> comes before <AutoText key="metadata::ex.Title"/>, the exploded titles will be displayed.</Text> 2117 </MajorVersion> 2118 <MajorVersion number="3"> 2119 <Format> 2120 <gsf:choose-metadata><br/> 2121 <Tab n="1"/><gsf:metadata name="dc.Title"/><br/> 2122 <Tab n="1"/><gsf:metadata name="exp.Title"/><br/> 2123 <Tab n="1"/><gsf:metadata name="ex.dc.Title"/><br/> 2124 <Tab n="1"/><gsf:metadata name="Title"/><br/> 2125 <Tab n="1"/><gsf:default>Untitled</gsf:default><br/> 2126 </gsf:choose-metadata> 2127 </Format> 2128 The above format statement is found in the <AutoText text="choose-title"/> template defined in the <AutoText text="global"/> format feature, which is included by the <AutoText text="browse"/> format statements. 2129 </MajorVersion> 2130 <Text id="0533-11c">Since there is no <AutoText key="metadata::dc.Title"/> metadata and because <AutoText key="metadata::exp.Title"/> comes before <AutoText key="metadata::ex.Title"/>, the exploded titles will be displayed.</Text> 2111 2131 </NumberedItem> 2112 2132 <Heading> … … 2117 2137 <Text id="0533-12b">We need to modify the collection design to take note of these changes.</Text> 2118 2138 <NumberedItem> 2119 <Text id="0533-13">In the <AutoText key="glidict::CDM.GUI.Indexes"/> section, change the Title index to use <AutoText key="metadata::exp.Title"/>: select the Title index in the <AutoText key="glidict::CDM.IndexManager.Indexes"/> list and click <AutoText key="glidict::CDM.IndexManager.Edit_Index" type="button"/>. Deselect <AutoText key="metadata::dc.Title"/> and <AutoText key="metadata::ex.Title"/> in the list of metadata, and select <AutoText key="metadata::exp.Title"/>. Click <AutoText key="glidict::CDM.IndexManager.Replace_Index" type="button"/>.</Text>2139 <Text id="0533-13">In the <AutoText key="glidict::CDM.GUI.Indexes"/> section, change the Title index to use <AutoText key="metadata::exp.Title"/>: select the Title index in the <AutoText key="glidict::CDM.IndexManager.Indexes"/> list and click <AutoText key="glidict::CDM.IndexManager.Edit_Index" type="button"/>. Deselect <AutoText key="metadata::dc.Title"/>, <AutoText key="metadata::ex.dc.Title"/> and <AutoText key="metadata::ex.Title"/> in the list of metadata, and select <AutoText key="metadata::exp.Title"/>. Click <AutoText key="glidict::CDM.IndexManager.Replace_Index" type="button"/>.</Text> 2120 2140 </NumberedItem> 2121 2141 <NumberedItem> … … 2138 2158 <BulletList> 2139 2159 <Bullet> 2140 <Text id="0533-16a">There is no dc metadata for this collection, so replace <Format>{Or}{[dc.Title],[exp.Title],[ex.Title],Untitled}</Format> with <Format>{Or}{[exp.Title],[ex.Title],Untitled}</Format>.</Text> 2141 </Bullet> 2142 <Bullet> 2143 <Text id="0533-16b">There are no source or thumb icons, so remove the second line: <Format><td valign="top">[ex.srclink]{Or}{[ex.thumbicon],[ex.srcicon]}[ex./srclink]</td></Format>.</Text> 2144 </Bullet> 2145 <Bullet> 2146 <Text id="0533-16c">The ex.Source metadata is set to the nul filename, so remove that from the display: remove <Format>{If}{[ex.Source],<br><i>([ex.Source])</i>}</Format></Text> 2160 <MajorVersion number="2"> 2161 <Text id="0533-16a">There is no dc metadata for this collection, so replace <Format>{Or}{[dc.Title],[exp.Title],[ex.dc.Title],[ex.Title],Untitled}</Format> with <Format>{Or}{[exp.Title],[ex.Title],Untitled}</Format>.</Text> 2162 </MajorVersion> 2163 <MajorVersion number="3"> 2164 <Text id="0533-16e">There is no dc (or ex.dc) metadata for this collection, so in the <AutoText text="global"/> format feature's <AutoText text="choose-title"/> template, replace the following</Text> 2165 <Format> 2166 <gsf:choose-metadata><br/> 2167 <Tab n="1"/><gsf:metadata name="dc.Title"/><br/> 2168 <Tab n="1"/><gsf:metadata name="exp.Title"/><br/> 2169 <Tab n="1"/><gsf:metadata name="ex.dc.Title"/><br/> 2170 <Tab n="1"/><gsf:metadata name="Title"/><br/> 2171 <Tab n="1"/><gsf:default>Untitled</gsf:default><br/> 2172 </gsf:choose-metadata> 2173 </Format> 2174 <Text id="0691b">with</Text> 2175 <Format> 2176 <gsf:choose-metadata><br/> 2177 <Tab n="1"/><gsf:metadata name="exp.Title"/><br/> 2178 <Tab n="1"/><gsf:metadata name="Title"/><br/> 2179 <Tab n="1"/><gsf:default>Untitled</gsf:default><br/> 2180 </gsf:choose-metadata> 2181 </Format> 2182 </MajorVersion> 2183 </Bullet> 2184 <Bullet> 2185 <MajorVersion number="2"> 2186 <Text id="0533-16b">There are no source or thumb icons, so remove the second line:</Text> 2187 <Format><td valign="top">[ex.srclink]{Or}{[ex.thumbicon],[ex.srcicon]}[ex./srclink]</td></Format> 2188 </MajorVersion> 2189 <MajorVersion number="3"> 2190 <Text id="0533-16b-3">There are no source or thumb icons, so in the <AutoText text="documentNode"/> and <AutoText text="classifierNode"/> templates of the <AutoText text="browse"/> format feature, remove the occurrences of the following section:</Text> 2191 <Format> 2192 <gsf:link type="source"><br /> 2193 <Tab n="1"/><gsf:choose-metadata><br /> 2194 <Tab n="2"/><gsf:metadata name="thumbicon"/><br /> 2195 <Tab n="2"/><gsf:metadata name="srcicon"/><br /> 2196 <Tab n="1"/></gsf:choose-metadata><br /> 2197 </gsf:link><br /> 2198 </Format> 2199 </MajorVersion> 2200 </Bullet> 2201 <Bullet> 2202 <Text id="0533-16c">The ex.Source metadata is set to the nul filename, so remove that from the display. Remove:</Text> 2203 <MajorVersion number="2"> 2204 <Format>{If}{[ex.Source],<br><i>([ex.Source])</i>}</Format> 2205 </MajorVersion> 2206 <MajorVersion number="3"> 2207 <Format> 2208 <gsf:switch><br /> 2209 <Tab n="1"/><gsf:metadata name="Source"/><br /> 2210 <Tab n="1"/><gsf:when test="exists"><br /> 2211 <Tab n="2"/><br/><br /> 2212 <Tab n="2"/><i>(<gsf:metadata name="Source"/>)</i><br /> 2213 <Tab n="1"/></gsf:when><br /> 2214 </gsf:switch><br /> 2215 </Format> 2216 </MajorVersion> 2147 2217 </Bullet> 2148 2218 </BulletList> 2219 <MajorVersion number="2"> 2149 2220 <Text id="0533-16d">The resulting format statement looks like:</Text> 2150 2221 <Format> … … 2154 2225 [/highlight]</td> 2155 2226 </Format> 2156 </NumberedItem> 2157 <NumberedItem> 2227 </MajorVersion> 2228 </NumberedItem> 2229 <NumberedItem> 2230 <MajorVersion number="2"> 2158 2231 <Text id="0533-19">Clear the <AutoText text="DocumentHeading"/> format statement by selecting it in the list of assigned format statements and deleting the contents in the <AutoText key="glidict::CDM.FormatManager.Editor"/>. The record Title will be displayed as part of the <AutoText text="DocumentText"/> format, so we don't need it here. </Text> 2159 </NumberedItem> 2160 <NumberedItem> 2232 </MajorVersion> 2233 <MajorVersion number="3"> 2234 <Text id="0533-19-3">The record Title will be displayed as part of the default <AutoText text="documentContent"/> format, so we override the <AutoText text="documentHeading"/> format statement (which displays the Title) with one that does not do anything. Go to the <AutoText text="display"/> format feature in the <AutoText key="glidict::CDM.FormatManager.Editor"/> and add the following:</Text> 2235 <Format><gsf:template name="documentHeading"/></Format> 2236 </MajorVersion> 2237 </NumberedItem> 2238 <NumberedItem> 2239 <MajorVersion number="2"> 2161 2240 <Text id="0533-20">Next, edit the <AutoText text="DocumentText"/> format statement. Delete the contents and replace it with</Text> 2162 2241 <Format> … … 2167 2246 </table> 2168 2247 </Format> 2169 </NumberedItem> 2170 <NumberedItem> 2171 <Text id="0533-22">The <AutoText key="coredm::_document:textDETACH_" type="italics"/> and <AutoText key="coredm::_document:textNOHIGHLIGHT_" type="italics"/> buttons are not very useful for this collection, so lets get rid of them. Edit the <AutoText text="DocumentButtons"/> format statement to make it empty. Press the <AutoText key="glidict::CreatePane.Preview_Collection" type="button"/> button to preview the collection.</Text> 2248 </MajorVersion> 2249 <MajorVersion number="3"> 2250 <Text id="0533-20-3">Next, override the default <AutoText text="documentContent"/> behaviour by creating a format statement for this. Still in the <AutoText text="display"/> format features, add:</Text> 2251 <Format> 2252 <gsf:template name="documentContent"><br /> 2253 <Tab n="1"/><table><br /> 2254 <Tab n="2"/><tr><br /> 2255 <Tab n="3"/><td>Title:</td><br /> 2256 <Tab n="3"/><td><gsf:metadata name="exp.Title"/></td><br /> 2257 <Tab n="2"/></tr><br /> 2258 <Tab n="2"/><tr><br /> 2259 <Tab n="3"/><td>Subject:</td><br /> 2260 <Tab n="3"/><td><gsf:metadata name="exp.Subject"/></td><br /> 2261 <Tab n="2"/></tr><br /> 2262 <Tab n="2"/><tr><br /> 2263 <Tab n="3"/><td>Publisher:</td><br /> 2264 <Tab n="3"/><td><gsf:metadata name="exp.Publisher"/></td><br /> 2265 <Tab n="2"/></tr><br /> 2266 <Tab n="1"/></table><br /> 2267 </gsf:template> 2268 </Format> 2269 </MajorVersion> 2270 </NumberedItem> 2271 <NumberedItem> 2272 <Text id="0533-22"><MajorVersion number="2">The <AutoText key="coredm::_document:textDETACH_" type="italics"/> and <AutoText key="coredm::_document:textNOHIGHLIGHT_" type="italics"/> buttons are not very useful for this collection, so lets get rid of them. Edit the <AutoText text="DocumentButtons"/> format statement to make it empty. </MajorVersion> 2273 Press the <AutoText key="glidict::CreatePane.Preview_Collection" type="button"/> button to preview the collection.</Text> 2172 2274 </NumberedItem> 2173 2275 </Content> … … 2203 2305 </NumberedItem> 2204 2306 <NumberedItem> 2307 <MajorVersion number="2"> 2205 2308 <Text id="is-11">In the <AutoText key="glidict::CDM.GUI.Formats"/> section of the <AutoText key="glidict::GUI.Format"/> panel, change the <AutoText text="VList"/> format statement to display <AutoText text="Photographer"/> and <AutoText text="Notes"/> metadata. Change it to look like:</Text> 2206 2309 <Format> … … 2208 2311 <td valign=top><b>[ex.Photographer^all]</b><br/>[ex.Notes^all]</td> 2209 2312 </Format> 2210 </NumberedItem> 2313 </MajorVersion> 2314 <MajorVersion number="3"> 2315 <Text id="is-11">In the <AutoText key="glidict::CDM.GUI.Formats"/> section of the <AutoText key="glidict::GUI.Format"/> panel, change the <AutoText text="browse"/> format statement to display <AutoText text="Photographer"/> and <AutoText text="Notes"/> metadata. Change its <AutoText text="documentNode"/> template to look like:</Text> 2316 <Format> 2317 <gsf:template match="documentNode"><br /> 2318 <Tab n="1"/><td valign="top"><br /> 2319 <Tab n="2"/><gsf:link type="document"><br /> 2320 <Tab n="3"/><gsf:icon type="document"/><br /> 2321 <Tab n="2"/></gsf:link><br /> 2322 <Tab n="1"/></td><br /> 2323 <highlight> 2324 <Tab n="1"/><td valign="top"><br /> 2325 <Tab n="2"/><b><gsf:metadata name="Photographer^all"/></b><br /> 2326 <Tab n="2"/><br/><gsf:metadata name="Notes^all"/><br /> 2327 <Tab n="1"/></td> 2328 </highlight><br /> 2329 </gsf:template> 2330 </Format> 2331 </MajorVersion> 2332 </NumberedItem> 2333 <MajorVersion number="2"> 2211 2334 <NumberedItem> 2212 2335 <Text id="is-11a">Make fielded searching the default by changing the <AutoText text="SearchTypes"/> format statement to <AutoText text="form,plain"/> (instead of <AutoText text="plain,form"/>).</Text> 2213 2336 </NumberedItem> 2337 </MajorVersion> 2214 2338 <Text id="is-13"><AutoText text="ISISPlug"/> stores a nicely formatted version of the record as the document text, and this is what is displayed when we view a record. Let's tidy it up a little more.</Text> 2339 <MajorVersion number="2"> 2215 2340 <NumberedItem> 2216 2341 <Text id="is-14">Remove the <AutoText key="coredm::_document:textDETACH_" type="italics"/> and <AutoText key="coredm::_document:textNOHIGHLIGHT_" type="italics"/> buttons by setting the <AutoText text="DocumentButtons"/> format statement to empty.</Text> … … 2219 2344 <Text id="is-15">Remove the <AutoText text="Untitled" type="quoted"/> at the top of the document by setting the <AutoText text="DocumentHeading"/> format statement to empty.</Text> 2220 2345 </NumberedItem> 2221 <NumberedItem> 2222 <Text id="is-16">Finally, lets link to the raw record, which is stored as <AutoText text="ISISRawRecord"/> metadata. Edit the <AutoText text="DocumentText"/> format statement to look like the following. (This format can be copied from <Path>sample_files → isis → format_tweaks → document_text.txt</Path>.)</Text> 2346 </MajorVersion> 2347 <NumberedItem> 2348 <Text id="is-16">Finally, lets link to the raw record, which is stored as <AutoText text="ISISRawRecord"/> metadata. 2349 <MajorVersion number="2">Edit the <AutoText text="DocumentText"/> format statement to look like the following. (This format can be copied from <Path>sample_files → isis → format_tweaks → document_text.txt</Path>.)</MajorVersion> 2350 <MajorVersion number="3">Add the following to the <AutoText text="display"/> format statement, to adjust the <AutoText text="documentContent"/>. This now makes use of a predefined Greenstone javascript function to toggle between displaying and hiding the raw record.</MajorVersion></Text> 2351 <MajorVersion number="2"> 2223 2352 <Format> 2224 2353 <p>[Text]</p><br/> … … 2229 2358 } 2230 2359 </Format> 2360 </MajorVersion> 2361 <MajorVersion number="3"> 2362 <Format> 2363 <gsf:template name="documentContent"><br/> 2364 <Tab n="1"/><p><br/> 2365 <Tab n="2"/><xsl:call-template name="wrappedSectionText"/><br/> 2366 <Tab n="1"/></p><br/> 2367 <br/> 2368 <Tab n="1"/><a href="javascript:;" id="cdsreclink">Show/Hide CDS Record</a><br/> 2369 <Tab n="1"/><div id="cdsrecord"><br/> 2370 <Tab n="2"/><b>CDS Record:</b><br/> 2371 <Tab n="2"/><br/><br/> 2372 <Tab n="2"/><tt><br/> 2373 <Tab n="3"/><gsf:metadata name="ISISRawRecord"/><br/> 2374 <Tab n="2"/></tt><br/> 2375 <Tab n="1"/></div><br/> 2376 <br/> 2377 <Tab n="1"/><script type="text/javascript"><br/> 2378 <Tab n="2"/><xsl:text disable-output-escaping="yes"><br/> 2379 <Tab n="3"/>var link=document.getElementById("cdsreclink");<br/> 2380 <Tab n="3"/>var div=document.getElementById("cdsrecord");<br/> 2381 <Tab n="3"/>gs.functions.makeToggle(link, div);<br/> 2382 <Tab n="2"/></xsl:text><br/> 2383 <Tab n="1"/></script><br/> 2384 </gsf:template><br/> 2385 </Format> 2386 </MajorVersion> 2231 2387 </NumberedItem> 2232 2388 <NumberedItem>
Note:
See TracChangeset
for help on using the changeset viewer.