Englisch version is in work and will come soon
It’s a while ago, since my last post. The best excuse is, that I really had a lot of projects to push forward and less of time to talk and blog about. But that’s only the half of the story.
Last month, on June 9. I was in Spain for a customer meeting. It was a really good meeting and it was nice to be there. But during the meeting, I was getting cold. Real cold and my first tought was: what a strong air conditioning. But in fact, my body temperature was rising and the cold was a result of the fever. We went to the airport after the meeting, and I realized that also the airport has an air conditioning. After standing a while outside in the warm spanish sun, we took our flight back home. My wife picked me up I had a night with nice fever driven dreams.
The day after, at the evening, we went to the hospital. My right leg was twice thick then my left one, but I was more caring about the high fever and the diarrhea. Fortunately the medical team and the doctors at the hospital didn’t ignore my leg and took the swollen leg at their top priority. According to some swiss hospital rules, I was moved to the isolation station.
A team of medical doctors started to figure out why my leg was so swollen and why all me blood doesn’t look really good. They started with a antibiotics therapy, which had a strong impact to the fever. Day by day the size of the leg was shrinking, but the heavily forced skin has built some bubbles, which were filled with some liquid. A part of the medial team where really excited about this fact, because the took some of the liquid from the bubble and could analyze what was happened to my leg (It was fun to see what passion these doctors had, because of this bubble and the opportunity to know more).
Flesh eating bacteria! What a radical diagnose. I heard also the “normal” and the worst case scenario of this disease. To be honest, in the worst case, I wouldn’t be able to write this blog entry. I wanna thank first god the almighty father and creator of heaven and earth, for my recovery, for his carrying, for all the moments where I could feel his presence and for pointing me to this wonderful song which gave me hope and patient (https://www.youtube.com/watch?v=A-1MR5JAu2M). Thanks to all friends who prayed for me. Thanks to the medical team and the doctors at KSW Winterthur, you did a great job. And thanks to my company, who is giving me the time to recover and handles all my projects. And last but not least to my family, thanks for every visit, SMS and your prayers: I love you!
My leg ist recovering. Fever is gone, but the skin of my leg has still the nice color scale from a bright orange to a dark yellow. But the skin is also recovering and I’m able to type and think. My action circle is currently my home and I will remain at home, until my leg is recovered. It’s hard to stay at home and not enjoy the swimming or other outdoor activities, but patient is the best friend currently.
I hope that I can now catchup with all the interesting projects I was involved and a lot of news around XPages, Java and some new technologies.
All the best
PS: Sorry Bruce that I missed your birthday, be blessed!
While Switzerland was covered with snow, the OpenNTF Base project has made some progress. There are two new plugins, one is org.openntf.base and the other is org.openntf.base.lib.internal.
org.openntf.base contains all the stuff to register the plugin collection as an extension library and also all “Top Level” classes. org.openntf.base is designed to have all the dependencies to the XPages engine. I try to make org.openntf.base.jaxb.dxl with less dependencies to other plugins, as possible. specially not any dependency to the XPages Engine (as I sad, I TRY). My intention is to reuse the org.openntf.base.jaxb.dxl part also for Notes Client plugins.
org.openntf.base.lib.internal contains all the JAR files which will be used in the org.openntf.base package, but not exposed to the Desinger Client. Maybe there will be a org.openntf.base.lib.external plugin, which contains jars of useful java libraries, that could also be used at the Designer Client level. GSON and GUAVA are candidates for this.
Btw. the org.openntf.base.jaxb.dxl.testsuite is also moved to org.openntf.base.testsuite and is now a fragment of org.openntf.base
Ready for the next move? ….. we need a feature to bring all the plugins under one umbrella. (Btw. the testsuite Fragment will not be part of this feature!)
It all begins with a new ………. module!
Once we have the new project, we need to files:
Check if everything is fine with your run configuration “clean install”
POI4XPages has a module called poi.assembly. This module builds the final ZIP file which can be uploaded to the OpenNTF website. One step in the assembly is that the module downloads the source code direct from github. This step takes a lot of time, so each mvn clean build takes a lot of time, because the assembly line is also executed. Fortunately Maven has a concept called profiles. Maven let you define different profiles. In the POI4XPages case, I’ve built two different profiles, which contains different set of modules:
I’ve now to different run configuration in my eclipse client. To run the default profile, I use the following:
But if I need the assembly profile, I use the following configuration:
Part I has covered the building of the parent pom.xml, Part II was about the plugin and now in Part III we talk about the test suite. It’s fair to say that this part seems not to be very interesting, but in this Part we talk also about the why.
Why do I make the org.openntf.base.jaxb.dxl plugin?
The core purpose of the jaxb.dxl plugin is to convert a DXL export of a document, or of some design elements into an object based representation. Imagine this: You have a document with 2 rich text fields, one is a traditional rich text field and the other is mime based. For some reason (like transforming the content of the rich text field to a POI document or PDF document) there is an interest in the structure of this rich text field. A simple export as DXL and conversion to this java objects which are cascaded helps a lot.
Or you have this database, and you want to scan the content of all design element for a specific @Formula….. Export the database to DXL and convert it with jaxb to java object tree. And the scan the tree and analyse.
But why not start with the implementation, that sound better than testing!
Agree. Implementing is always better than writing test for the sake of writing tests. But after reading the book “Test Driven Developement” by Kent Beck, my understanding of test has changed. Tests explains what I want to do. Read the following test:
This test covers my user story “Reading a dxl-document.xml and convert it to a java object structure”. To make this test work, I’ve to writte a lot of implementation stuff, so stay tuned.
The next Maven module -> org.openntf.base.jaxb.dxl.testsuite
Again with the eclipse client:
select as packaging type “eclipse-test-plugin”:
And now repeat the following steps, like you have done for the plugin in Part II
- New file called MANIFEST.MF into the folder META-INF
- New file called build.properties
Open the MANIFEST.MF File and go to the MANIFEST.MF Tab and enter the following stuff:
Open the build.properties File and go to the build.properties tab. Enter the following stuff:
Open the MANIFEST.MF again and add the following dependency. This is needed that we can start writing our test class.
Let’s write the first Test:
We have also imported the dxl-db-test.xml and the dxl-document-test.xml. This documents were produced by a nice simple DXL Export.
To make the test compile (STEP 2 in TDD), we have to import the XSD File for domino_9_0_1 and convert it to classes. We use for this the JAXB import
JAXB Import of the domino xsd
Start with menu “New” and select the JAXB Classes from Schema Wizard
Select the target project for the import (yes our plugin)
If you do not have the domino_9_0_1.xsd in a project in your workspace, you can import it from your Notes/Data directory
Select finish. The import will now generate a lot of classes.
You can now resolve the import of the Document object (yes its a …jaxb.dxl.Document object)
Time to finish the compilation problems in the test class.
Create the ConvertorFactor in the plugin (see the package that I select? It’s outside of the dxl package, because the content of this package was generated before).
Only one step, and we can test (with executing our runtime configuration)
We have to include the *.xml Files in our binary build. We open for this step the MANIFEST.MF and add the 2 files
Lets build the project by executing org.openntf.base clean install
Oh yes the build fails! This is total ok at this point, because our test fails, and a failing test should stop our build!
Now its time to have some fun and finalize the plugin… The next Part will cover how to build the feature and the update site
If you wanna follow the project, please watch this repository on github.com https://github.com/guedeWebGate/org.openntf.base
When I try to explain what Maven is, then I’m using often the following picture:
Maven is a factory building with a brilliant factory manager
Imagine this: There is this empty factory building and you walk with your construction plan to the office of the factory manager. You enter the room and the factory manager takes your construction plan. He read it and then he runs to tool storage. In a short time he has all the tools to build your construction taken from the storage and build a production line.
According to your plan, he has also hired the Q & A people, which let first run some unit tests directly in the production line and also some integration tests. At the end of the whole production line is also an assembly line to build the kit that is ready to ship.
… at this point you say. “mvn clean install” and the factory manager builds the software.
The other day, you come back to the factory building with a new construction plan. And the factory manager “cleans” the building and setup a new production line for you. If he finds some tools not in the storage, he orders the tools directly from *Maven Central*. But with the same passion and quality as the day before the manager tries to build the software.
What Maven can do for you depends on your construction plan and the tools that are available
Back from the analogy:
- factory building -> maven
- factory manager -> mvn
- construction plan -> pom.xml
- tool storage -> maven repository
- tools -> maven plugins
Your construction plan contains all instruction about what builder should be used, how unit testing should work, and also how the assembly should run.
And it is not some kind of magic to build your own builder. I’ve built the headless designer integration, also a builder to build complete XPages Applications. It’s only hard work, nothing more and nothing less (and also a lot of fun 🙂 )