RSS

Tag Archives: xpages

My slides from SNoUG 2015 – Content is in German

Englisch version is in work and will come soon

 
4 Comments

Posted by on October 28, 2015 in OpenNTF

 

Tags: ,

Maven and XPages Plugin – From Scratch / Part II – The Plugin

The core purpose of org.openntf.base.* is to bring some core plugins to the community. This plugin could be used in conjunction with other plugins, like org.eclipse.core.runtime. The first plugin that I want to build is a JAXB representation of the domino9 dxl. This plugin should offer some basic method to convert any domino object to a java object tree based on the domino dxl definition. This could be used to explore the design of a domino database, but also to represent the content of a single rich text item.

We will focus in this part on how to build the plugin based on the parent, that we have already build in Part 1

As in Part 1, we will do the stuff again with our Eclipse Kepler IDE.

1. Build a Maven module

100

Go to your parent project and use “right-click” for the context menu. Browse to Maven / New Maven Module Project.

101

The module name should be the same as your plugin id (later).

102

While you fill out the dialog, it seems that the group id is necessary, but you can delete this later. Be sure that you specify as packaging type: eclipse-plugin. This has a huge impact on the build process and your new maven module will now be handled as eclipse-plugin.

Nice we have now created some folders and files, but unfortunately not the necessary files to handle this project as a plugin project.

Create some files….

That a plugin project is a plugin project, it needs to files.

  1. META-INF/MANIFEST.FM
  2. build.properties

With the right content -> so let’s build this files.

Create the META-INF Folder:

103Create the MANIFEST.MF File:

104

Let’s open the MANIFEST.MF File with the Manifest Editor

And we do this with a right-click on the project and browse to “Plugin Tools / Open manifest”

105

Lets fill out some base information for the plugin.

Btw. the Version should correspond to the version in the parent’s pom file, instead of SNAPSHOT use qualifier (as the plugin would expect)

106

Now its a good moment to update the classpath of the plugin project (do it again with a right click on the project) and the go to Plugin Tools / Update classpath

107

To complete the plugin configuration, we add the dependency to org.eclipse.core.runtime108

And we create the file build.properties109

We open again our MANIFEST.MF and go to the last tab called build.properties.

There we complete the build.properties with the yellow marked text. (bin.includes and sources.. are needed for the whole plugin build process)
110

Give the Plugin an Activator

We build now the Activator class for the plugin, by building first the package and then the class.

111

Creating the class file112

Let’s open the MANIFEST.MF again and assign the activator class113

Build a run configuration to build the project with Maven

Now its time for the fun part. We build a run configuration, to execute the goal clean and install in the maven build cycle

  • clean will delete all genearted code
  • install will compile, test and package all code

114

Select “Maven Build” as category and click on the blank sheet to build a new run configuration115

Please fill out all yellow highlighted fields. Be aware of the goals field. We define with -Dnotes-platform=file:/// the external variable ${notes-platform} for our parent pom file.

Click “Run” to check if all is builded correct the output should look like this:

116

 
1 Comment

Posted by on December 22, 2014 in Java, Maven, OpenNTF, XPages

 

Tags: , ,

If you love IBM Domino – please learn Java, NOW!

It’s now over 3 years ago that I head to take over a project, which covers a critical business case. And it was one of my most painful experience ever. It ends up that each day I worked on that project, I took pain-killer. The request was quite simple: “Please rollback a Java agent to a LotusScript Agent”. But I’ve never seen such a painful implementation of Java. It was quite horrible and against all that I’ve learned about Java.

But Java is the most important language for the future of IBM Domino. If you’re an Application Developer please learn Java. And please learn it, like you would learn something new. Trow away all your knowledge about programing, you can reintroduce it later. Here my advises how you should start:

  1. Download Eclipse
  2. Read Head First Java
  3. Do all examples from HeadFirst Java
  4. Read Design Patterns from HeadFirst
  5. Read Effective Java from Joshua Bloch

“I have not the time for that” could be your answer. The most of us do not have the time for our own education, but only 30 minute per day will pay of in a short time. And reading this books has also a positive effect on coding with Lotus Script 🙂

“How do I bring that in my Domino / Notes Projects?” – This is one of the most critical part. But in fact it’s very easy. DECIDE and DO….

…. and there is webinar this Thursday January 16 from TLCC and Teamstudio which covers XPages and Java Development. I hope you will participate: http://www.tlcc.com/admin/tlccsite.nsf/pages/xpages-webinar

And when you feel your self fit with Java, it’s time for the best-selling developer book form IBM Press called Mastering XPages.

 

 

 
5 Comments

Posted by on January 12, 2014 in Design Pattern, Domino, Java, XPages

 

Tags: , ,

Image

Join us … there is something essential to share

Join us ... there is something essentials to share

 
Leave a comment

Posted by on November 5, 2013 in Uncategorized

 

Tags: , ,

Video

OpenNTF Webinar 10/08/13: The Power of XPages Extensibility

My first webinar as OpenNTF chairman. What a great honor.

 
Leave a comment

Posted by on October 8, 2013 in Uncategorized

 

Tags: , ,

Yes you can….

Today we will have a webinar about POI4XPages. POI4XPages is plugin that enhance and extend the XPages / XWork platform. It gives you the freedom to produce Word and Excel files direct from a application.

We are getting feedback around the globe for the plugin and it’s amazing to hear that developers use POI4XPages to deliver excellent solutions to their customers. POI4XPages is under the Apache V2 License, that means YES YOU CAN ….

  • use it in any project (see this wiki entry http://en.wikipedia.org/wiki/Apache_License)
  • build a solution or a product and sell this product
  • getting the source code and extend it
  • taking parts of the source code to solve a problem
  • bundle it to a new set of plugins for the XPages / XWork platform

Bundling POI4XPages to a new set of plugins? Sounds like a good idea! Stay tuned we are thinking about some thing real cool @ OpenNTF. I hope that I can blog about it this week.

 

Tags: ,

The “ninja-style” programming model by WebGate

First I’ve to excuse that we are so selfish to call our programming model ninja-style. It was happened based on the fact, that we have programmed ninjas in internal programming course. But the term ninja-style was established and if you gave something a name, it’s very hard to change it (Maybe you have seen Monster.Inc by Pixar, then you know what I mean).

Our intention is to make programming for XPages as much fun as possible.  And fun means in the case of programming: Having success, with less of effort and stress.

But the ninja-style has also to do with leaving the comfort zone and go out from this protected workshop in which the most of the domino developers where living. XPages requires a complete new set of skills. On the front end part are you faced with: HTML5, JavaScript, CSS, DOJO (and that’s only the beginning) and of course SSJS for the binding part. On the backend is Java the most required skills, that you should have. But you have also to learn about data sources, controls, data binding and something called JSF life-cycle.

Definitely a lot of topics to cover and the most of us are not geniuses, specially universal genius. It’s a matter of fact that it is easier to split and separate the topics. Because of this we have introduced the N-Tier architecture to our programming model. We have separated the front end stuff, from the back-end stuff.

The front end covers all the presentation (Presentation Layer)

Typically our front end developers are brilliant in arranging all the controls in the XPages and they are mostly virtuous in JavaScript, CSS and Dojo. They know about the “beans” as far as they have to know how to use them as API to the model and the business logic. They don’t care, how object are loaded and stored, they don’t care about how processes and logic are executed, as long all is working correct.

The backend covers all the model and business logic (Business logic Layer)

The back-end guys do all the brilliant stuff with the model of the data and all the processes. Mostly they are Java Cracks or on the way to it. They care about good backend performance and have read the book “design pattern” by the gang of for. No interface and connection to any backend is to complex for them, but do not let them do any HTML stuff.

But where are the storage guys?

At this point, some of the core features of the XPT cames to action. The DSS of the XPT solves all the storage stuff.

But keep this: Having success with XPages has to be about simplification. Our first step was to separate front end from back-end.

To be continued >>>

Christian

 

Tags: , ,

<xpt:….> – The XPages Tookit – Beta1 released

We have released an early beta of the XPages Toolkit, called beta1 on OpenNTF. A short time before I was going to the hospital for a heart revision task :). But the XPages Toolkit need some explanations about the why and what.

xptStartScreenshot

The XPages Toolkit (in short XPT) is a extendable Extension to the XPages Runtime and the Extension Library. The XPT contains a strong core for a programming model that we have introduced at WebGate as the ninja-style. I will blog later this week about this programming model and I will also make some snippets to this available.

But what contains the XPT:

  • The core (for the ninja-style / hope this name is not protected)
  • RSS Datasource and UIControl -> a ready to use UI-Element so display RSS Feeds
  • Read and write Access to properties files
  • Some missing OneUI Elements (like the aboutbox, the welcomebox and the tipbox)
  • And the XPages Agents with ready to use UI Elements and a replacment for the agents manager

And it is extendable. We have designed the XPT to make it easy to plugin other solutions. I will cover this topic also in a separate blog post. But in short, I think there are some many good things available under apache licence. Or think about the charting in dojox, its one of the things that I miss as a good UI Control. I know that there is a great OpenNTF project available from Julian Buss (YouAtNotes xCharting), but why not integrate the code into a plugin?

All the best
Christian

PS: Heart revision task was successfully completed and I have a good recovery time.

 
1 Comment

Posted by on September 23, 2013 in Architektur, OpenNTF, XPages, XPT

 

Tags: , ,

The odyssey of loading a class in a Eclipse plugin – or how we integrated docx4j in POI4XPages

While I was visiting the IBMConnect in Orlando, Lena investigated about how to convert Word files into PDFs. Because of licence reasons, we decide to use docx4j in conjunction with Apache FOP. Both projects are licensed using the Apache V2 license, in opposition to iText.

Lena built a prototype and tested it with Eclipse against the current JVM of the domino server. All worked fine and we started to integrate docx4j as new plugin project in POI4XPages. We also tested the plugin against a regular java programm. Everything worked fine.

The next step was to integrate the creation of the PDF into the UIDocument and the DocumentGeneration classes. This worked fine as well but when we started the conversion it seemed that docx4j has lost its ‘Focus’. The conversion failed because it could not find ‘docx4j.properties’ and ‘log4j.properties’.
After several attempts of building source code based of docx4j and debugging and patching it, I figured out the problem during the night. To make it short, here is the analysis of what had happened:

The problem:

The conversion function in the eclipse plugin was executed by a ClassLoader from Domino. This is not bad at all. But in this case, the context was absolutly relevant to find all the resource files in the docx4j.jar and all the classes. JAXB seems also to be classloading context sensitiv.

The solution:

We changed the ClassLoader context during the PDF conversion as you can see in the code below.
The red marked code does the trick. currentThread.setContextClassLoader( Activator.class.getClassLoader() ) changes the ClassLoader context to the context of the plugin.
When the conversion is done we change the ClassLoader context back to the old context.

public void buildPDF(InputStream isDocument, OutputStream osTarget)
throws PDFException {
Logger logCurrent = LoggerFactory.getLogger(this.getClass().getCanonicalName());
boolean blRC = true;
Exception eRESP = null;
Thread currentThread = Thread.currentThread();
ClassLoader clCurrent = currentThread.getContextClassLoader();
logCurrent.info(“Current thread class loader is: ” +clCurrent);
try {
 currentThread.setContextClassLoader(Activator.class
                    .getClassLoader());
logCurrent.info(“Getting WordprozessingPackage”);
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage
.load(isDocument);

logCurrent.info(“Getting PdfSettings”);
// 2) Prepare Pdf settings
PdfSettings pdfSettings = new PdfSettings();

// 3) Convert WordprocessingMLPackage to Pdf
logCurrent.info(“Getting PdfConversion”);
PdfConversion converter = new Conversion(wordMLPackage);

logCurrent.info(“do Conversion”);
converter.output(osTarget, pdfSettings);
} catch (Exception e) {
eRESP = e;
logCurrent.log(Level.SEVERE, “Error during PDF Conversion: “+e.getMessage(),e);
blRC = false;
} finally {
            currentThread.setContextClassLoader(clCurrent);
}
if (!blRC) {
throw new PDFException(“Error during FOP PDF Generation”, eRESP);
}
}

A happy ending to a long odyssey.
The new release of POI4XPages will be released later this week, together with some bug fixes and new features.

 
 

Tags: , ,

New Documentation for POI 4 XPAGES available

Today we released some howtos for POI 4 XPAGES on my.webgate.biz/poi.documentation.

Thanks Lena for sharing this with us.

 

Tags: ,