Esteemed Monks,

I'm looking at accessing my Lotus Notes Datebook through perl and would like to know how I can visualize the document structure of an appointment (i.e. show all its attributes and their respective values).

Is there a ready-made function to do this

The (fully functional) code I'm currently using is the following, which finds a number of appointments in my calendar and prints their titles:

#!/usr/bin/perl -w use strict; use Notes::OLE; use vars qw( $SERVER ); $SERVER=''; # leave empty if querying local client my $mailfile='mail\myshortname.nsf'; my $maxdocs=50; # 0=all my $maxshowdocs=5; my $db = $S->GetDatabase($SERVER, $mailfile); my $docs=$db->Search( "Form = \"Appointment\"" , $DT, $maxdocs); # "Ap +pointment"(calendar) or "Memo"(email) my $count = $docs->Count; print "found ",$count," docs.\n\n"; # show the appointments' titles for(my $i=1; $i<=$maxshowdocs and $i<=$count ;++$i){ my $doc=$docs->GetNthDocument($i); if($doc->HasItem('Subject')){ print $doc->GetFirstItem('Subject')->{Text},"\n"; }else{ print "No Subject\n"; } }
I'm just hoping I don't have to write code to individually check every one of the attributes in these tables the same way as with the subject attribute above. (Not to mention possible multivalue and/or structured attributes... do they use those in Notes?)

Thanks for any suggestions!

Michael

Update: added clarification on "mailbox documents" and on first sentence.


In reply to Notes::OLE: Doc-Dumper? by mhi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.