0
votes

I have seen some tools which are generating xpages automatically, from the existing lotus design(forms & Views)...using DXL exporter & XML conversion or whatsoever.

As i'm new to Xpage ,I'm curious to know how to Create a Xpage Dynamically?

Thanks In Advance.

3

3 Answers

2
votes

An XPage is simply XML in a file with the extension .xsp, There is no trick here simply output the correct XML to a file. These tools would convert existing controls to XPages controls or where they can already be used, simply wrap them up in a container I would imagine.

The best approach however is to manually code these as you will loose a lot of the benefits of XPages by relying on these tools to create it for you. These tools are generally for large scale applications that would take far too long to rewrite or they are depending on legacy code etc.

A similar question was asked on how to do this and I answered it here:

How to convert forms to xpages programatically?

2
votes

There is no way (at least not without a lot of hacking) to create XPages on the fly. The XML is just the "source" of the java source that designer creates, then compiles when you build your application.

Since XPages are ultimately an implementation of JSF, you can write Java classes that can manipulate the component tree at runtime to inject controls, etc. But this is not a trivial task.

0
votes

If you're new to XPages I would strongly recommend you get up to speed on building XPages before trying to build something that will dynamically take forms / views and convert to XPages on the fly. Those who have done that kind of thing had already built up considerable knowledge of building XPages applications and the Java classes that actually do all the code, as well as understanding what client functionality can and can't be done in XPages and how to work around it. Take an @Prompt or @DialogBox or the LotusScript equivalents, for example. That needs to run SSJS, then wait for response from the user before continuing with code. That is probably beyond many experienced XPages developers, let alone one new to XPages. If you have considerable Java experience, you might have a heads tart, but otherwise I would highly advise learning to walk before you try to run.