Links

Custom Button

Phorm Prohibited

The contents of this site, and communications between this site and its users, are protected by database right, copyright, confidentiality and the right not to be intercepted conferred by section 1(3) of the Regulation of Investigatory Powers Act 2000.

The use of those contents and communications by Internet Service Providers or others to profile or classify users of this site for advertising or other purposes is strictly forbidden.

01/05/2009 Programming the Sidebar using Java

Category   
This blog will show how to programmatically control the Lotus Notes 8 Sidebar using Java.

There is a demo plug-in called com.domiclipse.demo.sidebar which can be found in the CVS. The demo adds a Sidebar Demo menu entry with three actions that will show info about the sidebar, toggle the state of the sidebar and toggle the 'Day-At-A-Glance' panel.

The starting point is the IWorkbenchWindowWithShelfPages which we get by adapting the Eclipse Workbench.

        IAdapterManager adapterMgr = Platform.getAdapterManager();
        IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow() ;
        IWorkbenchWindowWithShelfPages windowWithShelfPages = (IWorkbenchWindowWithShelfPages)adapterMgr.getAdapter(window, IWorkbenchWindowWithShelfPages.class);

Once we have the workbench we can get a handle on any of the Sidebars or ShelfPages as they are known. The Notes client has left and right sidebars.

        ShelfPage shelfPage = windowWithShelfPages.getShelfPage(IWorkbenchWindowWithShelfPages.RIGHT);

A ShelfPage can be displayed in three ways, thin, expanded or collapsed. This is controlled using the setMode() method.

        if ( shelfPage.getMode() == ShelfPage.COLLAPSED ) {
                shelfPage.setMode( ShelfPage.EXPANDED) ;
        }

Now that we have a handle on the ShelfPage we can see which sidebar panels are currently active.

        IShelfViewReference[] viewReferences = shelfPage.getShelfViewReferences() ;
                               
        System.out.println("There are " + viewReferences.length + " views in the Sidebar.\n\n" );                                
        for ( int x = 0 ; x < viewReferences.length ; x++ ) {
                System.out.println( viewReferences[x].getTitle() + " (" + viewReferences[x].getId() + ")\n" ) ;
        }

If we know the id of a particular sidebar panel it can be opened or closed. The example below toggles the Day-At-A-Glance panel.

        String PANEL_ID = "com.ibm.workplace.ui.sidecalendar.views.SideCalendarViewPart" ;
        IViewReference view = shelfPage.findView( PANEL_ID ) ;

        if ( view != null ) {
                shelfPage.hideView( view ) ;
        }
        else {
                shelfPage.showView( PANEL_ID ) ;
        }

The collection of all the available Sidebar panels can be obtained from the Eclipse extension registry.

        IExtensionRegistry registry = Platform.getExtensionRegistry();
        IExtensionPoint point = registry.getExtensionPoint( "com.ibm.rcp.ui.shelfViews" );
        IConfigurationElement[] elements = point.getConfigurationElements();
               
        System.out.println( "There are " + elements.length + " Sidebar Panels available.\n\n" );
        for( int i = 0; i < elements.length; i++ ) {
                System.out.println( elements[i].getAttribute( "view" ) + "\n" ) ;
        }
               
The registry returns a collection of IConfigurationElement, each one corresponds to a Sidebar panel. Any of the attributes defined by the ShelfView extension point schema can be accessed using the .getAttribute() method.
Bookmark : del.icio.us  Technorati  Digg This  Add To Furl  Add To YahooMyWeb  Add To Reddit  Add To NewsVine 

04/12/2008 Icons for Notes/Eclipse plug-ins

Category   

Finding icons to use in plug-ins can be a real pain but there is a simple way to find loads of icons.

In Windows, search the directory where you installed Eclipse for *.gif,*.jpg,*.png , change the View to Thumbnails and voila..!

A picture named M2
Bookmark : del.icio.us  Technorati  Digg This  Add To Furl  Add To YahooMyWeb  Add To Reddit  Add To NewsVine 

30/11/2008 This one's gotta work or I'm shooting myself.

Category

Luckily Part 2 of the tutorial now woks so I won't be shooting myself... not yet anyway...

I've struggled for hours to get my rich-text blog posts to display correctly. Tutorial part 2 was especially troublesome.

It seems that having a combination of imported pictures and an attachment confused the Blogsphere engine. Moving all the images into a separate document and referring to them by pass-thru HTML has fixed the problem.
Bookmark : del.icio.us  Technorati  Digg This  Add To Furl  Add To YahooMyWeb  Add To Reddit  Add To NewsVine 

