« Uninstalling Beta2 | Main| I need a flash mob »

NOBODY SUMMONS MEGATRON!!!


Remember when I said there'd be some exciting news here this week?  Well, it's time.
SmallDecLogo.png

Bob Balaban posted on his blog a few weeks ago about the idea of a data-only URL API for Domino, where you could retrieve the DXL for a document directly through a URL.  This was an idea I had discussed directly with Bob before he ever posted about it (and I'm sure I was FAR from the first one to talk to him about the idea) so I'd already had some thoughts about this cooking around in my head.  Well, shortly after that conversation, I thought of a very simple way to use Internet Site substitution rules to capture requests for data content through a broker database.  I told Tim Tripcony about it, and two hours later, he had a proof of concept in place.

Well, lucky me, Tim also decided to come work with Lotus911.  So we had an opportunity to take that proof of concept and turn it into something real.

The basic concept is straight forward.  We want to be able to use standard Domino URL syntax, but with a different argument to return the DXL, like so...
http://server/db.nsf/view/key?ReadDocument

But to return the DXL content, we need an agent call to actually perform the action.  Enter substitution rules...
/*/ReadDocument* --> /nathan/dxlbroker.nsf/broker?OpenAgent&OrigURL=*/readdocument*

Now we have an agent call with a pointer to the original syntax.  And our agent can take the QueryString, parse it, and return the result as DXL.  (Note: we didn't actually use ?ReadDocument, as substitution rules apparently can't redirect arguments.  We used an additional forward slash instead.)

Once we do that, why should we limit to documents?  Why not have...
http://server/db.nsf/form?ReadFormDesign

Which leads us to another substitution rule...
/*/Read*Design* --> /nathan/dxlbroker.nsf/broker?OpenAgent&OrigURL=*/read*design*

sampleOut.png

Now we use these rules to send to a central NSF with an agent that parses the QueryString and send back the DXL.  But what else might be useful to do with that?  As long as we're working with a DXLExporter, why not use the pipelining capabilities of the parser and be able to do a transform?  All we need is a source Stream to plug in.

So we added the capability to store XSLTs into the broker database, which would handle inline transforms via XMLProcessor pipelines.
http://server/db.nsf/form?ReadFormDesign&Stylesheet=ItemSummary

And with that, we'd created our transformer.  Decepticon, REST-bot in disguise!
SmallDecLogo.png

At that point, I started to get concerned about performance.  If someone really wanted to use this as an AJAX tool to extract design and data DXL from Domino, would we end up with 50 million URL requests to export, transform and deliver names.nsf/Person/ReadFormDesign?  Yuck!

Logical choice: implement a cache.  Store the resulting XML output into a notes document that can then be served up the next time a request comes for the same URL.  The Domino Command cache already does something similar, except we're just putting the cache into a document in the Decepticon database!

We're still tuning this part, but you can get our beta version of Decepticon at OpenNTF.org!

More to follow here soon!

Comments

1 - Nice idea,
just my 50 cents:
1. idea with cache is good, but you should also take care about user rights, hide-when formulas, computed sections, etc.
2. i have implemented a similar approach in august 2006 for a small project (not finished because I got a job not related to development, but I have a working version Emoticon, so at least it can built a web interface identical to notes one for simple databases), and all records in cache had a MD5 or SHA-1 (depends on configuration) hash built from ACL data and name of element.
3. another approach is to evaluate some of hide-when formulas and computed text when XSLT (or other) transformation occurs, unfortunately this is not possible in all cases, but may be I'm wrong.


2 - Very interesting Nathan. We'd started down a similar path for our Sphere presentation in 06, but ran out of steam. I've not looked at the code for the cached document storage, but I like the idea a lot. The security piece is a concern, but less so for view design elements where there's some real opportunity to finally produce some nice view widgets. I'll be playing around with this. Thx.

Post A Comment

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::lips::rolleyes:;-)

Search 

Disclaimer 

Welcome to Escape Velocity!

Opinions expressed here by Nathan T. Freeman are not necessarily those of his employer. However, there's a decent chance they are, so check with them if you really want to know.

But really... do you need that kind of validation? Are the opinions expressed here in doubt?

MiscLinks