in Search
 
Home Blogs Forums Marketplace Files
 
 
 

TrainerMatt's Blog

The Alchemy SDK CoolTools Session in Kuala Lumpur

A few weeks ago we had our annual International Partner Conference in Kuala Lumpur. At that conference I delivered a session on using the Alchemy SDK in interesting ways. It was mostly a demo session with as few Powerpoint slides as possible. I was planning to wait to describe the session and the tools demonstrated until the Visual Studio projects were published on this site. Unfortunately, the process for uploading the files seems to be taking a long time, so I will just start writing. Hopefully soon they will show up here and I will be sure to let you know when they do. For now, this post will describe each of the tools. Later posts will go into detail on each tool and possibly list the full source code in the blog post. One of my rules for creating the tools was that each had to be less than about 100 lines of code. So here we go.

First since we are dealing with Alchemy we need to have a database. Out of the box, creating a database and adding it to server control means opening Alchemy Administrator, creating the database, closing Administrator, opening the server console, adding the database to the server, closing the server console, and opening Administrator. Wow! That's a lot of steps! So my first app was a simple tool to create a new database and add it to server control in one step.

But this doesn't actually do everything. It didn't add the database to the alchemy.ini file so it won't appear in Administrator next time you launch it. But that gave me an excuse for the next tool. So sometimes I use a development machine that's actually a virtual machine. The VM has the Alchemy server, and a bunch of other services. I already have Visual Studio on my host machine and I don't want to install it again in the VM, so I use the host as my client, and the VM as my server. That works great! But when I want to add a database that is under server control, finding the database can be tough. Its not on My Computer and my Domain is the Captaris domain. While I may think of myself as important, IT sees me as another loser user and doesn't want me adding servers to the domain willy nilly. So how do I find the new database on my dev server? Well, my DBChooser makes that easy. I simply specify a server name and I see a list of all databases under server control. The databases that are selected are already in the alchemy.ini. I can unselect and select any of the databases and click the save button. Now the next time I launch Administrator, only the selected databases will appear.

So now that I have a database, I need to add content to the database. I had a bunch of tif files representing invoices that I wanted to add, so I launched DnDOCR. From a simple form I choose a database from the list. Then I can drag and drop one or many files onto that form. Alchemy will add all the files to the root of that database, OCR each of them, and then build the database, all in one step.

Sometimes I want to add other files that I found in the file explorer in Windows. So I selected a bunch of them, clicked the right mouse button, and chose Add to Alchemy. This is a nice tool, but we quickly run into a limitation of this implementation. I am consuming an administrator license for every file I selected. It will release those licenses when done, but adding 100 files at a time means having 100 admin licenses...not likely. So I have another version of the application that uses web services. The benefit here is that no licenses are used. Yeah, no licenses, zip, nil, nada. The downside is that consuming our webservices are a royal pain in the...well, you know, and they aren't all that speedy. But 0 licenses!!!!

OK, so now we have some documents in our database. Now I want to search for that content. I used the SimpleSearch I talked about in a previous blog post. There were a few interesting things about that tool. First, there were no buttons or icons, just type what you want. Also, I only consume a Search license, not an Administrator license.

Searching is nice but there are times I want to do a search and retrieve all the results to a particular folder. So I made a simply Retrieve command line program that just takes two parameters: the search query and a location to retrieve the files to. You can even leave out the location and it will retrieve the search results to the current directory. The search is performed on all databases in your Alchemy.ini file.

From there I went to workflow integration. Some of our customers want a simple workflow integrated in with Alchemy. Captaris Workflow is great, but it could be beyond the budget and all they want is a simple one step approval. So the next app "workflow enables" any database and adds a few extra buttons to the Administrator interface. When I drag and drop a file to the database for the first time, an unprocessed folder is created and the file is moved into that folder. If I click on the document in that folder and click the Approved button, the document is moved back to the root. Later on I can click on the Request Review button. At that point, the document is moved to the Review Requested folder. After reviewing, someone can then Approve to move it back to the root.

Next I dealt with security. Imagine the problem: I have a database and 1000 users. I want each user to have their own folder that no one else can access. When they enter the database they only see their personal folder. How would you set that up? Well, you would probably hire a student to come in as an intern (meaning they work hard and get paid nothing), teach them how to do all the steps, then have them slave away for the next few weeks to add each user individually to the database as a group, add a folder, add a role to the server console, add their username to the role, add the database to the role, assign their group to the role, assign certain licenses to the role, etc. Or you could run my command which looks in the Active Directory for the group AlchemyUsers and performs all of those steps for all members of that group all at once. And it takes seconds rather than weeks.

For anyone new to Alchemy development, creating all of these applications would guarantee at least one thing: a complete monopoly on all licenses...well, at least the Administrator ones. Each of my applications only use the license that it really needs. And to confirm that, I have a little AJAX enabled web site that checks every few seconds to see how many licenses of each type are available. I am using the standard Alchemy Object Library for this and creating objects then destroying them every 5 seconds.

So that's 9 cool little utilities. Again, all of them were less than 100 lines (or not that much more than 100). And I will go into detail about each of them in the coming days. I hope you will find it interesting...

Published Wednesday, June 20, 2007 5:45 PM by TrainerMatt
Filed Under: ,

Comments

No Comments
Anonymous comments are disabled

This Blog

Post Calendar

<June 2007>
SuMoTuWeThFrSa
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

Syndication

  Privacy    Site Terms   Contact Administrator