30/11/2008 Developing a simple plug-in for Lotus Notes. Part 2

Category   

This is part 2 of a three part tutorial.
Part 1
Part 3

5. Testing the plug-in

 
Click on the Run button tutorial1-32.jpg or select Run -> Run... from the main menu.
In the Run dialog select Client Services and click on the New tutorial1-34.jpg icon.      
Expeditor will do most of the work to setup the new run configuration. All we need to do is name it Notes 8 instead of the default New_configuration and click on the Run button.
tutorial1-67.jpg
Note. Only one instance of Notes 8 can be open at once. If you already have your 'real' copy of Notes 8 open the development instance will fail to launch with the following error.
tutorial1-36.jpg
Once Notes 8 is open our new plug-in will show in the Sidebar. If it doesn't, select View -> Sidebar Panels -> Sample View from the main menu.
tutorial1-37.jpg


We have now written our first Lotus Notes 8 plug-in.

6. Customising the plug-in

 

Now it's time to make a few changes to the plug-in. We are not going to write any code but we will change the views icon and name.

Close the development instance of Notes 8 and return to Eclipse.
Double-click on plugin.xml file in the Project Navigator.
Select the Extensions tab and expand the org.eclipse.ui.views extension and select the Sample View (view) entry.
Change the value of the name field from Sample View to Tutorial 1.
Change the value of the icon field from icons/sample.gif to icons/tutorial1.gif. Note: Images names are case sensitive.
Save and close plugin.xml.
tutorial1-38.jpg
Download this icon tutorial1.gif, save it as tutorial1.gif and paste it into the icons folder of the plug-in.
Click on the Run button tutorial1-32.jpg to test the plug-in in Notes.    
Here's how the plug-in looks now. Note the new icon and title.
tutorial1-40.jpg


Our plug-in masterpiece is finished. In the next section we will see how to package it so that it can be installed in the Notes 8 client.

7. Creating a Feature Project


This section will explain how to package our plug-in so that it can be installed into the Notes 8 client. We will create a feature plug-in, an update site and an update site database.

Earlier on in the tutorial we installed the Lotus Expeditor toolkit and I said that we were installing loads of plug-ins. That's only partly true. In Eclipse we never actually install plug-ins, we install Features. So, before anyone can install our plug-in we need to create a feature which will hold the plug-in.
To create a new feature project select File -> New -> Other... from the main menu.
Expand the Plug-in Development section, select Feature Project and click Next.
tutorial1-41.jpg
On the Feature Properties page enter the name of the project. Give it the same name as the plug-in with .feature on the end and then click Next.
tutorial1-42.jpg
On the References Plug-ins page select the com.domiclipse.tutorial1 plug-in and click Finish.
tutorial1-43.jpg
The new feature project can now be seen in the Project Navigator view and feature.xml is open for editing.
Select the Overview tab and change the Name of the feature from the default Feature Feature to Tutorial1 Feature.
tutorial1-46.jpg
Select the Information tab and enter the description, copyright and license of the feature.
tutorial1-45.jpg
Select the Plug-ins tab. This tab shows which plug-in are included in the feature.
tutorial1-48.jpg
Save and close feature.xml.
The feature is now ready to be deployed to an Update Site.

Bookmark : del.icio.us  Technorati  Digg This  Add To Furl  Add To YahooMyWeb  Add To Reddit  Add To NewsVine 

30/11/2008 Developing a simple plug-in for Lotus Notes. Part 1

Category   
  1. Introduction
  2. Installing Lotus Notes 8
  3. Installing and configuring Eclipse and Expeditor
  4. Creating a simple plug-in
  5. Testing the plug-in
  6. Customising the plug-in
  7. Creating a Feature Project
  8. Creating an Update Site Project
  9. Installing the plug-in in the Notes 8 Client
  10. Creating a Notes Application Update Site
  11. Conclusion

This is part 1 of a three part tutorial.
Part 2
Part 3

1. Introduction

 

This tutorial will show you how to create, test and deploy a simple Sidebar plug-in for Lotus Notes 8.

This tutorial is focused on the process of creating, testing and deploying the plug-in rather than explaining how to write the plug-in itself. In fact we will not see any Java code in this tutorial. That will be the subject of further tutorials. In this tutorial we will let Eclipse write all the code for us.

