|
|
|
|
|
|
|
|
Converting Notes Address Books to the Web for Palm devices and pagers (continued)
The key part of this form is the line of HTML that tells the browser to send all of the UNIDs of all of the documents selected to the "CreateAddressBookForm" and then tells the browser to create a new document. Here's the code that makes this happen:
Remember to customize this code to point to the correct location of the CreateAddressBookForm, shown in Figure D on your server.
FIGURE D
 
The CreateAddressBookForm is the piece of the application where it all comes together. Roll over picture for a larger image.
The CreateAddressBookForm "catches" all of the UNIDs of the User Information Forms that were selected on the previous page. Since you are posting this information using the HTML POST command and specifying within the URL that a document is created, the document automatically saves itself. So you put a $$WebQuerySave field (works on Domino Release 4.5 and 4.6) on the "CreateAddressBookForm" that is a computed or computed for display field that calculates to the name of the agent (in my case, "WebSaveCreateAddressBook").
Using the DocumentContext property of the NotesSession class
In order to get to the information that the user has just entered onto a Web page you must use the DocumentContext property of the NotesSession class. Once you master this, you've got a great way to get at the information the user enters via the Web and to make things happen with it. Here is the snippet of code that sets all of this up:
Set session = New NotesSession
Set db = session.CurrentDatabase
Set note = session.DocumentContext
|
Properly signing an agent using an ID that has rights to run unrestricted agents on the server
The next step, after having created the agent and customizing it to do your bidding, is to get somebody with proper access to sign the agent so that it has sufficient rights to work. Since the agent creates and deletes files off of the server itself, you need to have somebody sign it -- somebody that has access to run unrestricted agents on the server it will be running on. Hopefully, this person will be you, the developer. But if it isn't, don't fret. This is a harmless agent that cleans up after itself. It's just using the file system as a temporary holding place for the file it's creating and then deleting it as soon as it has been attached to another document.
Figuring out the correct file structure of the server so you can temporarily place a file there
One thing that you need to be aware of is that you will need to customize the example I've provided for your own server's operating system if it is running Unix or Solaris or something that does not use the same directory structure as Windows NT. I actually customized the agent so that it would run on a Sun Solaris server and all I really had to do was to put in a forward slash "/" instead of a backslash "\" when calculating the directory variable (where to put the file).
|
|
|
|
|
|
|
|
|
|
|