Changeset 3838


Ignore:
Timestamp:
Oct 16, 2007, 1:38:56 PM (15 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #805: Add syntax coloring to code examples in docbook

Location:
trunk
Files:
16 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/build.xml

    r3832 r3838  
    11021102      <property name="base.version" value="${base.version}"/>
    11031103    </ant>
     1104     <copy todir="${docbook.html.out}">
     1105         <fileset dir="${docbook.src}" includes="css/*.*" />
     1106         <fileset dir="${docbook.src}" includes="script/*.*" />
     1107     </copy>
    11041108   
    11051109    <property name="catalog.location" location="${lib}/docbook/preprocess/catalog.xml" />
  • trunk/doc/3rd-party-components.txt

    r3737 r3838  
    230230Files    : Everything in lib/docbook except the 'docbook' subdirectory
    231231
     232Example code syntax highlighter
     233-------------------------------
     234A javascript library that can be used to dynamically highlight
     235the syntax in program examples. We have made minor changes to
     236make it support the HTML produced by Docbook (ie. find the language
     237from the 'language' attribute instead of the 'class' attribute).
     238
     239More info: http://www.dreamprojections.com/syntaxhighlighter
     240Version  : 1.5.1
     241License  : LGPL (lgpl.txt)
     242Files    : Everything in the /doc/src/docbook/script and
     243           /doc/src/docbook/css directories
    232244
    233245Affymetrix Fusion SDK
  • trunk/doc/src/docbook/developerdoc/api_overview.xml

    r3835 r3838  
    10921092        </para>
    10931093     
    1094         <programlisting>
     1094        <programlisting language="java">
    10951095DbControl dc = ...
    10961096FileStoreEnabled item = ...
     
    11561156        </para>
    11571157       
    1158         <programlisting>
     1158        <programlisting language="java">
    11591159DbControl dc = ...
    11601160FileStoreEnabled item = ...
     
    12581258        </para>
    12591259       
    1260         <programlisting>
     1260        <programlisting language="java">
    12611261RawBioAssay rba = ...
    12621262DbControl dc = ...
     
    12801280      </para>
    12811281     
    1282       <programlisting>
     1282      <programlisting language="java">
    12831283RawBioassay rba = ...
    12841284// The file the user selected to import from
     
    13121312        </para>
    13131313       
    1314         <programlisting>
     1314        <programlisting language="java">
    13151315Experiment e = ...
    13161316RawDataType rdt = e.getRawDataType();
     
    13261326        </para>
    13271327       
    1328         <programlisting>
     1328        <programlisting language="java">
    13291329Experiment e = ...
    13301330DbControl dc = ...
  • trunk/doc/src/docbook/developerdoc/core_ref.xml

    r3715 r3838  
    330330        </para>
    331331         
    332         <programlisting>
     332        <programlisting language="java">
    333333public static int long MAX_ADDRESS_LENGTH = 255;
    334334private String address;
     
    366366          cases end with <classname>Data</classname>.
    367367        </para>
    368         <programlisting>
     368        <programlisting language="java">
    369369public class SampleData
    370370   extends CommonData
     
    408408        </para>
    409409       
    410         <programlisting>
     410        <programlisting language="java">
    411411// From GroupData.java
    412412public GroupData()
     
    853853          <title>Class mapping</title>
    854854         
    855           <programlisting>
     855          <programlisting language="java">
    856856/**
    857857   This class holds information about any data...
     
    963963          <bridgehead>String properties</bridgehead>
    964964         
    965           <programlisting>
     965          <programlisting language="java">
    966966public static int long MAX_STRINGPROPERTY_LENGTH = 255;
    967967private String stringProperty;
     
    996996          <bridgehead>Numerical properties</bridgehead>
    997997         
    998           <programlisting>
     998          <programlisting language="java">
    999999private int intProperty;
    10001000/**
     
    10201020
    10211021        <bridgehead>Boolean properties</bridgehead>
    1022         <programlisting>
     1022        <programlisting language="java">
    10231023private boolean booleanProperty;
    10241024/**
     
    10441044        <bridgehead>Date values</bridgehead>
    10451045       
    1046         <programlisting>
     1046        <programlisting language="java">
    10471047private Date dateProperty;
    10481048/**
     
    11011101          <title>Many-to-one mappings</title>
    11021102         
    1103           <programlisting>
     1103          <programlisting language="java">
    11041104private OtherData other;
    11051105/**
     
    12051205          </para>
    12061206         
    1207           <programlisting>
     1207          <programlisting language="java">
    12081208// RoleData.java
    12091209private Set&lt;UserData&gt; users;
     
    12501250          </para>
    12511251         
    1252           <programlisting>
     1252          <programlisting language="java">
    12531253// UserData.java
    12541254private Set&lt;RoleData&gt; roles;
     
    12871287          </para>
    12881288         
    1289           <programlisting>
     1289          <programlisting language="sql">
    12901290SELECT ... FROM GroupData grp WHERE grp.users ...
    12911291SELECT ... FROM UserData usr WHERE usr.groups ...
     
    13331333          </para>
    13341334
    1335           <programlisting>
     1335          <programlisting language="java">
    13361336// ClientData.java
    13371337private Set&lt;HelpData&gt; helpTexts;
     
    13931393          </para>
    13941394         
    1395           <programlisting>
     1395          <programlisting language="java">
    13961396// ProjectData.java
    13971397private Map&lt;UserData, Integer&gt; users;
     
    14821482          </para>
    14831483         
    1484           <programlisting>
     1484          <programlisting language="java">
    14851485// HybridizationData.java
    14861486private ArraySlideData arrayslide;
     
    15361536          </para>
    15371537         
    1538           <programlisting>
     1538          <programlisting language="java">
    15391539// UserData.java
    15401540/**
     
    16351635          </para>
    16361636         
    1637           <programlisting>
     1637          <programlisting language="java">
    16381638/**
    16391639   This class holds information about any items.
     
    16691669          </para>
    16701670         
    1671           <programlisting>
     1671          <programlisting language="java">
    16721672// UserData.java
    16731673private String address;
     
    17131713          </para>
    17141714         
    1715           <programlisting>
     1715          <programlisting language="java">
    17161716/**
    17171717   The maximum length of the name of an item that can be
  • trunk/doc/src/docbook/developerdoc/documentation.xml

    r3791 r3838  
    152152                <example id="docbook.examples.chapterbody">
    153153                  <title>Example of a chapter</title>
    154 <programlisting>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
     154<programlisting language="xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
    155155&lt;!DOCTYPE chapter PUBLIC
    156156  "-//Dawid Weiss//DTD DocBook V3.1-Based Extension for XML and graphics inclusion//EN"
    157157  "../../../../lib/docbook/preprocess/dweiss-docbook-extensions.dtd"&gt;
    158158
    159 &lt;chapter id="<replaceable>example_chapter</replaceable>"&gt;
    160    &lt;?dbhtml dir="<replaceable>folder name to put the chapter's files in</replaceable>"?&gt;
     159&lt;chapter id="example_chapter"&gt;
     160   &lt;?dbhtml dir="folder name to put the chapter's files in"?&gt;
    161161   &lt;title&gt;Example of a chapter &lt;/title&gt;
    162162   &lt;para&gt;
    163163      &hellip;
    164164   &lt;/para&gt;
    165    &lt;sect1 id="<replaceable>example_chapter.sect1</replaceable>"&gt;
     165   &lt;sect1 id="example_chapter.sect1"&gt;
    166166      &lt;title&gt;Example of top level section &lt;/title&gt;
    167167      &lt;para&gt;
    168168         &hellip;
    169169      &lt;/para&gt;
    170       &lt;sect2 id="<replaceable>example_chapter.sect1.sect2</replaceable>"&gt;
     170      &lt;sect2 id="example_chapter.sect1.sect2"&gt;
    171171         &lt;title&gt;Example of second level section &lt;/title&gt;
    172172         &lt;para&gt;
    173173            &hellip;
    174174         &lt;/para&gt;
    175          &lt;sect3 id="<replaceable>example_chapter.sect1.sect2.sect3</replaceable>"&gt;
     175         &lt;sect3 id="example_chapter.sect1.sect2.sect3"&gt;
    176176            &lt;title&gt;Example of third level section&lt;/title&gt;
    177177            &lt;para&gt;
     
    207207              <example id="docbook.examples.include_chapter">
    208208                <title>Include a chapter</title>
    209 <programlisting>&lt;part id="userdoc"&gt;
     209<programlisting language="xml:nogutter:nocontrols">&lt;part id="userdoc"&gt;
    210210   &lt;title&gt;User documentation&lt;/title&gt;
    211211   &lt;include file= "about.xml"/&gt;
     
    219219   &lt;include file="protocols.xml"/&gt;
    220220   &lt;include file="hardware.xml"/&gt;
    221    <userinput>&lt;include file="example_chapter.xml"/&gt;</userinput>
     221   &lt;include file="example_chapter.xml"/&gt;
    222222   &lt;include file="software.xml"/&gt;
    223223   &lt;include file="array_lims.xml"/&gt;
     
    254254        as an attribute to the <sgmltag class="starttag">chapter</sgmltag> tag, for example:
    255255      </para>
    256       <programlisting>&lt;chapter id="resources" chunked="0"&gt;</programlisting>
     256      <programlisting language="xml">&lt;chapter id="resources" chunked="0"&gt;</programlisting>
    257257      <para>
    258258        This will stop the chunking of <sgmltag class="starttag">sect1</sgmltag>
     
    267267        section in a separate chunk:
    268268      </para>
    269       <programlisting>&lt;sect1 id="sect.with.large.sect2" chunked="1"&gt;</programlisting>
     269      <programlisting language="xml">&lt;sect1 id="sect.with.large.sect2" chunked="1"&gt;</programlisting>
    270270   
    271271    </sect3>
     
    418418      <example id="docbook.examples.helptexttag">
    419419        <title>How to use the help text tag</title>
    420 <programlisting>&lt;sect1&gt;
    421    &lt;helptext external_id="<replaceable>helptexts.external.id</replaceable>" title="<replaceable>The title</replaceable>"&gt;
    422       <replaceable>The text that also should be used as a helptext in the program.</replaceable>
     420<programlisting language="xml">&lt;sect1&gt;
     421   &lt;helptext external_id="helptexts.external.id" title="The title"&gt;
     422      The text that also should be used as a helptext in the program.
    423423      &lt;seeother&gt;
    424          &lt;other external_id="<replaceable>other.external.id</replaceable>"&gt;
    425             <replaceable>Related info here...</replaceable>&lt;/other&gt;
     424         &lt;other external_id="other.external.id"&gt;
     425            Related info here...&lt;/other&gt;
    426426      &lt;/seeother&gt;
    427427   &lt;/helptext&gt;
     
    440440          outputted to the help texts.
    441441        </para>     
    442         <programlisting>&lt;nohelp&gt;see &lt;xref linkend="chapter11" /&gt;&lt;/nohelp&gt;</programlisting>
     442        <programlisting language="xml">&lt;nohelp&gt;see &lt;xref linkend="chapter11" /&gt;&lt;/nohelp&gt;</programlisting>
    443443      </sect4>
    444444     
     
    467467        </variablelist>
    468468       
    469 <programlisting>&lt;seeother&gt;
     469<programlisting language="xml">&lt;seeother&gt;
    470470  &lt;other external_id="userpreferences.password"&gt;Change password&lt;/other&gt;
    471471  &lt;other external_id="userpreferences.other"&gt;Other information&lt;/other&gt;
     
    784784            Method with no arguments and a return value
    785785          </title>
    786 <programlisting>&hellip;
     786<programlisting language="xml">
    787787&lt;methodsynopsis language="java"&gt;
    788788   &lt;modifier&gt;public&lt;/modifier&gt;
     
    791791   &lt;void /&gt;
    792792&lt;/methodsynopsis&gt;
    793 &hellip;</programlisting>
     793</programlisting>
    794794        </example>
    795795        <example id="docbook.examples.methodimpl1">
     
    797797            Method with arguments and no return value
    798798          </title>
    799 <programlisting>&hellip;
     799<programlisting language="xml">
    800800&lt;methodsynopsis language="java"&gt;
    801801   &lt;modifier&gt;public&lt;/modifier&gt;
     
    815815   &lt;/methodparam&gt;
    816816&lt;/methodsynopsis&gt;
    817 &hellip;</programlisting>
     817</programlisting>
    818818        </example>
    819819       
     
    910910        <example id="docbook.examples.guielements">
    911911          <title>Describe a menu choice</title>
    912 <programlisting>&hellip;         
     912<programlisting language="xml">
    913913&lt;menuchoice&gt;
    914914   &lt;guimenu&gt;Administrate&lt;/guimenu&gt;
     
    916916   &lt;guimenuitem&gt;Types&lt;/guimenuitem&gt;
    917917&lt;/menuchoice&gt;
    918 &hellip;</programlisting>
     918</programlisting>
    919919          <para>
    920920            In the text it will look like this:
     
    943943          is implemented with the following code
    944944        </para>
    945 <programlisting>&lt;figure id="docbook.figures.menuchoice"&gt;
     945<programlisting language="xml">&lt;figure id="docbook.figures.menuchoice"&gt;
    946946  &lt;title&gt;The home page&lt;/title&gt;
    947947  &lt;screenshot&gt;
     
    10341034        </para>
    10351035      </warning>
    1036       <note>
    1037         <itemizedlist>
    1038           <listitem>
    1039             <simpara>
    1040               The verbatim text must begin on the same row as the start tag of a
    1041               verbatim element if you do not want an empty line at the top of the
    1042               text area.
    1043             </simpara>
    1044           </listitem>
    1045           <listitem>
    1046             <simpara>
    1047               The verbatim text is splitted into several lines if the text contains
    1048               more then 80 characters. This could give the text an unwanted look and
    1049               it's therefore recommended to manually insert new lines to have controll
    1050               over layout of the text
    1051             </simpara>
    1052           </listitem>
    1053         </itemizedlist>
    1054       </note>
     1036
     1037      <itemizedlist>
     1038        <listitem>
     1039          <simpara>
     1040            The verbatim text is splitted into several lines if the text contains
     1041            more then 80 characters. This could give the text an unwanted look and
     1042            it's therefore recommended to manually insert new lines to have controll
     1043            over layout of the text
     1044          </simpara>
     1045        </listitem>
     1046        <listitem>
     1047          <simpara>
     1048            We have added support for syntax highlightning of program
     1049            examples in the HTML version. To enable it add a
     1050            <sgmltag class="attribute">language</sgmltag>
     1051            attribute with one of the following values: <constant>java</constant>,
     1052            <constant>xml</constant> or <constant>sql</constant>. The highlightning engine
     1053            support more languages. To add support for those in docbook, change
     1054            the <filename>customized.chunked.xsl</filename> file. The syntax highlightning
     1055            engine doesn't handle markup inside the <sgmltag class="starttag">programlisting</sgmltag>
     1056            tag very well. You should avoid that. By default, java program examples
     1057            include line numbering, but not xml examples. To disable line numbering
     1058            for java add <constant>:nogutter</constant> to the <sgmltag>language</sgmltag>
     1059            attribute: <constant>&lt;programlisting language="java:nogutter"&gt;</constant>.
     1060            To enable line numbering for xml add <constant>:gutter</constant> to the <sgmltag>language</sgmltag>
     1061            attribute: <constant>&lt;programlisting language="xml:gutter"&gt;</constant>.
     1062          </simpara>
     1063        </listitem>
     1064      </itemizedlist>
     1065
    10551066      <example id="docbook.examples.example">
    10561067        <title>Example in the documentation</title>
     
    10601071          is written in the corresponding XML-file.
    10611072        </para>
    1062 <programlisting>&hellip;
     1073<programlisting language="xml">
    10631074&lt;example id="net.sf.basedb.core.plugin.Plugin.getAbout"&gt;
    10641075   &lt;title&gt;A typical implementation stores this information
    10651076      in a static field&lt;/title&gt;
    1066    &lt;programlisting&gt;private static final About about = new AboutImpl
     1077   &lt;programlisting language="java"&gt;
     1078private static final About about = new AboutImpl
    10671079(
    10681080   "Spot images creator",
     
    10791091{
    10801092   return about;
    1081 } &lt;/programlisting&gt;
     1093}
     1094&lt;/programlisting&gt;
    10821095&lt;/example&gt;
    1083 &hellip;</programlisting>
     1096</programlisting>
    10841097      </example>     
    10851098    </sect3>
     
    11941207      <example id="docbook.examples.variablelist">
    11951208        <title>Example how to write a variable list</title>
    1196 <programlisting>&hellip;
     1209<programlisting language="xml">
    11971210&lt;variablelist&gt;
    11981211   &lt;varlistentry&gt;
     
    12621275      <example id="docbook.examples.links">
    12631276        <title>Links</title>
    1264 <programlisting>&hellip;
     1277<programlisting language="xml">
    12651278&lt;xref linkend="docbook.usedtags.links" /&gt;
    12661279&lt;link linkend="docbook.usedtags.links"&gt;Link to this section&lt;/link&gt;
    12671280&lt;ulink url="http://base.thep.lu.se"&gt;Base2's homepage&lt;/ulink&gt;
    1268 &hellip;</programlisting>
     1281</programlisting>
    12691282        <para>
    12701283          The first element will autogenerate the linked section's/chapter's title as a
  • trunk/doc/src/docbook/developerdoc/plugin_developer.xml

    r3763 r3838  
    8181        <example id="plugin_developer.organize.build.file">
    8282          <title>A simple build file</title>
    83 <programlisting>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
     83<programlisting language="xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
    8484&lt;project
    8585   name="MyPlugin"
     
    190190        and be in the format described below.
    191191      </para>
    192       <programlisting>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
     192      <programlisting language="xml">
     193&lt;?xml version="1.0" encoding="UTF-8"?&gt;
    193194&lt;!DOCTYPE plugins SYSTEM "base-plugins.dtd" &gt;
    194 &lt;plugins jarname="<filename>jarfile.jar</filename>"&gt;
    195   &lt;pluginclass classname="<classname>se.lu.thep.PluginClass</classname>"&gt;
     195&lt;plugins jarname="jarfile.jar"&gt;
     196  &lt;pluginclass classname="se.lu.thep.PluginClass"&gt;
    196197    &lt;minbaseversion&gt;2.4&lt;/minbaseversion&gt;
    197198    &lt;hasconfigurations/&gt;
     
    200201    .
    201202    .
    202 &lt;/plugins&gt;</programlisting>
     203&lt;/plugins&gt;
     204</programlisting>
    203205      <para>
    204206        The first two lines should be the same in all base-plugins.xml, rest of the tags are
     
    361363              <example id="net.sf.basedb.core.plugin.Plugin.getAbout">
    362364                <title>A typical implementation stores this information in a static field</title>
    363 <programlisting>private static final About about = new AboutImpl
     365<programlisting language="java">
     366private static final About about = new AboutImpl
    364367(
    365368   "Spot images creator",
     
    435438              <example id="net.sf.basedb.core.plugin.Plugin.getMainType">
    436439                <title>A typical implementation just return one of the values</title>
    437 <programlisting>public Plugin.MainType getMainType()
     440<programlisting language="java">
     441public Plugin.MainType getMainType()
    438442{
    439443   return Plugin.MainType.OTHER;
     
    585589              <example id="net.sf.basedb.core.plugin.Plugin.init">
    586590                <title>The <classname>AbstractPlugin</classname> implementation of Plugin.init()</title>
    587 <programlisting>protected SessionControl sc = null;
     591<programlisting language="java">
     592protected SessionControl sc = null;
    588593protected ParameterValues configuration = null;
    589594protected ParameterValues job = null;
     
    673678                  method
    674679                </title>
    675 <programlisting>public void run(Request request, Response response, ProgressReporter progress)
     680<programlisting language="java">
     681public void run(Request request, Response response, ProgressReporter progress)
    676682{
    677683   // Open a connection to the database
     
    725731                  method to null
    726732                </title>
    727 <programlisting>/**
     733<programlisting language="java">
     734/**
    728735   Clears the variables set by the init method. If a subclass
    729736   overrides this method it is recommended that it also calls super.done().
     
    843850                  <methodname>getGuiContexts</methodname>
    844851                </title>
    845 <programlisting>// From the net.sf.basedb.plugins.RawDataFlatFileImporter plug-in
     852<programlisting language="java">
     853// From the net.sf.basedb.plugins.RawDataFlatFileImporter plug-in
    846854private static final Set&lt;GuiContext&gt; guiContexts =
    847855   Collections.singleton(new GuiContext(Item.RAWBIOASSAY, GuiContext.Type.ITEM));
     
    936944                  <methodname>isInContext</methodname>
    937945                </title>
    938 <programlisting>/**
     946<programlisting language="java">
     947/**
    939948   Returns null if the item is a {@link RawBioAssay} of the correct
    940949   {@link RawDataType} and doesn't already have spots.
     
    10461055                  from and if existing items should be updated or not
    10471056                </title>
    1048 <programlisting >// The complete request information
     1057<programlisting language="java">
     1058// The complete request information
    10491059private RequestInformation configure Job;
    10501060
     
    11221132              </para>
    11231133             
    1124 <programlisting>StringParameterType stringPT = new StringParameterType(255, null, true);
     1134<programlisting language="java">
     1135StringParameterType stringPT = new StringParameterType(255, null, true);
    11251136PluginParameter one = new PluginParameter("one", "One", "First string", stringPT);
    11261137PluginParameter two = new PluginParameter("two", "Two", "Second string", stringPT);
    1127 // ... and so on</programlisting>
     1138// ... and so on
     1139</programlisting>
    11281140              <para>
    11291141                The
     
    12321244                parameters page.
    12331245              </para>
    1234 <programlisting>PluginParameter firstSection = new PluginParameter(null, "First section", null, null);
     1246<programlisting language="java">
     1247PluginParameter firstSection = new PluginParameter(null, "First section", null, null);
    12351248PluginParameter secondSection = new PluginParameter(null, "Second section", null, null);
    12361249// ...
     
    12421255parameters.add(secondSection);
    12431256parameters.add(firstParameterInSecondSection);
    1244 parameters.add(secondParameteInSecondSection);</programlisting>
     1257parameters.add(secondParameteInSecondSection);
     1258</programlisting>
    12451259            </listitem>
    12461260          </varlistentry>
     
    13111325                  Configuration implementation building on the examples above
    13121326                </title>
    1313 <programlisting>public void configure(GuiContext context, Request request, Response response)
     1327<programlisting language="java">
     1328public void configure(GuiContext context, Request request, Response response)
    13141329{
    13151330   String command = request.getCommand();
     
    17731788              </parameter>
    17741789            </simpara>
    1775 <programlisting>// Plugin generate PluginParameter
     1790<programlisting language="java:nogutter">
     1791// Plug-in generate PluginParameter
    17761792StringParameterType stringPT = new StringParameterType(255, null, true);
    17771793PluginParameter one = new PluginParameter("one", "One", "First string", stringPT);
     
    17801796// JSP should name fields as:
    17811797First string: &lt;input type="text" name="parameter:one"&gt;&lt;br&gt;
    1782 Second string: &lt;input type="text" name="parameter:two"&gt;</programlisting>
     1798Second string: &lt;input type="text" name="parameter:two"&gt;
     1799</programlisting>
    17831800          </listitem>
    17841801          <listitem>
     
    17901807            parameters as shown below.
    17911808          </simpara>
    1792 <programlisting>&lt;form action="index.jsp" method="post"&gt;
     1809<programlisting language="xml">
     1810&lt;form action="index.jsp" method="post"&gt;
    17931811&lt;input type="hidden" name="ID" value="&lt;%=ID%&gt;"&gt;
    17941812&lt;input type="hidden" name="requestId" value="&lt;%=request.getParameter("requestId")%&gt;"&gt;
    17951813&lt;input type="hidden" name="cmd" value="SetParameters"&gt;
    17961814...
    1797 &lt;/form&gt;</programlisting>
     1815&lt;/form&gt;
     1816</programlisting>
    17981817          <simpara>
    17991818            The <varname>ID</varname> is the session ID for the logged
     
    18241843              object created by your plug-in.
    18251844            </para>
    1826 <programlisting>// Get session control and its ID (required to post to index.jsp)
     1845<programlisting language="java">
     1846// Get session control and its ID (required to post to index.jsp)
    18271847final SessionControl sc = Base.getExistingSessionControl(pageContext, true);
    18281848final String ID = sc.getId();
     
    18371857PluginDefinition job =
    18381858   (PluginDefinition)sc.getSessionSetting("plugin.configure.job");
    1839 RequestInformation ri = pcRequest.getRequestInformation();</programlisting>
     1859RequestInformation ri = pcRequest.getRequestInformation();
     1860</programlisting>
    18401861
    18411862    </sect2>
     
    18881909              by reading the headers from the input stream and checking if
    18891910              it stopped at an unknown type of line or not:
    1890                 <programlisting>
     1911                <programlisting language="java">
    18911912public final boolean isImportable(InputStream in)
    18921913   throws BaseException
     
    20782099        </para>
    20792100       
    2080         <programlisting>
     2101        <programlisting language="java">
    20812102// Parameter that maps the items name from a column
    20822103private PluginParameter&lt;String&gt; nameColumnMapping;
     
    21672188          has a fixed format and doesn't use configurations.
    21682189          </para>
    2169           <programlisting>
     2190          <programlisting language="java">
    21702191@Override
    21712192protected FlatFileParser getInitializedFlatFileParser()
     
    22122233          </para>
    22132234         
    2214           <programlisting>
     2235          <programlisting language="java">
    22152236/**
    22162237   Check that the file is a TAM or MwBr file.
     
    22522273          <methodname>super.begin()</methodname> is always called.
    22532274          </para>
    2254           <programlisting>
     2275          <programlisting language="java">
    22552276// Snippets from the RawDataFlatFileImporter class
    22562277private DbControl dc;
     
    23022323          nothing.
    23032324          </para>
    2304           <programlisting>
     2325          <programlisting language="java">
    23052326@Override
    23062327protected void handleHeader(Line line)
     
    23562377          </para>
    23572378         
    2358           <programlisting>
     2379          <programlisting language="java">
    23592380private Mapper reporterMapper;
    23602381private Mapper blockMapper;
     
    23742395   reporterMapper = getMapper(ffp, (String)configuration.getValue("reporterIdColumnMapping"),
    23752396      cropStrings ? ReporterData.MAX_EXTERNAL_ID_LENGTH : null, nullMapper);
    2376    blockMapper = getMapper(ffp, (String)configuration.getValue("blockColumnMapping"), null, nullMapper);
    2377    columnMapper = getMapper(ffp, (String)configuration.getValue("columnColumnMapping"), null, nullMapper);
    2378    rowMapper = getMapper(ffp, (String)configuration.getValue("rowColumnMapping"), null, nullMapper);
     2397   blockMapper = getMapper(ffp, (String)configuration.getValue("blockColumnMapping"),
     2398      null, nullMapper);
     2399   columnMapper = getMapper(ffp, (String)configuration.getValue("columnColumnMapping"),
     2400      null, nullMapper);
     2401   rowMapper = getMapper(ffp, (String)configuration.getValue("rowColumnMapping"),
     2402      null, nullMapper);
    23792403   // ... more mappers: metaGrid coordinate, X-Y coordinate, extended properties
    23802404   // ...
     
    24042428          </para>
    24052429
    2406           <programlisting>
     2430          <programlisting language="java">
    24072431// Snippets from the RawDataFlatFileImporter class
    24082432@Override
     
    24532477          </para>
    24542478         
    2455           <programlisting>
     2479          <programlisting language="java">
    24562480@Override
    24572481protected void end(boolean success)
     
    25012525          message will be generated.
    25022526          </para>
    2503           <programlisting>
     2527          <programlisting language="java">
    25042528@Override
    25052529protected String getSuccessMessage()
     
    27342758          Your plug-in should extend the <classname>AbstractExporterPlugin</classname>
    27352759          class:
    2736           <programlisting>
     2760          <programlisting language="java">
    27372761public class HelpExporter
    27382762  extends AbstractExporterPlugin
     
    27552779          required parameter.
    27562780         
    2757           <programlisting>
     2781          <programlisting language="java">
    27582782// Selected parts of the getRequestConfiguration() method
    27592783...
     
    27952819        method.
    27962820
    2797         <programlisting>
     2821        <programlisting language="java">
    27982822// Selected parts from the configure() method
    27992823if (request.getParameterValue(SAVE_AS) == null)
     
    28962920    </para>
    28972921   
    2898 <programlisting>
     2922<programlisting language="java">
    28992923private static final Set&lt;GuiContext&gt; guiContexts =
    29002924   Collections.singleton(new GuiContext(Item.BIOASSAYSET, GuiContext.Type.ITEM));
     
    29142938    </para>
    29152939 
    2916     <programlisting>
     2940    <programlisting language="java">
    29172941public boolean isInContext(GuiContext context, Object item)
    29182942{
     
    29482972    </para>
    29492973
    2950     <programlisting>
     2974    <programlisting language="java">
    29512975private static final RequestInformation configurePlugin;
    29522976private RequestInformation configureJob;
     
    29993023    </para>
    30003024 
    3001     <programlisting>
     3025    <programlisting language="java">
    30023026public void configure(GuiContext context, Request request, Response response)
    30033027{
     
    30433067    </para>
    30443068 
    3045     <programlisting>
     3069    <programlisting language="java">
    30463070public void run(Request request, Response response, ProgressReporter progress)
    30473071{
  • trunk/lib/docbook/custom-styles/docbook/plain/xsl/customized.chunked.xsl

    r3715 r3838  
    139139</xsl:template>
    140140
     141<xsl:template name="script">
     142  <xsl:param name="src"></xsl:param>
     143  <script>
     144    <xsl:attribute name="language">JavaScript</xsl:attribute>
     145    <xsl:attribute name="type">text/javascript</xsl:attribute>
     146    <xsl:attribute name="src"><xsl:value-of select="$src" /></xsl:attribute>
     147  </script>
     148</xsl:template>
     149
     150<xsl:template name="user.head.content">
     151  <xsl:variable name="pathtorootdir">
     152    <xsl:call-template name="pathtorootdir" />
     153  </xsl:variable>
     154  <link rel="stylesheet"
     155    type="text/css"
     156    href="{concat($pathtorootdir, 'css/SyntaxHighlighter.css')}">
     157  </link>
     158  <xsl:call-template name="script">
     159    <xsl:with-param name="src" select="concat($pathtorootdir, 'script/shCore.js')" />
     160  </xsl:call-template>
     161  <xsl:call-template name="script">
     162    <xsl:with-param name="src" select="concat($pathtorootdir, 'script/shBrushJava.js')" />
     163  </xsl:call-template>
     164  <xsl:call-template name="script">
     165    <xsl:with-param name="src" select="concat($pathtorootdir, 'script/shBrushXml.js')" />
     166  </xsl:call-template>
     167  <xsl:call-template name="script">
     168    <xsl:with-param name="src" select="concat($pathtorootdir, 'script/shBrushSql.js')" />
     169  </xsl:call-template>
     170</xsl:template>
     171
     172<xsl:template name="body.attributes">
     173  <xsl:attribute name="onLoad">dp.SyntaxHighlighter.HighlightAll('pre', 'programlisting', null, false);</xsl:attribute>
     174</xsl:template>
     175
    141176<xsl:template name="user.footer.navigation">
     177  <table width="100%">
     178  <tr valign="bottom"><td>
    142179  <div
    143180    class="navfooter"
     
    153190    </i></p>
    154191  </div>
     192  </td>
     193  <td>
     194    <div class="navfooter" align="right">
     195    <i>
     196    Syntax coloring provided by <a href="http://www.dreamprojections.com/syntaxhighlighter">dp.SyntaxHighlighter</a>
     197    </i>
     198    </div>
     199  </td>
     200  </tr>
     201  </table>
    155202</xsl:template>
    156203
  • trunk/lib/docbook/docbook/xsl/html/verbatim.xsl

    r3283 r3838  
    6161    <xsl:otherwise>
    6262      <pre>
     63        <xsl:if test="@language != ''">
     64      <xsl:attribute name="language"><xsl:value-of select="@language" /></xsl:attribute>
     65      </xsl:if>
    6366        <xsl:apply-templates select="." mode="class.attribute"/>
    6467  <xsl:call-template name="apply-highlighting"/>
Note: See TracChangeset for help on using the changeset viewer.