After creating and testing the plug-in it will be packaged onto an Update Site and installed into the Notes 8 Client.

The finished plug-in looks like this in the Notes 8 Sidebar:

tutorial1-57.jpg

2. Installing Lotus Notes 8

 

The tutorial assumes that you already have the Notes 8 client installed. I have only tested this tutorial on Notes 8.0.2 but it should run fine in 8.0, 8.0.1 and 8.5.
There is no need to have access to a Domino server unless you want to replicate your update site to a web server as described in section 10.

3. Installing and configuring Eclipse and Expeditor

 

There are various different packages of Eclipse that can be downloaded from eclipse.org, each one tailored for a different audience. However, the Lotus Expeditor Toolkit 6.1.2 only seems to install correctly on Eclipse 3.2.2. Newer version of Eclipse don't work because Expeditor has dependencies on older  version of Equinox.

Eclipse 3.2.2 can be found here. For Windows eclipse-SDK-3.2.2-win32.zip is the file you need.

Eclipse doesn't need installing like a normal Windows program. Just unzip the file to a suitable location of your hard-drive. That's it, no need to run any install program.
To run Eclipse just double-click on eclipse.exe.

Top Tip: On Windows file paths can only be 260 characters long. If you try and unzip the file on your Desktop you might get error messages about files needing passwords or warnings that filenames are too long. Try extracting the files to a location with a shorter filepath, eg c:\temp.

The Lotus Expeditor toolkit can be downloaded for free from the Lotus Download site but you will need an IBM User ID. Download the Lotus Expeditor Toolkit 6.1.2 Multiplatform Multilingual. There appear to be two identical versions of the toolkit for download so I downloaded the first in the list.
Unzip the Lotus Expeditor 6.1.2.zip file to a local folder.
The Expeditor Toolkit is installed from within Eclipse so launch the program by double-clicking on eclipse.exe.
The first time you start Eclipse you will be asked for the location of the workspace. This is the directory that will contains all you Eclipse projects.
Top Tip: If you have lots of different projects and plug-ins you can have different Workspaces and switch between them.
tutorial1-2.jpg
When the Welcome page appears, click on the Workbench icon.
tutorial1-4.jpg
Now we need to install the Expeditor Toolkit. The toolkit is distributed as a set of plug-ins in an Update Site. We will see how to create our own Update Site later in this tutorial.
From the main menu select Help -> Software Updates -> Find and Install...
Select Search for new features to install and click on the Next button.
Click on the New Local Site... button and navigate to the Expeditor_Toolkit_install folder within the folder where you unziped the toolkit and click OK.
tutorial1-10.jpg
Make sure that the new update site is selected and click Finish.
tutorial1-12.jpg
The next dialog show all the different features in the toolkit. What do they all do? No idea... but it's all very clever so we might as well install the lot.
Select the top level checkbox and click on the Next button. Accept the license and click Finish. Then wait as about a zillion plug-in are downloaded and installed.
tutorial1-14.jpg
When prompted to restart the Workbench, click Yes.
After Eclipse has restarted you will be asked to configure the Expeditor Toolkit. Select Lotus Notes 8 as the Test Environment and click OK.
tutorial1-16.jpg
That's it, Eclipse and Expeditor are now configured for developing Notes 8 plug-ins.


4. Creating a simple plug-in

 

Now let's get Eclipse to write a plug-in for us.
Form the main menu select File -> New -> Other.
Expand the Plug-in Development section, select Plug-in Project and click on the Next button.
tutorial1-18.jpg
Give the plug-in an ID, mine is called com.domiclipse.tutorial1. Click on the Next button.
tutorial1-20.jpg
On the Templates page select Plug-in with a view and click Finish.
tutorial1-24.jpg
After a few moments our plug-in is opened in the workbench.
On the left hand side of the screen is the Package Navigator view which shows all the Projects in the Workbench. The most important bits are the src folder which contains all the Java code and the plugin.xml file which defines how our plug-in fits into the Eclipse environment.
To add our view to the Lotus Notes 8 Sidebar we need to define an Extension.
Click on the Extensions tab of the plugin.xml file and click on the Add... button.
tutorial1-28.jpg
De-select the Show only extension points from the required plug-ins checkbox and in the Extension Point filter field start typing com.ibm.rcp.ui.
Select the com.ibm.rcp.ui.shelfView Extension Point and click Finish.
tutorial1-29.jpg
Select Yes to add the com.ibm.rcp.ui plug-in to the dependencies.
tutorial1-30.jpg
Right-click on the new extension point and select New -> shelfView.
In the Extension Element Details form enter the class name of our view in the id and view fields. In this case the view is called com.domiclipse.tutorial1.views.SampleView. Note, class names are case sensitive.
tutorial1-31.jpg
Save and close the plugin.xml file.
Our plug-in is now finished. Time to test it.

