Author Topic: LotusScript on how to generate XML for Cognos Connection  (Read 158 times)

0 Members and 1 Guest are viewing this topic.

Offline h2obubbler

  • Full Member
  • *
  • Posts: 228
  • Karma: +0/-0
  • Life is like a box of chocolate.
    • View Profile
LotusScript on how to generate XML for Cognos Connection
« on: August 01, 2008, 06:09:29 AM »
This is a sample script i created to create XML via browser. am using it via agent.

Code: [Select]
Sub Initialize
   On Error Resume Next
   
   Dim session As New NotesSession
   Dim db As NotesDatabase
   Dim strTag As String
   Set db = session.currentDatabase      
   Print "Content-type: text/xml"   \'prevents Domino from sending default headers               
   Print |<?xml version=\'1.0\' encoding=\'utf-8\' ?>|               
   Print    |<dataset xmlns="http://developer.cognos.com/schemas/xmldata/1/" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">|            
   
   Print  Tab(1) ; |<metadata>|   
     \'** ALL DATE FORMAT SHOULD BE YYYY-MM-DD STANDARD FORMAT FOR XML FOR COGNOS TO RECOGNIZE DATE
   \'** ALL DATA SHOULD BE VALIDATED AND MODIFICATION IS DONE IN THE NOTES VIEW OF DMS
\' -------------------------------------------------------------------------------
\'     Initialize xml headers
\' -------------------------------------------------------------------------------
   \'column values in All CPS for Reporting view should tally with the values on column name
   
   Print  Tab(2) ; |<item name="Process" type="xs:string" />|                  \'1      process   
   Print  Tab(2) ; |<item name="CountryName" type="xs:string" />|            \'2      Country Name   
   Print  Tab(2) ; |<item name="StartYearDte" type="xs:double" />|            \'3      Start Year
   Print  Tab(2) ; |<item name="EndYearDte" type="xs:double" />|            \'4      End Year
   Print  Tab(2) ; |<item name="DateRange" type="xs:string" />|               \'5      DateRange
   Print  Tab(2) ; |<item name="Department" type="xs:string" />|               \'6       Department
   Print  Tab(2) ; |<item name="CountryTeamLead" type="xs:string" />|         \'7      Country Team Lead   
   Print  Tab(2) ; |<item name="CountryAssistant" type="xs:string" />|         \'8      Country Assistant         
   Print  Tab(2) ; |<item name="Position" type="xs:string" />|                  \'9      Position
   Print  Tab(2) ; |<item name="PCPWorkflow" type="xs:string" />|            \'10        Workflow         
   Print  Tab(2) ; |<item name="DocType" type="xs:string" />|                \'11         DocType
   Print  Tab(2) ; |<item name="Disp_DocType" type="xs:string" />|             \'12       Display DocType
   Print  Tab(2) ; |<item name="COBPYear" type="xs:string" />|                \'13    COBPYear
   Print  Tab(2) ; |<item name="AssessmentType" type="xs:string" />|          \'14      Assessment Type
   Print  Tab(2) ; |<item name="Status" type="xs:string" />|                   \'15      Status
   Print  Tab(2) ; |<item name="DocumentTitle" type="xs:string" />|             \'16      DocumentTitle
   Print  Tab(2) ; |<item name="URLLink" type="xs:string" />|                   \'17      URL (if Applicable)
   Print  Tab(2) ; |<item name="EstCompleteDte" type="xs:date" />|                 \'18        Estimated Completed Date
   Print  Tab(2) ; |<item name="ActualDte" type="xs:date" />|                \'19      Actual Date (ICM/MRM/CPM)
   Print  Tab(2) ; |<item name="DisclosureStartDte" type="xs:date" />|          \'20      Disclosure Start Dte
   Print  Tab(2) ; |<item name="DisclosureEndDte" type="xs:date" />|          \'21      Disclosure End Dte
   Print  Tab(2) ; |<item name="DisclosureLagTime" type="xs:double" />|       \'22      Disclosure Lag Time
   Print  Tab(2) ; |<item name="BankRepositoryTag" type="xs:string" />|          \'23    Bank Repository Y or N
   Print  Tab(2) ; |<item name="BankRepositoryDte" type="xs:string" />|          \'24        Bank Repository Date
   Print  Tab(2) ; |<item name="BankRepositoryLagTime" type="xs:double" />|    \'25        Bank Repository Lag Time
   Print  Tab(2) ; |<item name="BoardScenario" type="xs:double" />|             \'26      Board Scenario
   Print  Tab(2) ; |<item name="DateSubmittedtoBDS" type="xs:date" />|       \'27      Date Submitted to BDS
   Print  Tab(2) ; |<item name="DateCircToBoard" type="xs:date" />|          \'28      Date Circulated to Board
   Print  Tab(2) ; |<item name="CirculatedLagTime" type="xs:double" />|       \'29      Circulation Lag Time
   Print  Tab(2) ; |<item name="DateAcceptedbyOSEC" type="xs:date" />|       \'30      Date Accepted by OSEC
   Print  Tab(2) ; |<item name="ApprovalLagTime" type="xs:double" />|          \'31      Approval Lag Time
   Print  Tab(2) ; |<item name="BoardEndorseDte" type="xs:date" />|          \'32      Board Endorsement Date
   Print  Tab(2) ; |<item name="OneTwoThrEmailDte" type="xs:date" />|       \'33      1-2-3 Email Date
   Print  Tab(2) ; |<item name="Option" type="xs:string" />|                   \'34      Option
   
   Print  Tab(2) ; |<item name="OneTwoThrAnswerDte" type="xs:date" />|       \'35      1-2-3 Answer Date
   Print  Tab(2) ; |<item name="OneTwoThrLagTime" type="xs:double" />|       \'36      1-2-3 Lag Time
   Print  Tab(2) ; |<item name="DateSubmittedToWeb" type="xs:date" />|       \'37      Date Completed or Date submitted to Web
   Print  Tab(2) ; |<item name="PostedWebDte" type="xs:date" />|             \'38      Web Posting Date
   Print  Tab(2) ; |<item name="BoardLagTime" type="xs:double" />|             \'39      Board Lag Time (Board-Submit)
   
   Print  Tab(2) ; |<item name="WebLagTime" type="xs:double" />|             \'40      Web Lag Time (Post-Submit)
   Print  Tab(2) ; |<item name="SubmitTransWebDte" type="xs:date" />|       \'41      Submit Translated to Web         
   Print  Tab(2) ; |<item name="TransLagTime" type="xs:double" />|             \'42      Translated Lag Time (board)
   Print  Tab(2) ; |<item name="PostTransToWebDte" type="xs:date" />|          \'43      Post Translated to Web
   
   Print  Tab(2) ; |<item name="PostTransLagTime" type="xs:double" />|          \'44    Post Translated Lag Time
   Print  Tab(1)  ;  |</metadata>|               
   Print Tab(2) ;  |<data>| 
   
