[TABLE]I'm all for platform independence, but the facts are the majority of WebSphere and iSeries shops are also running Windows-based desktops with Microsoft Office -- Word, Excel, Outlook, etc.
Let's discuss some ideas on how Web applications can integrate with Office and other Microsoft specific components using ActiveX technology. This would enable features such as:
1. Productivity aids to open and create Microsoft Word documents.
2. Integrating calendar features with backend iSeries data
3. Excel integration with backend data
4. Mail integration with Microsoft Outlook
5. and much more
ActiveX definition:
A software module based on Microsoft's Component Object Model (COM) architecture. Increasingly, Microsoft is using the term ActiveX to refer to a variety of its COM-based technologies.
A simple example:
[TABLE]
In this first example, we have the standard HTML tag followed by the declaration of a JScript function. The function is called "openWord()." objShell references the Microsoft Windows scripting object, while objWord references an ActiveX component representing Microsoft Word application. objDoc holds a newly added document that is then set to visible and activated. Finally objShell object is used to send keyboard keys to Word. This is where you could substitute data retrieved from your iSeries for form letters since this Jscript could be generated by WebSphere servlets or JSPs. The last <input> tag creates the button and when clicked runs the Jscript "openWord()."
To run this example, cut and paste the HTML above into an HTML file, such as c:\openWord.html on your desktop and open it with Microsoft Internet Explorer.
You could also run this sample from our Web site, however, because of security, ActiveX components may not be allowed to run on based on yo
To continue reading for free, register below or login
To read more you must become a member of Search400.com
');
// -->

ur browser settings. To work around this, you can add www.planetjavainc.com as a trusted site. To enable this sample, open Internet Explorer->Tools menu->Internet Options->Security Tab and uncheck the https requirement on the bottom. Add www.planetjavainc.com to the list as shown below.
Once completed, open Internet Explorer to this site:
http://www.planetjavainc.com/temp/openWordActiveX.html
You should not be able to click the "Open Word" button that will cause MS Word to open and text to be inserted as shown below:
[TABLE]
[TABLE]
Additional examples
Opening an existing MS Word document:
[TABLE]
In this example, we open a Microsoft Word document called A.doc. iSeries shops could store documents on the IFS with a mapped drive and have a Web application that searches for, and allows, easy access to mission critical documents. Again, your Web application would need to generate the script and replace a.doc with data from your iSeries, which could be easily done with JDBC.
Creating MS Excel worksheets and charts
[TABLE]
This example is very similar except it uses Excel with hard-coded data. You servlet or JSP could generate the data dynamically.
All these examples can be run from:
http://www.planetjavainc.com/temp/activeX.html
Once viewing the page, you can right-click on and select "view source" to see the examples. You can also select File-Save As to save to your desktop and run locally.
Issues:
Obviously this approach locks the user into the Microsoft platform since it uses direct Windows components.
Summary:
This approach could be used to create integrated Web-based applications leveraging iSeries data with MS Window components. There are a vast set of ActiveX components available along with code examples that can be found with a simple Google search.
---------------------------
About the author: Paul Holm is an iSeries WebSphere and Java specialist at PlanetJ Corp. He worked for IBM-Rochester for over 10 years as a DB2/400 and Java/WebSphere developer. Matt Jensen is a Web software developer at PlanetJ Corp.