Skip to main content
This forum is closed to new posts and responses. New discussions are now taking place in the IBM Developer Answers forum.
Information Mgmt
New to Lotus
How to buy
Live demos
Technical library
Forums & community
Java™ technology
Open source
SOA and Web services
Web development
My developerWorks
About dW
Submit content

developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum



PreviousPrevious NextNext

RE: Here's a suggestion
Kings Fern 14.Feb.18 02:27 AM a Web browser
Applications Development 7.0.3 FP1 Linux on zSeries

Thanks for your reply & tips to NewComers on this forum.

My WebQueryOpen agent code is:
Agent VerifyUser
Created Feb 5, 2018 by Kingsley E Fernandes-1/India/IBM
Description: Comments for Agent
Option Public
Option Declare
Use "BluePages"
Sub Initialize
On Error GoTo ErrHandle
Dim s As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim coll As BPResults
Dim bpd As BluePages
Dim curUser As NotesName
Dim dbProfileView As NotesView
Dim dbProfileDoc As NotesDocument
Dim http As Variant
Dim userEmail As String
Dim objHttp As Variant
Dim url As String
Dim req As Variant
Dim webDoc As NotesDocument
Dim rtItem As NotesRichTextItem

Set doc = s.Documentcontext
Set db = s.Currentdatabase
Set dbProfileView = db.Getview("Database Profile")
Set dbProfileDoc = dbProfileView.Getfirstdocument()

Set bpd = New BluePages(dbProfileDoc.APILocator(0)) 'which is the same as = New BluePages("")

If Not bpd.IsOpen() Or bpd.GetReturnCode() <> 0 Then
MessageBox "Error in connecting to BluePages API",, "Error"
Exit Sub
MessageBox "Connected to BluePages API"
End If

Set curUser = New NotesName(doc.Remote_User(0))
MsgBox "In WQO agent: User logged in is " + doc.Remote_User(0) + " Abbv Name = " & curUser.Abbreviated

'Set coll = bpd.GetPersonByCnum("03350M")
Set coll = bpd.GetPersonsByNotesID(curUser.Abbreviated)
'Set coll = bpd.GetPersonsByNotesID("John O'Brien/Somers/Contr/IBM")
If coll.succeeded() Then
MsgBox "BP message = " & coll.GetErrorMessage() & " code = " & coll.GetReturnCode() 'If the query completed normally,
If coll.rows() = 0 Then 'No records found
Msgbox curUser.Abbreviated & " was not found." & coll.GetColumn("name")
ElseIf coll.rows() >= 1 Then ' coll.rows()>=1 ...and found at least one name,
Msgbox "Name: " & coll.GetColumn("name") & " EMAIL = " & coll.GetColumn("INTERNET")(0)
End if
End If

userEmail = coll.GetColumn("INTERNET")
'userEmail = ""

MsgBox "To verify " & userEmail & " in ICA BlueGroups"

url = "" & userEmail & "&group=ICADEV"
Set objHttp = CreateObject("MSXML2.ServerXMLHTTP") "POST", url, False
objHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
objHttp.send req

MsgBox objHttp.responseText

If InStr( objHttp.responseText, "<rc>0</rc>") <> 0 Then
MsgBox "User is a Member of ICADEV BlueGroups"
MsgBox "User is NOT a Member of ICADEV BlueGroups"
End If

Exit Sub

MsgBox "WQO agent error on line = " & Erl & " with msg = " & Error$
End Sub

The output in the Logs are:
02/14/2018 02:07:14 AM Agent message: Connected to BluePages API
02/14/2018 02:07:14 AM Agent message: In WQO agent: User logged in is CN=Kingsley E Fernandes-1/OU=India/O=IBM Abbv Name = Kingsley E Fernandes-1/India/IBM
02/14/2018 02:07:14 AM WEB(2): Loading additional WEB task
02/14/2018 02:07:14 AM WEB(3): Initializing
02/14/2018 02:07:15 AM Agent message: BP message = Success code = 0
02/14/2018 02:07:15 AM Agent message: Kingsley E Fernandes-1/India/IBM was not found.
02/14/2018 02:07:15 AM Agent message: To verify in ICA BlueGroups
02/14/2018 02:07:15 AM Agent message: WQO agent error on line = 77 with msg = Operation not supported on this platform
02/14/2018 02:07:15 AM Agent 'VerifyUser' error: No RESUME

