Another blog on Lotus Notes Technologies

Lotus Notes R8.0.2

John Turnbow August 24 2008 06:22:31 PM
http://www-01.ibm.com/support/docview.wss?uid=swg27012644

I see on some posts people are expecting a release around August 26th.  Yahoo...

New to PlanetLotus.org

John Turnbow August 11 2008 06:12:21 AM
Looks like I am in very good company with many of the best of Lotus technology professionals.  I am a tech guy and like to keep my thoughts around technology and the use of the technology in a way that gives a corporation a competitive edge.  I believe that technology is an ingredient often overlooked. Last week I had a conversation with someone that said we already have all these apps and don't need anything new.  In many cases this may be true, but the new technologies coming out today from IBM and others brings reuse of code to a new level, integration to new levels, meaning fewer lines of code, ease of use,  less duplication of effort, less duplication of data and fewer network resources used since only the data needed is carried on the lines and stored on disk.  All of this means lower cost and giving your company a competitive edge ( http://www.scip.org ).

Some of the technologies part of the IBM/Lotus portfolio now embraces with Web 2.0 (catch all), AJAX, Web Services, Composite Application, xPages, Lotus Notes R8+, Symphony, Connections, phone and device support and Quickr.  

So, can we start referring to Microsoft as a Legacy company? One that does not enable a company to be as competitive as the next due to cost? It's all about margin in the corporate world, so if we help enable a company to be better, faster, and cost less, then we've contributed to that bottom line.

I think this is where IBM/Lotus is starting to shine now.

AJAX calling Web Service (How It Works)

John Turnbow August 4 2008 08:31:35 PM
As promised, in a previous post I said I would explain how the AJAX solution I created works with a web service. I believe this is a nice solution as there is no additional software needed other than Lotus Notes.  Here is how I worked AJAX to call a Web service.  Simple, really, just call a Lotus Notes agent via XMLHTTP, the Notes agent then calls the Web service, utilizing the Consumer. The Web Service takes off on it's own could be anywhere on the web. The return value is then sent back to the agent for processing. The Lotus Notes agent does a simple print back to the XMLHTTP process which then uses some Javascript to print back to the web page.

Click Here for Sample

Here is a simple flowchart of how it works.
Image:AJAX calling Web Service (How It Works)
   Code from Lotus Notes Agent: (LookupData)
   Dim msg As String, username As String, password As String, endpoint As String
   Dim port As New ClassChemicals
   
   endpoint = "http://www.recondite2.com/Turnbow/chemicals.nsf/chemicalsList?openwebservice"
   username = "John Tester"
   password = "test"
   
   Call port.SetEndpoint( endpoint )  'Point to Web service with URL above
   Call port.SetCredentials(username, password ) 'send Name and password
   
   Returndata =  port.LookupChemical(getChemical) 'do the lookup here using web service - value is put into Returndata
   
   Print "Content-Type: text/plain"
   Print "Price is: " & Returndata & "  " & query 'passed back to XMLHTTP process.

Code from the Web Service.


We have two web services actually.  One as a consumer and one as a provider.  The "Provider" is the service that processes the data we pass it with the "Consumer". The Consumer makes a call to the Provider to give us the data we've asked for.

Provider

Dim s As NotesSession
Dim db As NotesDatabase
Dim nam As NotesName
Dim doc As NotesDocument
Dim view As NotesView
Dim dc  As NotesDocumentCollection

Class ClassChemData
     Public ChemicalName As String        
     Public Price As String
End Class

Class ClassChemicals
     Sub New()
             Set s = New NotesSession
             Set db = s.CurrentDatabase
             Set doc = db.CreateDocument 'temporary for Evaluate
     End Sub        
     
     Function LookupChemical(Chem As String) As String
             Set view = db.GetView("ByChemName")
             Set doc = view.GetDocumentByKey(Chem,True)
             If doc Is Nothing Then
                     LookupChemical = "Price Not Found"
             Else
                     LookupChemical =  doc.Price(0)
             End If
     End Function
     
End Class

Consumer

The Consumer is actually built for us by Notes when importing the WSDL.  

%INCLUDE "lsxsd.lss"
Class ClassChemicals As PortTypeBase
     
     Sub NEW
             Call Service.Initialize ("UrnDefaultNamespaceClassChemicalsService", _
             "ClassChemicalsService.Domino", "http://www.recondite2.com:80/turnbow/chemicals.nsf/chemicalslist?OpenWebService", _
             "ClassChemicals")
             
     End Sub
     
     Function LOOKUPCHEMICAL(CHEM As String) As String
             Let LOOKUPCHEMICAL = Service.Invoke("LOOKUPCHEMICAL", CHEM)
     End Function
     
End Class


So, now you can see how all the pieces fit together using a web browser with no added software.  Using AJAX, Javascript, a LotusScript agent you can interfaces with any Web Service.

AJAX with Web Services proof of concept

John Turnbow July 19 2008 10:14:05 AM
Web services are very exciting. What makes this technology exciting is being able to link to another data source and not care about the technology behind it.  

The benefits of using AJAX with a Web Service (internal or external)
  • No down loading a boat load of data from one environment to another
  • Data is fresh coming from the source (or as near as you can get - e.g. Data Warehouse) - no waiting for updates
  • Network traffic is kept at an optimum as no large transfers of files or data is needed
  • No need for vendor specific drivers or software, so we save money not having to purchase these outdated things or creating them ourselves in house.
  • Data is transferred via a standard accepted format XML
  • Data and functions are defined by the WSDL (Web Services Description Language) so you may not even need to talk to an IT person in another department if the WSDL is documented well. Means people can stay focused on their work.
  • Security models are kept in tact as direct access removes the ability of other ancillary areas to grant access to down loaded data that was not intended.
  • Resources for data integration no longer need to be "Masters" of multiple technologies just to work with data from another system, source, or device.
  • No additional software needed to make this work as with other web solutions
  • Of course all of this together means that you save time, money. Hardware resources, and people resources are kept focused on their intended work.

