MetaUML

The educational technology and digital learning wiki
Revision as of 14:14, 6 November 2008 by Daniel K. Schneider (talk | contribs) (using an external editor)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

<pageby nominor="false" comments="false"/>

Definition

MetaUML is a GNU GPL MetaPost library for typesetting UML diagrams, using a human-friendly textual notation. Currently (nov 2008) it offers support for class diagrams, package diagrams, activity diagrams, state machine diagrams use case diagrams and component diagrams.

MetaUML can be used to:

  • Create UML diagrams readily usable in a LaTeX article or book.
  • Create independent PDF-s
  • Create jpeg-s, png-s etc.
  • Insert UML diagrams in Mediawikis (provided that the extension is installed)

Examples

Diagrams error (with plantuml command): /bin/bash: plantuml: command not found

The following was copied from the Extension:UML page

Diagrams error (with plantuml command): /bin/bash: plantuml: command not found


Diagrams error (with plantuml command): /bin/bash: plantuml: command not found


Using the MediaWiki extension

Using the MetaUML uml tag in a mediawiki is quite tricky. The only way to figure out errors is to install this software locally (or log on to your wiki server machine) and then test like this. E.g code like this:

 <uml redraw>
 Fork.forkA("h", 100);
 Fork.forkB("v", 20);
 leftToRight(10)(forkA, forkB);
 drawObjects(forkA, forkB);
 </uml>

goes into a xxx.mp file like this:

input metauml;
beginfig(1);
 Fork.forkA("h", 100);
 Fork.forkB("v", 20);
 leftToRight(10)(forkA, forkB);
 drawObjects(forkA, forkB);
endfig;
end

Then, type in a console:

mpost xxx.mp

Installation notes for MetaUML and Mediawiki extension for Solaris

Installing the necessary software requires some installation skills. Here are my (rough) installation notes

Step: Make sure that latex, dvips, gs (ghostscript), and convert (ImageMagick) installed and available in the PATH. Depending on how the system is installed, this also means to fix the path of the Apache webserver.

It probably would be a good idea to install livetex, but since I found I binary for (older) teTex I went with this. texTex in /opt/sfw wasn't correctly installed. Got a new version from http://www.sunfreeware.com/. This package installs in /usr/local

gunzip tetex-3.0-sol10-sparc-local.gz
pkgadd -d tetex-3.0-sol10-sparc-local

teTex now should be installed and there is some postinstall work to do

  • Add /usr/local/teTeX/bin/sparc-sun-solaris2.10 to the path.
  • Configure
texconfig conf

Step: Install texvc (maybe not needed). This is a standard Mediawiki script to render Latex math fragments.

Step: Get the MediaWiki extension

http://www.mediawiki.org/wiki/Extension:UML

Step: Fix some configuration variables. Some documentation on variables is here:

You have to make sure that all these variables are defined:

$wgUseTeX	    = true;
$wgMathPath         = "{$wgUploadPath}/math";
$wgMathDirectory    = "{$wgUploadDirectory}/math";
$wgTmpDirectory     = "{$wgUploadDirectory}/tmp";
$wgImageMagickIdentifyCommand="/usr/local/bin/identify";
$wgImageMagickConvertCommand = "/usr/local/bin/convert";
$wgDvipsCommand="/usr/local/teTeX/bin/sparc-sun-solaris2.10/dvips";

Step: Install MetaUML, UML for LaTeX/MetaPost

Links