[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby + Lotus Domino oh my!

Kev Jackson

12/8/2005 5:07:00 AM

Hi,

Does anyone have any experience interfacing ruby to Notes/Domino? I
only need to do a data extract, and I absolutely do not want to have to
code up C/Java just to suck the data out of a Notes database.

I could (in theory) hack up a Notes agent to export the database it was
in, but I doubt I'll be allowed to mess with it in that much detail,
simple ODBC hookup will be about as good as it gets I think

Kev


1 Answer

Wilson Bilkovich

12/8/2005 9:32:00 PM

0

If you can run Ruby on the same box as Domino, you can do this. This
particular kind of access doesn't work across systems. (Untested
code, use as directed, etc, etc.)
require 'win32ole'
SERVER_NAME = 'example/M/ORG'
USER_NAME = 'godmode'
NOTES_PASSWORD = 'supersecret'
DB_NAME = 'example.nsf'

s = WIN32OLE.new 'Lotus.NotesSession'
s.InitializeUsingNotesUserName(USER_NAME, NOTES_PASSWORD)
db = s.GetDatabase(SERVER_NAME, DB_NAME)
view = db.GetView "All Documents"
entry = view.GetFirstDocument # I hate the Notes COM interface.
while entry
doc = entry.Document
puts doc.GetFirstItem("Subject").Values
puts doc.GetFirstItem("Categories").Values
entry = view.GetNextDocument(entry) # Yes, this is weird.
end

Once you've gotten that working, you can read up on the various evil
COM methods here:
http://rubyu...

Personally, I find them easier to view them inside Visual Studio's
"object browser".

--Wilson.

On 12/8/05, Kev Jackson <kevin.jackson@it.fts-vn.com> wrote:
> Hi,
>
> Does anyone have any experience interfacing ruby to Notes/Domino? I
> only need to do a data extract, and I absolutely do not want to have to
> code up C/Java just to suck the data out of a Notes database.
>
> I could (in theory) hack up a Notes agent to export the database it was
> in, but I doubt I'll be allowed to mess with it in that much detail,
> simple ODBC hookup will be about as good as it gets I think
>
> Kev
>
>