Responsive web design (RWD) has been the talk of town the last years. In 2012 it was listed as #2 in ‘Top Web Design Trends’ by .net magazine and Mashable called 2013 the ‘Year of Responsive Web Design’. Many other sources have recommended responsive design as a cost-effective alternative to mobile applications.
While I assume that a large portion of the internet (and in some cases intranet) sites are nowadays optimized for the device that accesses them, but what about your company’s (internal) business applications?
IT departments need to prioritize their activities and internal applications are most often accessed by a smaller audience than external applications. Historically the internal app was accessed with a desktop computer. With the trend of smartphones and tablets taking over the workspace this may no longer be the case in your company?
With a VPN connection users want to continue to execute their work on this new breed of devices, instead starting up a desktop computer for a single task. Here is where the business value of RWD comes in.
Continue to work on same device = More productive employees = Saving time and perhaps even hardware
A trend is to apply the progressive application strategy of ‘Mobile first’. Instead of designing a complex application for desktop computers first and thereafter gracefully degrade it for mobile devices, the user interface is initially designed for mobile devices and enhanced for desktops with more processing power.
Many RWD frameworks embrace this ‘Mobile first’ concept nowadays.
Options in Notes
So what are your options in delivering RWD in your beloved Notes applications? Depending on your roadmap for the platform and personal preferences you have the following options.
- Build the application with XPages technologies.
- Build the application with common web technologies.
The XPages way
An approach for your Notes platform that is highly promoted by IBM is to deliver web interfaces for Notes applications with XPages. Not only bring you in Rapid Application Development (RAD) principles in your project also the range of capabilities is much more diverse.
You have several options how you distribute the Bootstrap framework to your audience:
- Install the files on your Domino server.
- Embed the files in a Notes application.
- Install an additional XSP library on your Domino server.
- Install the latest extension library on your Domino server.
In case you do not utilize the OSGi runtime on your Domino server you can either install the files on centrally on the Domino server or embed the files in each Notes application. The installation on the Domino server makes the distribution of updates easier but the administrator is responsible for the distribution across servers. Embedding the files in a Notes application is less efficient (e.g. caching) but makes distribution of updates a task for the developer.
Probably the best approach would be to utilize the OSGi runtime on your Domino server and distribute the files as a library via an Update site Notes application across your servers. This makes the task even simple and small for an administrator.
If you choose to do so you have the option to either install bootstrap4xpages library as a separate library or you can install the latest extension library (from 10 november 2014). The latter give you several benefits:
Custom renderer for the Application Layout control, which makes it easy to define the layout structure of your application.
- This renderer gives the control a Bootstrap look & feel, as well making the control responsive.
- A newer version of jQuery.
- Latest Bootstrap themes (3.2.0 normal or flat).
- Additional configuration options in the Application Layout control wizard for the Bootstrap navigation components.
Separate Mobile devices UI alternative
The extension library (a library with additional XPages controls and functions) provides also so-called ‘Mobile controls’ which allow you to deliver a separate interface for mobile devices for your Notes apps. Via a wizard you can build a ‘single page application’ in a matter of minutes with full CRUD (create, read, update and delete) operations and infinite scrolling through document lists (aka views).
This approach does not deliver RWD but a separate user interface for mobile devices. At least it gives you the option to deliver a UI adapted for mobile devices in a very short time with little investment.
You can choose to make the UI of the app look like a native app for iPhone or Android. Alternatively you can choose to make the UI look in line with other IBM products (iNotes, Connections). A video that demonstrates the controls briefly you can find here: http://vimeo.com/99537780.
The WEB way
In case you do not walk the XPages path but instead you prefer the approach to deliver the application with more common web technologies like HTML, CSS, AJAX and REST services you can still install the files of your responsive web design framework of choice on the Domino server or embed them in a Notes application.
From there you can start to (re)write your ‘traditional’ Domino application as a Web project. In the latter case you use Notes only as a container for your data documents and design elements and use forms and views only as data schemes.
This approach dodges the RAD capabilities in Notes and will demand more development time. But you can apply this approach also to other platforms that you may have. You can later even debate why the data should be stored in Notes and not in a document-oriented database alternative? The layered security and replication capabilities are often good arguments.
Implementing RWD via the Extension Library option
In the following scenario we will describe the implementation of RWD with the Extension Library more in details.
- Database enablement.
- Application Layout.
Assuming you have installed the extensions for the Domino server and Domino Designer (DDE) client according the instructions in the readme.pdf file you can now enable a Notes application.
The XSP properties file allows you to configure parameters for the XPages framework. Open the file in DDE.
In the General tab you have now two more themes to select:
- Bootstrap 3.2.0
- Bootstrap 3.2.0 flat
The ‘flat’ theme delivers:
- The resources and styling that comes with Bootstrap v3.2.0.
- jQuery v2.1.1 resources.
- Cleanup of specific XPages controls when using Bootstrap.
- Glyphicon halflings.
- dbootstrap resources, which provide Bootstrap styling for Dojo controls.
The ‘ordinary’ theme provides all of the same resources as the flat theme, and includes 3D effects to buttons and some other additional styling.
Select one of the two themes:
The RWD plugin adds a new renderer for the Application Layout control which you normally use to structure the layout of your application. This renderer gives your application layout the Bootstrap look and feel, as well as responsive behavior. When the application is rendered on a smaller screen, such as on a mobile device, it will automatically re-organize the application contents for an optimal user experience.
The control also has new configuration options. Add the Application control on a custom control and open the All Properties tab. In the basics section you can choose now the xe:bootstrapResponsiveConfiguration option:
Note: in case you have already a configured Application Layout control you can change the configuration option directly in the Source panel to keep the rest of your configuration (e.g. xe:applicationConfiguration -> xe:bootstrapResponsiveConfiguration).
This configuration options give you several more properties:
With the first 3 properties you define how the left column should behave on smaller devices (collapsed for smaller devices, display text when collapsed, item the left menu should be attached to).
You can determine the behavior of the navbar (inverted, fixed (top or bottom)) and the width of the page e.g. fluid = use Bootstrap 'fluid' container (almost full width).
When you initially drag on the Application Layout control on the custom control a two-step wizard is presented. In the first step you select one of available configurations. You can filter on responsive and non-responsive.
In the second you set the properties for the chosen configuration. In case you choose the Responsive Bootstrap option you will see the following screen:
Under configuration you can set the properties for the layout including the 6 additional properties mentioned earlier. Set also the other properties like you would normally do.
Voila! Your application is now ready for development.
Hiding elements for specific devices
The plugin provides only the resources and structure for responsive web design. In case you want to optimize the layout for devices by explicitly show or hide them you can use CSS classes.
Bootstrap provides some handful helper classes, for faster mobile-friendly development. These can be used for showing and hiding content by device via media query combined with large, small, and medium devices.
Extra small (less than 768px) visible
Small (up to 768 px) visible
Medium (768 px to 991 px) visible
Larger (992 px and above) visible
Extra small (less than 768px) hidden
Small (up to 768 px) hidden
Medium (768 px to 991 px) hidden
Larger (992 px and above) hidden
Note that the elements that you hide are still being loaded, but simply not being displayed.
Data View control
Probably a typical use case is the display of table columns or lists. On a desktop you may want to show more columns than on a smaller devices.
Typical you use the Data View control from the extension library to display lists of documents. The information you want to display as a link is defined in the summaryColumn property.
Additional columns that are displayed on the right of the summaryColumn will be displayed via the extraColumns property. Each additional column is defined in a viewExtraColumn item which contains properties for styleClass and headerStyleClass. For example you could set these as followed:
<xe:viewExtraColumn columnName="Date" columnTitle="Date" style="width: 100px" styleClass=" hidden-xs hidden-sm " headerStyleClass=" hidden-xs hidden-sm"></xe:viewExtraColumn>
This will show the extra column only for medium and larger devices since they will be hidden for (extra) small devices.
Delivering responsive web design on your Notes applications has never been as easy as it is nowadays with the RWD plugin in the extension library. It also respects the rapid application (web) development mantra of XPages.
In case you do decide to follow this path remember you need to check what information you want to show or hide for specific devices.
So what is keeping you from getting a bigger bang for the buck by delivering optimized user experiences for mobile, tablet and desktops for your Notes applications?