<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>new BrainOverloadException();</title>
	<atom:link href="http://brainoverloadexception.de/feed/" rel="self" type="application/rss+xml" />
	<link>http://brainoverloadexception.de</link>
	<description></description>
	<lastBuildDate>Sun, 08 Nov 2009 18:16:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ant-Task in Netbeans</title>
		<link>http://brainoverloadexception.de/ant-task-in-netbeans-php/</link>
		<comments>http://brainoverloadexception.de/ant-task-in-netbeans-php/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 11:07:33 +0000</pubDate>
		<dc:creator>maren</dc:creator>
				<category><![CDATA[Ant]]></category>
		<category><![CDATA[Netbeans]]></category>

		<guid isPermaLink="false">http://localhost/~maren/wordpress/?p=30</guid>
		<description><![CDATA[Manchmal gibt es Aufgaben in der Entwicklung, die echt lästig sind. Solche immer wiederkehrenden Aufgaben lassen sich sehr gut automatisieren. Obwohl ich persönlich mit der Bash gut klar komme, möchte ich dennoch nicht immer zwischen meiner IDE (Netbeans) und anderen Fenstern unnötig hin und her wechseln. Netbeans hat jedoch das Feature, Ant-Tasks [1] auf Knopfdruck ]]></description>
			<content:encoded><![CDATA[<p>Manchmal gibt es Aufgaben in der Entwicklung, die echt lästig sind. Solche immer wiederkehrenden Aufgaben lassen sich sehr gut automatisieren. Obwohl ich persönlich mit der Bash gut klar komme, möchte ich dennoch nicht immer zwischen meiner IDE (Netbeans) und anderen Fenstern unnötig hin und her wechseln. Netbeans hat jedoch das Feature, Ant-Tasks <a href="http://de.wikipedia.org/wiki/Apache_Ant">[1]</a> auf Knopfdruck zu starten und alle anstehenden Aufgaben durchzuführen. Ich habe z.B. einen Task erstellt, der mir über <code>ssh</code> ein bestimmtes Verzeichnis löscht, dann ein <code>svn export</code> macht und schließlich noch per <code>scp</code> ein Verzeichnis von meiner Maschine auf einen beliebigen Server kopiert.   </p>
<p>Natürlich könnte ich das alles manuell machen, aber da ich diesen &raquo;Prozess&laquo; relativ häufig benötige, starte ich nur den Ant-Task und widme mich wieder meiner eigentlichen Arbeit. </p>
<h3>Installation des Plugins</h3>
<p>Die Installation des Netbeans Ant-Plugins ist recht schnell erledigt. Unter Tools -> Plugins sucht man nach Ant und installiert das Paket. Zu diesem Paket kommen noch eine Hand voll abhängige Pakete, die automatisch mit installiert werden. </p>
<h3>Installation des JDK</h3>
<p>Falls kein JDK installiert ist, wird Netbeans eines einfordern. Das benötigte JDK ist hier <a href="http://java.sun.com/javase/downloads/index.jsp">[2]</a> zu bekommen.  </p>
<p>Wenn das Paket heruntergeladen und ausgepackt ist, muss man Netbens noch mitteilen, dass es nun dieses JDK verwenden soll. Im Installationsverzeichnis gibt es im <code>etc </code>Verzeichnis die <code>netbeans.conf</code> welche auf das JDK Verzeichnis geändert werden muss.</p>
<p>Beispiel:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">netbeans_jdkhome</span>=<span style="color: #ff0000;">&quot;C:\Programme\Java\jdk1.6.0_14&quot;</span></pre></div></div>

<h3>Zucker</h3>
<p>Ja, ich gebe zu, ich bin faul &ndash; sehr faul. Das geht nicht nur so weit, dass ich Ant-Tasks von Hand starte. Ich gehe einen Schritt weiter und lasse Tasks permanent automatisch aufrufen. Natürlich ist das keine neue Idee, schließlich gibt es <code>cron</code>-Jobs seit langem. Aber es gibt, soweit ich weiß, nur ein Cron-Job Plugin für Netbeans, um Ant-Tasks kontinuierlich ablaufen zu lassen. Dieses Plugin ist hier <a href="http://kenai.com/projects/nbcronjob">[3]</a> zu bekommen.</p>
<h3>Fazit</h3>
<p>Die Ant-Tasks schaffen lästige, wiederkehrende Arbeit aus dem Fokus und sorgen dafür, dass mit einem simplen Aufruf vielfältige Aufgaben übernommen werden können. Im Zusammenspiel mit dem Cronjob-Plugin für Netbeans lassen sich die Aufgaben vollständig automatisiert im Hintergrund erledigen. Ant ist leicht zu erlernen <a href="http://ant.apache.org/manual/index.html">[4]</a> und wenn die Build-Scripts einmal aufgebaut sind, können sie von Projekt zu Projekt weiter vererbt und angepasst werden. </p>
]]></content:encoded>
			<wfw:commentRss>http://brainoverloadexception.de/ant-task-in-netbeans-php/feed/</wfw:commentRss>
		<slash:comments>192</slash:comments>
		</item>
		<item>
		<title>firePHP Einführung</title>
		<link>http://brainoverloadexception.de/firephp-einfuhrung/</link>
		<comments>http://brainoverloadexception.de/firephp-einfuhrung/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 20:12:56 +0000</pubDate>
		<dc:creator>maren</dc:creator>
				<category><![CDATA[debugging]]></category>

		<guid isPermaLink="false">http://brainoverloadexception.de/?p=141</guid>
		<description><![CDATA[In dem Artikel bin ich schon auf firebug eingegangen. Ich beschrieb welche Funktionen aus der firebug API nützlich sind um so JavaScript einfacher zu Debuggen.
Nun gibt es auch eine firebug-Erweiterung mit dem Namen firePHP. Diese Erweiterung ermöglicht dem Entwickler die Inhalte aus einer Debug-Session auch im firebug auszugeben. Das hat den großen Vorteil, dass Debug-Ausgaben ]]></description>
			<content:encoded><![CDATA[<p>In dem <a href="http://brainoverloadexception.de/mehr-aus-firebug-herausholen/">Artikel</a> bin ich schon auf firebug eingegangen. Ich beschrieb welche Funktionen aus der firebug API nützlich sind um so JavaScript einfacher zu Debuggen.</p>
<p>Nun gibt es auch eine firebug-Erweiterung mit dem Namen firePHP. Diese Erweiterung ermöglicht dem Entwickler die Inhalte aus einer Debug-Session auch im firebug auszugeben. Das hat den großen Vorteil, dass Debug-Ausgaben nicht mehr mit print(_r) oder mit der Ausgabe im error_log gemacht werden müssen. Zum einen wird so das Layout nicht übermäßig zerstört, zum anderen das error_log nicht stetig vollgemüllt.</p>
<p>Um firePHP nutzen zu können, müssen ein paar Dinge vorbereitet werden. Zum einen benötigt man das Plugin für den Firebug welches <a href="https://addons.mozilla.org/en-US/firefox/addon/6149">[1] hier</a> zu bekommen ist. Zum anderen benötigen wir noch die php Klassen bzw Funktionen, die vom Autoren zur Verfügung gestellt werden.</p>
<p>Die benötigten Klassen bzw Funktion können über den PEAR Installer heruntergeladen werden.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">pear channel-discover pear.firephp.org
pear <span style="color: #c20cb9; font-weight: bold;">install</span> firephp<span style="color: #000000; font-weight: bold;">/</span>FirePHPCore</pre></div></div>

<p>Der Entwickler von firePHP bietet mehrere Möglichkeiten in der Firebug Konsole Debug-Meldungen auszugeben.<br />
Zum einen gibt es die Funktionen im Paradigma der Prozeduralen Programmierung  bzw Aufrufe der Methoden der objektorientierten Programmierung. Je nach vorgehen müssen verschiedene includes getätigt werden.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'FirePHPCore/FirePHP.class.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//oder</span>
<span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'FirePHPCore/fb.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Um es einfach zu halten, stelle ich allerdings nur die objektorientierte Variante vor.<br />
Zunächst sollte eine Instanz erzeugt werden (Alle Methoden sind auch statisch abrufbar).</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$firephp</span> <span style="color: #339933;">=</span> FirePHP<span style="color: #339933;">::</span><span style="color: #004000;">getInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Die interessantesten Methoden die firePHP zur Verfügung stehen sind:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$firephp</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">log</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$Object</span><span style="color: #339933;">,</span> <span style="color: #000088;">$Label</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #000088;">$firephp</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">info</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$Object</span><span style="color: #339933;">,</span> <span style="color: #000088;">$Label</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #000088;">$firephp</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">warn</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$Object</span><span style="color: #339933;">,</span> <span style="color: #000088;">$Label</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$firephp</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">error</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$Object</span><span style="color: #339933;">,</span> <span style="color: #000088;">$Label</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$firephp</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">trace</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$Label</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$firephp</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">table</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$Label</span><span style="color: #339933;">,</span> <span style="color: #000088;">$Table</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$firephp</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">group</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$Lable</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$firephp</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">groupEnd</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Die Methoden log, info, warn und error sind vom Prinzip identisch, allerdings werden sie mit unterschiedlichen Farben innerhalb des Firebugs gekennzeichnet. </p>
<p><a href="http://brainoverloadexception.de/wp-content/uploads/2009/09/firephp_example.png" target="_blank"><img src="http://brainoverloadexception.de/wp-content/uploads/2009/09/firephp_example.png" alt="firephp_example" title="firephp_example" width="540" class="aligncenter size-full wp-image-159" /></a></p>
<p>Ein sehr nettes Feature von firePHP, ist die Darstellung von Variablen und deren Inhalte. So ist jede Debug-Ausgabe ordentlich verpackt und sauber dargestellt:</p>
<p><a href="http://brainoverloadexception.de/wp-content/uploads/2009/09/firephp_example2.png"><img src="http://brainoverloadexception.de/wp-content/uploads/2009/09/firephp_example2.png" alt="firephp_example2" title="firephp_example2" width="540" class="aligncenter size-full wp-image-164" /></a></p>
<p>Die einzigen Methoden, die man ein wenig gesondert betrachten muss, sind <code>$firephp->group($lable)</code> und <code>$firephp->groupEnd()</code>.<br />
Diese Methoden beschreiben eine Gruppe im Firebug. Alle Methoden die zwischen den beiden Aufrufen verwendet werden, werden dann innerhalb einer Gruppe dargestellt.</p>
<p><a href="http://brainoverloadexception.de/wp-content/uploads/2009/08/firebug_console.png"><img src="http://brainoverloadexception.de/wp-content/uploads/2009/08/firebug_console.png" alt="Gruppen darstellung" title="firebug_console" class="size-full wp-image-94" /></a></p>
<p>Wie man sehen kann, sind alle wichtigen fierbug Funktionen auch für firePHP verfügbar. So steht also einer entspannten und komfortablen Debug-Session nichts mehr im Wege. </p>
]]></content:encoded>
			<wfw:commentRss>http://brainoverloadexception.de/firephp-einfuhrung/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>DocBook Generierung &#8211; Erstellen eines Buches.</title>
		<link>http://brainoverloadexception.de/docbook-generierung-erstellen-eines-buches/</link>
		<comments>http://brainoverloadexception.de/docbook-generierung-erstellen-eines-buches/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 17:14:38 +0000</pubDate>
		<dc:creator>maren</dc:creator>
				<category><![CDATA[DocBook]]></category>

		<guid isPermaLink="false">http://localhost/~maren/wordpress/?p=22</guid>
		<description><![CDATA[Im letzten Artikel habe ich beschrieben, was DocBook ist und erklärte schon das Grundgerüst eines DocBook-Dokuments. Kommen wir aber nun zum eigentlich interessanten Teil. Wie erzeuge ich aus meinem DocBook ein PDF?
Für eine komplette Transformation von DocBook zu PDF benötigen wir ein paar Komponenten, die noch installiert werden müssen:

Ein DocBook-Dokument ( hier ein Beispieldokument)
einen XSLT-Prozessor
die ]]></description>
			<content:encoded><![CDATA[<p>Im letzten <a href="http://brainoverloadexception.de/?p=4">Artikel</a> habe ich beschrieben, was DocBook ist und erklärte schon das Grundgerüst eines DocBook-Dokuments. Kommen wir aber nun zum eigentlich interessanten Teil. Wie erzeuge ich aus meinem DocBook ein PDF?</p>
<p>Für eine komplette Transformation von DocBook zu PDF benötigen wir ein paar Komponenten, die noch installiert werden müssen:</p>
<ul>
<li>Ein DocBook-Dokument ( <a href="http://brainoverloadexception.de/wp-content/uploads/2009/08/test.xml.txt">hier</a> ein Beispieldokument)</li>
<li>einen XSLT-Prozessor</li>
<li>die XSL-Stylesheets von DocBook</li>
<li>einen XSL-FO Prozessor</li>
</ul>
<p>Der XSLT-Prozessor erzeugt mit Hilfe der XSL-Stylesheets aus unserem DocBook ein XSL-FO Dokument. XSL-FO dient als Zwischenstufe für andere Ausgabeformaten wie z.B. PDF, PostScript und Rich Text Format. Um von diesem Zwischenformat weiter zu unserem Wunschformat zu kommen benötigen wir den XSL-FO Prozessor.</p>
<h3>Installation Windows</h3>
<p>Ich verwende unter Windows sowie Linux xsltproc. Die benötigten Pakete für Windows sind <a href="http://www.zlatkovic.com/pub/libxml/">[1] hier</a> zu finden.<br />
Für die Installation unter Windows werden folgende Ziparchive benötigt:</p>
<ul>
<li>iconv*.zip</li>
<li>libxml2*.zip</li>
<li>libxmlsec*.win32.zip</li>
<li>libxslt*.win32.zip</li>
<li>openssl*.win32.zip</li>
<li>xsldbg*.win32.zip</li>
<li>zlib*.win32.zip</li>
</ul>
<p>Weiterhin benötigen wir noch die XSL-Stylesheets von DocBook; die uns eine Basis zur Generierung von PDFs bereit stellt. Dieses Archiv ist <a href="http://sourceforge.net/projects/docbook/files/">[2] hier</a> zu finden. Dort benötigen wie das docbook-xsl-[version].zip.</p>
<p>Zu guter Letzt benötigen wir noch den <a href="http://archive.apache.org/dist/xmlgraphics/fop/binaries/fop-0.95-bin.zip">[3] FOP</a>, der das eigentliche PDF erzeugen wird.</p>
<p>Jetzt da wir alle unsere Werkzeuge zusammen haben, geht es an die Installation. Zunächst erstellen wir ein Verzeichnis &#8211; nennen wir es </p>
<p>&raquo;docbook&laquo;. In Dieses Verzeichnis entpacken wir nun, in separate Unterverzeichnisse, den FOP und die XSL-Stylesheets.</p>
<p>Unter Windows ist die Installation des xsltproc leider keine saubere Sache. Es gibt zwei Möglichkeiten den xsltproc in der comand line bereitzustellen.<br />
Wir können zum Einen alle dlls in das win32 Verzeichnis verschieben. Allerdings hat nicht jeder die Administratorrechte, die es dazu braucht.<br />
Der zweite Weg ist, das Verzeichnis mit in unser DockBook zu verschieben und die gesamten Pfade im batch File auszulagern.</p>
<p>Zur Erleichterung ist hier noch eine kleines batch File, dass uns die Generierung abnimmt.</p>

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;"><span style="color: #33cc33;">@</span><span style="color: #b1b100; font-weight: bold;">echo</span> off
<span style="color: #b1b100; font-weight: bold;">TITLE</span> MakeDocBook
<span style="color: #808080; font-style: italic;">
REM ==============================================================</span>
<span style="color: #808080; font-style: italic;">REM Edit these lines:</span>
<span style="color: #b1b100; font-weight: bold;">SET</span> <span style="color: #448844;">scriptpath</span>=C:\Programme\docbook
<span style="color: #b1b100; font-weight: bold;">SET</span> <span style="color: #448844;">stylepath</span>=<span style="color: #33cc33;">%</span><span style="color: #448888;">scriptpath</span><span style="color: #33cc33;">%</span>\docbook-xsl-1.74.0\fo
<span style="color: #b1b100; font-weight: bold;">SET</span> <span style="color: #448844;">foppath</span>=<span style="color: #33cc33;">%</span><span style="color: #448888;">scriptpath</span><span style="color: #33cc33;">%</span>\fop-<span style="color: #cc66cc;">0.95</span>
<span style="color: #b1b100; font-weight: bold;">set</span> <span style="color: #448844;">repository</span>=<span style="color: #33cc33;">%</span><span style="color: #448888;">scriptpath</span><span style="color: #33cc33;">%</span>\repository
<span style="color: #b1b100; font-weight: bold;">set</span> <span style="color: #448844;">src</span>=T:\docbook\repository
<span style="color: #b1b100; font-weight: bold;">set</span> <span style="color: #448844;">fooutput</span>=<span style="color: #33cc33;">%</span><span style="color: #448888;">repository</span><span style="color: #33cc33;">%</span>\fo
<span style="color: #b1b100; font-weight: bold;">set</span> <span style="color: #448844;">pdfoutput</span>=<span style="color: #33cc33;">%</span><span style="color: #448888;">src</span><span style="color: #33cc33;">%</span>\pdf
<span style="color: #b1b100; font-weight: bold;">set</span> <span style="color: #448844;">xsltproc_home</span>=<span style="color: #33cc33;">%</span><span style="color: #448888;">scriptpath</span><span style="color: #33cc33;">%</span>\install
<span style="color: #808080; font-style: italic;">REM ==============================================================</span>
&nbsp;
&nbsp;
<span style="color: #33cc33;">%</span><span style="color: #448888;">xsltproc_home</span><span style="color: #33cc33;">%</span>\xsltproc --xinclude --nonet --stringparam section.autolabel <span style="color: #cc66cc;">1</span> --stringparam xref.with.number.and.<span style="color: #b1b100; font-weight: bold;">title</span> <span style="color: #cc66cc;">0</span>  --stringparam body.start.indent 0mm -o <span style="color: #33cc33;">%</span><span style="color: #448888;">fooutput</span><span style="color: #33cc33;">%</span>\<span style="color: #33cc33;">%</span><span style="color: #448888;">1</span>.fo <span style="color: #33cc33;">%</span><span style="color: #448888;">stylepath</span><span style="color: #33cc33;">%</span>\docbook.xsl <span style="color: #33cc33;">%</span><span style="color: #448888;">src</span><span style="color: #33cc33;">%</span>\src\<span style="color: #33cc33;">%</span><span style="color: #448888;">1</span>.xml
<span style="color: #33cc33;">%</span><span style="color: #448888;">foppath</span><span style="color: #33cc33;">%</span>\fop.bat -fo <span style="color: #33cc33;">%</span><span style="color: #448888;">fooutput</span><span style="color: #33cc33;">%</span>\<span style="color: #33cc33;">%</span><span style="color: #448888;">1</span>.fo -pdf <span style="color: #33cc33;">%</span><span style="color: #448888;">pdfoutput</span><span style="color: #33cc33;">%</span>\<span style="color: #33cc33;">%</span><span style="color: #448888;">1</span>.pdf &gt; <span style="color: #0000ff; font-weight: bold;">nul</span></pre></div></div>

<p>Wenn in dem batch File alle benötigten Pfade angepasst sind, kann man nun über die command line das batch File aufrufen, und unser selbst erstelltes PDF bewundern.</p>
<h3>Installation Linux</h3>
<p>Unter Linux ist die Installation recht simpel. Die benötigten Pakete sind die docbook* und die libxslt* Pakete. Alle benötigten Abhängigkeiten sollten vom jeweiligen Paketmanager automatisch mit aufgelöst werden. Hier ist noch ein Script für das ~/bin Verzeichnis, welches mit einem chmod ausführbar gemacht werden sollte.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
&nbsp;
<span style="color: #007800;">USER_HOME</span>=<span style="color: #ff0000;">&quot;/home/userhome&quot;</span>
<span style="color: #007800;">FOP_HOME</span>=<span style="color: #ff0000;">&quot;/usr/local/fop/fop-0.95/&quot;</span>
<span style="color: #007800;">DOCBOOK_HOME</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$USER_HOME</span>/docbook/&quot;</span>
<span style="color: #007800;">SOURCE_HOME</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$USER_HOME</span>/Documents/documentation&quot;</span>
<span style="color: #007800;">OUTPUT_HOME</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$USER_HOME</span>/Documents/documentation&quot;</span>
<span style="color: #007800;">docbookfo</span>=<span style="color: #ff0000;">&quot;/usr/share/xml/docbook/stylesheet/nwalsh/current/fo&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># using xslt for xslt:fo</span>
xsltproc	<span style="color: #660033;">--xinclude</span> \
		<span style="color: #660033;">--nonet</span> \
		<span style="color: #660033;">--stringparam</span> section.autolabel <span style="color: #000000;">1</span> \
		<span style="color: #660033;">--stringparam</span> xref.with.number.and.title <span style="color: #000000;">0</span> \
		<span style="color: #660033;">--stringparam</span> body.start.indent 0mm \
		<span style="color: #660033;">--output</span> $1.fo <span style="color: #007800;">$docbookfo</span><span style="color: #000000; font-weight: bold;">/</span>docbook.xsl $1.xml
<span style="color: #666666; font-style: italic;"># using fop to generate pdf.</span>
<span style="color: #007800;">$FOP_HOME</span><span style="color: #000000; font-weight: bold;">/</span>fop <span style="color: #660033;">-fo</span> $1.fo <span style="color: #660033;">-pdf</span> $1.pdf</pre></div></div>

<p>Mit den beiden Scripts lassen sich sehr schnell unter den jeweiligen Betriebssystemen ein PDF erstellen. DocBook bringt von sich aus Templates mit, die einem alle möglichen Verzeichnisse automatisiert erstellt (Inhalts- Bilder- Tabellenverzeichnis), welche auch direkt verlinkt sind. Die Positionierung von Bildern geschieht automatisch, sie werden nicht abgeschnitten und die Bild Unter- bzw. Überschriften stehen dort wo sie sein sollen. Das Layout des Dokuments ist konsistent.</p>
]]></content:encoded>
			<wfw:commentRss>http://brainoverloadexception.de/docbook-generierung-erstellen-eines-buches/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Mehr aus Firebug herausholen</title>
		<link>http://brainoverloadexception.de/mehr-aus-firebug-herausholen/</link>
		<comments>http://brainoverloadexception.de/mehr-aus-firebug-herausholen/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 18:39:08 +0000</pubDate>
		<dc:creator>maren</dc:creator>
				<category><![CDATA[debugging]]></category>

		<guid isPermaLink="false">http://brainoverloadexception.de/?p=88</guid>
		<description><![CDATA[Jeder gute Web-Entwickler, der etwas auf sich hält, verwendet zum Entwickeln und Analysieren den Firebug. Wie wahrscheinlich jeder Firebug-Benutzer weiß, besitzt diese Erweiterung einen Reiter &#8220;Konsole&#8221;. Dieser Konsole widme ich heute ein wenig mehr Aufmerksamkeit.
Die Konsole gibt dem Entwickler von sich aus jede Menge Informationen zum jeweills ablaufenden JavaScript Geschehen. Man kann die Konsole auch ]]></description>
			<content:encoded><![CDATA[<p>Jeder gute Web-Entwickler, der etwas auf sich hält, verwendet zum Entwickeln und Analysieren den Firebug. Wie wahrscheinlich jeder Firebug-Benutzer weiß, besitzt diese Erweiterung einen Reiter &#8220;Konsole&#8221;. Dieser Konsole widme ich heute ein wenig mehr Aufmerksamkeit.</p>
<p>Die Konsole gibt dem Entwickler von sich aus jede Menge Informationen zum jeweills ablaufenden JavaScript Geschehen. Man kann die Konsole auch aktiv ansteuern und zum Debuggen verwenden. So entfällt das umständliche und zeitraubende Debuggen mit <code>alert()</code> Aufrufen. </p>
<p>Durch den einfachen Aufruf von <code>console.log(object[, object, ...]);</code> hat man die Möglichkeit, beliebige Objekte auf der Konsole auszugeben. Schleifeninhalte können genauer analysiert werden, indem die Inhalte mit dem Aufruf <code>console.group()</code> und <code>console.groupEnd()</code> umschlossen werden. So sind die Ausgaben aus Schleifen oder Funktionen nicht völlig unübersichtlich.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">    console.<span style="color: #660066;">group</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;loop call&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">5</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;loop: &quot;</span> <span style="color: #339933;">+</span> i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    console.<span style="color: #660066;">groupEnd</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Wer die gruppierten Informationen lieber initial eingeklappt haben möchte, ruft statt <code>console.group() </code> einfach <code>console.groupCollapsed()</code> auf.</p>
<div id="attachment_94" class="wp-caption aligncenter" style="width: 406px"><a href="http://brainoverloadexception.de/wp-content/uploads/2009/08/firebug_console.png"><img src="http://brainoverloadexception.de/wp-content/uploads/2009/08/firebug_console.png" alt="Unterschied console.group() und console.groupCollapsed()" title="firebug_console" width="396" height="246" class="size-full wp-image-94" /></a><p class="wp-caption-text">Unterschied console.group() und console.groupCollapsed()</p></div>
<h3>Es geht noch mehr</h3>
<p>Bisher haben wir uns nur um die Darstellung von Daten innerhalb der Konsole gekümmert. Die Konsole erleichtert uns das Entwickeln, indem sie uns erlaubt, JavaScript einzugeben und direkt auszuführen. So kann im Prompt z.B. das Ergebnis einer bestimmten Funktion überprüft werden. </p>
<div id="attachment_104" class="wp-caption aligncenter" style="width: 483px"><a href="http://brainoverloadexception.de/wp-content/uploads/2009/08/firebug_console_call.png"><img src="http://brainoverloadexception.de/wp-content/uploads/2009/08/firebug_console_call.png" alt="Verwendung des Prompts" title="firebug_console_call" width="473" height="405" class="size-full wp-image-104" /></a><p class="wp-caption-text">Verwendung des Promts</p></div>
<p>Die Konsole bietet weiterhin die Funktion <code>$x</code>, die per XPath die Knoten des DOMs abzufragen. Kombiniert mit <code>inspect()</code> lassen sich die Nodesets genauer betrachten. Ist die Auswahl eindeutig, springt man zum gesuchten Element.<br />
<code>inspect($x("//input")[0]);</code></p>
<p>Die Möglichkeiten, die die Firebug API bietet, sind hier nur kurz angerissen, können aber in der <a href="http://getfirebug.com/docs.html">Dokumentation</a> genauer nachgelesen werden.</p>
]]></content:encoded>
			<wfw:commentRss>http://brainoverloadexception.de/mehr-aus-firebug-herausholen/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>DocBook &#8211; oder wie ich zum Schreiben kam</title>
		<link>http://brainoverloadexception.de/docbook-oder-wie-ich-zum-schreiben-kam/</link>
		<comments>http://brainoverloadexception.de/docbook-oder-wie-ich-zum-schreiben-kam/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 08:36:55 +0000</pubDate>
		<dc:creator>maren</dc:creator>
				<category><![CDATA[DocBook]]></category>

		<guid isPermaLink="false">http://localhost/~maren/wordpress/?p=4</guid>
		<description><![CDATA[DocBook ist ein auf XML basierendes Dokumentenformat. Es erleichtert die Publikation von Büchern, Artikeln oder Dokumentationen in verschiedenen Ausgabeformaten wie z.B. XHTML, Windowshilfe und XSL-FO. Letzteres dient als Vorstufe zum PDF.
Ich habe DocBook schätzen gelernt, als es darum ging, umfangreiche Dokumente zu schreiben. Bei Word &#38; Co. habe ich mich in regelmäßigen Abständen darüber geärgert, ]]></description>
			<content:encoded><![CDATA[<p><em>DocBook</em> ist ein auf XML basierendes Dokumentenformat. Es erleichtert die Publikation von Büchern, Artikeln oder Dokumentationen in verschiedenen Ausgabeformaten wie z.B. XHTML, Windowshilfe und XSL-FO. Letzteres dient als Vorstufe zum PDF.</p>
<p>Ich habe DocBook schätzen gelernt, als es darum ging, umfangreiche Dokumente zu schreiben. Bei Word &amp; Co. habe ich mich in regelmäßigen Abständen darüber geärgert, dass ich ein gutes Drittel meiner Zeit darauf verwendete, das Layout einigermaßen hinzubiegen. Ich beschäftigte mich also mehr mit der Positionierung der Bilder und deren Beschriftungen, als mit dem eigentlichen Inhalt des Dokuments. Ich hatte auch keine Lust, stetig das Inhalts-, Bilder- oder Tabellenverzeichnis manuell zu aktualisieren, damit es &ndash; schlicht& ndash; aktuell ist. Zu guter Letzt gab es immer wieder Probleme mit dem PDF-Export, weil gelegentlich dabei das Layout auseinander gefallen ist. Daran änderte leider auch der Versuch nichts, Bilder, Tabellen und deren Beschriftungen erst zum Schluss einzufügen.</p>
<p>Leider führt die Verwendung von XML dazu, dass diese Art der Dokumentenerstellung kaum akzeptiert wird. Die Begründung lautet oft, dass das Schreiben mit DocBook komplizierter und damit auch langwieriger sei als mit Word &#038; Co. Zum anderen scheinen die Schmerzen bei der Dokumentenerstellung zu gering, um sich generell mit alternativen Möglichkeiten zu beschäftigen.</p>
<p>Aber wie arbeitet man nun mit DocBook?  Wie ist das XML aufgebaut und was soll oder muss man beachten?</p>
<p>Der Aufbau eines DocBook-Dokuments ist schnell erklärt.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;book</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://docbook.org/ns/docbook&quot;</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;5.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Titel des Buches<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;subtitle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Untertitel<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/subtitle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;chapter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Dies ist ein Titel zum Kapitel<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;section<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Dies ist der Titel für den Abschnitt<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;para<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Dies ist ein Absatz, in dem der ganz <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;emphasis<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>wichtige<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/emphasis<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> Text steht.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/para<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/section<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/chapter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/book<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Natürlich gibt es die Möglichkeit, Bilder, Tabellen oder Verweise in DocBook zu erstellen:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;figure</span> <span style="color: #000066;">xml:id</span>=<span style="color: #ff0000;">&quot;bild_id&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Bildtitel<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mediaobject<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;imageobject<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;imagedata</span> <span style="color: #000066;">fileref</span>=<span style="color: #ff0000;">&quot;pfad/zum/bild&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/imageobject<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mediaobject<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/figure<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;table</span> <span style="color: #000066;">xml:id</span>=<span style="color: #ff0000;">&quot;tabellen_id&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Tabellentitel<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tgroup</span> <span style="color: #000066;">cols</span>=<span style="color: #ff0000;">&quot;2&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;thead<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;row<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;entry<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Titel der ersten Spalte<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/entry<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;entry<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Titel der zweiten Spalte<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/entry<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/row<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/thead<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tbody<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;row<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;entry<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;code<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Eintrag mit einem monospace Font für z.B. Funktionsnamen <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/code<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/entry<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;entry<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	    Zweite spalte
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/entry<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/row<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tbody<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tgroup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/table<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">&lt;!-- Verweis auf die obige Tabelle --&gt;</span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xref</span> <span style="color: #000066;">linkend</span>=<span style="color: #ff0000;">&quot;tabellen_id&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></td></tr></table></div>

<p>Auf den ersten Blick scheint der Nutzen nicht direkt ersichtlich, und der Overhead mag gerade beim Einbetten von Bildern und Tabellen recht hoch anmunten. Hingegen haben wir den großen Vorteil, dass wir uns das Ausgabeformat beliebig aussuchen, es austauschen und verändern können. </p>
<p>Wie  aber komme ich zu einem lesbaren Ausgabeformat wie z.B. PDF? Da es sich bei DocBook um XML handelt, muss dieses transformiert, und so in die gewünschten Ausgabeformate umgewandelt werden. Wie man diese Transformation bewältigt, werde ich in meinem nächsten Eintrag erläutern.</p>
<p>Die Vorteile von DocBook nochmal zusammengefasst: </p>
<ul>
<li>Inhalt und Layout sind voneinander getrennt.</li>
<li>Es gibt (theoretisch) beliebig viele verschiedene Ausgabeformate.</li>
<li>Aus einem einzigen DocBook-Dokument lassen sich mehrere Ausgaben erzeugen.</li>
<li>XML ist standardisiert und kann gegen ein Schema validiert werden.</li>
<li>DocBook bietet alle Möglichkeiten der Erweiterbarkeit und Anpassbarkeit des Layouts.</li>
<li>DocBook kann auf vielen Plattformen betrieben werden.</li>
</ul>
<p>Die Nachteile zusammengefasst: </p>
<ul>
<li>Es gibt leider nur wenige kooperierende Tools</li>
<li>Die Akzeptanz bei Nichtprogrammieren ist eher gering.</li>
</ul>
<hr/>
Referenzen:<br />
<a href="http://de.wikipedia.org/wiki/Docbook">DocBook</a><br />
<a href="http://de.wikipedia.org/wiki/Extensible_Stylesheet_Language_%E2%80%93_Formatting_Objects">XSL:FO</a></p>
]]></content:encoded>
			<wfw:commentRss>http://brainoverloadexception.de/docbook-oder-wie-ich-zum-schreiben-kam/feed/</wfw:commentRss>
		<slash:comments>992</slash:comments>
		</item>
	</channel>
</rss>

