This is a great technique! I unfortunately got stumped for a while because
exact copies of your design elements (re-signed) were not working for me after
being pasted into my database. The problem presented itself as the agent not
seeing any POST data, only GET data. I knew like all computer problems I was
just missing some single character somewhere, and sure enough that held true
again.
I finally realized because I had "require SSL for this database" checked on the
database properties, combined with a conflicting HTML Head Content on the form
that Domino kept rewriting the POST into a GET.
The solution was simple: change the HTML Head Content on the $$ViewTemplate you
provided to have HTTPS instead of HTTP as follows:
@NewLine + "<base href=\"https://" ... rest of your code.
In the process of doing this, I did hack together a previous agent from one of
your other readers, along with updating it a bit to use @URLDecode. The
purpose of this agent is to spit out on the server console what kind of data is
coming in on a request to an agent (GET or POST). Maybe someone else will find
it handy also. It will display any data POST-ed to it on the server console
for debug purposes.
'CodeStoreRequestProcessor:
Option Public
Function fnGetRCFieldValue( requestContent$, fieldToGet$ ) As Variant
'Owen Enraght-Moony 28-01-99
'returns: the value of a field in the Request_Content CGI var (case sensitive)
Dim search$, retStr$, offset%, ends%
search$ = fieldToGet$ & "="
retStr$ = ""
offset% = 0
ends% = 0
offset = Instr(requestContent$, search)
If (offset <> 0) Then
offset = offset + Len(search)
ends = Instr(offset, requestContent$, "&")
If (ends = 0) Then ends = Len(requestContent$)+1
retStr = Mid(requestContent$, offset, ends-offset)
End If
fnGetRCFieldValue = Trim$(retStr)
End Function
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim context As NotesDocument
Dim process As NotesDocument
Set db = session.CurrentDatabase
Set context = session.DocumentContext
Messagebox "Request_method: " + context.Request_Method(0)
Messagebox "Request_context: " + context.Request_Content(0)
Const NotesMacro$ = |@URLDecode("Domino"; Request_Content)|
Dim request_content_decoded As Variant
request_content_decoded = Evaluate( NotesMacro$, context)
Messagebox "Decoded: " & request_content_decoded(0)
'This line gets the field you are looking for from the decoded data
Dim fieldvalue As String
fieldvalue = fnGetRCFieldValue(request_content_decoded(0),
"processdocs")
Messagebox "processdocs: " & fieldvalue
End Sub
Jake,
This is a great technique! I unfortunately got stumped for a while because exact copies of your design elements (re-signed) were not working for me after being pasted into my database. The problem presented itself as the agent not seeing any POST data, only GET data. I knew like all computer problems I was just missing some single character somewhere, and sure enough that held true again.
I finally realized because I had "require SSL for this database" checked on the database properties, combined with a conflicting HTML Head Content on the form that Domino kept rewriting the POST into a GET.
The solution was simple: change the HTML Head Content on the $$ViewTemplate you provided to have HTTPS instead of HTTP as follows: @NewLine + "<base href=\"https://" ... rest of your code.
In the process of doing this, I did hack together a previous agent from one of your other readers, along with updating it a bit to use @URLDecode. The purpose of this agent is to spit out on the server console what kind of data is coming in on a request to an agent (GET or POST). Maybe someone else will find it handy also. It will display any data POST-ed to it on the server console for debug purposes.
'CodeStoreRequestProcessor:
Option Public
Function fnGetRCFieldValue( requestContent$, fieldToGet$ ) As Variant 'Owen Enraght-Moony 28-01-99 'returns: the value of a field in the Request_Content CGI var (case sensitive) Dim search$, retStr$, offset%, ends% search$ = fieldToGet$ & "=" retStr$ = "" offset% = 0 ends% = 0 offset = Instr(requestContent$, search) If (offset <> 0) Then offset = offset + Len(search) ends = Instr(offset, requestContent$, "&") If (ends = 0) Then ends = Len(requestContent$)+1 retStr = Mid(requestContent$, offset, ends-offset) End If fnGetRCFieldValue = Trim$(retStr) End Function
Sub Initialize Dim session As New NotesSession Dim db As NotesDatabase Dim context As NotesDocument Dim process As NotesDocument Set db = session.CurrentDatabase Set context = session.DocumentContext Messagebox "Request_method: " + context.Request_Method(0) Messagebox "Request_context: " + context.Request_Content(0) Const NotesMacro$ = |@URLDecode("Domino"; Request_Content)| Dim request_content_decoded As Variant request_content_decoded = Evaluate( NotesMacro$, context) Messagebox "Decoded: " & request_content_decoded(0) 'This line gets the field you are looking for from the decoded data Dim fieldvalue As String fieldvalue = fnGetRCFieldValue(request_content_decoded(0), "processdocs") Messagebox "processdocs: " & fieldvalue End Sub