Welcome to InteropTips Sign in | Join | Help


Demos

Last post 06-30-2006, 1:36 PM by GaryDev. 0 replies.
Sort Posts: Previous Next
  •  06-30-2006, 1:36 PM 62

    Notes Form design DXL over HTTP demo

    demo of pulling the “Form” design as DXL/XML

     

    http://www.msdomino.net/orders.nsf/formXML?openagent?order

    This URL calls the public Agent "formXML" with the parameter "order"  which is the Form name.

    Valid forms are “New order”, “XSLT”, “TEST”, and “order”.  Just replace the text after the second “?” with the form you want and you will get it’s XML version.   A Notes document can be rendered with many forms.  In this case, “order” and “New order” are designed for the same documents.  By doing a transform on the Document XML and the appropriate Form XML we should be able to create an Infopath form that looks like the Notes document in the Notes client.  

     

    LotusScript:

    Sub Initialize
     
     Dim s As New notessession
     Dim db As notesdatabase
     Dim doc As notesdocument
     Dim doc1 As notesdocument
     Dim Myform As NotesForm
     Dim view As NotesView
     Dim OrderID As Long
     Dim stream As NotesStream
     Set doc1 = s.DocumentContext
     Set db = s.currentdatabase
     Set stream = s.CreateStream
     
     On Error Goto Myerr
    ' Tell Domino return content is XML
     Print "Content-type: text/xml"
     
    'read the URL parameter
     CommandStr = s.DocumentContext.Query_String_Decoded(0)
     FormName = Mid(CommandStr,11)  ' remove ?openagent prefix
     
       REM Create note collection
     Dim nc As NotesNoteCollection
     Set nc = db.CreateNoteCollection(False)
     Call nc.BuildCollection
     
     'formName from URL parmeter
     Set Myform = db.GetForm(formName)
     Call nc.Add(Myform)
     
      REM Export note collection as DXL
     Dim exporter As NotesDXLExporter
     Set exporter = s.CreateDXLExporter(nc, stream)
     exporter.OutputDOCTYPE=False
     
     Call exporter.Process
     
     
     Print stream.ReadText()
     'Print Myform.Name
     '**********************************
     End
    Myerr:
     If (Err = 4336) Or (Err = 13) Then
      Print |<?xml version="1.0" encoding="utf-8" ?>|
      Print |<error>Form Not Found - error number- | & Err & |</error>|
     Else
      Print |<?xml version="1.0" encoding="utf-8" ?>|
      Print |<error>You reached in error | & Err & |  | & Error$ &| | & Erl &  |</error>|
     End If
     
     
    End Sub

     

View as RSS news feed in XML

Terms of Use |  Upload Agreement |  Trademarks |  Privacy Statement |  Contact Us

© 2006 Microsoft Corporation. All rights reserved.