I had a thought the other day. Maybe it was today. It doesn’t matter, really, but I was thinking… wouldn’t it be neat to have a menu item that you could open a dialog that – when online, of course – let you enter a book title and have it return a link to Amazon? Or maybe a list of books, in the event that there’s more than one that fits. It’s very easy to do, with the Amazon XML Services interface exposed – and I’m certain that there’s other service to grab from online – but then I got to thinking some more, and now I have a quandary.
Rather than just a hard coded link to only Amazon, I got to thinking that it would be killer if I could publish an interface to expose some functionality… you know something that let other people write plug-ins for me, much like how the IBlogExtension was published for people like me for hooks into RSS Aggregators? I figure it would be a couple of member functions or maybe a property/procedure combo that would take in a parameter (or two or three) for search parameters and then returned a collection of results that represented text (or links) that would be inserted into the currently select text box.
So, using the Amazon book thingy as an example, there would be a smt_amazon.dll in a plug-in directory. #MT would have to know about the plug-in ahead of time and there would be a “Amazon” menu item. You put focus in the Entry Body text box and select the menu item. A dialog opens with a “search” text box and a search button; click “search” and a list is populated with a list of matching books. Select a book and click OK and voilà! the link would be inserted into the Entry Body text box.
From #MT’s point of view, I’d have to keep a list of plug-ins to load and expose on a menu; if clicked, I pass up to three parameters to a plug-in and wait for a return set of items that I display in a list box. If one is selected, I take the returned text from the plug-in and show it.
From a #MT plug-in point of view, they would be a .NET DLL that inherited the interface. It would get handed up to three parameters and return a collection of results. The results could be a list of URL’s, anchor links, image references; it would be up to the plug-in coder to decide what to include. So long as some text was associated with it (to show in the results box) it could be anything.
The problem that I have with this whole idea is the “what if”. Maybe I’ve been looking into security too much lately – been studying for the second third of the MCAD certification and there’s all sorts of chapters for security stuffs – but how could I prevent malicious code from running? Every time I think of something that could be enacted on the plug-in, to keep it “safe”, I think of something else that could be exploited. There’s no way that I’m willing to keep a machine around just for testing plug-ins and setting up a “certification” system – that’s way beyond anything that I want to do. I guess it could be a “use at your own risk” type system, but I’m not sure if I feel comfortable about that either…
Any thoughts on this?
Oh, and BTW: how is 2.4 Beta 1 doing? I haven’t heard a peep as to whether or not the changes help the international situation… I’d like to know, so that I can get 2.4 “done” soon. Silly leaving a beta out there that people aren’t happy with or happy with. If it’s working well, I’ll can call it a release; if it sucks, I need to know so I can fix it. Thanks!