Bring information and collaboration into the context of your daily business processes using composite applications
I was at the European ISSL Professional Symposium in Vilnius at the beginning of this week. There were more than 300 people, primarily people from ISSL.
My composite application session had the second most enrollments and since the actual number of people was pretty much identical I assume that my session was the second best attended one. The only session with more people was the Quickr overview. The hands on composite application session was booked out and all attendees managed to build their first NSF component, Eclipse component and NSF based application. In the composite application BOF I had very interesting discussions with the ISSL people.
Looks like everyone agrees on the great value add of this new capability in Lotus Notes 8 making Notes a real integration platform.
I've been asked recently several times how Composite Applications relate to mashups. I think Composite Applications are a superset of mashups. Mashups and Composite Applications support tightly coupled components. Mashups and Composite Applications can trigger dialogs with additional information from another service (example when Google Maps comes up for a selected address). In addition to mashups however Composite Applications also support loosely coupled components. In this entry I want to focus on how Composite Applications can be used to build a mashup as many people think of it.
Check out this screenshot. It shows a very simple application that I've built. When you click on a view entry in Notes a JFace dialog comes up with the selected value.
I admit the sample is not that sexy. I've tried to keep it as simple as possible so that other people can build it also. I've used our simple tutorials as starting point. I exchanged the implementation of the Java action to pop up a message box:Shell shell = new Shell();
"My SWT dialog displaying value from NSF",
"Selected category: " + val);
The real trick was then to hide the ViewPart of my Eclipse components. You can do this easily by setting a preference in the Composite Application Editor:
I think this is pretty cool. It shows how easy it is to build mashup-like functionality with Composite Applications.
Jo Grant asked me to post this entry since he is out on vacation this week. He describes how you can develop ViewParts that can be put as components in composite applications and in the sideshelf at the same time."Any legal ViewPart can be used as a shelf view. Any legal Viewpart with allowMultiple=True can be used as a component. So it is possible to create one view that can be used as both a shelf view and a component.
However a component isn't that interesting unless it has actions or properties that let it communicate with other components. And such actions and properties are not helpful for a shelf view. So, in general this is the architecture I would recommend for reusing code between shelf views and components.
1) First create all of the custom UI you wish to make in a SWT Composite or Canvas. Be sure to include public APIs for all of the features you wish to expose or consume that relate to that UI.
2) Create a ViewPart for your sideshelf and place an instance of your Composite or Canvas upon it. Connect up whatever way you wish your sideshelf component to interact with the rest of the platform (e.g. wiring in the eclipse selection model, etc) to your control.
3) Create a ViewPart for your component and place an instance of your Composite or Canvas upon it. Create your WSDL to expose the properties and actions you wish, and within this view part connect up the property broker to your UI control.
Using this approach you have all the work of the visualization in a single place. You can then reuse that in two different places that each require different ways of linking to your display logic. If other areas come up where you wish this sort of visualization (e.g. a pop-up dialog box from a toolbar icon) you can use your UI control again.
An example: I wish to display "business cards" from my name and address book. It would be nice to do so either in the sideshelf or as a component. So the first thing I did was create a ContactPanel control subclassed from Composite. It had an API setContactID() which, when called, would search your names and address book, find the corresponding record, extract the information, and display it on it's UI.
For the component then, I created a ViewPart whose UI was one of these ContactPanels. I created a WSDL file that declared a single action to receive a contact ID. The ViewPart then contained the glue to route the calling of that action to a call to the setContactID() API on the ContactPanel.
For the sideshelf, I created a ViewPart which had a drop down combo box, and an instance of the ContactPanel. The ViewPart registered as a listener to the PropertyBroker and looked for property changes that were of an email address type. As it noted these, it used the combo box as a "most recently used" type list. When the user selected a name from the drop down, that value was passed to the setContactID() API on the ContactPanel"[Read More]
Haus Weilgut has implemented their mindplan product as component for a composite application in Lotus Notes 8. The component is a Swing component with static properties, output properties and actions documented here. With these properties you can now interact with other components, e.g. when you select a node a sametime buddy list component can display the associated people and allow you to chat with them.
Karsten Lehmann describes below more details.
MindPlan (->http://www.mindplan.com) combines mindmapping, project planning and Lotus Notes in one application. Each node you see in the MindPlan tree is stored as a Lotus Notes document.
The MindPlan application is implemented in Java using Swing to draw the mindmap and gantt chart. We integrated the former standalone java application as an Expeditor plugin (using the SWT-AWT-bridge) and replaced the standard menu bar and toolbars with those of the Expeditor/R8 client.
The MindPlan component exposes several Composite Application properties and actions, that are documented in the MindPlan blog at http://blog.mindplan.biz, for example you can track the selection and modification of nodes. The application provides actions to open/close a MindPlan and refresh part of the node tree. We're also planning to support CA component properties to define your own menu commands. When the command is invoked, we then publish the command id and the Notes URLs of the current selection via the Property Broker.
At the moment there are two example use cases. The first one combines the MindPlan CA with the DocumentViewer component of the Component Library at http://www.openntf.org: You select a MindPlan node and see the node's document (e.g. to edit the richtext) in the lower part of the screen.
In the second use case, we wire the resource names of selected nodes (like tasks and milestones) to a Sametime buddy list. Just select a few nodes and you can start a group chat with one click.
We posted recently the component catalog to OpenNTF.Org. This is work that has primarily been done by Jo Grant and Craig Wolpert from the ISV enablement team. The catalog contains primarily utility components that we've found very valuable when implementing the first composite applications. You can use these components to easily assemble composite applications without development skills by just using the Composite Application Editor.
In this series of blog entries we describe some recipes for how to use some of the components to build some applications and extend the mail/calendar application. We are working on cleaning this up but wanted to get it out since we won't be able to polish it in the next days.Introduction
Recipe 1: mail and business card
Recipe 2: calendar and buddy list
Recipe 3: merged Notes views
Recipe 4: on the glass integration
Recipe 5: categorized view and tag cloud
Many Notes databases make use of categorized views to display data. This appears as a tree with each category as an expanding node. A tag cloud is a method of visualization that shows a bunch of keywords weighted by some value. The keyword appears bigger the higher it's value, and smaller the lower it's value.
This recipe shows you how to take any categorized Notes view and to add it into a composite application with a tag cloud. The tag cloud is used to display category information weighted by the number of documents in each category. Selecting the category in the tag cloud displays just that category in the view. Optionally you can also only apply the weighting based on documents you own. That way you get a tag cloud with customized weighting depending on which categories you participate in.
What you need
(1) You will need a notes URL to a categorized view that you want to display. A Notes URL is kind of cryptic and complicated and not all that easy to create by hand. It's general form is "Notes://<server hint>/<replica id>/<view name>?OpenView". If you know all those details you can fill it in. If not, here is a trick to try.
Open the Composite Application Editor (select a Composite Application and choose Actions->Edit Application). Right click the component palette to the right and select Add Component->NSF Component. In the dialog box click "Browse". Select "View" from the top drop down. Select the database you are interested in. And select the view from the bottom drop down.
Click on OK. This will fill in the add component dialog with the Notes url. Cut and paste this off into a blank copy of Notepad or something. You can use "Notes://CAMDB01/85257337006C8B8E/Components?OpenView" to test with if you are just exploring.
(2) You need the name of the field that contains the keyword. For a standard discussion based database, this is "Categories". But other databases may use other things. While looking at the view in question you can do a right click on a document and select "Properties". The second tab contains a list of the field names and their values. Scroll through this till you find the field you want, and make a note of it. (You can use "OfferingStatus" with the above URL.)
(3) You need the name of the field that contains the name of the author. This is option. If you don't fill this in the "My Documents" button won't appear. You can find the field name via the info box, as above. (You can use "$UpdatedBy" with the above URL.)
1. Drop a Document Viewer component Notes Link onto an empty page.
2. Drop a Notes View to Tag Cloud component Notes Link to form a right hand column.
3. Drop a Tag Cloud component Notes Link in the right column under the Notes View to Tag Cloud.
4. Drop a Constants component Notes Link in the right column under the Tag Cloud.
5. Adjust sizes to fit screen.
1. Constants.Field 1 -> Document Viewer.Show Document
2. Constants.Field 1 -> Notes View to Tag Cloud.URL
3. Notes View to Tag Cloud.TagCloudData -> Tag Cloud.Primary Data
4. Tag Cloud.Focused Entity -> Document Viewer.Column Filter
Advanced Component Properties
(Note: field names are case sensitive.)
1. Constants.field1 = Notes URL to view (1)
2. Notes View to Tag Cloud.field = Field that contains the keyword (2)
3. Notes View to Tag Cloud.authorField = Field that contains the author (3) (optional)
4. TagCloud.drawHeader = false
5. TagCloud.drawFooter = false
6. TagCloud.title = Categories: (or a good label to describe the shown keywords)
How it Works
Processing all starts in the Constants component. The notes URL you place in here gets sent to the Document Viewer and Notes View to Tag Cloud components when the pages is opened, made visible or shown again. The Document View component just loads the url it is given, so that is how the view is displayed. The Notes View to Tag Cloud component does the indexing. It goes through each document in the view and looks for the fields that you set in the Advanced Component Properties settings. It keeps track as it goes and when done, it now has the weighted data. When you click the "All Documents" (or the "My Documents" if you entered in an authorField setting) it broadcasts the weighted information to the tag cloud. The tag cloud displays this graphically. When you then select on a category, it sends this over to the Document Viewer which filters the view being displayed to only show that category.
Sometimes you have to click the blank square that makes up the "Constants" component to fire things off.
Large database can take quite some time to index. Get a cup of tea. The Notes View to Tag Cloud component caches the values though, and only updates them every 8 hours. So it will be quick to do it again if you open it within 8 hours. It will not reflect up to the minute information though. Double clicking the background of the Notes View to Tag Cloud component will force it to reindex.
As noted above, the indexing is slow. A better implementation would be to create an agent in the Notes database. This could run periodically on the server and update the cached information.[Read More]
Gedys Intraware has implemented one of their standard products 'Business Mail' as composite application in Notes 8. One advantage they point out is the ability to implement these extensions to mail now without changing the mail template.
For one thing the context data they want to display is put in different tabs which are loaded in different threads as part of the composite application infrastructure in Notes 8.
Another use case is when you implement Eclipse components that pull in data from different NSFs. There is a performance advantage since different Java threads can be used. This is not trivial since you need to clean up in the same thread where you created the session but most Notes developers who have used the Notes Java API know how to do this.
In the first week our catalog with utility components had 200 downloads at OpenNTF.Org.
Santosh Kumar who did the BIRT component implemented another nice sample. This time he uses the Symphony spreadsheet editor to display data from a Notes database graphically. The text below is from him. I demonstrated this sample in the keynote at DNUG two weeks ago and it was very well received.
With Lotus Productivity Editors and Symphony making OpenDocument Format (ODF) spreadsheets more pervasive in user and enterprise space, business users would like to view, drill into, manipulate and graph Notes data directly in Spreadsheets. These spreadsheets not only offers familiarity to end users, but also offers basic data analysis, manipulation and visualization features.
The screenshot above shows data from view category "Kraja Systems" from Sales Lead application is displayed in tabular format in spreadsheet and pie chart is created for total revenue
Its also possible to display data from selected documents. The below screenshot display data from selected documents and creates bar chart for revenue for type of car against each year.
This prototype has been built with existing productivity editors and Universal Network Objects ( UNO ) API to visualize data in spreadsheet and leveraging composite application infrastructure to enable as composite component. This showcases how in built productivity editors in Notes 8 can be made more integral to composite applications.
We've added another nice feature to Notes 801 on the request of one of our bigger customers. For Portal based applications people had often talked about role based applications so that users only see the pages and components on pages that they should see based on their roles. In Notes 801 we have the ability to define for every page which users should see them.
For example you could now have an HR assessment application with two pages, one for employees and one for managers. The manager page could be a superset of the employee page plus some additional tools or components managers needs.In order to associate roles with pages you can use the CAE:
Pls note that this is not a real security feature. First of all we wanted a way to open the complete application with all pages in CAE even if you as an end user doesn't have 'access' to all pages. Second we thought about making it a real security feature but we couldn't come up easily with a good design that would allow a good performance and we could not regress mail performance which is also a composite application. Our customer who requested this was also not interested in real security in the particular context. Note that this doesn't mean that there is no security. The security of the components in the rectangles (ACLs in case of NSF components) is obviously still used.
In the CAE you can now associate either person names or group names or Notes roles from the NSF that contains the CA XML.
I talked with Gedys Intraware (http://www.gedys-intraware.de/) about composite applications and benefits of composite applications. They've called out several points, one of them I want to describe here briefly since I haven't thought about it earlier.
They implemented an application in Notes 6.5 that you could conceptionally certainly call a composite application. The arrows 1 and 2 describe the flow on the screen. The implementation is not very easy though. I'm sure that hardcore Notes developers will claim it is not a big deal, but it is certainly not trivial.
The real issue however was to implement 3. There are links in the navigator that invoke actions on the Notes UI document in the right column. The problem was that this Notes UI doc never has the focus when the action is invoked in the left frame. So they had to do a native Windows dll call to switch the focus to the Notes UI document which obviously doesn't work unchanged on other platforms.
With comp apps in Notes 8x you can invoke an action on the Notes UI document and when it is executed the platform ensure the UI doc has the focus.
Jo Grant from our ISV enablement team has produced a catalog with 22 reusable components.
I personally think that there are some pretty good components in there and also some weaker ones but even they give some ideas about how they could be extended. One component that I like a lot is the NotesURL component. It allows to listen for Eclipse selections in a Notes view. So you can listen for selection changes in the Notes view and get a NotesURL for the current view entry WITHOUT changing the NSF and adding a WSDL to it. The NotesURL component can then read any other field from the Notes document by using internally the Notes Java APIs. It then publishes one or multiple of these fields to other components that can do something with these changed values.
In order to use this and other components just go in the CAE and add a component via update site. When you use the URL "nrpc:///__852573710072208D/site.xml" you get all components provisioned as soon as you drop one of them on your page. Note that the URL in the xxx.txt file is wrong "nrpc://__852573710072208D/site.xml" since there is one "/" missing.
Other good components are the web clipper, Notes name, document viewer, web launcher and Sametime business card. I think it describes our vision to build reusable components to assemble comp apps in a mix & match kind of way. As always it is not perfect in the first stage. For example I learned again that our UI to set advanced component properties needs to be much better. But again, we had to stage it.
In the next weeks we'll also post some recipes which are samples that show how to use these components together with other NSFs. These repipes can then be re-done via CAE only - without doing WSDL, Eclipse Java coding, etc.