OsgiWorlds is a set of Java files to allow a Vaadin OSGi application running on a Domino server running OpenNTF Domino API (release 2.0.0 +). There is a configuration file that allows production mode to pull from a setting in the web.xml to define the current user.
The application expects org.openntf.domino.xsp plugin to be running on the server. It requires at least version 2.0.0 - there is additional functionality for checking whether ODAPlatform is started (it should be automatically as part of XPages runtime).
The org.openntf.osgiworlds package provides four files:
- ApplicationConfiguration.java is an interface defining variables expected in the web.xml for signer, default developmentMode user and session identity. It also defines the contract for certain methods expected by any implementation of the interface.
- BaseApplicationConfigurator is an implementation of the ApplicationConfiguration interface. This adds some basic implementations of methods, but will need extending for any actual configuration.
- DefaultDominoApplicationConfig is a default, working configurator, adding devMode, user, signer and server org.openntf.domino.Sessions.
- ODA_VaadinServlet is an extension to VaadinServlet that wraps a Domino and ODA session for every HTTPServletRequest.
The org.openntf.osgiworlds.model package contains Domino-specific wrappers for Vaadin, e.g. Calendar, ViewEntry.
The com.timtripcony package is based on Tim Tripcony's SmartDocumentModel code demoed on NotesIn9. It has also been extended to provide additional functionality like using case insensitive checks on field names, to support historical data where LotusScript did not require case sensitivity when interacting with the document.
- Copy the Java files into your OSGi application's source code folder. This assumes your OSGi application already includes all Vaadin jar files required.
- In your WebContent\WEB-INF\web.xml file, the following configuration can be used:
- A context-param with the name "osgiworlds.developermode" and the value "true" should be added to set developerMode.
- A context-param with the name "org.openntf.osgiworlds.devtimename" and a value mapping to a valid, hierarchical Notes Name (e.g. "CN=Mickey Mouse/O=Disney") should be added to define a specific developer name to use.
- In the servlet definition, the servlet-class should map to the ODA_VaadinServlet class or any extension you use.
So the relevant settings might look like:
<context-param>
<param-name>osgiworlds.developermode</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>org.openntf.osgiworlds.devtimename</param-name>
<param-value>CN=Micky Mouse/O=Disney</param-value>
</context-param>
<servlet>
<servlet-name>KeyDatesServlet</servlet-name>
<servlet-class>org.openntf.osgiworlds.ODA_VaadinServlet</servlet-class>
<init-param>
<param-name>UI</param-name>
<param-value>uk.co.intec.keyDatesApp.MainUI</param-value>
</init-param>
</servlet>
- In the plugin.xml, org.openntf.domino and org.openntf.domino.xsp will need to be added as required plugins.
You should then be good to go.
CrossWorlds already includes all the relevant HTTPServletWrappers. For CrossWorlds, developermode is set at server level. The web.xml configuration for devtime name are virtually identical, just org.openntf.crossworlds.devtimename. The com.timtripcony and org.openntf.osgiworlds.model packages can be copied from here into a CrossWorlds Vaadin app to add those model classes. No changes to the packages is required.
If you add additional functionality or build additional model classes you would like to contribute back, please do so. The aim of this project is to make it easier for Domino developers to use Vaadin in OSGi applications or web applications on Websphere Liberty running CrossWorlds.