Bookmark : del.icio.us  Technorati  Digg This  Add To Furl  Add To YahooMyWeb  Add To Reddit  Add To NewsVine 

30/11/2008 Developing a simple plug-in for Lotus Notes. Part 3

Category   

This is part 3 of a three part tutorial.
Part 1
Part 2

8. Creating an Update Site Project

To create a new Update Site project select File -> New -> Other... from the main menu.
Expand the Plug-in Development section, select Update Site Project and click Next.
tutorial1-49.jpg
On the Update Site Project page enter the name of the project. Give it the same name as the plug-in with .update on the end and then click Finish.
tutorial1-50.jpg
The new update site project can now be seen in the Project Navigator view and site.xml is open for editing.
Select the Site Map tab and click the New Category button. On the Category Properties form change the values of the Name and Label fields to Tutorials.
tutorial1-51.jpg
Select the Tutorials entry in the Managing the Site form, click on the Add Feature... button, select the com.domiclipse.tutorial1.feature feature and click OK.
tutorial1-52.jpg
Click on the Build All button and wait for all the features to be built.
Save and close site.xml
In the Package Explorer we can see that there are two new folders in the update Project, a features folder and a plugins folder. These folders contain the actual jar files that will be installed on the Notes 8 Client.
In addition, the site.xml file defines which plugins and feature are available on the update site.
tutorial1-53.jpg
The tutorial1 feature is now ready to be installed in Notes 8.


9. Installing the plug-in in the Notes 8 Client

Before any plug-ins can be installed in Notes 8 the client needs to be configured correctly. Locate the file {notes install dir}\framework\rcp\plugin_customization.ini, add the line com.ibm.notes.branding/enable.update.ui=true and restart the client.
From the main menu select File -> Application -> Install.
Select Search for new features to install
Create a new Local Update Site which points to the site.xml file in the update site project.
tutorial1-54.jpg
Select the new location and click Finish.
tutorial1-55.jpg
Select the Tutorial1 Feature, click Next and agree with all subsequent dialogs. Finally, allow Notes 8 to restart.
tutorial1-56.jpg
Once the client has restarted you should see the plug-in in the Sidebar.
tutorial1-57.jpg



10. Creating a Notes Application Update Site


The local update site we created in the previous section is fine for testing purposes but if we want to make our plug-in available to the world there are two choices.
  1. Copy the update site folder onto a web server and publish the address of the site.xml file.
  2. Create a Update Site Notes Application and replicate it onto a web server.

In this section we will create a Notes Application Update Site and replicate it onto a web server.
Open the Notes 8 client and select File -> Application -> New... from the main menu.
Specify the Title and Filename, select the Show advanced templates option, select the Eclipse Update Site (8) template and click OK.
tutorial1-58.jpg
Once the new application has opened, click on the Import Local Update Site... action.
tutorial1-59.jpg
Browse to the site.xml file in the update site project and click OK.
tutorial1-60.jpg
After a few moments the local update site is imported into the database.
tutorial1-61.jpg
After setting the ACL appropriately, create a new replica on a web server. I made a replica on the Domiclipse server. The URL is http://www.domiclipse.com/domiclipse/TutorialUpdateSite.nsf
Accessing the site via a web browser displays the default web page that describes how to use it and what features are available.
tutorial1-66.jpg
To use the new update site we need to create a new Remote Update Site that points to http://www.domiclipse.com/domiclipse/TutorialUpdateSite.nsf/site.xml and then install the plug-ins as normal.
tutorial1-63.jpg


11. Conclusion


This tutorial has shown how to configure Eclipse and Lotus Expeditor for the development of Lotus Notes 8 plug-ins. We have seen how to create a simple plug-in and test it in Notes 8. We have also seen how to package the plug-in for deployment via a Local Update Site and a Notes Database Update Site.

Future tutorials will explain some of the fundamental Eclipse concepts and look in more detail exactly how the plug-in works.
Bookmark : del.icio.us  Technorati  Digg This  Add To Furl  Add To YahooMyWeb  Add To Reddit  Add To NewsVine