Above shows that even though it has connected to BluePages, the subsequent call says the user is not found which is Incorrect.

Some related BluePages scriptlibrary code:
Class BluePages
Private webDb As NotesDatabase ' The local client's Web Retriever database.
Private webDBOpen As Integer ' Set to true if Web Retriever opens.
Private locatorURL As String ' URL for accessing API Locator, for API dictionary.
Private urlList List As String ' A dictionary of URLs, keyed by command names.
Private listInPlace As Integer ' Flag to determine if API dictionary is loaded.
Private statusCode As Integer ' Integer code to indicate the status.
Private errorMessage As String ' Error message (if any) to indicate the status.

' Constructs a new BluePages object with the specified URL for the Web Server
' API Locator. Opens the Notes Web Navigator to be used to retrieve outputs
' from URLs.
Sub New(locatorURL As String)
' Default API Locator:
Me.locatorURL = locatorURL

Me.listInPlace = False

Set Me.webDb = New NotesDatabase("", "")
If Not Me.webDb.OpenURLDb Then
' On Notes client, false if Open/Retrieve Pages is "from
' Notes workstation" and Web Navigator Database is
' blank or if Open/Retrieve Pages is "no retrievals" and
' Web Navigator Database is blank or nonexistent..
' Messagebox "Error: Configuration for Web Navigator is incorrect", , "BluePages Script Library"
Me.statusCode = 1
Me.errorMessage = "Unexpected error occurred due to invalid Web Navigator configuration."
Me.webDBOpen = False
Me.statusCode = 0
Me.errorMessage = ""
Me.webDBOpen = True
End If
End Sub

Function GetPersonsByNotesID(template As String) As BPResults
Set GetPersonsByNotesID = GetBPResults("ALLBYNOTESID", template & "%")
End Function

' Returns a BPResults object representing the result table constucted based on
' the results to be retrieved for the specified Web Server API query function
' (opName) and the query string (opArg).
Private Function GetBPResults(opName As String, opArg As String) As BPResults
Dim bpe As BPEnumerator

If Me.IsOpen() Then
opArg = Trim$(opArg)

' If argument is missing, warn..
If opArg ="" Or opArg = "%" Then
Set bpe = Me.GetFailedBPEnumerator(opName & " requires a string argument.")
Elseif opArg = "+" Then
Set bpe = Me.GetFailedBPEnumerator(opName & " requires two string arguments.")
' If argument is present, fetch data from BluePages..

' Is the API dictionary is loaded?
If Me.URLListReady() Then
' Does the specified query function exist?
If Iselement(Me.urlList(opName)) Then
Set bpe = Me.GetBPEnumerator(Me.urlList(opName) & URLEncode(opArg))
' The specified query function does not exist..
Set bpe = Me.GetFailedBPEnumerator("Command: " & opName & " not found in the API dictionary.")
End If
' The API dictionary is not loaded..
Set bpe = Me.GetFailedBPEnumerator("The API locator function failed to load the API dictionary.")
End If
End If
Set bpe = Me.GetFailedBPEnumerator("Cannot complete the request due to invalid Web Navigator configuration.")
End If

Set GetBPResults = New BPResults(bpe)
End Function

So the first problem is that it does not fetch the user from getPersonsByNotesID which triggers the log messages: "WEB(2): Loading additional WEB task & WEB(3): Initializing" and the second problem is that I cannot use CreateObject("MSXML2.ServerXMLHTTP") which triggers the log message: Operation not supported on this platform.

Please advise for a workaround. Thank.

Unable to make more HTTP requests i... (Kings Fern 13.Feb.18)
. . Here's a suggestion (Carl Tyler 13.Feb.18)
. . . . RE: Here's a suggestion (Kings Fern 14.Feb.18)
. . . . . . RE: Here's a suggestion (Carl Tyler 14.Feb.18)
. . . . . . . . RE: Here's a suggestion (Kings Fern 15.Feb.18)

Document Options

  Document options
Print this pagePrint this page

Search this forum

Forum views and search

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Advanced search

Member Tools

RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds


Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds


IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Connections Cloud Developers
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums

 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
IBM Connections
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite