Ignore:
Timestamp:
2004-12-08T17:19:29+13:00 (19 years ago)
Author:
kjdon
Message:

more stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/docs/manual/manual.tex

    r8696 r8757  
    683683\end{verbatim}\end{gsc}
    684684
    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_&amp;rl=1&amp;href=" text="?a=d&amp;c=folktale&amp;s0.ext=1&amp;d="/>
    695 <replace macro="_httpextlink_&amp;rl=0&amp;href=" text="?a=p&amp;sa=html&amp;c=folktale&amp;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.
     685Scope 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
     687Appendix~\ref{app:gs2replace} gives some examples that have been used for Greenstone 2 collections.
    701688
    702689\subsection{buildConfig.xml}\label{sec:buildconfig}
     
    798785\end{verbatim}\end{gsc}
    799786
    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\ .
     787Table~\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\ .
    801788 
    802789\begin{table}
     
    23822369
    23832370\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}
    23852374The following table shows the \gsii\  format elements, and their equivalents in \gsiii\
    23862375\begin{table}[h]
     
    24252414\end{tabular}}
    24262415\end{table}
     2416\subsection{Cleaning up macros}\label{app:gs2replace}
     2417
     2418Here we show some of the replace items that have been used for Greenstone 2 collections.
     2419
     2420Getting 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
     2425Macro 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
     2432Fixing up broken external links:
     2433\begin{gsc}\begin{verbatim}
     2434<replace macro="_httpextlink_&amp;rl=1&amp;href=" text="?a=d&amp;c=folktale&amp;s0.ext=1&amp;d="/>
     2435<replace macro="_httpextlink_&amp;rl=0&amp;href=" text="?a=p&amp;sa=html&amp;c=folktale&amp;url="/>
     2436</replaceList>
     2437\end{verbatim}\end{gsc}
     2438
     2439These 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.
     2440The 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
     2442Sometimes 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="&lt;img border='0' height='26' width='26' alt='PDF' title='_texticonpdf_' src='interfaces/default/images/ipdf.gif'/&gt;"/>
     2445<replace macro="_texticonpdf_" scope="metadata" bundle="interface_classic" key="texticonpdf"/>
     2446\end{verbatim}\end{gsc}
     2447
    24272448\end{document}
Note: See TracChangeset for help on using the changeset viewer.