<?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>zInformatik &#187; Java</title>
	<atom:link href="http://zinformatik.de/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://zinformatik.de</link>
	<description>Computer, Informatik und Mikrocontroller Blog</description>
	<lastBuildDate>Fri, 23 Jul 2010 21:22:06 +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>NaturalDocs &#8211; Quelltexte natürlich dokumentieren</title>
		<link>http://zinformatik.de/programmieren/naturaldocs-quelltexte-naturlich-dokumentieren/</link>
		<comments>http://zinformatik.de/programmieren/naturaldocs-quelltexte-naturlich-dokumentieren/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 14:14:03 +0000</pubDate>
		<dc:creator>zimon</dc:creator>
				<category><![CDATA[Programmieren]]></category>
		<category><![CDATA[Ubuntuusers-Planet]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[ADA]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Dokumentation]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Makefile]]></category>
		<category><![CDATA[NaturalDocs]]></category>
		<category><![CDATA[Pascal]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[TCL]]></category>

		<guid isPermaLink="false">http://zinformatik.de/?p=1374</guid>
		<description><![CDATA[<div id="attachment_1412" class="wp-caption alignright" style="width: 205px"><a href="http://zinformatik.de/wp-content/uploads/2009/06/naturaldocs_big.png" ><img src="http://zinformatik.de/wp-content/uploads/2009/06/naturaldocs_big-195x300.png" alt="NaturalDocs Dokuementation des zBot" title="NaturalDocs Dokuementation des zBot" width="195" height="300" class="size-medium wp-image-1412" /></a><p class="wp-caption-text">NaturalDocs Dokuementation des zBot</p></div>Da mir POD/PerlDoc nicht gefällt, habe ich mich vor einiger Zeit auf die Suche nach einer Alternative gemacht und bin auf <a href="http://www.naturaldocs.org" title="NaturalDocs" target="_blank" class="liexternal">NaturalDocs</a> gestoßen. Mit diesem System können eine ganze Reihe von Programmiersprachen dokumentiert werden, wie z.B. perl, C#, c++, Makefiles, Ruby, Python, PHP, ActionScript, Java, JavaScript, Pascal, ADA,<p>&#8230;</p>]]></description>
			<content:encoded><![CDATA[<div id="attachment_1412" class="wp-caption alignright" style="width: 205px"><a href="http://zinformatik.de/wp-content/uploads/2009/06/naturaldocs_big.png" ><img src="http://zinformatik.de/wp-content/uploads/2009/06/naturaldocs_big-195x300.png" alt="NaturalDocs Dokuementation des zBot" title="NaturalDocs Dokuementation des zBot" width="195" height="300" class="size-medium wp-image-1412" /></a><p class="wp-caption-text">NaturalDocs Dokuementation des zBot</p></div>Da mir POD/PerlDoc nicht gefällt, habe ich mich vor einiger Zeit auf die Suche nach einer Alternative gemacht und bin auf <a href="http://www.naturaldocs.org" title="NaturalDocs" target="_blank" class="liexternal">NaturalDocs</a> gestoßen. Mit diesem System können eine ganze Reihe von Programmiersprachen dokumentiert werden, wie z.B. perl, C#, c++, Makefiles, Ruby, Python, PHP, ActionScript, Java, JavaScript, Pascal, ADA, TCL, &#8230;</p>
<p>Sehr schön an NaturalDocs ist, dass die Dokumentation sehr nahe an natürlichsprachlichem Plaintext ist und sich die Beschreibungen von Klassen oder Methoden auch sehr gut aus den Quellen lesen lässt ohne dass man die Syntax von NaturalDocs kennen muss. Auch einfache Textdateien wie eine Readme oder ähnliches können damit erstellt werden. So kann man (zumindest bei kleineren Projekten) sogar sämtliche Dokumente wie Anforderungen, UML-Diagramme, &#8230; mit NaturalDocs erstellen, wodurch man alle Informationen an einem Ort gebündelt und in einem einheitlichen Format vorliegen hat.</p>
<p>Das Perl-Tool versteht auch JavaDoc, so dass eine Umstellung erleichtert wird.</p>
<p>Gestartet wird NaturalDocs mittels:<br />
<code>NaturalDocs -i [input (source) directory]<br />
            -o [output format] [output directory]<br />
            -p [project directory]<br />
            [options]</code><br />
wobei ich mir ein kleines Script zum erstellen/aktualisieren der Dokumentation erstellt habe, welches ein Changelog beinhaltet, welches aus einem <code>svn log</code> automatisch generiert wird. Das Script habe ich unten angehängt.</p>
<p>Ein Beispiel in perl:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># SUB: multiplicate</span>
<span style="color: #666666; font-style: italic;"># </span>
<span style="color: #666666; font-style: italic;"># multiplicates two numbers</span>
<span style="color: #666666; font-style: italic;"># </span>
<span style="color: #666666; font-style: italic;"># PARAMETERS:</span>
<span style="color: #666666; font-style: italic;"># $a - first parameter</span>
<span style="color: #666666; font-style: italic;"># $b - second parameter</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># RETURNS:</span>
<span style="color: #666666; font-style: italic;"># the product of $a and $b</span>
<span style="color: #000000; font-weight: bold;">sub</span> multiplicate <span style="color: #009900;">&#123;</span>
    <span style="color: #0000ff;">$a</span><span style="color: #339933;">=</span><span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
    <span style="color: #0000ff;">$b</span><span style="color: #339933;">=</span><span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
    <span style="color: #000066;">return</span> <span style="color: #0000ff;">$a</span><span style="color: #0000ff;">*$b</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>So sieht die Dokumentation einer einfachen Funktion aus. Bei Sprachen die full language support besitzen (bisher perl, ActionScript und C#) kann auch eine JavDoc-artige Dokumentation genutzt werden:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;"># multiplicates two numbers</span>
<span style="color: #666666; font-style: italic;"># </span>
<span style="color: #666666; font-style: italic;"># PARAMETERS:</span>
<span style="color: #666666; font-style: italic;"># $a - first parameter</span>
<span style="color: #666666; font-style: italic;"># $b - second parameter</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># RETURNS:</span>
<span style="color: #666666; font-style: italic;"># the product of $a and $bsub multiplicate {</span>
    <span style="color: #0000ff;">$a</span><span style="color: #339933;">=</span><span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
    <span style="color: #0000ff;">$b</span><span style="color: #339933;">=</span><span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
    <span style="color: #000066;">return</span> <span style="color: #0000ff;">$a</span><span style="color: #0000ff;">*$b</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Beide Beispiele haben das selbe Ergebnis:<br />
<div id="attachment_1401" class="wp-caption aligncenter" style="width: 439px"><a href="http://zinformatik.de/wp-content/uploads/2009/06/naturaldocs.png" ><img src="http://zinformatik.de/wp-content/uploads/2009/06/naturaldocs.png" alt="NaturalDocs Beispiel" title="NaturalDocs Beispiel" width="429" height="350" class="size-full wp-image-1401" /></a><p class="wp-caption-text">NaturalDocs Beispiel</p></div>
<p>Listen können erstellt werden, indem eine Zeile mit &#8220;<code>-</code>&#8221; angefangen wird. Definitionen haben ein &#8220;<code>-</code>&#8221; zwischen Bezeichner und Definition. Es können auch Grafiken, Beispielquelltexte und ASCII-Diagramme eingefügt werden.</p>
<p>Leider kann NaturalDocs von Haus aus nicht mit Listen in Listen umgehen, doch dafür gibt es einen Patch: <a href="http://sourceforge.net/tracker/index.php?func=detail&#038;aid=1371134&#038;group_id=81796&#038;atid=564052" title="NaturalDocs Patch - Nested Bullet Lists" target="_blank" class="liexternal">Nested Bullets</a>, womit man durch <code>+</code> oder <code>*</code> eine Liste in der Liste einleitet.<br />
Installiert wird es, indem die Datei Native.pm.diff nach $NATURALDOCS_PATH/Modules/NaturalDocs/Parser Kopiert wird und dann der Befehl</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">patch</span> Native.pm Native.pm.diff</pre></div></div>

<p>aufgerufen wird.</p>
<p>Einen neuen Absatz erzwingt man durch eine Leerzeile. Eine Überschrift kann mittels <code># Überschrift:</code> eingefügt werden, wobei die Zeile darüber leer sein muss.<br />
Es kann auch auf Webseiten, Emailadressen und andere Stellen der Dokumentation verlinkt werden.<br />
Natürlich kann auch unterstrichen und fett geschrieben werden. Die Zusammenfassung wird automatisch erstellt. </p>
<p>Cool ist auch die Möglichkeit der Abkürzung, womit man mehrere Defines, Funktionen oder Variablen zusammenfassend dokumentieren kann. So kann man statt dem folgenden Code</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># VARIABLE: $configFile</span>
<span style="color: #666666; font-style: italic;"># Filename of configuration file</span>
<span style="color: #0000ff;">$configFile</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;config.txt&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># VARIABLE: $inputFile</span>
<span style="color: #666666; font-style: italic;"># Filename of input file</span>
<span style="color: #0000ff;">$inputFile</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;input.txt&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># VARIABLE: $outputFile</span>
<span style="color: #666666; font-style: italic;"># Filename of output file</span>
<span style="color: #0000ff;">$outputFile</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;out.txt&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>die Variablen für die Dateinamen zusammen fassen:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># VARIABLES: Filenames</span>
<span style="color: #666666; font-style: italic;"># $configFile - Filename of configuration file</span>
<span style="color: #666666; font-style: italic;"># $inputFile - Filename of input file</span>
<span style="color: #666666; font-style: italic;"># $outputFile - Filename of output file</span>
<span style="color: #0000ff;">$configFile</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;config.txt&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$inputFile</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;input.txt&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$outputFile</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;out.txt&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Dabei können mehrere solcher Blöcke für verschiedene Belange angelegt werden (z.B. Dateinamen, Logindaten für Datenbank, &#8230;). Das Ergebnis sieht dann so aus:<br />
<div id="attachment_1410" class="wp-caption aligncenter" style="width: 394px"><a href="http://zinformatik.de/wp-content/uploads/2009/06/naturaldocs2.png" ><img src="http://zinformatik.de/wp-content/uploads/2009/06/naturaldocs2.png" alt="NaturalDocs - Variablen zusammenfassend dokumentiert" title="NaturalDocs - Variablen zusammenfassend dokumentiert" width="384" height="195" class="size-full wp-image-1410" /></a><p class="wp-caption-text">NaturalDocs - Variablen zusammenfassend dokumentiert</p></div></p>
<p>Auch mein <a href="http://zinformatik.de/tipps-tricks/interessante-programme/zbot-ein-jabber-bot-in-perl/" title="zBot - ein Jabber Bot in Perl" target="_self" class="liinternal">Jabber Bot zBot</a> ist mit NaturalDocs dokumentiert. Als Beispiel kann man sich <a href="http://zinformatik.de/zbotdoc/index.html" title="Dokumentation zBot Version 0.2" target="_blank" class="liinternal">dessen Dokumentation</a> ansehen.</p>
<p>Für Neulinge gibt es ein schönes <a href="http://www.naturaldocs.org/documenting/walkthrough.html" title=" NaturalDocs - Walpthrough" target="_blank" class="liexternal">Walktrough</a>, wo die ersten Schritte mit NaturalDocs erklärt werden.</p>
<p>Hier noch das Script, welches eine von NaturalDocs lesbare Changelist im Ordner documents  und dann die Dokumentation selbst erstellt:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Script: makedocs.pl</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># This script generates the documentation.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Requirements:</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># - NaturalDocs path must be in ENV variable $NATURALDOCS_PATH</span>
<span style="color: #666666; font-style: italic;"># - Projectdirectory naturaldocs has to be in the same directory as this script</span>
<span style="color: #666666; font-style: italic;"># - There must be a (empty) directory documentation in the same directory as this script</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Usage:</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Just start this script when something has changed or use the script &lt;make.pl&gt;</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># &gt; tools/makedocs.pl [OPTIONS]</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Options:</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#  -o - start makedocs.pl in offline modus</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># In offlinemode the changelog is not generated</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># SVN:</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Commit only the textfiles of the projectdirectory (Not the directory &quot;Data&quot;) from NaturalDocs.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># The documentation directory should be an empty dir in SVN.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># So everybody can create the documentation by himself just by executing this script.</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> warnings<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> vars <span style="color: #000066;">qw</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">%ENV</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Sub: generatechangelog</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Generates documents/changelog.txt from svn log -v</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #000000; font-weight: bold;">sub</span> generatechangelog <span style="color: #009900;">&#123;</span>
    <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Generating changelog...n&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #0000ff;">$ENV</span><span style="color: #009900;">&#123;</span>LANG<span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;C&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$log</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">`svn log -v`</span><span style="color: #339933;">;</span> 
&nbsp;
    <span style="color: #0000ff;">$log</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/(-){2,}//g</span><span style="color: #339933;">;</span>
    <span style="color: #0000ff;">$log</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/(r[0-9]{1,4})/$1:nn$1/g</span><span style="color: #339933;">;</span>
    <span style="color: #0000ff;">$log</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/n/nn/g</span><span style="color: #339933;">;</span>
    <span style="color: #0000ff;">$log</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/Pfade:/Pfade/g</span><span style="color: #339933;">;</span>
    <span style="color: #0000ff;">$log</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/paths:/paths/g</span><span style="color: #339933;">;</span>
    <span style="color: #0000ff;">$log</span> <span style="color: #339933;">=~</span> <span style="color: #000066;">s</span><span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>A<span style="color: #339933;">-</span>Z<span style="color: #009900;">&#93;</span> <span style="color: #339933;">/</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">/-</span> <span style="color: #0000ff;">$1</span><span style="color: #339933;">/</span>g<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>DATEI<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;&gt;documents/changelog.txt&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066;">print</span> DATEI <span style="color: #ff0000;">&quot;Title: Changelognn$log&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #000066;">close</span> DATEI<span style="color: #339933;">;</span>
    <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Done.n&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">######### PROGRAM START ############</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">defined</span> <span style="color: #0000ff;">$ENV</span><span style="color: #009900;">&#123;</span>NATURALDOCS_PATH<span style="color: #009900;">&#125;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #0000ff;">$ENV</span><span style="color: #009900;">&#123;</span>NATURALDOCS_PATH<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">ne</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    generatechangelog<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #b1b100;">not</span><span style="color: #009900;">&#40;</span><span style="color: #000066;">defined</span> <span style="color: #0000ff;">@ARGV</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">eq</span> <span style="color: #ff0000;">&quot;-o&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;"># Generate documentation of current directory in HTML and save to directory documentation. Projectdirectory is naturaldocs.</span>
<span style="color: #666666; font-style: italic;"># Ignore directory tests</span>
    <span style="color: #000066;">system</span>
<span style="color: #ff0000;">&quot;$ENV{NATURALDOCS_PATH}/NaturalDocs -i . -o HTML ./documentation -p ./naturaldocs -xi ./tests&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Environment variable $NATURALDOCS_PATH not defined!n&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://zinformatik.de/programmieren/naturaldocs-quelltexte-naturlich-dokumentieren/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>StayOnline &#8211; Timeout bei Webkicks Chat verhindern</title>
		<link>http://zinformatik.de/programmieren/stayonline-timeout-bei-webkicks-chat-verhindern/</link>
		<comments>http://zinformatik.de/programmieren/stayonline-timeout-bei-webkicks-chat-verhindern/#comments</comments>
		<pubDate>Sat, 27 Dec 2008 17:57:46 +0000</pubDate>
		<dc:creator>zimon</dc:creator>
				<category><![CDATA[Programmieren]]></category>
		<category><![CDATA[Chat]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Timeout]]></category>
		<category><![CDATA[Webkicks]]></category>

		<guid isPermaLink="false">http://zinformatik.de/?p=124</guid>
		<description><![CDATA[<p>Ich hab vor einiger Zeit mal ein kleines Java-Programm geschrieben, um den Timeout beim Webkicks Chat zu umgehen. Dies möchte ich hier nun vorstellen: <strong>StayOnline</strong></p>
<div id="attachment_125" class="wp-caption alignright" style="width: 290px"><strong></strong><strong><a href="http://zinformatik.de/wp-content/uploads/2008/12/stayonline.png" ><img class="size-full wp-image-125" src="http://zinformatik.de/wp-content/uploads/2008/12/stayonline.png" alt="Das StayOnline Hauptfenster" width="280" height="130" /></a></strong><p class="wp-caption-text">Das StayOnline Hauptfenster</p></div>
<p><strong></strong></p>
<p>Bisher gab es das Bottertool, welches diesen Zweck erfüllte. Jedoch nur für Windows.</p>
<p><span class="postbody">StayOnline ist unter der <a href="http://www.fsf.org/licenses/gpl.html" title="GPL" target="_blank" class="liexternal">GPL</a> veröffentlicht und unterstützt wie</span>&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Ich hab vor einiger Zeit mal ein kleines Java-Programm geschrieben, um den Timeout beim Webkicks Chat zu umgehen. Dies möchte ich hier nun vorstellen: <strong>StayOnline</strong></p>
<div id="attachment_125" class="wp-caption alignright" style="width: 290px"><strong><strong><a href="http://zinformatik.de/wp-content/uploads/2008/12/stayonline.png" ><img class="size-full wp-image-125" src="http://zinformatik.de/wp-content/uploads/2008/12/stayonline.png" alt="Das StayOnline Hauptfenster" width="280" height="130" /></a></strong></strong><p class="wp-caption-text">Das StayOnline Hauptfenster</p></div>
<p><strong></strong></p>
<p>Bisher gab es das Bottertool, welches diesen Zweck erfüllte. Jedoch nur für Windows.</p>
<p><span class="postbody">StayOnline ist unter der <a href="http://www.fsf.org/licenses/gpl.html" title="GPL" target="_blank" class="liexternal">GPL</a> veröffentlicht und unterstützt wie das Bottertool einige Replacer (wenn auch nicht alle) und hat eine Funktion &#8220;bei Logout schließen&#8221;, die das Programm schließt, wenn keine Verbindung mehr besteht (allerdings erst, wenn die Zeit abgelaufen ist, da erst beim Senden erkannt werden kann, ob noch eine Verbindung besteht)<br />
Der Text kann jederzeit geändert werden, also auch während der Countdown läuft. </span></p>
<p><span class="postbody"><span style="font-weight: bold;">Vorraussetzungen:</span><br />
Java 1.5 oder höher kann man bei <a href="http://java.sun.com/" class="postlink" target="_blank">http://java.sun.com</a> kostenlos herunterladen (das jre). Java sollte jedoch auf den meisten Windows Systemen (und auch den meisten anderen Betriebssystemen) bereits installiert sein.<br />
</span></p>
<p><span style="font-weight: bold;">Starten des Programms:</span><br />
Unter Windows sollte ein Doppelklick genügen.<br />
Auf anderen Systemen (und wenns unter Windows nicht mit Doppelklick funktioniert) geht man in die Konsole (unter Windows:  Start -&gt; Ausführen und dann cmd eingeben)<br />
und gibt dort (im richtigen Verzeichnis, welches man mit cd wechseln kann) &#8220;java -jar stayonlinev013.jar&#8221; (ohne die &#8220;) ein.</p>
<p><span style="font-weight: bold;">Einstellungen</span></p>
<ul>
<li><span class="postbody"> Username: ist wohl klar, der Username des Webkicks Users</span></li>
<li>Link zur Message Box: hier kommt der Link zur Message Box rein. Mit rechter Maustaste auf die Message Box im Webkicks Chat klicken und &#8220;Linkadresse Kopieren&#8221; (oder entsprechendes je nach Browser) auswählen. Dann in den Einstellungen von StayOnline mit Strg+V ins entsprechende Fenster einfügen.</li>
<li>Zeit: die Zeit zwischen zwei Nachrichten in Sekunden (900 sind 15 Min)</li>
</ul>
<div id="attachment_126" class="wp-caption alignleft" style="width: 310px"><a href="http://zinformatik.de/wp-content/uploads/2008/12/stayonline_einstellungen.png" ><img class="size-medium wp-image-126" src="http://zinformatik.de/wp-content/uploads/2008/12/stayonline_einstellungen-300x171.png" alt="Einstellungen von StayOnline" width="300" height="171" /></a><p class="wp-caption-text">Einstellungen von StayOnline</p></div>
<p><span class="postbody">Die Einstellungen werden beim Starten in eine Datei data.txt ins gleiche Verzeichnis geschrieben, in der sich auch die .jar-Datei befindet. Beim erneuten Laden des Programms wird diese geladen und ausgewertet.</span></p>
<p>Hier die Replacer, wenn man diese sendet werden Sie automatisch ersetzt:</p>
<ul>
<li><span class="postbody"> $u wird ersetzt durch den Usernamen</span></li>
<li>$cnt wird durch die Anzahl der (vom Programm) gesendeten Nachrichten ersetzt</li>
<li>$ver wird durch die Version des Programmes ersetzt</li>
</ul>
<p><span class="postbody"><span style="font-weight: bold;">Quelltext selber compilieren:</span><br />
Hierfür benötigt man das Java JDK. Man entpackt die stayonline_src.zip in einen neuen Ordner und führt in diesem Ordner folgende Befehle aus: </span></p>
<blockquote>
<p style="text-align: justify;"><span class="postbody">javac *.java</span></p>
<p style="text-align: justify;">jar cvfm stayonline.jar MANIFEST.MF *.class</p>
</blockquote>
<p style="text-align: justify;"><span class="postbody"><br />
Die dabei erzeugte Datei stayonline.jar kann man nun verschieben wie man mag und wie oben beschrieben ausführen. (unter Linux sind afaik keine Rechte zum ausführen notwendig)</span></p>
<p style="text-align: justify;"><span class="postbody"><span style="font-weight: bold;">Ausführliche Anleitung</span></span></p>
<p style="text-align: justify;"><span class="postbody">Falls das jemandem zu schnell ging oder noch nicht ganz klar ist, wie man das Programm zum laufen bekommt, hier noch eine Schritt für Schritt Anleitung:</span></p>
<ol>
<li><span class="postbody"> Verzeichnis erstellen: C:ProgrammeStayOnline (kann auch wo anders sein)</span></li>
<li>Datei Herunterladen und in das Verzeichnis kopieren: <a href="http://www.webspace-invasion.com/zimon/stayonlinev013.jar" target="_blank" class="liexternal"></a><a href="http://zinformatik.de/wp-content/uploads/2008/12/stayonlinev013.jar" class="liinternal">stayonlinev013.jar</a></li>
<li>Doppelklick auf die Datei, dann auf Einstellungen klicken.</li>
<li>Im Chat mit der rechten Maustaste auf die &#8220;Message Box&#8221; klicken und &#8220;Linkadresse kopieren&#8221; (oder Sinngemäßes je nach Browser) auswählen.</li>
<li>Bei &#8220;Link zur Message Box&#8221; einfügen (Strg gedrückt halten und einmal v drücken)</li>
<li>Bei &#8220;Text&#8221; den gewünschten Text eingeben, der nach ablauf des Timers vom User im Chat gesagt werden soll</li>
<li>Gewünschte Zeit eingeben, wie lange gewartet werden soll bis der Text erneut ausgegeben wird (in Sekunden)</li>
<li>Häckchen bei &#8220;bei Logout schließen&#8221; machen</li>
<li>Auf OK klicken und dann im Hauptfenster auf Start. Fertig</li>
</ol>
<p style="text-align: justify;"><span class="postbody"> (Falls sich das Programm bei einem Doppelklick nicht öffnet:<br />
Start-&gt;Ausführen dort cmd eingeben. im MSDOS-Fenster java -jar C:ProgrammeStayOnlinestayonlinev013.jar eingeben und Enter drücken.)</span></p>
<p>Man kann nun noch eine Verknüpfung erstellen, um nicht immer in das Verzeichnis gehen zu müssen um das Programm zu starten:</p>
<ol>
<li><span class="postbody">Rechte Maustaste auf Desktop -&gt; Neu -&gt; Verknüpfung</span></li>
<li>C:Programme/Java/jre/bin/java auswählen.</li>
<li>Auf OK, bis Verknüpfung fertig ist.</li>
<li>Rechte Maustaste auf die Verknüpfung -&gt; Einstellungen</li>
<li>Den auszuführenden Befehl ändern auf: C:Programme/Java/jre/bin/java &#8211; jar  C:ProgrammeStayOnlinestayonlinev013.jar</li>
<li>Verzeichnis in dem Das Programm ausgeführt werden soll: C:ProgrammeStayOnline</li>
</ol>
<p style="text-align: justify;"><span class="postbody"> Fertig </span></p>
<p style="text-align: justify;"><span class="postbody"><br />
</span></p>
<p style="text-align: justify;"><span class="postbody"><span style="font-weight: bold;">Die Dateien</span><br />
</span></p>
<ul>
<li><span class="postbody"><a href="http://zinformatik.de/wp-content/uploads/2008/12/stayonlinev013.jar" class="liinternal">stayonlinev013.jar</a> &#8211; Die Ausführbare Date, das eigentlich Programm</span></li>
<li><span class="postbody"><a href="http://zinformatik.de/wp-content/uploads/2008/12/stayonlinev013_src.zip" class="lizip">stayonlinev013_src.zip</a> &#8211; </span>Die Quelltexte inclusive der Manifest-Datei</li>
<li><a href="http://www.webspace-invasion.com/zimon/stayonlinev012_doc.zip" class="postlink" target="_blank"></a><a href="http://zinformatik.de/wp-content/uploads/2008/12/stayonlinev013_doc.zip" class="lizip">stayonlinev013_doc.zip</a> &#8211; Die Dokumentation</li>
</ul>
<p style="text-align: justify;"><span class="postbody"> </span></p>
<div>
</div>
<p><img alt="" /><img alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://zinformatik.de/programmieren/stayonline-timeout-bei-webkicks-chat-verhindern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
