Changeset 8757 for trunk/gsdl3/docs/manual
- Timestamp:
- 2004-12-08T17:19:29+13:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/docs/manual/manual.tex
r8696 r8757 683 683 \end{verbatim}\end{gsc} 684 684 685 Scope determines on what text the replacements are carried out: text, metadata, or both (all). An empty scope attribute is equivalent to scope=all. Each replace type can be used with all scope values. Replacing uses Java's 'String.replaceAll' functionality, so macro and replacement text are actually regular expressions. The first example is a straight is a straight textual replacement. The second example uses dictionary lookups. xxx will be replaced with the (language-dependent) value for key zzz in resource bundle yyy. The thrid example uses metadata: xxx will be replaced by the value of the yyy metadata for that document. 686 687 Some examples that have been used for existing Greenstone 2 collections are: 688 \begin{gsc}\begin{verbatim} 689 <replaceList> 690 <replace scope='text' macro="\backslash\backslash?\backslash\backslash\backslash/" text="\backslash("/> 691 <replace scope='metadata' macro="_magazines_" bundle="NZDLMacros" key="Magazines"/> 692 <replace scope='all' macro='_thisOID_' metadata='archivedir'/> 693 <replace macro="_httpcollimg_" text="sites/localsite/collect/folktale/index/assoc"/> 694 <replace macro="_httpextlink_&rl=1&href=" text="?a=d&c=folktale&s0.ext=1&d="/> 695 <replace macro="_httpextlink_&rl=0&href=" text="?a=p&sa=html&c=folktale&url="/> 696 </replaceList> 697 \end{verbatim}\end{gsc} 698 699 The last two examples show how to deal with Greenstone 2's external link macros. The first one is for a 'relative' external link. In this case, the links are like URL's but they actually refer to Greenstone internal documents. So the Greensotne 3 link is to the document, but with parameter s0.ext signifying that the d argument will need translating before retrieving the content. 700 The second example is a truly external link. This is translated into a html type page action, where the url is presented as a frame along with the collection header in a separate frame. 685 Scope determines on what text the replacements are carried out: text, metadata, or both (all). An empty scope attribute is equivalent to scope=all. Each replace type can be used with all scope values. Replacing uses Java's 'String.replaceAll' functionality, so macro and replacement text are actually regular expressions. The first example is a straight textual replacement. The second example uses dictionary lookups. xxx will be replaced with the (language-dependent) value for key zzz in resource bundle yyy. The third example uses metadata: xxx will be replaced by the value of the yyy metadata for that document. 686 687 Appendix~\ref{app:gs2replace} gives some examples that have been used for Greenstone 2 collections. 701 688 702 689 \subsection{buildConfig.xml}\label{sec:buildconfig} … … 798 785 \end{verbatim}\end{gsc} 799 786 800 Table~\ref{tab:gsf-format} shows the set of 'gsf' (Greenstone Format) elements. If you have come from a \gsii\ background, Appendix~\ref{app: format} shows \gsii\ format elements and their equivalents in \gsiii\ .787 Table~\ref{tab:gsf-format} shows the set of 'gsf' (Greenstone Format) elements. If you have come from a \gsii\ background, Appendix~\ref{app:gs2format} shows \gsii\ format elements and their equivalents in \gsiii\ . 801 788 802 789 \begin{table} … … 2382 2369 2383 2370 \newpage 2384 \section{Format statements: \gsii\ vs \gsiii\ }\label{app:format} 2371 \section{Tidying up the formatting for imported Greenstone 2 collections}\label{app:gs2tidy} 2372 2373 \subsection{Format statements: \gsii\ vs \gsiii\ }\label{app:gs2format} 2385 2374 The following table shows the \gsii\ format elements, and their equivalents in \gsiii\ 2386 2375 \begin{table}[h] … … 2425 2414 \end{tabular}} 2426 2415 \end{table} 2416 \subsection{Cleaning up macros}\label{app:gs2replace} 2417 2418 Here we show some of the replace items that have been used for Greenstone 2 collections. 2419 2420 Getting rid of silly backslashes: 2421 \begin{gsc}\begin{verbatim} 2422 <replace scope='text' macro="\backslash\backslash?\backslash\backslash\backslash(" text="\backslash("/> 2423 \end{verbatim}\end{gsc} 2424 2425 Macro resolving using resource bundles and metadata: 2426 \begin{gsc}\begin{verbatim} 2427 <replace scope='metadata' macro="_magazines_" bundle="NZDLMacros" key="Magazines"/> 2428 <replace scope='all' macro='_thisOID_' metadata='archivedir'/> 2429 <replace macro="_httpcollimg_" text="sites/localsite/collect/folktale/index/assoc"/> 2430 \end{verbatim}\end{gsc} 2431 2432 Fixing up broken external links: 2433 \begin{gsc}\begin{verbatim} 2434 <replace macro="_httpextlink_&rl=1&href=" text="?a=d&c=folktale&s0.ext=1&d="/> 2435 <replace macro="_httpextlink_&rl=0&href=" text="?a=p&sa=html&c=folktale&url="/> 2436 </replaceList> 2437 \end{verbatim}\end{gsc} 2438 2439 These two examples show how to deal with Greenstone 2's external link macros. The first one is for a 'relative' external link. In this case, the links are like URL's but they actually refer to Greenstone internal documents. So the Greensotne 3 link is to the document, but with parameter s0.ext signifying that the d argument will need translating before retrieving the content. 2440 The second example is a truly external link. This is translated into a html type page action, where the url is presented as a frame along with the collection header in a separate frame. 2441 2442 Sometimes we need to add in macros to be resolved in a second step: 2443 \begin{gsc}\begin{verbatim} 2444 <replace macro="_iconpdf_" scope="metadata" text="<img border='0' height='26' width='26' alt='PDF' title='_texticonpdf_' src='interfaces/default/images/ipdf.gif'/>"/> 2445 <replace macro="_texticonpdf_" scope="metadata" bundle="interface_classic" key="texticonpdf"/> 2446 \end{verbatim}\end{gsc} 2447 2427 2448 \end{document}
Note:
See TracChangeset
for help on using the changeset viewer.