Tutorial: How to add the Attachment Viewer to your mail file

As promised, here is the step by step tutorial for adding the attachment viewer to your email.  Go ahead and check out the video before you begin so you will get a clear picture of what I am talking about – in case you missed the post.  While these steps are very basic, I am going to explain them using the very technical Eclipse terminology so in the end you will surely know how the Notes 8 client is constructed and especially Mail. 🙂

Attachment viewer in Lotus Notes Mail

Step by Step Instructions

First step is to install the widget.  You will need Toolbox enabled in the Notes client in order to do this.  You can drag and drop the widget right from this page into your My Widgets view.  This installs the Eclipse feature and plugin that contains the SWT ViewPart into the client – which is exactly the same view part we will be placing in our mail file.

Next, if you did not install The Composite Application Editor (CAE) when you installed Lotus Notes then you will need to re-install and make sure it is selected in the install options.  The CAE will allow us to tell the Eclipse subsystem how perspectives (Documents) will be opened.  We are going to change email so the Memo and Reply forms will be opened into a composite page versus just the document view opening in its own tab.

Open your mail file in Lotus Notes, then at the top, in the menu select Actions | Edit Application.  It should be at the bottom of the list.  If you do not see this option then you have one of two problems: 1 – the CAE is not installed or 2 – your mail template is not version 8 and above.

The first step we will do in the CAE is turn on a setting at the application level.  You access the application properties by clicking the menu of the Page Navigator menu:

When the dialog opens, navigate to the Advanced tab and create a new property called com.ibm.rcp.useClonePages and set its value to true.

This application property tells the composite runtime to open any document doubled clicked in the application inside of a corresponding composite page.  We will then create two new pages in the hierarchy called Memo and Reply – meaning any time a document where the form name equals “Memo” or “Reply” the corresponding page is opened instead.  This setting is what controls that logic path.

Next, right click on the Mail page in the Page Navigator and bring up the context menu.  Select Add Page and then After…

When the dialog appears name the page “Memo“.  This is very important because this fills in the alias property of the page which needs to be the same value as the name of the form in the document being opened.  You can verify this by right clicking on the new Memo page in the Page Navigator and bring up the Page Properties.

As shown in the screen shot, you can also use the Select button to change the page icon.  This will then be used when the Memo form is open in its own tab.  Close the dialog by clicking the Ok button.

We will now add some components to the page but first we need to define the components in our Component Palette.

Under the Component Palette select the Add Component button and then select NSF Component:

When the dialog comes up you can name it whatever you want.  Then select the Browse button and just click Ok with the Database option and the users mail file.  In the end, the URL is not even used because this view part is simply a placeholder for the document being open.

Next, click the Advanced button (which should now be enabled) and add the com.ibm.notes.isDocumentPlaceholder property and set it to true. This tells the CA run-time to use this view part for the document being opened within the composite page.  *There can only be one component on a page with this setting set to true.

Click Ok on both dialogs and then the component should be added to the My Palette area of the CAE.  You can then drag that component from the My Palette to the center of the screen to place it on our new page.

We are almost done with the first page!

Next we are going to add the Attachment Viewer to the Memo page.  We need to find the component since it does not show up on the palette automatically.  CAE has a neat little utility that scans the Eclipse view registry to see what views are installed in the system.  The dialog will show any view part that has the allowMultiple setting set to true – which the Attachment Viewer does!

Once you select this a dialog will appear, since the views title begins with “a” it should be close to the top of the list.  Look for “Attachment Viewer“.  Select the Attachment Viewer component and click Ok.

This adds the component (Eclipse View) to the palette.   You can then drag the Attachment Viewer from the palette to the screen positioning it under the Memo component.  You can also change the height of it so it is very small at the bottom of the screen – this is the height of the component when a memo document is open in the client.  You can click on the image below to see how small I made it.

You can now use the application as is or go ahead and create pages for Reply or the other mail file forms like calendar entry, etc.

Close the Composite Application Editor and make sure you save your changes.

That’s it!

10 thoughts on “Tutorial: How to add the Attachment Viewer to your mail file

    • Ugh, thanks Patrick. I went ahead and removed the “else” condition from the javascript file – so if I do not recognize the type of file I do not create an block. You have to uninstall and re-install the widget.

      Like

  1. Pingback: Tweets that mention Tutorial: How to add the Attachment Viewer to your mail file » Balfes.net -- Topsy.com

  2. The plugin does not work any more in a Mac 8.5.1 client:

    osgi> start org.openntf.attachmentviewer
    org.osgi.framework.BundleException: The bundle could not be resolved. Reason: Missing Constraint: Require-Bundle: com.ibm.rcp.xulrunner.runtime.win32.x86; bundle-version=”0.0.0″
    at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:309)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:265)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:257)
    at org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(FrameworkCommandProvider.java:257)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:150)
    at org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:302)
    at org.eclipse.osgi.framework.internal.core.FrameworkConsole.console(FrameworkConsole.java:287)
    at org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:223)
    at java.lang.Thread.run(Thread.java:637)

    osgi>

    Like

    • Thanks Karsten. Can you uninstall and re-install to check it out. I removed the use of XULRunner for now.

      I also fixed the size issue with embedded IE. I was doing node.createElement() and it was causing the browser to set the height and width regardless of what I did a set attribute with. So I just moved it to use .innerHTML = with my own string. So now the resize works! Weird.

      Like

  3. Cool stuff, thanks.

    Out of curiosity (and forgive me for being a n00b), how would one go about deploying a widget + CA change like this to an organization?

    Could it be as simple as modifying the CA in the template and choosing “Add from update site” or “NSF Component” (and adding the widget to the appropriate place) or is there more to it?

    A pointer in the right direction would be much appreciated.

    Nice work.

    Like

    • Oh great, I must have left it enabled. There is no option, I will have to post another plugin. You can then just copy down the one plugin over the existing file. Make sure you shut down notes first. I will let you know when I post the updated plugin.

      Thanks again for helping out.

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s