So, for these benefits, I thought as a proof of concept I would merge AJAX and a Web service.  This means that our Domino applications can work with data on any web service enabled system, software, or device.

We also need a business example to sell to management, so one business example might be that you have a Lotus Notes Deal database with the prices existing in SAP. So, calling the SAP Web service you are able to look-up the price (or post one). The nice thing about the SAP Web service is that it does not care about what technology is being used to call it either. Of course this means working with anyone that is a web service provider, the backend could be anything.

To make this work we have to use some Javascript to call an XMLHTTP request that then calls a Lotus Notes agent that then calls a Web Service. A lot of moving parts, but once you create a repeatable template then it can be used over and over again. This may seem a little convoluted, but remember the web service can reside anywhere and we don't care about the technology behind it.

This is a simple build on of technology, instead of doing something native to Lotus Notes/Domino with AJAX now we add an extra ingredient to our Lotus Notes Agent to run a web service behind the scenes.

Click Here for Sample

I'll Post the database and code later... Going to teach Tae Kwon Do and then see Batman.

Web Service in R8.5

John Turnbow July 12 2008 02:46:46 PM
I like the organization of all the design elements in R8.5.  I like that now we have more separation for Providers and Consumers.
In this example first we'll create a Provider and then create a Consumer. All of the code and explanation is below along
with a sample database for you to play with (chemicals.nsf)

Image:Web Service in R8.5
As you can see in the pic above there is a clear separation of Providers and Consumers.  Much nicer than in R7 or R8.0x. In
this new version all of the design elements are well categorized, easy to find and use.

First we click on "New Web Service Provider".  When writing a web service with Lotusscript know that a web service exists as
a single class instance.  Always remember to include "lsxsd.lss".   Next we have to create our class.  See the sample code below.

Dim s As NotesSession
Dim db As NotesDatabase
Dim nam As NotesName
Dim doc As NotesDocument
Dim view As NotesView
Dim dc  As NotesDocumentCollection

Class ClassChemData
Public ChemicalName As String        
Public Price As String
End Class

Class ClassChemicals  'include this as your port type
Sub New()
    Set s = New NotesSession
    Set db = s.CurrentDatabase
    Set doc = db.CreateDocument 'temporary for Evaluate
End Sub        

Function LookupChemical(Chem As String) As String
    Set view = db.GetView("ByChemName")
    Set doc = view.GetDocumentByKey(Chem,True)
    If doc Is Nothing Then
            LookupChemical = "Price Not Found"
    Else
            LookupChemical =  doc.Price(0)
    End If
End Function

End Class

Some relationships to know is that the PortType Class refers to the Class "ClassChemicals". Service port name for
is Domino.


Image:Web Service in R8.5Image:Web Service in R8.5

Save it all and now we can look at the WSDL that Domino creates for us.  A WSDL is an XML representation of the elements
and operations available in the web service. You can check this sample here.
http://www.recondite2.com/turnbow/chemicals.nsf/chemicalslist?WSDL

So, now we have our web service provider to give us some data so long as we give it the key.  
So, next we create we Web Service Consumer.  
We use the Provider URL to import into our new Web Consumer.

Just give the consumer a name and import the WSDL using the URL.

Image:Web Service in R8.5

So, let's look at what we have. Lotus Notes does all the build for us.  We'll need to use this new Web Consumer to get data from
the Provider.  We'll call the LOOKUPCHEMICAL function to make a call to the web service provider.

Image:Web Service in R8.5



OK, so now we have built our Provider and Consumer.  Now we can start working with the Web services to pull some data.  Let's build a form
to activate the consumer by giving the Consumer the chemical and credentials to do a simple lookup and value return
for us.

What we are going to do is send a Chemcial name and then return the price, very simple lookup.  This is a sample only the web service
could exist anywhere.

In the button, below we'll have to set the endpoint to the Web Service URL so we know where to get our data. Next  we have to do a
port.setcredentials so we can log on to the Web Service to get our data.   Now that we have communicated the URL and credentials
we can can ask the provider to execute the LookupChemical function passing it the chemcial name we want our price on and return the price.  That's all there is to it.  - This could be the "Dblookup" web service... LOL... The sample code is below.


Image:Web Service in R8.5
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim composed As String
Dim getChemical As String
Set uidoc = ws.CurrentDocument
getChemical = uidoc.FieldGetText( "Chemical" )

Dim msg As String, username As String, password As String, endpoint As String
Dim port As New ClassChemicals

endpoint = "http://www.recondite2.com/Turnbow/chemicals.nsf/chemicalsList?openwebservice"
username = "John M Turnbow"
password = "xxxxxxx"


Call port.SetEndpoint( endpoint )
Call port.SetCredentials(username, password )

Call uidoc.FieldSetText("Price", port.LookupChemical(getChemical)) 'this is where we get our Price from chemical entered.


End Sub

Desktop of the future

John Turnbow March 30 2008 08:23:57 AM
This presentation from Ed Brill could also be named "How to save money in IT"  or "IBM Saves you money $$$".  

While it shows some good numbers for saving money, to be complete and give a more accurate delta, the presentation needs some numbers around central management and software to accomplish it, the cost of conversion and education.  The difference between the MS$ and the new desktop described is some $700 in round numbers, if you were to boldly say that central management, conversion cost, and education cost $200 per desktop, then you are still saving your company $500 per desktop using Ed's numbers.  Just a thought... What are yours?