<?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>MHUs . DE</title>
	<atom:link href="http://www.mhus.de/wp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mhus.de/wp</link>
	<description></description>
	<lastBuildDate>Mon, 23 Apr 2012 12:56:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>regexeditor and xpatheditor for developers</title>
		<link>http://www.mhus.de/wp/regexeditor-and-xpatheditor-for-developers/</link>
		<comments>http://www.mhus.de/wp/regexeditor-and-xpatheditor-for-developers/#comments</comments>
		<pubDate>Mon, 23 Apr 2012 07:35:13 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[mhu-inka]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[xpath]]></category>

		<guid isPermaLink="false">http://www.mhus.de/wp/?p=438</guid>
		<description><![CDATA[Most time it&#8217;s the need to test regex or xpath expressions because of some unclear behaviours. It&#8217;s every time a journey to find a fitting tool or plugin. For this I developed a small and tiny editor. The editor is java swing driven and can only be executed &#8216;by hand&#8217;. If I have somedays the [...]]]></description>
			<content:encoded><![CDATA[<p>Most time it&#8217;s the need to test regex or xpath expressions because of some unclear behaviours. It&#8217;s every time a journey to find a fitting tool or plugin. For this I developed a small and tiny editor. The editor is java swing driven and can only be executed &#8216;by hand&#8217;. If I have somedays the possibility to create and upload releases then I will configure it for this two editors too. But in the meantime, checkout the inka svn and look into the projects &#8216;de.mhus.app.inka.regexeditor&#8217; and &#8216;de.mhus.app.inka.xpathedior&#8217;. Compile it or execute in eclipse the class &#8216;RegEditor&#8217; or &#8216;XPathEditor&#8217;.</p>
<p><a href="http://www.mhus.de/wp/regexeditor-and-xpatheditor-for-developers/de-mhu-lib-apps-regexeditor-reg/" rel="attachment wp-att-439"><img class="alignnone size-medium wp-image-439" title="de.mhu.lib.apps.regexeditor.Reg" src="http://www.mhus.de/wp/wp-content/uploads/de.mhu_.lib_.apps_.regexeditor.Reg_-274x300.png" alt="" width="274" height="300" /></a><a href="http://www.mhus.de/wp/regexeditor-and-xpatheditor-for-developers/de-mhus-app-inka-xpatheditor-xp/" rel="attachment wp-att-440"><img class="alignnone size-medium wp-image-440" title="de.mhus.app.inka.xpatheditor.XP" src="http://www.mhus.de/wp/wp-content/uploads/de.mhus_.app_.inka_.xpatheditor.XP_-273x300.png" alt="" width="273" height="300" /></a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mhus.de/wp/regexeditor-and-xpatheditor-for-developers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developing Vaadin with Maven in Eclipse</title>
		<link>http://www.mhus.de/wp/developing-vaadin-with-maven-in-eclipse/</link>
		<comments>http://www.mhus.de/wp/developing-vaadin-with-maven-in-eclipse/#comments</comments>
		<pubDate>Thu, 05 Apr 2012 23:23:36 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[eclipse]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[vaadin]]></category>

		<guid isPermaLink="false">http://www.mhus.de/wp/?p=428</guid>
		<description><![CDATA[After a while googling around and a hand full of tests I can present the solution. First of all the main information I got from the vaadin wiki. It explains how to create different vaadin projects in the console. To do the same with eclipse create a new maven project. Do not use &#8216;Create a [...]]]></description>
			<content:encoded><![CDATA[<p>After a while googling around and a hand full of tests I can present the solution. First of all the main information I got from the <a href="https://vaadin.com/wiki/-/wiki/Main/Using%20Vaadin%20with%20Maven" target="_blank">vaadin w</a>iki. It explains how to create different vaadin projects in the console. To do the same with eclipse create a new maven project. Do not use &#8216;Create a simple project&#8217; and click &#8216;Next&#8217;. Now you see a list of archetypes. Click &#8216;Add Archetype &#8230;&#8217; and insert the information from the console command:</p>
<p><a href="http://www.mhus.de/wp/developing-vaadin-with-maven-in-eclipse/add-archetype/" rel="attachment wp-att-429"><img class="alignnone size-medium wp-image-429" title="Add Archetype" src="http://www.mhus.de/wp/wp-content/uploads/Add-Archetype-300x175.png" alt="" width="300" height="175" /></a></p>
<p>Select the new archetype and that&#8217;s it.</p>
<p><span id="more-428"></span></p>
<p>Here the list of possible archetypes (out of the documentation):</p>
<p>Simple and empty project</p>
<pre>mvn archetype:generate \
-DarchetypeGroupId=com.vaadin \
-DarchetypeArtifactId=vaadin-archetype-clean \
-DarchetypeVersion=LATEST \
-DgroupId=your.company \
-DartifactId=project-name \
-Dversion=1.0 \
-Dpackaging=war</pre>
<p>Sample vaadin project</p>
<pre>mvn archetype:generate \
-DarchetypeGroupId=com.vaadin \
-DarchetypeArtifactId=vaadin-archetype-sample \
-DarchetypeVersion=LATEST \
-DgroupId=your.company \
-DartifactId=project-name \
-Dversion=1.0.0 \
-Dpackaging=war</pre>
<div> Vaadin widget project</div>
<div>
<pre>mvn archetype:generate \
-DarchetypeGroupId=com.vaadin \
-DarchetypeArtifactId=vaadin-archetype-widget \
-DarchetypeVersion=LATEST \
-DgroupId=your.company \
-DartifactId=vaadin02 \
-Dversion=1.0 \
-Dpackaging=war</pre>
</div>
<pre></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.mhus.de/wp/developing-vaadin-with-maven-in-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developing eclipse plugins with maven dependencies</title>
		<link>http://www.mhus.de/wp/developing-eclipse-plugins-with-maven-dependencies/</link>
		<comments>http://www.mhus.de/wp/developing-eclipse-plugins-with-maven-dependencies/#comments</comments>
		<pubDate>Fri, 30 Mar 2012 20:37:54 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[eclipse]]></category>

		<guid isPermaLink="false">http://www.mhus.de/wp/?p=415</guid>
		<description><![CDATA[Im developing eclipse plugins and on the other hand libraries with maven to handle dependencies easy. But how can I link my libraries into my eclipse environment. Ok, I can copy it into the eclipse project. But that&#8217;s not really the idea of dependency management. The next tool I fond was Tycho. A plugin for [...]]]></description>
			<content:encoded><![CDATA[<p>Im developing eclipse plugins and on the other hand libraries with maven to handle dependencies easy. But how can I link my libraries into my eclipse environment. Ok, I can copy it into the eclipse project. But that&#8217;s not really the idea of dependency management. The next tool I fond was <a href="http://www.sonatype.org/tycho" target="_blank">Tycho</a>. A plugin for maven to bring eclipse and maven together. But it looks like Tycho is only focusing to RCP products. Maybe this will change but it didn&#8217;t help me at the moment.</p>
<p>So I started to develop a simple solution with existing tools. First question was how to bring maven handled files to out of the repository. I found a <a href="http://maven.apache.org/ant-tasks/index.html" target="_blank">ant task plugin</a> to handle maven out of ant. That&#8217;s done and working.</p>
<p><span id="more-415"></span>Second question is what I have to manipulate in the eclipse project to register the found jar files as part of the project / eclipse plugin definition. I found three files where I have to manipulate the structure. First one is the .classpath file. It&#8217;s a xml file with the references to the parts of the class path. Second file it META-INF/MANIFEST.MF. It&#8217;s in a java manifest style and contains the &#8216;Bundle-ClassPath&#8217; that&#8217;s the libraries which part of the plugin. This is also defined in the file build.properties. It&#8217;s a properties file with the same information.</p>
<p>And that&#8217;s the plan:</p>
<ol>
<li>Create an ant task to be triggered on build time of the project</li>
<li>The ant task should copy the dependencies out of the maven repository in a local directory</li>
<li>Parse the directory and find all jar files</li>
<li>Manipulate the manifest file</li>
<li>Manipulate the build.properties</li>
<li>Manipulate the .classpath file</li>
<li>Refresh the eclipse virtual filesystem</li>
</ol>
<p>Looks like it will be a long night <img src='http://www.mhus.de/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The first point is easy. Create a empty file auto build.xml and auto build.properties in the root of the project. Open the properties of the project and create a new builder:</p>
<p><a href="http://www.mhus.de/wp/developing-eclipse-plugins-with-maven-dependencies/properties-for-de-mhus-cap-driver/" rel="attachment wp-att-416"><img class="alignnone size-medium wp-image-416" title="Properties for de.mhus.cap.driver - before new autoloader" src="http://www.mhus.de/wp/wp-content/uploads/Properties-for-de.mhus_.cap_.driver-300x262.png" alt="" width="300" height="262" /></a></p>
<p>Click on &#8216;New&#8217;:</p>
<p><a href="http://www.mhus.de/wp/developing-eclipse-plugins-with-maven-dependencies/choose-configuration-type/" rel="attachment wp-att-417"><img class="alignnone size-thumbnail wp-image-417" title="Choose configuration type" src="http://www.mhus.de/wp/wp-content/uploads/Choose-configuration-type-150x150.png" alt="" width="150" height="150" /></a></p>
<p>And double-click &#8216;Ant builder&#8217;. The configuration form opens:</p>
<p><a href="http://www.mhus.de/wp/developing-eclipse-plugins-with-maven-dependencies/edit-configuration/" rel="attachment wp-att-418"><img class="alignnone size-medium wp-image-418" title="Edit Configuration" src="http://www.mhus.de/wp/wp-content/uploads/Edit-Configuration-300x247.png" alt="" width="300" height="247" /></a></p>
<p>Select your &#8216;autobuild.xml&#8217; file in your project and your project as the base directory. Finish the form thigh an &#8216;OK&#8217;.</p>
<p><a href="http://www.mhus.de/wp/developing-eclipse-plugins-with-maven-dependencies/properties-for-de-mhus-cap-driver-2/" rel="attachment wp-att-419"><img class="alignnone size-medium wp-image-419" title="Properties for de.mhus.cap.driver - after new auto build" src="http://www.mhus.de/wp/wp-content/uploads/Properties-for-de.mhus_.cap_.driver1-300x266.png" alt="" width="300" height="266" /></a></p>
<p>Move your new created builder to the top of the list. That&#8217;s it. We have now a custom build script. To complete the task open the auto build.xml file and fill it with a ant skeleton like this:</p>
<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;project name="CAO-DRIVER" default="main"&gt;
&lt;property file="autobuild.properties" /&gt;
&lt;!-- The Main Task --&gt;
    &lt;target name="main"&gt;
    &lt;mkdir dir="libs"/&gt;
    &lt;/target&gt;
&lt;/project&gt;</pre>
<p>I already add the first thing todo. I created the directory &#8216;libs&#8217; in the root of the project. You can try the builder if you select in the menu &#8216;Project &gt; Clean&#8217;. Refresh the project (F5) to see the new created folder.</p>
<p>Next step is to copy the maven dependencies into the &#8216;libs&#8217; folder. After studying the <a href="http://maven.apache.org/ant-tasks/index.html" target="_blank">Maven Ant Task</a> documentation I created a folder &#8216;antlibs&#8217; in the root of the project (in my case in the root of a sibling project) and drop the binaries there &#8216;maven-ant-tasks-2.1.3.jar&#8217;.</p>
<p>Now extend the ant definition file (is the wording &#8216;ant script&#8217; ok?). First declare the new tasks, I put this in the head of the file:</p>
<p>&lt;path id=&#8221;maven-ant-tasks.classpath&#8221; path=&#8221;../de.mhus.cap.libs/antlibs/maven-ant-tasks-2.1.3.jar&#8221; /&gt;<br />
&lt;typedef resource=&#8221;org/apache/maven/artifact/ant/antlib.xml&#8221; uri=&#8221;antlib:org.apache.maven.artifact.ant&#8221; classpathref=&#8221;maven-ant-tasks.classpath&#8221; /&gt;</p>
<div>And extend the &lt;project&gt; tag with:</div>
<div>
<pre>xmlns:artifact="antlib:org.apache.maven.artifact.ant"</pre>
</div>
<p>Now I can use the maven tasks. And create a new target for it, called &#8216;getMavenLibs&#8217;:</p>
<pre>&lt;target name="getMavenLibs"&gt;
  &lt;artifact:dependencies filesetId="dependency.fileset" useScope="runtime"&gt;
  &lt;!-- Your dependency definitions go here --&gt;
    &lt;dependency groupId="de.mhus.cao" artifactId="cao-fs" version="${CAO_DRIVER_VERSION}"&gt;
      &lt;exclusion groupId="de.mhus.lib" artifactId="core" /&gt;
    &lt;/dependency&gt;
  &lt;/artifact:dependencies&gt;
  &lt;copy todir="libs"&gt;
    &lt;fileset refid="dependency.fileset" /&gt;
    &lt;!-- This mapper strips off all leading directory information --&gt;
    &lt;mapper type="flatten" /&gt;
  &lt;/copy&gt;
&lt;/target&gt;</pre>
<p>I copied the most parts of my definitions out of the documentation and modified it. In this example I define the dependency to &#8216;de.mhus.cao.cao-fs&#8217; with a version label. I also denied a special dependency to use. This is very helpful if (A) the dependency is already defined by another linked project (B) Its already in the prugin dependencies (C) The dependency is not important. Feel free to extend the definition to add more dependencies (Outlook: Maybe it would be nice of the list of dependencies is defined in the properties file. This will make it more easier).</p>
<p>Now we have the hole bundle of jars in the &#8216;libs&#8217; folder and can start digging into the eclipse configuration files.</p>
<p>First change the manifest file. ant itself contains a task to manipulate it by default. Let&#8217;s do it:</p>
<pre>&lt;manifest file="META-INF/MANIFEST.MF" mode="update"&gt;
  &lt;attribute name="Bundle-ClassPath" value=".,${libs.project}" /&gt;
&lt;/manifest&gt;</pre>
<p>But in the attribute &#8216;libs.project&#8217; we need a comma separated list of the jar files. Read the file list and build the string:</p>
<pre>  &lt;pathconvert property="libs.project" pathsep=","&gt;
    &lt;mapper&gt;
      &lt;chainedmapper&gt;
        &lt;!-- remove absolute path --&gt;
        &lt;flattenmapper /&gt;
        &lt;!-- add lib/ prefix --&gt;
        &lt;globmapper from="*" to="libs/*" /&gt;
      &lt;/chainedmapper&gt;
    &lt;/mapper&gt;
    &lt;path&gt;
      &lt;!-- lib.home contains all jar files, in several subdirectories --&gt;
      &lt;fileset dir="libs"&gt;
        &lt;include name="**/*.jar" /&gt;
      &lt;/fileset&gt;
    &lt;/path&gt;
  &lt;/pathconvert&gt;</pre>
<p>Got it!</p>
<p>And now the same for the build.properties. Manipulate it and set the same &#8211; comma separated &#8211; list as value for the key &#8216;bin.includes&#8217;.</p>
<pre>&lt;propertyfile file="build.properties"&gt;
     &lt;entry key="bin.includes" type="string" value="META-INF/,.,${libs.project}" /&gt;
&lt;/propertyfile&gt;</pre>
<p>That was simple. But now the problem. How to manipulate a xml file!</p>
<p>I found the library &#8216;xmltask&#8217; to handle that job. Thanks to the developers. Ok, download and put it also into the folder &#8216;antlibs&#8217;. Declare the ant task to use it, append the following lines into the head of the ant definition file:</p>
<pre>&lt;path id="xmltask.classpath" path="../de.mhus.cap.libs/antlibs/xmltask.jar" /&gt;
&lt;taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask" classpathref="xmltask.classpath"/&gt;</pre>
<p>And start manipulating the .classpath entries. First remove all entries pointing into the &#8216;libs&#8217; directory. That&#8217;s done by a xpath query and the remove order. And then append all libs. To add the libs another string with libs entries is needed, so do it a second time:</p>
<pre>  &lt;pathconvert property="libs.project.xml" pathsep=""&gt;
    &lt;mapper&gt;
      &lt;chainedmapper&gt;
        &lt;!-- remove absolute path --&gt;
        &lt;flattenmapper /&gt;
        &lt;!-- add lib/ prefix --&gt;
        &lt;globmapper from="*" to="&amp;lt;classpathentry kind=&amp;quot;lib&amp;quot; path=&amp;quot;libs/*&amp;quot;/&amp;gt;" /&gt;
      &lt;/chainedmapper&gt;
    &lt;/mapper&gt;
    &lt;path&gt;
      &lt;!-- lib.home contains all jar files, in several subdirectories --&gt;
      &lt;fileset dir="libs"&gt;
        &lt;include name="**/*.jar" /&gt;
      &lt;/fileset&gt;
    &lt;/path&gt;
  &lt;/pathconvert&gt;</pre>
<p>Now the xml task:</p>
<pre>&lt;xmltask outputter="simple" source=".classpath" dest=".classpath"&gt;
&lt;remove path="classpath/classpathentry[@kind='lib' and starts-with(@path,'libs/')]" /&gt;
&lt;insert path="classpath" xml="${libs.project.xml}"/&gt;
&lt;/xmltask&gt;</pre>
<p>Wasn&#8217;t that easy? <img src='http://www.mhus.de/wp/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>And as sugar refresh the eclipse resources:</p>
<pre>     &lt;eclipse.refreshLocal resource="${PROJECT}"/&gt;</pre>
<p>The solution is working very well in my eclipse plugins and also starting r building the project will trigger the auto build script. Most times if no library is changed the script is doing nearly nothing because it will only copy changed files in the local logs folder. I using subversion and set the libs folder to svn:ignore to exclude the libraries out of the repository. Have fun &#8230;</p>
<p>And now the hole file as example (autobuild.properties):</p>
<pre>PROJECT=de.mhus.cap.driver
CAO_DRIVER_VERSION=0.0.1-SNAPSHOT</pre>
<p>(autobuild.xml):</p>
<div>
<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;project name="CAO-DRIVER" default="main" xmlns:artifact="antlib:org.apache.maven.artifact.ant"&gt;
&lt;property file="autobuild.properties" /&gt;
&lt;path id="maven-ant-tasks.classpath" path="../de.mhus.cap.libs/antlibs/maven-ant-tasks-2.1.3.jar" /&gt;
&lt;typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="antlib:org.apache.maven.artifact.ant" classpathref="maven-ant-tasks.classpath" /&gt;
&lt;path id="xmltask.classpath" path="../de.mhus.cap.libs/antlibs/xmltask.jar" /&gt;
&lt;taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask" classpathref="xmltask.classpath"/&gt;
&lt;!-- The Main Task --&gt;
    &lt;target name="main"&gt;
    &lt;mkdir dir="libs"/&gt;
        &lt;antcall target="getMavenLibs"/&gt;
    &lt;antcall target="updateConfigurations"/&gt;
    &lt;eclipse.refreshLocal resource="${PROJECT}"/&gt;
    &lt;/target&gt;
&lt;!-- Update MANIFEST.MF, build.properties and .classpath file to configure the new jar files --&gt;
&lt;target name="updateConfigurations"&gt;
&lt;!-- create a property containing all .jar files, prefix lib/, and seperated with a space --&gt;
  &lt;pathconvert property="libs.project" pathsep=","&gt;
    &lt;mapper&gt;
      &lt;chainedmapper&gt;
        &lt;!-- remove absolute path --&gt;
        &lt;flattenmapper /&gt;
        &lt;!-- add lib/ prefix --&gt;
        &lt;globmapper from="*" to="libs/*" /&gt;
      &lt;/chainedmapper&gt;
    &lt;/mapper&gt;
    &lt;path&gt;
      &lt;!-- lib.home contains all jar files, in several subdirectories --&gt;
      &lt;fileset dir="libs"&gt;
        &lt;include name="**/*.jar" /&gt;
      &lt;/fileset&gt;
    &lt;/path&gt;
  &lt;/pathconvert&gt;
&lt;manifest file="META-INF/MANIFEST.MF" mode="update"&gt;
&lt;attribute name="Bundle-ClassPath" value=".,${libs.project}" /&gt;
&lt;/manifest&gt;
&lt;propertyfile file="build.properties"&gt;
      &lt;entry key="bin.includes" type="string" value="META-INF/,.,${libs.project}" /&gt;
    &lt;/propertyfile&gt;
  &lt;pathconvert property="libs.project.xml" pathsep=""&gt;
    &lt;mapper&gt;
      &lt;chainedmapper&gt;
        &lt;!-- remove absolute path --&gt;
        &lt;flattenmapper /&gt;
        &lt;!-- add lib/ prefix --&gt;
        &lt;globmapper from="*" to="&amp;lt;classpathentry kind=&amp;quot;lib&amp;quot; path=&amp;quot;libs/*&amp;quot;/&amp;gt;" /&gt;
      &lt;/chainedmapper&gt;
    &lt;/mapper&gt;
    &lt;path&gt;
      &lt;!-- lib.home contains all jar files, in several subdirectories --&gt;
      &lt;fileset dir="libs"&gt;
        &lt;include name="**/*.jar" /&gt;
      &lt;/fileset&gt;
    &lt;/path&gt;
  &lt;/pathconvert&gt;
&lt;xmltask outputter="simple" source=".classpath" dest=".classpath"&gt;
&lt;remove path="classpath/classpathentry[@kind='lib' and starts-with(@path,'libs/')]" /&gt;
&lt;insert path="classpath" xml="${libs.project.xml}"/&gt;
&lt;/xmltask&gt;
&lt;/target&gt;</pre>
<pre> &lt;!-- Copy the dependencies into the libs directory --&gt;
   &lt;target name="getMavenLibs"&gt;
    &lt;artifact:dependencies filesetId="dependency.fileset" useScope="runtime"&gt;
      &lt;!-- Your dependency definitions go here --&gt;
    &lt;dependency groupId="de.mhus.cao" artifactId="cao-fs" version="${CAO_DRIVER_VERSION}"&gt;
    &lt;exclusion groupId="de.mhus.lib" artifactId="core" /&gt;
    &lt;/dependency&gt;
    &lt;/artifact:dependencies&gt;
    &lt;copy todir="libs"&gt;
      &lt;fileset refid="dependency.fileset" /&gt;
      &lt;!-- This mapper strips off all leading directory information --&gt;
      &lt;mapper type="flatten" /&gt;
    &lt;/copy&gt;
    &lt;/target&gt;
&lt;/project&gt;</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.mhus.de/wp/developing-eclipse-plugins-with-maven-dependencies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mhu-lib: DynamicClassLoader</title>
		<link>http://www.mhus.de/wp/mhu-lib-dynamicclassloader/</link>
		<comments>http://www.mhus.de/wp/mhu-lib-dynamicclassloader/#comments</comments>
		<pubDate>Thu, 29 Mar 2012 09:46:02 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[mhu-lib]]></category>

		<guid isPermaLink="false">http://www.mhus.de/wp/?p=403</guid>
		<description><![CDATA[mhu-lib contains a flexible class loader which should be explained deeper. The class loader is constructed to allow protect and to extend the java code in runtime. In fact this could be dangerous in some cases if you replace libraries which are used just in this moment. You should have this in mind if you [...]]]></description>
			<content:encoded><![CDATA[<p>mhu-lib contains a flexible class loader which should be explained deeper. The class loader is constructed to allow protect and to extend the java code in runtime. In fact this could be dangerous in some cases if you replace libraries which are used just in this moment. You should have this in mind if you use this class loader.</p>
<p>The class loader can be filled with two kind information: First with resources and second with rules.</p>
<p><span id="more-403"></span></p>
<p>The resources are binary resources for classes. You can add IResourceProvider to the class loader. It will stored in a &#8216;List&#8217; and you can manipulate the list with the methods add(), remove() and clear(). The order you add it to the list is the order the class loader will find the binaries in the resources. Overlapping resources will hide each other.</p>
<p>Known implementations are &#8216;ZipResourceProvider&#8217; to append jar files and &#8216;PathResourceProvider&#8217; to append file paths with classes.</p>
<p>The rules will change the behaviour of the loader if it finds a class also in it&#8217;s parent class loader. The dynamic class loader can load a class from it&#8217;s parent and  own it self. This means a class will duplicated by the dynamic class loader. The benefit is the new class is loading new classes in with the same class loader. The problem: The two twins are not compatible and can&#8217;t be cast to each other. Be aware not to duplicate interface classes and you can handle this problem.</p>
<p>The first step is to define the default rule. Set it by calling &#8216;setDefaultRule()&#8217;. The options are:</p>
<ul>
<li>NEXT: Search the resources. If it&#8217;s found create and own it, if not ask the parent class loader (default option)</li>
<li>OWN: Find the class by the parent and duplicate it (owner by this class loader)</li>
<li>FORWARD: Ask the parent to create the class (owned by another class loader)</li>
</ul>
<p>Now you can create rules to manipulate the behaviour for classes in packages. Info: The classes starting with java.* and javax.* can&#8217;t be created by other class loader than the system class loader. The dynamic class loader has attention to this fact and do not own classes in this packages. Set the rules by calling the method &#8216;setRules()&#8217; this will set all rules and cleanup other configurations or &#8216;addRule()&#8217; to append a single rule.</p>
<p>You set a list of &#8216;Rule&#8217; classes. The Rule can be extended if you need special behaviour but the default implementation will compare the class name with a pattern (file system like with ! and *) and if it match return the result.</p>
<p>For example you like to use another version of a mysql driver than included in the current environment. Then you have to add the jar resource of the mysql driver and set a rule to own the classes by this name.</p>
<pre class="brush: java">
loader.add(new ZipResourceProvider(new File(&quot;foo/mysql.jar&quot;)));
loader.addRule(new Rule(&quot;com.mysql.jdbc.*&quot;,RESULT.OWN));
</pre>
<p>And do not use the JDBC Factory to create the Driver. Use a &#8216;MActivator&#8217; for it</p>
<pre class="brush: java">
MActivator activator = new MActivator(loader);
java.sql.Driver driver = activator.createObject(&quot;com.mysql.jdbc.Driver&quot;);

java.util.Properties info = new java.util.Properties();
info.put(&quot;user&quot;, user);
info.put(&quot;password&quot;, password);

Connection con = driver.connect(url, info);
</pre>
<h3>Automatic Configuration</h3>
<p>The DynamicClassLoader can be configured by a configuration object IConfig. The class loader has the following tags:</p>
<ul>
<li><strong>resource</strong>: Append a resource to the class loader. Use the attribute &#8216;path&#8217; for a file path or &#8216;jar&#8217; for a jar file</li>
<li><strong>rules</strong>: This tag can append a set of rules. Inside this tag can be a collection of &#8216;rule&#8217; tags. Use the attribute &#8216;default&#8217; sets the default rule. valid strings are &#8216;own&#8217;, &#8216;next&#8217; and &#8216;forward&#8217;.</li>
<li><strong>rule</strong>: Inside of the tag &#8216;rules&#8217; define a single rule. The attribute &#8216;pattern&#8217; define the pattern and the attribute &#8216;result&#8217; the action &#8216;own&#8217;, &#8216;next&#8217; or &#8216;forward&#8217;.</li>
</ul>
<p>Example (following the example above):</p>
<p>&lt;classpath&gt;<br />
&lt;resource jar=&#8217;foo/mysql.jar&#8217;/&gt;<br />
&lt;rules default=&#8217;next&#8217;&gt;<br />
&lt;rule pattern=&#8217;com.mysql.jdbc.*&#8217; result=&#8217;own&#8217;/&gt;<br />
&lt;/rules&gt;<br />
&lt;/classpath&gt;</p>
<pre class="brush: java">
loader = new DynamicClassLoader();
loader.doSetupFromConfig(config.getConfig(&quot;classpath&quot;));
</pre>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mhus.de/wp/mhu-lib-dynamicclassloader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maven: Install also the Sources &#8211; Reminder</title>
		<link>http://www.mhus.de/wp/maven-install-also-the-sources-reminder/</link>
		<comments>http://www.mhus.de/wp/maven-install-also-the-sources-reminder/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 10:31:07 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://www.mhus.de/wp/?p=338</guid>
		<description><![CDATA[Ok, this short reminder how to configure maven also to install the source package in starting &#8216;mvn install&#8217;. Add this part to the pom.xml: &#60;build&#62; &#60;plugins&#62; &#60;plugin&#62; &#60;groupId&#62;org.apache.maven.plugins&#60;/groupId&#62; &#60;artifactId&#62;maven-source-plugin&#60;/artifactId&#62; &#60;version&#62;2.1.2&#60;/version&#62; &#60;executions&#62; &#60;execution&#62; &#60;id&#62;attach-sources&#60;/id&#62; &#60;phase&#62;verify&#60;/phase&#62; &#60;goals&#62; &#60;goal&#62;jar-no-fork&#60;/goal&#62; &#60;/goals&#62; &#60;/execution&#62; &#60;/executions&#62; &#60;/plugin&#62; &#60;/plugins&#62; &#60;/build&#62;]]></description>
			<content:encoded><![CDATA[<p>Ok, this short reminder how to configure maven also to install the source package in starting &#8216;mvn install&#8217;. Add this part to the pom.xml:</p>
<pre class="brush: xml">
&lt;build&gt;
    &lt;plugins&gt;
      &lt;plugin&gt;
        &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
        &lt;artifactId&gt;maven-source-plugin&lt;/artifactId&gt;
        &lt;version&gt;2.1.2&lt;/version&gt;
        &lt;executions&gt;
          &lt;execution&gt;
            &lt;id&gt;attach-sources&lt;/id&gt;
            &lt;phase&gt;verify&lt;/phase&gt;
            &lt;goals&gt;
              &lt;goal&gt;jar-no-fork&lt;/goal&gt;
            &lt;/goals&gt;
          &lt;/execution&gt;
        &lt;/executions&gt;
      &lt;/plugin&gt;
    &lt;/plugins&gt;
  &lt;/build&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.mhus.de/wp/maven-install-also-the-sources-reminder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mhu-aqua development is stopped</title>
		<link>http://www.mhus.de/wp/mhu-aqua-development-is-stopped/</link>
		<comments>http://www.mhus.de/wp/mhu-aqua-development-is-stopped/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 20:47:38 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[mhu-aqua]]></category>

		<guid isPermaLink="false">http://www.mhus.de/wp/?p=321</guid>
		<description><![CDATA[Looks like the mhu-aqua development makes no more sense. After a deep look into other CMS I think about closing this project. The main reason is the less manpower in this project. My focus is in developing mhu-hair and mhu-lib. To have a portal or CMS I think about using liferay or sling as basis. [...]]]></description>
			<content:encoded><![CDATA[<p>Looks like the mhu-aqua development makes no more sense. After a deep look into other CMS I think about closing this project. The main reason is the less manpower in this project. My focus is in developing mhu-hair and mhu-lib. To have a portal or CMS I think about using liferay or sling as basis. This will have the effect to work with the community and to participate from the knowledge and manpower of the rest of the world.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mhus.de/wp/mhu-aqua-development-is-stopped/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Howto show the CQ5 /content folder in CRXDE</title>
		<link>http://www.mhus.de/wp/howto-show-the-cq5-content-folder-in-crxde/</link>
		<comments>http://www.mhus.de/wp/howto-show-the-cq5-content-folder-in-crxde/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 15:25:08 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[cq5]]></category>

		<guid isPermaLink="false">http://www.mhus.de/wp/?p=280</guid>
		<description><![CDATA[Open CRX and connect to your repository. Select the path &#8216;/etc/crxde/profiles/default&#8217;. Now you can see the property &#8216;crxde:paths&#8217; in the properties view. Open id and add the path &#8216;/content&#8217; In my case I had to refresh the hole content in the &#8216;Package Explorer&#8217; to see the new paths in the &#8216;Navigator&#8217;: Select the repository and [...]]]></description>
			<content:encoded><![CDATA[<p>Open CRX and connect to your repository. Select the path &#8216;/etc/crxde/profiles/default&#8217;.</p>
<p><a href="http://www.mhus.de/wp/?attachment_id=301" rel="attachment wp-att-301"><img class="alignnone size-full wp-image-301" title="CRXDE" src="http://www.mhus.de/wp/wp-content/uploads/CRXDE3.png" alt="" width="228" height="106" /></a></p>
<p>Now you can see the property &#8216;crxde:paths&#8217; in the properties view. Open id and add the path &#8216;/content&#8217;</p>
<p><a href="http://www.mhus.de/wp/?attachment_id=302" rel="attachment wp-att-302"><img class="alignnone size-medium wp-image-302" title="CRXDE" src="http://www.mhus.de/wp/wp-content/uploads/CRXDE4-300x204.png" alt="" width="300" height="204" /></a></p>
<p>In my case I had to refresh the hole content in the &#8216;Package Explorer&#8217; to see the new paths in the &#8216;Navigator&#8217;:</p>
<p><a href="http://www.mhus.de/wp/?attachment_id=304" rel="attachment wp-att-304"><img class="alignnone size-full wp-image-304" title="CRXDE" src="http://www.mhus.de/wp/wp-content/uploads/CRXDE5.png" alt="" width="251" height="87" /></a></p>
<p>Select the repository and press F5.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mhus.de/wp/howto-show-the-cq5-content-folder-in-crxde/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enabling logging in UCF client</title>
		<link>http://www.mhus.de/wp/enabling-logging-in-ucf-client/</link>
		<comments>http://www.mhus.de/wp/enabling-logging-in-ucf-client/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 13:37:25 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Documentum]]></category>

		<guid isPermaLink="false">http://www.mhus.de/wp/?p=275</guid>
		<description><![CDATA[This is a short manual how to enable logging on Documentum UCF client. Use the UCF one time to install the UCF files on local system (e.g. Export a file) Open File Explorer and navigate to C:\Users\&#60;User&#62;\Documentum\ucf-java\&#60;Hostname&#62;\shared\config Open the file &#8216;ucf.client.config.xml&#8217; for editing Navigate to the option &#8216;tracing.enabled&#8217; and change the value from &#8216;false&#8217; to &#8216;true&#8217; [...]]]></description>
			<content:encoded><![CDATA[<p>This is a short manual how to enable logging on Documentum UCF client.</p>
<ol>
<li>Use the UCF one time to install the UCF files on local system (e.g. Export a file)</li>
<li>Open File Explorer and navigate to C:\Users\&lt;User&gt;\Documentum\ucf-java\&lt;Hostname&gt;\shared\config</li>
<li>Open the file &#8216;ucf.client.config.xml&#8217; for editing</li>
<li>Navigate to the option &#8216;tracing.enabled&#8217; and change the value from &#8216;false&#8217; to &#8216;true&#8217;</li>
<li>Open the file &#8216;ucf.client.logging.properties&#8217; for editing</li>
<li>Change the line &#8216;.level=WARNING&#8217; to full logging: &#8216;.level=FINEST&#8217;</li>
<li>Open the task manager and kill the UCF java process</li>
<li>Perform a new UCF activity like export or check out</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.mhus.de/wp/enabling-logging-in-ucf-client/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac Performance Problems After 1,5 Years</title>
		<link>http://www.mhus.de/wp/mac-performance-problems-after-15-years/</link>
		<comments>http://www.mhus.de/wp/mac-performance-problems-after-15-years/#comments</comments>
		<pubDate>Wed, 12 Oct 2011 07:33:09 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[iDefrag]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://www.mhus.de/wp/?p=262</guid>
		<description><![CDATA[In the last week I recognised a more and more performance problems. The problems are shown as a beach ball every time I do something. Looks like while the beach ball are shown every application hangs. Activity Monitor shown no running process over 80% CPU and memory was also ok. So I suppose the I/O [...]]]></description>
			<content:encoded><![CDATA[<p>In the last week I recognised a more and more performance problems. The problems are shown as a beach ball every time I do something. Looks like while the beach ball are shown every application hangs. Activity Monitor shown no running process over 80% CPU and memory was also ok. So I suppose the I/O could be the problem. A HD check shows problems on the filesystem.</p>
<p>Lucky I created the Lion start CD at installation time (after it thats not easy possible), so I can start from CD and repair the root HD. But that was no big win. Searching the web I found out that it is possible to defray the drive and so optimise the performance. Depressed I buy the tool iDefrag for 27 EUR, hoping I do not waste my money. After roaring a night my drive was tidy and the performance is also back.</p>
<p>Very happy now I wondering why OSX not bring a defray tool out of the box. The performance was really very bad and this is not what I understand about quality. A clever OS would cleanup in the background and use the idle time to help me have a nice and well working environment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mhus.de/wp/mac-performance-problems-after-15-years/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WebPublisher 6.5 SP 4 P08 &#8211; summary</title>
		<link>http://www.mhus.de/wp/webpublisher-6-5-sp-4-p08-summary/</link>
		<comments>http://www.mhus.de/wp/webpublisher-6-5-sp-4-p08-summary/#comments</comments>
		<pubDate>Wed, 15 Jun 2011 14:27:58 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Documentum]]></category>

		<guid isPermaLink="false">http://www.mhus.de/wp/?p=257</guid>
		<description><![CDATA[In the last few weeks we tried to install or migrate from an older version to WebPublisher 6.5 SP4 P08. We also migrate the CS to this version. Not the actual because we thought it would be a good idea to choose the same version line. But in fact this was a serious mistake. It [...]]]></description>
			<content:encoded><![CDATA[<p>In the last few weeks we tried to install or migrate from an older version to WebPublisher 6.5 SP4 P08. We also migrate the CS to this version. Not the actual because we thought it would be a good idea to choose the same version line. But in fact this was a serious mistake.</p>
<p>It looks like the WP 6.5 P08 is in real a 6.6 version. Only internal policy deny the label 6.6.</p>
<p>I have two hints for that statement. First the deployed dfc version is 6.6. You can check this if you execute java -cp ./dfc.jar DfShowVersion. Second the delivered WebPublisher.dar can&#8217;t be deployed with the DarInstaller 6.5. You need to use the 6.6 one.</p>
<p>A third bad thing is the following error message &#8216;[DFC_OBJPROTO_ATTRIBUTE_MISMATCH] The serialized attribute &#8220;r_supertype&#8221; did not match the previous definition;&#8217;. Looks like dfc 6.6 is not 100% compatible with CS 6.5.</p>
<p>The conclusion is to migrate the CS to 6.6 P08(09). Using 6.5 will cause a chain of suspect errors and an absolute instable system.</p>
<p>In the future I wish from companies like EMC more quality and in fact a working QA department. A simple test would show that it is compleatly impossible to install this versions together and a simple note in the ReadMe would save us weeks of work. (In fact the ReadMe says that the versions are compatible!)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mhus.de/wp/webpublisher-6-5-sp-4-p08-summary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

