I've written a little zimlet that works, but takes a while to run. I suspect I could make it faster by using the SOAP interface instead of a command-line search, but I'm having trouble finding any example zimlets which do something similar to my project. I'm hoping someone can point me toward a zimlet that does the equivalent of a "zmmailbox search" command with SOAP.
The Zimlet is pretty straightforward. It loads automatically and sends out an ajax request to a jsp script. The JSP builds a zmmailbox search command and runs it using Java's Runtime.exec method. This approach works, but on my test box the command takes about 30 seconds. It'll be a bit snappier on our production server, but if each login of our 10,000ish userbase results in 2 new Java threads and corresponding AJAX requests, I predict a noticeable hit in server performance, so...
My Question is whether a SOAP (or REST) query would be less resource intensive than a zmmailbox search command, and if so, could someone please point me toward a zimlet that does a similar query. I get the general idea of SOAP, but I'm fuzzy on how exactly I would implement my query in a zimlet.
I've attached the complete zimlet, in case that helps, or the code is up on github. The jsp file is called 35.jsp. As an aside, is there any way to tell zimbra to recompile JSP when a zimlet is loaded through the ?dev=1 mode? Renaming the file gets a bit tedious after a while.