Google Groups Home
Help | Sign in
Create record/document in Domino from web application
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
sira...@hotmail.com  
View profile
 More options Mar 19, 9:22 pm
Newsgroups: comp.groupware.lotus-notes.programmer
From: sira...@hotmail.com
Date: Wed, 19 Mar 2008 18:22:30 -0700 (PDT)
Local: Wed, Mar 19 2008 9:22 pm
Subject: Create record/document in Domino from web application
Hi, I have none to very little experience in Domino. So bear with my
ignorance as I try to explain my request.

We have a Lotus Notes application and we would like to automate
creating a new document or record in that application from another web
based application.

I am not asking for the entire code. All I would like is some
direction or high level steps to accomplish the above.

Here are the details:
User action on web application triggers a PERL script to create a new
record (document) in Lotus Notes (or Domino).

Question:
How can I accomplish the above? Clearly there is no Notes Client
available to the Web Application. So do I write an agent that creates
a new document? How can I call this agent from my web application? Or
am I taking the wrong approach?

Any suggestions would be greatly appreciated!


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
kaps  
View profile
 More options Mar 25, 3:51 am
Newsgroups: comp.groupware.lotus-notes.programmer
From: kaps <kapildeopan...@gmail.com>
Date: Tue, 25 Mar 2008 00:51:51 -0700 (PDT)
Local: Tues, Mar 25 2008 3:51 am
Subject: Re: Create record/document in Domino from web application
Hi,
You can use the agent approach, look into RunAgent property for
details.
Create new document in agent.

I cd not look into details if there's another way to do it, but if you
not able to do it with agent, let me know.

Kapil


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Karl-Henry Martinsson  
View profile
 More options Mar 25, 11:32 am
Newsgroups: comp.groupware.lotus-notes.programmer
From: "Karl-Henry Martinsson" <tx...@yahoo.com>
Date: Tue, 25 Mar 2008 15:32:15 GMT
Local: Tues, Mar 25 2008 11:32 am
Subject: Re: Create record/document in Domino from web application

<sira...@hotmail.com> wrote in message

news:70433929-b470-4b28-a027-fad0ce581cf7@a23g2000hsc.googlegroups.com...

As "kaps" also suggest, the agent approach is the best. I am using it myself
in several applications.

This is what I would do:
Create an agent that read the URL parameters you send to it.
Let's call the agent CreateNewDocument, and have two fields we want to fill
out when the document is created. The Perl script can then call the URL like
this:

http://www.example.com/notesdd.nsf/CreateNewDocument?OpenAgent&name=J...

The agent read the arguments and populate the corresponding fields, then
save the document. I would highly recommend using a list to store the
parameters, then you have a generic function you can re-use in any
application.
In my article in the November/December 2006 issue of The View (starting on
page 25) you have code for this.

Here is a class I just wrote to parse an incoming HTTP GET or POST. Put it
in a script library called for example "URL.class":

Class URLclass
 Public url As String
 Private params List As String

 Public Sub New()
  Dim session As New NotesSession
  Dim doc As NotesDocument
  Set doc = session.DocumentContext ' Document with all CGI variables
  ' Check if HTTP GET or POST was used...
  If Instr(doc.Query_String(0),"&") > 0 Then  ' GET was used
   url = doc.Query_String(0)
  Elseif Instr(doc.Request_Content(0),"&") > 0 Then ' POST was used
   url = "&" & doc.Request_Content(0)
  Else          ' No parameters
   Exit Sub
  End If
 End Sub

 Public Function GetParams() As Variant
  Dim offset As Integer
  Dim startpos As Integer
  Dim midpos As Integer
  Dim endpos As Integer
  Dim nextpos As Integer
  Dim dataname As String
  Dim datavalue As String
  startpos = Instr(url,"&")    ' Start of first parameter
  Do While Not startpos = 0
   nextpos = Instr(startpos+1, url, "&") ' Start of next parameter
   If nextpos = 0 Then     ' We reached the end
    endpos = Len(url)+1
   Else
    endpos = nextpos
   End If
   midpos = Instr(startpos+1, url, "=") ' Position of = character
   dataname = Mid$(url,startpos+1,midpos-startpos-1)  ' Get name
   datavalue = Mid$(url,midpos+1,endpos-midpos-1)  ' Get value
   params(dataname) = datavalue   ' Add value to list
   startpos = nextpos     ' Set new start position
  Loop
  GetParams = params
 End Function

End Class

And here is a sample agent that uses the class and print the arguments to
the browser:

Option Public
Option Declare
Use "URL.class"

Sub Initialize
 Dim url As New URLclass
 Dim params As Variant
 params = url.GetParams()
 Forall x In params
  Print Listtag(x) & " = " & params(Listtag(x)) & "<br>"
 End Forall
End Sub

Just expand on that code to create the document. Good luck!

I am also posting this code to my blog at
http://www.bleedyellow.com/blogs/texasswede/entry/parse_url_in_domino...

/Karl

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

Visit my blog at http://www.bleedyellow.com/blogs/texasswede/


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Karl-Henry Martinsson  
View profile
 More options Mar 26, 9:10 am
Newsgroups: comp.groupware.lotus-notes.programmer
From: "Karl-Henry Martinsson" <tx...@yahoo.com>
Date: Wed, 26 Mar 2008 13:10:29 GMT
Local: Wed, Mar 26 2008 9:10 am
Subject: Re: Create record/document in Domino from web application
Visit my blog at http://www.bleedyellow.com/blogs/texasswede/
"Karl-Henry Martinsson" <tx...@yahoo.com> wrote in message

news:3W8Gj.30146$R84.10719@newssvr25.news.prodigy.net...

> This is what I would do:
> Create an agent that read the URL parameters you send to it.
> Let's call the agent CreateNewDocument, and have two fields we want to
> fill out when the document is created.

Followup: Tim Tripcony (http://www.bleedyellow.com/blogs/trip/) posted the
following as a comment to my blog entry at
http://www.bleedyellow.com/blogs/texasswede/entry/parse_url_in_domino...

"If the Perl script issues a POST request instead of a GET, you can do this
without an agent:
http://www.example.com/notesdd.nsf/FormName?CreateDocument
That way you can just post the field/value pairs and they'll be written to
the correct fields automatically. It'll also honor any WebQuerySave agents
defined on the form, $$Return, input validations, etc."

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google