RSS

XPages Designer Plugin 4 Eclipse – The Basics!

02 Apr

First, and please keep it in mind, I’m talking about XPages. Nothing more, nothing else. Some years ago, in an open discussion between the XPages Community and the XPages Development Team, we agreed that it would have a huge value, to have a XPages Designer which is based on the latest and greatest Eclipse Release and can be installed as Plugin / Addon.

But where to start? Try to make the IBM Domino Designer loadable from Eclipse? Extract the relevant Plugins from the IBM Domino Designer and make them installable? Or? All this approaches seems to be a pain. So I started to RETHINK the whole stuff.

What does the IBM Domino Designer make, when he has to build an XPages Application?

  1. Convert all XPages / CustomControls to Java Files
  2. Compile all Java Files to classes
  3. Attach all the results in the .NSF Files on the right place

You think this is too simple? Things are become complex without our help 🙂 But let’s assume that this is the way how the IBM Domino Designer builds the XPages Stuff. If you want to proof it, open a Notes Application in the navigator view in the IBM Domino Designer and you will find the following:

xpde-01

Adminsettings.xsp becomse Adminsettings.java (xsp Package) and then Adminsettings.class & Adminsettings$AdminsettingsPage.class

So how does the IBM Domino Designer this? And is there some special knowledge needed to figure this out? I try to explain it with a simple example. The XPages is an XML file, which describes the combination of Components. Lets assume we have in that file the component . The IBM Domino Designer parse this file and will hit the tag. Based on the xp the IBM Domino Designer searchs all Plugins that are responsible for the XP prefix. If you build your own Plugin, you have to specify an own namespace, like wgcpoi. wgcpoi holds all tags for POI4XPages. But lets go on with the xp:panel. It will figure out which plugin is responsible and the .xsp-config file in the plugin describes what with a panel tag has to be done. It will figure out that a panel tag is hold be a component and it will also give back the name of the class that is responsible for the xp:panel.

With the knowledge of the class name, the IBM Domino Designer build a function that creates a UIComponent (the root of all components) and instantiate the class like this

private UIComponent createPanel(....) {
         UIPanelEx panel = new UIPanelEx();
         panel.setId("myId");
         panel.setStyleClass("superstyle");
         return panel;
}

For each property that is defined in the XML there is a corresponding setter defined in the .xsp-conf. This is the way how the designer builds the Java .class. I know it sounds simple, but there is some more complexity.

Now this class is be compiled and then the whole package is stored in the .NSF.

Already open sourced!

The fun part now is, that the transformation of .xsp -> .java is already open sourced. It is in the XPages Bazaar available.

XPages Designer Plugin 4 Eclipse

Based on all this I’ve builded an Eclipse Plugin that does the following:

  1. Build an NSF like project structure
  2. Transform .xsp -> .java
  3. Compile .java -> .class
  4. Build a .xpjar of all the files and publish this to a IBM Domino Server with some build instructions

On the IBM Domino Server runs a Plugin that receives the .xpjar File (via http) and does

  1. Parse the build instructions (JSON)
  2. Access or create the target Database
  3. Loop thru the .xpjar and produce the neede “Note” Documents in the NSF to store the produced and compiled files.

While I get you some Insides now, I’m working on the first Alpha release. All I’ve pointed out works like a charm, but the preparation of the environment is not “Alpha” ready. But stay tuned 😉

And have fun

Christian

 

 
3 Comments

Posted by on April 2, 2016 in Java, OpenNTF, XPages

 

3 responses to “XPages Designer Plugin 4 Eclipse – The Basics!

  1. Csaba Kiss

    April 2, 2016 at 8:51 pm

    This is a very promising project. I hope you will get some help from the official Xpage people, too.

     
  2. ebors

    April 4, 2016 at 10:16 am

    Hi Christian, amazing idea and good luck in this. If i could help you with something, let me know.

     
  3. Shillem Volpato

    April 4, 2016 at 1:05 pm

    One of the ultimate dreams… I’ll be hopefully awaiting

     

Leave a comment