|
|
|
|
|
|
|
|
Developing a Palm VII PQA that reads data from a Domino database (continued)
Looking at the LotusScript agent code Now let's dig into the code a bit and discuss some of the things you should include in your Web clipping scripts.
When the form is posted to the Domino server, there is a CGI variable called REQUEST_CONTENT that contains all of the values of the fields on the form. In our sample there is only one field called "Customer". The following code gets the value of the Customer field and stores it in Customer$.
Customer$ = Mid$(doc.REQUEST_CONTENT(0),Instr(1,doc.REQUEST_CONTENT(0),"=") + 1, Len(doc.REQUEST_CONTENT(0)))
|
When you generate a Web clipping, you need to put some information in the HEAD section of the resulting HTML. Since Domino likes to generate its own HEAD data, we need to tell Domino not to generate a HEAD section. These two lines of code prevent Domino from generating the HEAD section:
Print "Content-Type:text/plain"
Print "Content-Type:text/html"
|
Now that we told Domino not to generate a HEAD section we need to generate our own. Notice the meta tags in the HEAD section -- palmcomputingplatform and historylistext. These two tags tell the Palm VII that the data it's about to receive is intended for it, and that the History should contain the name of the Customer entered.
Print "<head><Title>PalmBuilder</Title>"
Print "<meta name=palmcomputingplatform content=true>"
Print "<meta name=historylisttext content=" & Ucase$(Customer$) & ">"
Print "</head>"
|
For the sake of simplicity we'll use the database search method to find records in the database that contain the customer name we entered. You can refine your search using other Notes classes such as the new R5 NotesViewEntryCollection.
Set c = db.ftsearch(Customer$, 0)
|
The rest of the LotusScript agent is simple LotusScript document collection processing. For each document in the document collection, we print the customer information from the back-end document.
We also need to provide the user with a way to navigate back to the previous page so that he or she can search for more customers.
Print "<a href=""file:Customers.pqa/Customers.html"">Back</a><p>"
|
Notice the reserved PQA word "file". This tells the Palm VII that the when the Back link is tapped with the stylus to load the Customers.html file in the Customers PQA.
|
|
|
|
|
|
|
|
|
|
|