Integrating Democracy in Action with Civicspace and Drupal
I've spent the weekend catching up on some of my development work. Among this weekend's challenges is integrating Civicspace with Democracy in Action's impressive array of tools.
Currently, I'm working on a suprisingly nasty challenge: creating a user registration form that enters info into the DIA database, and creates a user account for drupal. The alternative, which is requiring users to mull through two forms to sign up for the organizations mailing lists, ect. is unacceptable.
Unfortunately there is a serious dirth of documentation, examples, and modules for drupal and DIA integration. So far, I have only found one relevent drupal module. It's written by Smart Campaign's one and only Aldon Hynes. Aldon's module allows for a single signon with a Democracy in Action userid. You can download the module here.
Other than Aldon's module, google turned up no info, or pointers on how to integrate the two. DIA's developer resources weren't much of a help either. DIA's resources consist of a few snippets of code that allow people to sign up for DIA mailing lists from an external site *whoopie*. Now, this would be a very useful snippet if only HTML allowed for two form actions to execute when the user hit the submit button. One option I've considered is redirecting the first form submission to another form which automatically re-submits the info to Democracy in Action. However, that seems like a dirty, and probably ineffective solution. First off, most browsers will prevent the second automatic submission from going through (for very obvious reasons); and since the submissions will be blocked, that opens up a possibility of having a hopelessly tangled mess of unsychronized data. Not to mention, having such redudent data is a big developer no-no. Especially as this organization boasts a large number of members.
Sadly, all of these considerations have led me to regretfully conlude that I will soon be in a world of pain (A.K.A the DIA API). While I am very happy that they've provided an API, I'm nevertheless frustrated with the curious way that they've gone about organizating it. As with any APIs, you must understand how certain concepts build on one another to make full use of it. Unfortunately, however, the DIA API is strewn about in a such a way as that I must peace the concepts together like a mental puzzle.
So there is a point to this rather long, and given my audience, unnecessary rant:
One: If anyone finds this page, and is having similar problems, please e-mail me, or comment here. The more people we can get to work on DIA/Drupal integration, the faster we can put this headache behind us.
Two: Democracy in Action is a very impressive service. It boasts an incredible array of tools that I've seen on nearly every list of project requirements that's come my way. However, Democracy in Action still doesn't compare to Civicspace in terms of actual content management, and the creation of discussion based communites on the web. If the two services were well integrated, the result would be a powerful open-source/asp hybrid that would tackle the requirements of nearly any campaign or political advocacy website. If there was better integration, I would actually recommend for my clients to setup an account at Democracy in Action as a way to save money on custom development fees. However, sadly, Democracy in Action integration will spike the price on projects.
So in conclusion, I hope that Democracy in Action puts some effort into helping Civicspace developers take advantage of their toolset. If I were them, I'd begin by:
- Providing more documentation, and default support for PHP-based websites. While Democracy in Action is written in JSP, both Mambo, and Civicspace (which are undoubtably the most popular CMS's which take advantage of the DIA toolkit) are written in PHP.
- Developers shouldn't need to spend $70.00 an hour learning how to integrate DIA with their website. Build us a drupal module instead -- nothing fancy, just a solid foundation for us to expand upon. If you do that, we developers will happily return the favor by referring clients to your services. Otherwise, we'll just build our own custom modules.
In the words of forest gump... "that's all I have to say about that..."