\' -------------------------------------------------------------------------------
\'     Generate XML data
\' -------------------------------------------------------------------------------   
\'   strTag = PrintTag("Generating XML data...")
   Dim view As NotesView
   Dim viewNav As NotesViewNavigator
   Dim viewRow As NotesViewEntry   
   Dim nRunner As Long   
   
   
   \'--- Loop through view to get all countries/regions to display
   Set view = db.GetView("CPSprocdocsData")
   Set viewNav = view.CreateViewNav
   Set viewRow = viewNav.GetFirstDocument
   While Not viewRow Is Nothing  \'navigate data on the CPSprocdocsData  view
      Print Tab(2) ;  "<row>"   
      For nRunner = 0 To LAST_ITEM - 1
         Print Tab(3) ; "<value>"+  viewRow.ColumnValues(nRunner)  +"</value>"   \'7         
      Next
      Set viewRow = viewNav.GetNextDocument(viewRow)
      Print Tab(2) ; "</row>"       
   Wend
   
   Print Tab(1) ; "</data>"                    \'close the root element tag               
   Print |</dataset>|     
   
End Sub
« Last Edit: September 09, 2014, 02:48:21 AM by h2obubbler »

Techronnati | where technology never sleeps

LotusScript on how to generate XML for Cognos Connection
« on: August 01, 2008, 06:09:29 AM »

Mountain View

 

Related Topics

  Subject / Started by Replies Last post
0 Replies
131 Views
Last post September 15, 2008, 02:02:54 AM
by MoneyRepublic
0 Replies
133 Views
Last post October 11, 2008, 04:47:52 AM
by h2obubbler
1 Replies
4216 Views
Last post September 09, 2014, 02:55:16 AM
by JusticeLeague
1 Replies
53 Views
Last post January 16, 2010, 01:29:24 AM
by MrSpecialist
0 Replies
21 Views
Last post July 06, 2017, 12:14:53 AM
by rpmolecule

Posting Disclaimer: Any individual may post a message in this forum and may do so anonymously. Therefore, the sole author is exclusively and entirely responsible for all opinions in that message. They do not represent the official opinions of Techronnati, its administrators or moderators or the Techronnati Management. Techronnati is merely acting as an impartial conduit for constitutionally protected free speech and is not responsible and will not be held liable for the content of such messages. All images and service logos are trademarks of their respective owners.