source: trunk/doc/src/docbook/developerdoc/documentation.xml @ 3715

Last change on this file since 3715 was 3715, checked in by Nicklas Nordborg, 14 years ago

References #746 and #554. Added new new UML file for MagicDraw? 12.5. Updated documentation about
how to use MagicDraw?. Transfered some of the old data layer documentation to docbook.

File size: 55.2 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE chapter PUBLIC
3    "-//Dawid Weiss//DTD DocBook V3.1-Based Extension for XML and graphics inclusion//EN"
4    "../../../../lib/docbook/preprocess/dweiss-docbook-extensions.dtd">
5<!--
6  $Id$
7 
8  Copyright (C) 2007 Jari Hakkinen, Peter Johansson, Nicklas Nordborg, Martin Svensson
9 
10  This file is part of BASE - BioArray Software Environment.
11  Available at http://base.thep.lu.se/
12 
13  BASE is free software; you can redistribute it and/or
14  modify it under the terms of the GNU General Public License
15  as published by the Free Software Foundation; either version 2
16  of the License, or (at your option) any later version.
17 
18  BASE is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  GNU General Public License for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with this program; if not, write to the Free Software
25  Foundation, Inc., 59 Temple Place - Suite 330,
26  Boston, MA  02111-1307, USA.
27-->
28
29<chapter id="documentation">
30  <?dbhtml dir="write_doc"?>
31  <title>Write documentation</title>
32
33  <sect1 id="documentation.docbook">
34    <title>User, administrator and developer documentation with Docbook</title>
35
36    <para>
37      This chapter is for those who intent to contribute to the BASE2 user documentation.
38      The chapter contains explanations of how the documentation is organized, what the
39      different parts is about and other things that will make it easier to know
40      where to insert new text.
41    </para>
42    <para>
43      The documentation is written with the docbook standard, which is a bunch of defined XML
44      elements and XSLT style sheets that are used to format the text. Later on in this chapter
45      is a reference, over those docbook elements that are recommended to use when writing BASE2
46      documentation. Further information about docbook can be found in the on-line version of
47      O'Reilly's
48      <ulink url="http://www.docbook.org/tdg/en/html/">DocBook: The Definitive Guide</ulink>
49      by Norman Walsh and Leonard Muellner.
50    </para>
51   
52
53  <sect2 id="docbook.layout">
54    <title>Documentation layout</title>
55    <para>
56      The book, which is the main element in this docbook documentation, is divided into four
57      separated parts, depending on who the information is directed to. What kind of
58      documentation each one of these parts contains or should contain is described here
59      below.
60    </para>
61    <variablelist>
62      <varlistentry>
63        <term>Overview documentation</term>
64        <listitem>
65          <para>
66            The overview part contains, like the name says, an overview of BASE2.
67            For example an explanation about what the purpose with BASE2 is, the terms
68            that are used in the program and other general things that anyone that is
69            interested in the program wants/needs to know before exploring it further.
70          </para>
71        </listitem>
72      </varlistentry>
73      <varlistentry>
74        <term>User documentation</term>
75        <listitem>
76          <para>
77            This part contains information that are relevant for the common BASE2-user.
78            More or less should everything that a power user role or an user role needs
79            to know be included here.
80          </para>
81        </listitem>
82      </varlistentry>
83      <varlistentry>
84        <term>Administrator documentation</term>
85        <listitem>
86          <para>
87            Things that only an administrator-role can do is documented in this part. It
88            can be how to install the program, how to configure the server for best
89            performance or other subjects that are related to the administration.
90          </para>
91        </listitem>
92      </varlistentry>
93      <varlistentry>
94        <term>Developer documentation</term>
95        <listitem>
96          <para>
97            Documentation concerning the participation of BASE2 development should be placed
98            in this part, e.g. coding standards, the java doc from the source code, how
99            to develop a plugin etc.
100          </para>
101        </listitem>
102      </varlistentry>
103    </variablelist>
104  </sect2>
105
106
107  <sect2 id="docbook.begin">
108    <title>Getting started</title>
109    <para>
110      Before writing any documentation in BASE2 there are a couple of things, some
111      rules and standards, to have in mind.
112    </para>
113    <sect3 id="docbook.begin.sourcefiles">
114      <title>Organization of source files</title>
115      <para>
116        The source files of the documentation are located in
117        <filename class='directory'>&lt;base-dir&gt;/doc/src/docbook</filename>.
118        The different parts of the documentation are organized into separate folders and
119        each one of the folders contains one index file and one file for each chapter in
120        that part. The index file joins the chapters, in current part/folder, together and
121        does not really contain any text. The documentation root directory also contains an
122        <filename class='headerfile'>index.xml</filename>
123        file which joins the index files from the different parts together.
124      </para>
125      <figure id="docbook.figures.fileorganization">
126        <title>The organization of documentation files</title>
127        <screenshot>
128          <mediaobject>
129            <imageobject>
130              <imagedata fileref="figures/fileorganization.png" format="PNG" />
131            </imageobject>
132          </mediaobject>
133        </screenshot>
134      </figure>
135      <sect4 id="docbook.begin.sourcefiles.newfile">
136        <title>Create new chapter/file</title>
137        <para>
138          Most files in the documentation, except the index files, represents a chapter.
139          Here is how to create a new chapter and include it in the main documentation:
140          <orderedlist numeration='arabic' spacing='compact'>
141            <listitem>
142              <para>
143                Create a new XML-file in the folder for the part where the new chapter
144                should be included. Give it a name that is quite similar to the
145                new chapter's title but use <userinput>_</userinput> instead of
146                blank space and keep it down to one or a few words.
147              </para>
148            </listitem>
149            <listitem>
150              <para>
151                Begin to write the chapter's body, here is an example:
152                <example id="docbook.examples.chapterbody">
153                  <title>Example of a chapter</title>
154<programlisting>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
155&lt;!DOCTYPE chapter PUBLIC
156  "-//Dawid Weiss//DTD DocBook V3.1-Based Extension for XML and graphics inclusion//EN"
157  "../../../../lib/docbook/preprocess/dweiss-docbook-extensions.dtd"&gt;
158
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;
161   &lt;title&gt;Example of a chapter &lt;/title&gt;
162   &lt;para&gt;
163      &hellip;
164   &lt;/para&gt;
165   &lt;sect1 id="<replaceable>example_chapter.sect1</replaceable>"&gt;
166      &lt;title&gt;Example of top level section &lt;/title&gt;
167      &lt;para&gt;
168         &hellip;
169      &lt;/para&gt;
170      &lt;sect2 id="<replaceable>example_chapter.sect1.sect2</replaceable>"&gt;
171         &lt;title&gt;Example of second level section &lt;/title&gt;
172         &lt;para&gt;
173            &hellip;
174         &lt;/para&gt;
175         &lt;sect3 id="<replaceable>example_chapter.sect1.sect2.sect3</replaceable>"&gt;
176            &lt;title&gt;Example of third level section&lt;/title&gt;
177            &lt;para&gt;
178               &hellip;
179            &lt;/para&gt;
180         &lt;/sect3&gt;
181      &lt;/sect2&gt;     
182   &lt;/sect1&gt;
183&lt;/chapter&gt;</programlisting>
184                </example>
185              </para>
186              <note>
187                <para>
188                  Do not forget to include the
189                  <sgmltag>dbhtml</sgmltag>
190                  tag with the attribute
191                  <sgmltag class="attribute">dir</sgmltag>
192                  set to the value that the chapter's output folder should have as a
193                  name.
194                </para>
195              </note>
196            </listitem>
197            <listitem>
198              <para>
199                The last step is to get the new chapter included in the documentation. This is done by including the file's name in
200                the file
201                <filename>index.xml</filename>
202                that's located in the current part's folder.
203                The following example
204                shows how the chapter that was created above is included in the user
205                documentation part.
206              </para>
207              <example id="docbook.examples.include_chapter">
208                <title>Include a chapter</title>
209<programlisting>&lt;part id="userdoc"&gt;
210   &lt;title&gt;User documentation&lt;/title&gt;
211   &lt;include file= "about.xml"/&gt;
212   &lt;include file="webclient.xml"/&gt;
213   &lt;include file="project_permission.xml"/&gt;
214   &lt;include file="trashcan.xml"/&gt;
215   &lt;include file="file_system.xml"/&gt;
216   &lt;include file="jobs.xml"/&gt;
217   &lt;include file="reporters.xml"/&gt;
218   &lt;include file="annotations.xml"/&gt;
219   &lt;include file="protocols.xml"/&gt;
220   &lt;include file="hardware.xml"/&gt;
221   <userinput>&lt;include file="example_chapter.xml"/&gt;</userinput>
222   &lt;include file="software.xml"/&gt;
223   &lt;include file="array_lims.xml"/&gt;
224   &lt;include file="biomaterials.xml"/&gt;
225   &lt;include file="experiments_analysis.xml"/&gt;
226   &lt;include file="import_export_data.xml"/&gt;
227&lt;/part&gt;</programlisting>
228                </example>
229              <note>
230                <title>Order of chapters</title>
231                <para>
232                  The chapters will come in the same order as they are included in
233                  the index file.
234                </para>
235              </note>
236            </listitem>     
237          </orderedlist>
238          Now it's only to go ahead with the documentation writing.
239        </para>
240      </sect4>
241    </sect3>
242   
243    <sect3 id="docbook.begin.chunking">
244      <title>Controlling chunking</title>
245      <para>
246        We have configured docbook to create a new subdirectory for each
247        <sgmltag class="starttag">chapter</sgmltag> and a new output file for each
248        <sgmltag class="starttag">sect1</sgmltag> tag. In most cases this
249        gives each page a relatively good size. Not too long and not too short.
250        However, if a chapter contains many small <sgmltag class="starttag">sect1</sgmltag>
251        sections (for example, <xref linkend="resources"/>), you end up with many
252        pages with just a few lines of text on each page. This is not so
253        good and can be avoided by adding <sgmltag class="attribute">chunked="0"</sgmltag>
254        as an attribute to the <sgmltag class="starttag">chapter</sgmltag> tag, for example:
255      </para>
256      <programlisting>&lt;chapter id="resources" chunked="0"&gt;</programlisting>
257      <para>
258        This will stop the chunking of <sgmltag class="starttag">sect1</sgmltag>
259        sections in this chapter.
260      </para>
261     
262      <para>
263        On the other
264        hand, if you have a <sgmltag class="starttag">sect1</sgmltag>
265        that contains many long <sgmltag class="starttag">sect2</sgmltag>
266        sections you might want to put each <sgmltag class="starttag">sect2</sgmltag>
267        section in a separate chunk:
268      </para>
269      <programlisting>&lt;sect1 id="sect.with.large.sect2" chunked="1"&gt;</programlisting>
270   
271    </sect3>
272   
273    <sect3 id="docbook.begin.id">
274      <title>
275        The
276        <sgmltag class="attribute">id</sgmltag>
277        attribute
278      </title>
279      <para>
280        Common to all elements is that they have an <sgmltag class="attribute">id</sgmltag>
281        attribute that can be used to identify the
282        element with. The value must be unique for the entire documentation.
283        Most of the elements that are used inside the BASE2 documentation do not
284        need to have an id if they do not are used in any cross references from other part of
285        the text.
286      </para>
287      <para>
288        There are some elements that always should have the
289        <sgmltag class="attribute">id</sgmltag>
290        set. Which these elements are and how the
291        <sgmltag class="attribute">id</sgmltag>
292        should look like for each one of those is described below. All values should be as
293        short as possible and associated to the current element. The
294        <sgmltag class="attribute">id</sgmltag>
295        value should only consist of the lowercase characters a-z, '_' instead of blank
296        spaces and '.' to symbolize the different levels in the document.
297        <variablelist>
298          <varlistentry>
299            <term>chapter</term>
300            <listitem>
301              <para>
302                The chapter should have an
303                <sgmltag class="attribute">id</sgmltag>
304                that is identical or almost identical to the chapter's title.
305                <synopsis>chapter_title</synopsis>
306              </para>
307            </listitem>
308          </varlistentry>
309          <varlistentry>
310            <term>sect1-sect5</term>
311            <listitem>
312              <para>
313                The creation of a section's id is done by using the upper level's id
314                and add the section's title or a part of the title. For
315                &lt;sect2&gt; it should be like this;
316                <synopsis>chapter_title.sect1_title.sect2_title</synopsis>
317              </para>
318            </listitem>
319          </varlistentry>
320          <varlistentry>
321            <term>examples</term>
322            <listitem>
323              <para>
324                The naming of an example's
325                <sgmltag class="attribute">id</sgmltag>
326                is a bit different compare to the chapter's and section's id. It
327                should begin with the chapter's id followed by
328                <userinput>examples</userinput>
329                and the caption of the example.
330                <synopsis>chapter_title.examples.example_caption</synopsis>
331              </para>
332            </listitem>
333          </varlistentry>
334          <varlistentry>
335            <term>figures</term>
336            <listitem>
337              <para>
338                The figure's
339                <sgmltag class="attribute">id</sgmltag>
340                should have the following layout
341                <synopsis>chapter_title.figures.figure_name</synopsis>
342              </para>
343            </listitem>
344          </varlistentry>
345        </variablelist>
346      </para>
347    </sect3>
348    <sect3 id="docbook.begin.helptext">
349      <title>Mark help texts</title>
350      <para>
351        This documentation is also use to create the help texts that show up
352        in the web client when clicking on the question mark icons.
353        The parts of the text that also should be used as help texts in the web must be
354        inside
355        <sgmltag class="starttag">helptext</sgmltag>
356        tags. These texts will be exported to a XML-file at the same time as the
357        HTML-documentation is generated. The generated XML-file is compatible with the help
358        text importer in BASE2 and will be imported when running the update script or
359        installation script.
360      </para>
361      <note>
362      <para>
363        The
364        <sgmltag class="starttag">helptext</sgmltag>
365        must be outside the
366        <sgmltag class="starttag">para</sgmltag>
367        tag but inside a
368        <sgmltag class="starttag">sect</sgmltag> 
369        tag to work properly. Do not put any <sgmltag class="starttag">sect</sgmltag>
370        tags inside the helptext. This will make the automatic chapter and section
371        numbering confused.
372      </para>
373      </note>
374      <para>
375        The tag supports the following attributes
376        <variablelist>
377          <varlistentry>
378            <term>
379              <sgmltag class="attribute">external_id</sgmltag>
380            </term>
381            <listitem>
382              <para>
383                Is used to identify and to find a help text in the web client.
384                BASE2's web client already has several IDs to help texts defined,
385                it could therefore be a good idea to have a look in the
386                program to see if there already is an external id to use for the
387                particular help text.
388              </para>
389            </listitem>
390          </varlistentry>
391          <varlistentry>
392            <term>
393              <sgmltag class="attribute">title</sgmltag>
394            </term>
395            <listitem>
396              <para>
397                Is directly connected to the name/title property for a help text
398                item in BASE2.
399              </para>
400            </listitem>
401          </varlistentry>
402          <varlistentry>
403            <term>
404              <sgmltag class="attribute">webonly</sgmltag>
405            </term>
406            <listitem>
407              <para>
408                If set to a non-zero value, the contents of the tag
409                will not be outputted in the HTML or PDF documentation.
410                This is useful for minor functionality that is not
411                important enough to be mentioned in the documentation but has
412                a help icon in the web client.
413              </para>
414            </listitem>
415          </varlistentry>
416        </variablelist>
417      </para>
418      <example id="docbook.examples.helptexttag">
419        <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>
423      &lt;seeother&gt;
424         &lt;other external_id="<replaceable>other.external.id</replaceable>"&gt;
425            <replaceable>Related info here...</replaceable>&lt;/other&gt;
426      &lt;/seeother&gt;
427   &lt;/helptext&gt;
428&lt;/sect1&gt;</programlisting>
429      </example>
430     
431      <sect4 id="docbook.begin.helptext.nohelp">
432        <title>Skip parts of a help text</title>
433        <para>
434          From time to time, it may happen that you find that
435          some parts of the text inside a <sgmltag class="starttag">helptext</sgmltag>
436          tag does not make sense. It may, for example, be a reference to
437          an image or an example, or a link to another chapter or
438          section. Put a <sgmltag class="starttag">nohelp</sgmltag>
439          tag around the problematic part to avoid it from beeing
440          outputted to the help texts.
441        </para>     
442        <programlisting>&lt;nohelp&gt;see &lt;xref linkend="chapter11" /&gt;&lt;/nohelp&gt;</programlisting>
443      </sect4>
444     
445      <sect4 id="docbook.begin.helptext.link">
446      <title>Link to other help texts</title>
447     
448      <para>
449        You can use <sgmltag class="starttag">seeother</sgmltag> and
450        <sgmltag class="starttag">other</sgmltag>
451        to create links between different help texts. The
452        <sgmltag  class="starttag">seeother</sgmltag>
453        tag does not have any attributes and is just a container for one or more
454        <sgmltag  class="starttag">other</sgmltag> tags. Each tag requires a single attribute.
455      </para>
456        <variablelist>
457          <varlistentry>
458            <term>
459              <sgmltag class="attribute">external_id</sgmltag>
460            </term>
461            <listitem>
462              <para>
463                The external ID of the other help text to link to.
464              </para>
465            </listitem>
466          </varlistentry>
467        </variablelist>
468       
469<programlisting>&lt;seeother&gt;
470  &lt;other external_id="userpreferences.password"&gt;Change password&lt;/other&gt;
471  &lt;other external_id="userpreferences.other"&gt;Other information&lt;/other&gt;
472&lt;/seeother&gt;</programlisting>
473       
474        <para>
475          We recommend that you place the links at the end of the
476          help text section. The links will not show up in the HTML or PDF version.
477        </para>
478      </sect4>
479     
480      <sect4 id="docbook.begin.helptext.import">
481      <title>Import help texts into BASE</title>
482
483      <para>
484        Import the generated XML-file manually by uploading it from the
485        <filename class="directory">data</filename>
486        directory to the BASE-server's file system and then use the help text importer
487        plugin to import the help text items from that file.
488      </para>
489     
490      <para>
491        The help texts can also be imported by running the TestHelp
492        test program. In short, here are the commands you need to
493        import the help texts:
494      </para>
495     
496<programlisting>ant docbook
497ant test
498cd build/test
499./run.sh TestHelp</programlisting>
500      </sect4>
501     
502    </sect3>
503    <sect3 id="docbook.begin.generate">
504      <title>Generate output</title>
505
506      <sect4 id="docbook.begin.generate.requirements">
507        <title>Requirements</title>
508        <para>
509          Those who have checked out the documentation source from repository or got the
510          source from a distribution package needs to compile it to get the PDF and HTML
511          documentation files. The compilation of the documentation source requires, beside Ant, that the XML-parser
512          Xsltproc is installed on the local computer. More information about
513          XsltProc and how it is installed, can be found at
514          <ulink url="http://xmlsoft.org/XSLT/index.html"></ulink>.
515        </para>
516        <note>
517          <para>
518            There is an xml-parser in newer java-versions that can be used instead of
519            XsltProc but the compilation will most likely take much much longer time.
520            Therefore it's not recommended to be used when generating/compiling the
521            documentation in BASE 2.
522          </para>
523        </note>
524      </sect4>
525      <sect4 id="docbook.begin.generate.compile">
526        <title>Compile - generate output files</title>
527        <para>
528          There are two different types of format that is generated from the documentation
529          source. The format to view the documentation on-line will be the one with
530          chunked HTML pages where each chapter and section of first level are on separate
531          pages/files. The other format is a PDF-file that are most useful for printing
532          and distribution. Those two types of output are generated with the ant-target:
533          <command>ant docbook</command>. This documentation is also generated with
534          <command>ant dist</command>, which will put the output files in the right location for distribution with
535          BASE 2.
536        </para>
537      </sect4>
538    </sect3>
539  </sect2>
540
541  <sect2 id="docbook.usedtags">
542    <title>Docbook tags to use</title>
543    <para>
544      The purpose with this section is to give an overview of those docbook elements that are
545      most common in this documentation and to give some example on how they should be used.
546      There will not be any detailed explanation of the tags here, instead the reader is
547      recommended to get more information from
548      <ulink url="http://www.docbook.org/tdg/en/html/docbook.html">
549        Docbook's documentation
550      </ulink>
551      or other references.
552    </para>
553    <sect3 id="docbook.usedtags.text">
554      <title>Text elements</title>
555      <para>
556       
557      </para>
558      <informaltable frame="none">
559        <tgroup cols="3" rowsep="1" colsep="1">
560          <colspec align="left" />
561          <colspec align="center" />
562          <colspec align="left" />
563          <thead>
564            <row>
565              <entry>Define</entry>
566              <entry>Element to use</entry>
567              <entry>Comments</entry>
568            </row>
569          </thead>
570          <tbody>
571            <row>
572              <entry>Chapter</entry>
573              <entry>
574                <sgmltag class="starttag">chapter</sgmltag>
575              </entry>
576              <entry>
577                <para>
578                  See
579                  <xref linkend="docbook.examples.chapterbody" />
580                </para>
581              </entry>
582            </row>
583            <row>
584              <entry>Title</entry>
585              <entry>
586                <sgmltag class="starttag">title</sgmltag>
587              </entry>
588              <entry>
589                <xref linkend="docbook.examples.chapterbody" />
590                shows how this can be implemented
591              </entry>
592            </row>
593            <row>
594              <entry>Paragraph</entry>
595              <entry>
596                <sgmltag class="starttag">para</sgmltag>
597              </entry>
598              <entry>Used almost everywhere around real text.</entry>
599            </row>
600            <row>
601              <entry>Top-level subsection</entry>
602              <entry>
603                <sgmltag class="starttag">sect1</sgmltag>
604              </entry>
605              <entry>
606                See
607                <xref linkend="docbook.begin.id" />
608              </entry>
609            </row>
610            <row>
611              <entry>Second level section</entry>
612              <entry>
613                <sgmltag class="starttag">sect2</sgmltag>
614              </entry>
615              <entry>
616                See
617                <xref linkend="docbook.begin.id" />
618              </entry>
619            </row>
620            <row>
621              <entry>Third level section</entry>
622              <entry>
623                <sgmltag class="starttag">sect3</sgmltag>
624              </entry>
625              <entry>
626                See
627                <xref linkend="docbook.begin.id" />
628              </entry>
629            </row>
630            <row>
631              <entry>Fourth level section</entry>
632              <entry>
633                <sgmltag class="starttag">sect4</sgmltag>
634              </entry>
635              <entry></entry>
636            </row>
637            <row>
638              <entry>Fith level section</entry>
639              <entry>
640                <sgmltag class="starttag">sect5</sgmltag>
641              </entry>
642              <entry></entry>
643            </row>
644          </tbody>
645        </tgroup>
646      </informaltable>
647
648      <sect4 id="docbook.usedtags.text.keywords">
649        <title>Code elements</title>
650        <para>
651          These elements should be used to mark up words and phrases that have a special
652          meaning in a coding environment, like method names, class names and
653          user inputs, etc.
654        </para>
655        <informaltable frame="none">
656          <tgroup cols="3" rowsep="1" colsep="1">
657            <colspec align="left" />
658            <colspec align="center" />
659            <colspec align="left" />
660            <thead>
661              <row>
662                <entry>Define</entry>
663                <entry>Element to use</entry>
664                <entry>Comment</entry>
665              </row>
666            </thead>
667            <tbody>
668              <row>
669                <entry>Class name</entry>
670                <entry>
671                  <sgmltag class="starttag">classname</sgmltag>
672                </entry>
673                <entry>The name of a (Java) class.</entry>
674              </row>
675              <row>
676                <entry>User input</entry>
677                <entry>
678                  <sgmltag class="starttag">userinput</sgmltag>
679                </entry>
680                <entry>Text that is entered by a user.</entry>
681              </row>
682              <row>
683                <entry>Variable name</entry>
684                <entry>
685                  <sgmltag class="starttag">varname</sgmltag>
686                </entry>
687                <entry>The name of a variable in a program.</entry>
688              </row>
689              <row>
690                <entry>Constant</entry>
691                <entry>
692                  <sgmltag class="starttag">constant</sgmltag>
693                </entry>
694                <entry>The name of a variable in a program.</entry>
695              </row>
696              <row>
697                <entry>Method definition</entry>
698                <entry>
699                  <sgmltag class="starttag">methodsynopsis</sgmltag>
700                </entry>
701                <entry>
702                  See
703                  <xref linkend="docbook.examples.methodimpl" />
704                </entry>
705              </row>
706              <row>
707                <entry>Modifier of a method</entry>
708                <entry>
709                  <sgmltag class="starttag">modifier</sgmltag>
710                </entry>
711                <entry>
712                  See
713                  <xref linkend="docbook.examples.methodimpl" />
714                </entry>
715              </row>
716              <row>
717                <entry>Classification of return value</entry>
718                <entry>
719                  <sgmltag class="starttag">type</sgmltag>
720                </entry>
721                <entry>
722                  See
723                  <xref linkend="docbook.examples.methodimpl" />
724                </entry>
725              </row>
726              <row>
727                <entry>Method name</entry>
728                <entry>
729                  <sgmltag class="starttag">methodname</sgmltag>
730                </entry>
731                <entry>
732                  See
733                  <xref linkend="docbook.examples.methodimpl" />
734                </entry>
735              </row>
736              <row>
737                <entry>No parameter/type</entry>
738                <entry>
739                  <sgmltag class="starttag">void</sgmltag>
740                </entry>
741                <entry>
742                  See
743                  <xref linkend="docbook.examples.methodimpl" />
744                </entry>
745              </row>
746              <row>
747                <entry>Define a parameter</entry>
748                <entry>
749                  <sgmltag class="starttag">methodparam</sgmltag>
750                </entry>
751                <entry>
752                  See
753                  <xref linkend="docbook.examples.methodimpl1" />
754                </entry>
755              </row>
756              <row>
757                <entry>Parameter type</entry>
758                <entry>
759                  <sgmltag class="starttag">type</sgmltag>
760                </entry>
761                <entry>
762                  See
763                  <xref linkend="docbook.examples.methodimpl1" />
764                </entry>
765              </row>
766              <row>
767                <entry>Parameter name</entry>
768                <entry>
769                  <sgmltag class="starttag">parameter</sgmltag>
770                </entry>
771                <entry>
772                  See
773                  <xref linkend="docbook.examples.methodimpl1" />
774                </entry>
775              </row>
776            </tbody>
777          </tgroup>
778        </informaltable>
779        <para>
780          Follow one of the examples below to insert a method definition in the document.
781        </para>
782        <example id="docbook.examples.methodimpl">
783          <title>
784            Method with no arguments and a return value
785          </title>
786<programlisting>&hellip;
787&lt;methodsynopsis language="java"&gt;
788   &lt;modifier&gt;public&lt;/modifier&gt;
789   &lt;type&gt;Plugin.MainType&lt;/type&gt;
790   &lt;methodname&gt;getMainType&lt;/methodname&gt;
791   &lt;void /&gt;
792&lt;/methodsynopsis&gt;
793&hellip;</programlisting>
794        </example>
795        <example id="docbook.examples.methodimpl1">
796          <title>
797            Method with arguments and no return value
798          </title>
799<programlisting>&hellip;
800&lt;methodsynopsis language="java"&gt;
801   &lt;modifier&gt;public&lt;/modifier&gt;
802   &lt;void /&gt;
803   &lt;methodname&gt;init&lt;/methodname&gt;
804   &lt;methodparam&gt;
805      &lt;type&gt;SessionControl&lt;/type&gt;
806      &lt;parameter&gt;sc&lt;/parameter&gt;
807   &lt;/methodparam&gt;
808   &lt;methodparam&gt;
809      &lt;type&gt;ParameterValues&lt;/type&gt;
810      &lt;parameter&gt;configuration&lt;/parameter&gt;
811   &lt;/methodparam&gt;
812   &lt;methodparam&gt;
813      &lt;type&gt;ParameterValues&lt;/type&gt;
814      &lt;parameter&gt;job&lt;/parameter&gt;
815   &lt;/methodparam&gt;
816&lt;/methodsynopsis&gt;
817&hellip;</programlisting>
818        </example>
819       
820      </sect4>
821      <sect4 id="docbook.usedtags.text.gui">
822        <title>Gui elements</title>
823        <para>
824          Docbook has some elements that can be used to symbolize gui items in a program.
825          Following list contains the ones that are most common in this document.
826        </para>
827        <informaltable frame="none">
828          <tgroup cols="3" rowsep="1" colsep="1">
829            <colspec align="left" />
830            <colspec align="center" />
831            <colspec align="left" />
832            <thead>
833              <row>
834                <entry>Define</entry>
835                <entry>Element to use</entry>
836                <entry>Comment</entry>
837              </row>
838            </thead>
839            <tbody>
840              <row>
841                <entry>Button</entry>
842                <entry>
843                  <sgmltag class="starttag">guibutton</sgmltag>
844                </entry>
845                <entry></entry>
846              </row>
847              <row>
848                <entry>Label</entry>
849                <entry>
850                  <sgmltag class="starttag">guilabel</sgmltag>
851                </entry>
852                <entry></entry>
853              </row>
854              <row>
855                <entry>Menu choice</entry>
856                <entry>
857                  <sgmltag class="starttag">menuchoice</sgmltag>
858                </entry>
859                <entry></entry>
860              </row>
861              <row>
862                <entry>Menu</entry>
863                <entry>
864                  <sgmltag class="starttag">guimenu</sgmltag>
865                </entry>
866                <entry></entry>
867              </row>
868              <row>
869                <entry>Submenu</entry>
870                <entry>
871                  <sgmltag class="starttag">guisubmenu</sgmltag>
872                </entry>
873                <entry></entry>
874              </row>
875              <row>
876                <entry>Menu item</entry>
877                <entry>
878                  <sgmltag class="starttag">guimenuitem</sgmltag>
879                </entry>
880                <entry></entry>
881              </row>
882              <row>
883                <entry>Icon</entry>
884                <entry>
885                  <sgmltag class="starttag">guiicon</sgmltag>
886                </entry>
887                <entry></entry>
888              </row>
889            </tbody>
890          </tgroup>
891        </informaltable>
892        <para>
893          <xref linkend="docbook.examples.guielements" />
894          shows how the menu choice in figure
895          <xref linkend="docbook.figures.menuchoice" />
896          can be described.
897        </para>
898        <figure id="docbook.figures.menuchoice">
899          <title>Menu choice</title>
900          <screenshot>
901            <mediaobject>
902              <imageobject>
903                <imagedata 
904                  fileref="figures/menuchoice.png" format="PNG" 
905                />
906              </imageobject>
907            </mediaobject>
908          </screenshot>
909        </figure>
910        <example id="docbook.examples.guielements">
911          <title>Describe a menu choice</title>
912<programlisting>&hellip;         
913&lt;menuchoice&gt;
914   &lt;guimenu&gt;Administrate&lt;/guimenu&gt;
915   &lt;guisubmenu&gt;Plugins&lt;/guisubmenu&gt;
916   &lt;guimenuitem&gt;Types&lt;/guimenuitem&gt;
917&lt;/menuchoice&gt;
918&hellip;</programlisting>
919          <para>
920            In the text it will look like this:
921            <menuchoice>
922              <guimenu>Administrate</guimenu>
923              <guisubmenu>Plugins</guisubmenu>
924              <guimenuitem>Types</guimenuitem>
925            </menuchoice>
926          </para>
927        </example>
928      </sect4>
929    </sect3>
930    <sect3 id="docbook.usedtags.images">
931      <title>Images and figures</title>
932      <para>
933        Images and figures are normally implemented like the following example. The
934        image-file must be located in
935        <filename class="directory">doc/src/docbook/figures</filename>,
936        otherwise the image will not be visible in the generated output files.
937      </para>
938
939      <example id="docbook.examples.screenshot">
940        <title>Screen-shot in the documentation</title>
941        <para>
942          <xref linkend="webclient.figures.homepage" />
943          is implemented with the following code
944        </para>
945<programlisting>&lt;figure id="docbook.figures.menuchoice"&gt;
946  &lt;title&gt;The home page&lt;/title&gt;
947  &lt;screenshot&gt;
948    &lt;mediaobject&gt;
949      &lt;imageobject&gt;
950        &lt;imagedata
951          scalefit="1"
952          width="100%"
953          fileref="figures/homapage.png" format="PNG"
954        /&gt;
955      &lt;/imageobject&gt;
956    &lt;/mediaobject&gt;
957  &lt;/screenshot&gt;
958&lt;/figure&gt;</programlisting>
959      </example>
960      <warning>
961        <para>
962          When using images in docbook you will always have problems with image
963          resolution and scaling. Since we are generating output for both HTML
964          and PDF it is even worse. What we have found to work is this:
965         
966          <itemizedlist>
967          <listitem>
968            <para>
969            The screenshots must be saved without any resolution information
970            in them, or with the resolution set to 96 dpi. We have configured PDF to
971            use 96 dpi instead of 72 dpi to make the HTML and PDF output
972            look as similar as possible.
973            </para>
974          </listitem>
975         
976          <listitem>
977            <para>
978            Scaling in HTML has been disabled. The images will always be the
979            same size (number of pixels) as they actually are. Please, do not
980            make the screenshots too wide!
981           
982            <tip>
983              <para>
984              Change your BASE <link linkend="webclient.configuration.preferences"
985                >preferences</link> to a smaller font size or use
986              the zoom functionality in the web browser to make more information
987              fit in the same image width.
988              </para>
989            </tip>
990           
991            </para>
992          </listitem>
993         
994          <listitem>
995            <para>
996            For small images, less than the width of the PDF page,
997            do not specify scaling factors or widths.
998            </para>
999          </listitem>
1000         
1001          <listitem>
1002            <para>
1003            Images that are wider than the PDF page will be clipped. To
1004            prevent this you must add the following attributes to the
1005            <sgmltag class="starttag">imagedata</sgmltag> tag:
1006            <code>scalefit="1" width="100%"</code>. This will scale down
1007            the image so that it fits the available width.
1008            </para>
1009          </listitem>
1010         
1011          <listitem>
1012            <para>
1013            If you still need to scale the image differently in the PDF use
1014            the <sgmltag>width</sgmltag> and <sgmltag>depth</sgmltag>
1015            attributes.
1016            </para>
1017          </listitem>
1018          </itemizedlist>
1019        </para>
1020      </warning>
1021    </sect3>
1022    <sect3 id="docbook.usedtags.examples">
1023      <title>Examples and program listing</title>
1024      <para>
1025        Following describes how to insert an example in the documentation.The examples in
1026        this document are often some kind of program listing but they can still be examples
1027        of something else.
1028      </para>
1029      <warning>
1030        <title>Use spaces instead of tabs for indentation</title>
1031        <para>
1032          Use spaces for indentation in program listing, this is because of the
1033          tab-indentations will sooner or later cause corrupt text.
1034        </para>
1035      </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>
1055      <example id="docbook.examples.example">
1056        <title>Example in the documentation</title>
1057        <para>
1058          This shows how 
1059          <xref linkend="net.sf.basedb.core.plugin.Plugin.getAbout" />
1060          is written in the corresponding XML-file.
1061        </para>
1062<programlisting>&hellip;
1063&lt;example id="net.sf.basedb.core.plugin.Plugin.getAbout"&gt;
1064   &lt;title&gt;A typical implementation stores this information
1065      in a static field&lt;/title&gt;
1066   &lt;programlisting&gt;private static final About about = new AboutImpl
1067(
1068   "Spot images creator",
1069   "Converts a full-size scanned image into smaller preview jpg " +
1070   "images for each individual spot.",
1071   "2.0",
1072   "2006, Department of Theoretical Physics, Lund University",
1073   null,
1074   "base@thep.lu.se",
1075   "http://base.thep.lu.se"
1076);
1077 
1078public About getAbout()
1079{
1080   return about;
1081} &lt;/programlisting&gt;
1082&lt;/example&gt;
1083&hellip;</programlisting>
1084      </example>     
1085    </sect3>
1086    <sect3 id="docbook.usedtags.admonitions">
1087      <title>Admonitions</title>
1088      <para>
1089        The admonitions that are used in this document can be found in the table below.
1090      </para>
1091      <informaltable frame="none">
1092        <tgroup cols="3" rowsep="1" colsep="1">
1093          <colspec align="left" />
1094          <colspec align="center" />
1095          <colspec align="left" />
1096          <thead>
1097            <row>
1098              <entry>Define</entry>
1099              <entry>Element to use</entry>
1100              <entry>Comment</entry>
1101            </row>
1102          </thead>
1103          <tbody>
1104            <row>
1105              <entry>Warning text</entry>
1106              <entry>
1107                <sgmltag class="starttag">warning</sgmltag>
1108              </entry>
1109              <entry></entry>
1110            </row>
1111            <row>
1112              <entry>Notification text</entry>
1113              <entry>
1114                <sgmltag class="starttag">note</sgmltag>
1115              </entry>
1116              <entry></entry>
1117            </row>
1118            <row>
1119              <entry>A tip</entry>
1120              <entry>
1121                <sgmltag class="starttag">tip</sgmltag>
1122              </entry>
1123              <entry></entry>
1124            </row>
1125            <row>
1126              <entry>Important text</entry>
1127              <entry>
1128                <sgmltag class="starttag">important</sgmltag>
1129              </entry>
1130              <entry></entry>
1131            </row>
1132            <row>
1133              <entry>Something to be cautious about</entry>
1134              <entry>
1135                <sgmltag class="starttag">caution</sgmltag>
1136              </entry>
1137              <entry></entry>
1138            </row>
1139          </tbody>
1140        </tgroup>
1141      </informaltable>
1142    </sect3>
1143    <sect3 id="docbook.usedtags.lists">
1144      <title>Lists</title>
1145      <para>
1146        Following items can be used to define different kind of lists in the documentation.
1147        Some common elements for the lists are also described here.
1148      </para>
1149      <informaltable frame="none">
1150        <tgroup cols="3" rowsep="1" colsep="1">
1151          <colspec align="left" />
1152          <colspec align="center" />
1153          <colspec align="left" />
1154          <thead>
1155            <row>
1156              <entry>Define</entry>
1157              <entry>Element</entry>
1158              <entry>Comment</entry>
1159            </row>
1160          </thead>
1161          <tbody>           
1162            <row>
1163              <entry>None-ordered list</entry>
1164              <entry>
1165                <sgmltag class="starttag">itemizedlist</sgmltag>
1166              </entry>
1167              <entry></entry>
1168            </row>
1169            <row>
1170              <entry>Term definition list</entry>
1171              <entry>
1172                <sgmltag class="starttag">variablelist</sgmltag>
1173              </entry>
1174              <entry></entry>
1175            </row>
1176            <row>
1177              <entry>Ordered list</entry>
1178              <entry>
1179                <sgmltag class="starttag">orderedlist</sgmltag>
1180              </entry>
1181              <entry></entry>
1182            </row>
1183            <row>
1184              <entry>List item</entry>
1185              <entry>
1186                <sgmltag class="starttag">listitem</sgmltag>
1187              </entry>
1188              <entry></entry>
1189            </row>
1190          </tbody>
1191        </tgroup>
1192      </informaltable>
1193      <para>The example below shows how to create a list for term definition in the text.</para>
1194      <example id="docbook.examples.variablelist">
1195        <title>Example how to write a variable list</title>
1196<programlisting>&hellip;
1197&lt;variablelist&gt;
1198   &lt;varlistentry&gt;
1199      &lt;term&gt;Term1&lt;/term&gt;
1200      &lt;listitem&gt;
1201         &lt;para&gt;
1202            Definition/explanation of the term
1203         &lt;/para&gt;
1204      &lt;/listitem&gt;
1205   &lt;/varlistentry&gt;
1206   
1207   &lt;varlistentry&gt;
1208      &lt;term&gt;Term2&lt;/term&gt;
1209      &lt;listitem&gt;
1210         &lt;para&gt;
1211            Definition/explanation of the term
1212         &lt;/para&gt;
1213      &lt;/listitem&gt;
1214   &lt;/varlistentry&gt;
1215&lt;/variablelist&gt;</programlisting>
1216      </example>
1217    </sect3>
1218   
1219    <sect3 id="docbook.usedtags.links">
1220      <title>Link elements</title>
1221      <para></para>
1222      <informaltable frame="none">
1223        <tgroup cols="3" rowsep="1" colsep="1">
1224          <colspec align="left" />
1225          <colspec align="center" />
1226          <colspec align="left" />
1227          <thead>
1228            <row>
1229              <entry>Define</entry>
1230              <entry>Element</entry>
1231              <entry>Comment</entry>
1232            </row>
1233          </thead>
1234          <tbody>
1235            <row>
1236              <entry>Cross reference</entry>
1237              <entry>
1238                <sgmltag class="starttag">xref linkend=""</sgmltag>
1239              </entry>
1240              <entry>Use this to linke to other parts of the document.</entry>
1241            </row>
1242            <row>
1243              <entry>Cross reference with own text</entry>
1244              <entry>
1245                <sgmltag class="starttag">link</sgmltag>
1246              </entry>
1247              <entry>
1248                Can be used as an alternative to
1249                <sgmltag>xref</sgmltag>
1250              </entry>
1251            </row>
1252            <row>
1253              <entry>External URLs</entry>
1254              <entry>
1255                <sgmltag class="starttag">ulink url=""</sgmltag>
1256              </entry>
1257              <entry></entry>
1258            </row>
1259          </tbody>
1260        </tgroup>
1261      </informaltable>
1262      <example id="docbook.examples.links">
1263        <title>Links</title>
1264<programlisting>&hellip;
1265&lt;xref linkend="docbook.usedtags.links" /&gt;
1266&lt;link linkend="docbook.usedtags.links"&gt;Link to this section&lt;/link&gt;
1267&lt;ulink url="http://base.thep.lu.se"&gt;Base2's homepage&lt;/ulink&gt;
1268&hellip;</programlisting>
1269        <para>
1270          The first element will autogenerate the linked section's/chapter's title as a
1271          hyperlinked text. As an alternative to
1272          <sgmltag>xref</sgmltag>
1273          is
1274          <sgmltag>link</sgmltag>
1275          that lets you write your own hyperlinked text. The third and last one should be
1276          used to link to any URL outside the document.
1277        </para>
1278      </example>
1279    </sect3>
1280  </sect2>
1281 
1282  </sect1>
1283 
1284  <sect1 id="documentation.magicdraw">
1285    <title>Create UML diagrams with MagicDraw</title>
1286
1287    <para>
1288      UML or UML-like diagrams are used to document the relationship of
1289      classes in the Core API. To create the diagrams we use the community edition (version 12.5)
1290      of a program called MagicDraw. This is a Java program and it should be possible
1291      to run it on any platform which has at least a Java 1.5 runtime.
1292      To get more information about MagicDraw and to download the program
1293      go to their website:
1294      <ulink url="http://www.magicdraw.com/">http://www.magicdraw.com/</ulink>
1295    </para>
1296   
1297
1298    <sect2 id="magicdraw.organisation">
1299      <title>Organisation</title>
1300     
1301      <para>
1302        All classes and diagrams are in a single UML file. It can be
1303        found at <filename>&lt;base-dir&gt;/doc/src/uml/base.mdzip</filename>
1304      </para>
1305     
1306      <para>
1307        Everything in MagicDraw has been organised into packages and
1308        modules. At the top we have the <code>Core layer</code> and
1309        the <code>Data layer</code>. The <code>Java</code> moduled is
1310        for classes that related to the Java programming language, such
1311        as <code>Map</code> and <code>Set</code> that are not pre-defined
1312        by MagicDraw.
1313      </para>
1314     
1315      <figure id="magicdraw.figures.organisation">
1316        <title>MagicDraw organisation</title>
1317        <screenshot>
1318          <mediaobject>
1319            <imageobject>
1320              <imagedata 
1321                fileref="figures/magicdraw/organisation.png" format="PNG" />
1322            </imageobject>
1323          </mediaobject>
1324        </screenshot>
1325      </figure>
1326    </sect2>
1327   
1328    <sect2 id="magicdraw.classes">
1329      <title>Classes</title>
1330        <para>
1331          New classes should be added to one of the subpackages inside
1332          the <code>Data layer/Classes</code> or <code>Core layer/Classes</code>
1333          modules. It is very simple:
1334        </para>
1335         
1336        <orderedlist>
1337        <listitem>
1338          <para>
1339          Select the subpackage in the overview and click with the right mouse button.
1340          </para>
1341        </listitem>
1342        <listitem>
1343          <para>
1344          Select the
1345          <menuchoice>
1346            <guimenu>New element</guimenu>
1347            <guimenuitem>Class</guimenuitem>
1348          </menuchoice>
1349          menu item in the menu that pops up.
1350          </para>
1351        </listitem>
1352        <listitem>
1353          <para>
1354          The overview will expand to add a new class. Enter the name of the class
1355          and press enter.
1356          </para>
1357        </listitem>
1358        </orderedlist>
1359       
1360        <sect3 id="magicdraw.classes.data">
1361          <title>Data layer classes</title>
1362         
1363          <para>
1364            If you added a class to the data layer you also need to
1365            record some important information.
1366          </para>
1367
1368          <itemizedlist>
1369          <listitem>
1370            <para>
1371            The database table the data is stored in
1372            </para>
1373          </listitem>
1374          <listitem>
1375            <para>
1376            If the second-level cache is enabled or not
1377            </para>
1378          </listitem>
1379          <listitem>
1380            <para>
1381            If proxies are enabled or not
1382            </para>
1383          </listitem>
1384          <listitem>
1385            <para>
1386            The superclass
1387            </para>
1388          </listitem>
1389          <listitem>
1390            <para>
1391            Implemented interfaces
1392            </para>
1393          </listitem>
1394          <listitem>
1395            <para>
1396            Simple properties, ie. strings, numbers, dates
1397            </para>
1398          </listitem>
1399          <listitem>
1400            <para>
1401            Associations to other classes
1402            </para>
1403          </listitem>
1404          </itemizedlist>
1405
1406          <para>
1407            To achive this we have slightly altered the meaning of some UML symbols.
1408            For example we use the access modified symbols (+, ~ and -) to indicate
1409            if a property is updatable or not.
1410          </para>
1411
1412          <sect4 id="magicdraw.classes.data.tags">
1413            <title>Setting tagged values</title>
1414           
1415            <para>
1416              Some of the information needed is specified as <emphasis>tagged values</emphasis>
1417              that can be attached to a class.
1418              Double-click on the new class to bring up it's properties dialog
1419              box. Switch to the <guilabel>Tags</guilabel> configuration page.
1420              We have defined the following tags:
1421            </para>
1422             
1423            <variablelist>
1424            <varlistentry>
1425              <term><guilabel>table</guilabel></term>
1426              <listitem>
1427                <para>
1428                The name of the database table where the items should be stored.
1429                </para>
1430              </listitem>
1431            </varlistentry>
1432            <varlistentry>
1433              <term><guilabel>cache</guilabel></term>
1434              <listitem>
1435                <para>
1436                The number of items to store in the second-level cache of Hibernate.
1437                Only specify a value if caching should be enabled.
1438                </para>
1439              </listitem>
1440            </varlistentry>
1441            <varlistentry>
1442              <term><guilabel>proxy</guilabel></term>
1443              <listitem>
1444                <para>
1445                A boolean flag to indicate if proxies should be used or not.
1446                </para>
1447              </listitem>
1448            </varlistentry>
1449            <varlistentry>
1450              <term><guilabel>extends</guilabel></term>
1451              <listitem>
1452                <para>
1453                Select the superclass of this class.
1454                </para>
1455              </listitem>
1456            </varlistentry>
1457            <varlistentry>
1458              <term><guilabel>implements</guilabel></term>
1459              <listitem>
1460                <para>
1461                Specify which interfaces the class implements. To save space
1462                we use the following one-letter abbreviations:
1463                </para>
1464               
1465                <itemizedlist>
1466                <listitem><para>A = AnnotatableData</para></listitem>
1467                <listitem><para>B = BatchableData</para></listitem>
1468                <listitem><para>D = DiskConsumableData</para></listitem>
1469                <listitem><para>E = ExtendableData</para></listitem>
1470                <listitem><para>F = FileAttachableData</para></listitem>
1471                <listitem><para>N = NameableData</para></listitem>
1472                <listitem><para>O = OwnableData</para></listitem>
1473                <listitem><para>R = RemoveableData</para></listitem>
1474                <listitem><para>S = ShareableData</para></listitem>
1475                <listitem><para>T = SystemData</para></listitem>
1476                </itemizedlist>
1477              </listitem>
1478            </varlistentry>
1479            </variablelist>
1480           
1481            <figure id="magicdraw.figures.classtags">
1482              <title>Setting tagged values</title>
1483              <screenshot>
1484                <mediaobject>
1485                  <imageobject>
1486                    <imagedata 
1487                      fileref="figures/magicdraw/classtags.png" format="PNG" />
1488                  </imageobject>
1489                </mediaobject>
1490              </screenshot>
1491            </figure>
1492          </sect4>
1493         
1494          <sect4 id="magicdraw.classes.data.properties">
1495            <title>Specifying simple properties for a class</title>
1496            <para>
1497              Simple properties are strings, numbers, dates, etc. that are part of an object.
1498              Properties are entered as attributes of the class. The easiest way to enter
1499              properties are by typing directly in a diagram. It can also be done
1500              from the <guilabel>Attributes</guilabel> configuration page.
1501            </para>
1502           
1503            <para>
1504              Each attribute must have information about:
1505            </para>
1506           
1507            <itemizedlist>
1508            <listitem>
1509              <para>
1510              The name of the attribute, ie. the name of the get/set method without the
1511              get or set part and starting with a lowercase letter.
1512              </para>
1513            </listitem>
1514            <listitem>
1515              <para>
1516              The data type: enter or select the Java object type in the
1517              <guilabel>Type</guilabel> selection list.
1518              </para>
1519            </listitem>
1520            <listitem>
1521              <para>
1522              If null values are allowed or not: specify a multiplicity of 1 if a
1523              non-null value is required.
1524              </para>
1525            </listitem>
1526            <listitem>
1527              <para>
1528              If it is modifiable or not. From the <guilabel>Visibility</guilabel> 
1529              list, select one of the following:
1530              </para>
1531             
1532              <itemizedlist>
1533              <listitem>
1534                <para>
1535                public (+): the attribute is modifiable. This translates to public get and set methods.
1536                </para>
1537              </listitem>
1538              <listitem>
1539                <para>
1540                package (~): the attribute can only be set once. This translates to public get and set methods
1541                and an <code>update="false"</code> tag in the Hibernate mapping.
1542                </para>
1543              </listitem>
1544              <listitem>
1545                <para>
1546                private (-): the attribute is private (will this ever be used?).
1547                This translates to package private get and set methods.
1548                </para>
1549              </listitem>
1550              </itemizedlist>
1551             
1552            </listitem>
1553            </itemizedlist>
1554     
1555            <figure id="magicdraw.figures.attributes">
1556              <title>Class attributes</title>
1557              <screenshot>
1558                <mediaobject>
1559                  <imageobject>
1560                    <imagedata 
1561                      fileref="figures/magicdraw/attributes.png" format="PNG" />
1562                  </imageobject>
1563                </mediaobject>
1564              </screenshot>
1565            </figure>         
1566          </sect4>
1567         
1568          <sect4 id="magicdraw.classes.data.associations">
1569            <title>Associations to other classes</title>
1570
1571            <para>
1572              Associations to other classes are easiest created from
1573              a diagram view by drawing an <guilabel>Association</guilabel>
1574              link between the two classes. The ends should be given a name,
1575              multiplicity and visibility should be selected. For the visibility
1576              we use the same options as for attributes, but with a slightly different
1577              interpretation.
1578            </para>
1579           
1580            <itemizedlist>
1581            <listitem>
1582              <para>
1583              public (+): the association is modifiable. This translates to public get and
1584              set methods for many-to-one associations. Many-to-many associations must have a
1585              package private set method since the set or map must never be replaced.
1586              </para>
1587            </listitem>
1588 
1589            <listitem>
1590              <para>
1591              package (~): same as public but the association cannot be changed once it has
1592              been created. For many-to-one associations an <code>update="false"</code> tag in
1593              the Hibernate mapping should be used. For many-to-many association there is
1594              no corresponding tag. It will be the responsibility of the core to make sure
1595              no modifications are done.
1596              </para>
1597            </listitem>
1598           
1599            <listitem>
1600              <para>
1601              private (-): this is the inverse end of an association. Only used for one-to-many
1602              and many-to-many associations and translates to package private get and set
1603              methods.
1604              </para>
1605            </listitem>
1606            </itemizedlist>
1607           
1608            <para>
1609              If the association involves a join table (many-to-many) the name of that
1610              table should be entered as a tagged value to the association.
1611            </para>
1612           
1613            <para>
1614              If the association have values attached to it, use the
1615              <guilabel>Association class</guilabel> link type and enter information about
1616              the values in the attached class.
1617            </para>         
1618
1619          </sect4>
1620
1621          <para>
1622            A lot more can be said about this, but
1623            it is probably better to have a look at already existing diagrams if you have
1624            any questions. The authentication overview shown below is one of the most
1625            complex diagrams that involves many different links.
1626          </para>
1627         
1628          <figure id="magicdraw.figures.realexample">
1629            <title>Authentication UML diagram</title>
1630            <screenshot>
1631              <mediaobject>
1632                <imageobject>
1633                  <imagedata 
1634                    fileref="figures/uml/datalayer.authentication.png" format="PNG" />
1635                </imageobject>
1636              </mediaobject>
1637            </screenshot>
1638          </figure>
1639         
1640        </sect3>
1641       
1642        <sect3 id="magicdraw.classes.core">
1643          <title>Core layer classes</title>
1644          <para>
1645          TODO
1646          </para>
1647        </sect3>
1648       
1649      </sect2>
1650     
1651      <sect2 id="magicdraw.diagrams">
1652        <title>Diagrams</title>
1653
1654        <sect3 id="magicdraw.diagrams.create">
1655          <title>Create a new diagram</title>
1656         
1657          <para>
1658            New diagrams should be added to one of the subpackages inside
1659            the <code>Data layer/Diagrams</code> or <code>Core layer/Diagrams</code>
1660            modules. It is very simple:
1661          </para>
1662 
1663          <orderedlist>
1664          <listitem>
1665            <para>
1666            Select the subpackage in the overview and click with the right mouse button.
1667            </para>
1668          </listitem>
1669          <listitem>
1670            <para>
1671            Select the
1672            <menuchoice>
1673              <guimenu>New diagram</guimenu>
1674              <guimenuitem>Class diagram</guimenuitem>
1675            </menuchoice>
1676            menu item in the menu that pops up.
1677            </para>
1678          </listitem>
1679          <listitem>
1680            <para>
1681            The overview will expand to add a new diagram. A new empty diagram
1682            frame is also opened on the right part of the screen. Enter the name of the diagram
1683            and press enter.
1684            </para>
1685          </listitem>
1686          </orderedlist>
1687 
1688          <note>
1689            <title>Only class diagrams are fully supported</title>
1690            <para>
1691              The community edition of MagicDraw only has full support for
1692              class diagrams. The other diagram types has limitations, in the number of
1693              objects that can be created.
1694            </para>
1695          </note>
1696         
1697          <para>
1698            To display a class in a diagram, simply select the class in the overview
1699            and drag it into to the diagram.
1700          </para>
1701        </sect3>
1702
1703        <sect3 id="magicdraw.diagrams.appearance">
1704          <title>Visual appearance and style</title>
1705           
1706          <para>
1707            We have defined several different display style for classes. To set a
1708            style for a class right click on it in a diagram and select the
1709            <menuchoice><guimenuitem>Symbol properties</guimenuitem></menuchoice>
1710            menu item. In the bottom of the
1711            popup, use the <guilabel>Apply style</guilabel> selection list to select
1712            one of the predefined styles.
1713          </para>
1714           
1715          <itemizedlist>
1716          <listitem>
1717            <para>
1718            Data class: Use this style for all primary data classes in a diagram. It will
1719            display all info that we are interested in.
1720            </para>
1721          </listitem>
1722          <listitem>
1723            <para>
1724            External class: Use this style for related classes that are actaully part of
1725            another diagram. This style will hide all information except the class name.
1726            This style can be used for both data layer and core layer classes.
1727            </para>
1728          </listitem>
1729          <listitem>
1730            <para>
1731            Association class: Use this style for classes that hold information
1732            related to an association between two other classes. Classes with this
1733            style are displayed in a different color. This style can be used for both
1734            data layer and core layer classes.
1735            </para>
1736          </listitem>
1737          </itemizedlist>     
1738        </sect3>
1739
1740        <sect3 id="magicdraw.diagrams.save">
1741          <title>Save diagram as image</title>
1742          <para>
1743            When the diagram is complete, save it as a PNG image in the
1744            <filename class="directory">&lt;base-dir&gt;/doc/src/docbook/figures/uml</filename>
1745            directory.
1746          </para>
1747        </sect3>
1748      </sect2>     
1749     
1750  </sect1>
1751 
1752</chapter>
Note: See TracBrowser for help on using the repository browser.