This is the first article in a series introducing our readers to some of the applications that we work on. A lot of the applications we write go unnoticed by the masses because they are targeted at a specific workflow or person, so we thought it would be cool to let everyone know what we are up to!
If you have been building applications long enough, you know that there are some things that you have to do with EVERY app you create. Authentication, authorization, user management, etc. No matter what the purpose of the app, you always have to deal with these things, and you are continually re-creating the same basic functionality with every new app. Perhaps it is a little different from app to app, but the concept is the same.
Perhaps we were totally late to the game, but we noticed this trend soon after we got into the Zend Framework. Zend Framework solved a lot of these problems for us. They had mechanisms for dealing with authentication and authorization, databases, forms, etc. It was great, so we created our first Zend Framework app, Billboard.
After we had totally drank the Zend Framework koolaid, we started working on another new app and realized that we wanted some of the interfaces we created in Billboard for our new app, so we went to the billboard project, copied what we needed, and moved on. That worked great until we found a bug in our login page. We fixed it, but the bug was still in our Billboard project. Quickly we changed projects and fixed the bug there. That is fine if we only have 2 projects, but we were planning to run all our projects with Zend Framework. What to do?
Enter the OT Framework. The basis of the OT Framework is that it is an application framework that includes everything an app writer needs to get their app up and going. It has code for dealing with user management, creating access control lists, managing cron jobs, handling application navigation, setting authentication types, dealing with application configuration variables, and more! Basically, it lets you get straight to writing the “meat” of your application, without having to worry about dealing with the boring stuff like authentication, authorization, etc.
(Beware…programming stuff!) OT Framework is built on top of Zend Framework, utilizing their MVC (Model-View-Controller) architecture and lots of other awesome ZF modules. To stay out of the way of the host application, we have setup the OT Framework to run out of a separate application and public folder. This keeps it’s logic separate from that of the host app, but still allows the end user to feel like it is the same application.
Enough about the programming. If you are interested in seeing the guts of the OT Framework, you can check out the code.
On to the fun stuff…what does it do for you, the application writer? Out of the box, it gives you an empty application:

Great! So….who cares. I can do that in 10 seconds with Zend_Tool! Ah yes, but click on the “Login” link at the top, and you get more aweseomely fun stuff to play with!

Hey…that’s a login screen! Zend_Tool doesn’t do that for me! That’s right, the OT Framework supports multiple types of authentication out of the box. Right now, the only adapters we have written are for NCSU’s WRAP authentication and a local authentication system that is managed within the application. So what does that do for you? If you want to integrate OpenID authentication, all you have to do is write an adapter. If you want to integrate some other authentication from some other university system somewhere, go for it! And OT Framework has the ability to support multiple authentication types simultaneously, so you can offer an OpenID authentication mechanism AND a local authentication system at the same time.
So you authenticate and voila! You have lots of fun new options in the Admin menu.

Let’s talk about each of these briefly.
Configuration -> App Config
Ever had a user that wanted to change how a date was displayed? Or wanted to set how errors were handled? Or maybe wanted to rename their application to “Joe’s Application”? Well, here they have an interface to do it! Pulling data from the pre-determined-by-the-developer config file, they can setup their custom options for the application here! All their changes are written into an override config file and processed every time the application runs!
Configuration -> Debug Mode
This one is simple, but it has the ability to be built upon. Right now, developer mode puts a bar at the top of each page that tells you what database you are connected to. This is helpful when you have production and development environments and they all look the same. Sanity check FTW!
Configuration -> Maintenance Mode
If you have ever used any sort of content management system, you are familiar with a “maintenance mode” plugin. Basically, as the application admin, you can put your app into maintenance mode and nobody but you can access the app. Comes in handy for playing with options without freaking out your users
Configuration -> Navigation Editor
This is a cool one. Basically, you can setup your entire navigational tree. Customize labels, targets, access control, etc in a drag and drop interface!

App Triggers
Triggers are events that you put in the application where you may want something to happen. Perhaps send an email, post a tweet, or create a help ticket. Triggers allow an administrator to set these events to happen without touching source code! As a programmer, you can create whatever types of triggers you want! Perhaps one to post to Facebook or send an SMS message. It has a plugin architecture similar to the authentication, so create whatever you want!
Triggers are more complex than that, especially from a development standpoint, but once you “get it,” you will be shooting off all kinds of events all over the place!
Bug Reports
Let’s face it, we never write bug-free code. We strive for it, but usually fail. So the OT Framework helps out everyone by providing a (very simple) bug reporting system that is confined to the application. Users can submit bugs, admins can fix them. Pretty simple but incredibly helpful.
Caching
With the help of Zend_Cache, we cache anything and everything from the navigation and ACL’s to the database meta data to increase performance. Under the “Caching” tab, you can clear the existing cache which can be helpful when config files change out from under the application.
Cron Jobs
We write lots of cron jobs, so this tab helps keep up with them. We can see when the last ran, and can run them manually if need be. We have some plans to improve this functionality in the near future, but right now it is pretty simple.
Custom Fields
Just like WordPress or Drupal, you can setup certain objects to have custom fields. There are several types you can choose from like checkboxes, textareas, or radio buttons.
Database Backup
You can download the *.sql file from MySQL here. If you just want an individual table as SQL or a CSV, you can do that too. This is helpful when we have users who want to run reports through excel for a certain part of their data.
Email Queue
This is one that will make your email admins happy. We had a problem where our apps were continually getting our webservers blocked because they were sending too many emails too often. Enter the Email Queue. It allows an application developer to queue emails up to be sent so as not to get anyone in trouble for spamming. The email queue is processed via a cron job, which is setup to run however often you want and send however many emails you want at a time.
Logs
This is a simple log viewer/searcher for any events that happen in the application. Using Zend_Log, we have also created a helpful Action Helper to log an event from a controller.
Registered Applications
Have I mentioned yet that the OT Framework comes complete with the ability to act as an OAuth server for your API’s? No? Well yeah, it can. This tab shows all the applications that have registered to use data from your application! We will talk more about OAuth a little later, but I should mention that the OT Framework also comes complete with an API service which is able to speak JSON, XML and SOAP! It is very easy to expose functionality to your code to remote procedure calls. Just add the method to your API class and BAM! API access all protected by OAuth. BTW, access control to the API is included too
Users
Boring…but you need it. This lets you add, edit, and remove users from the system. The user’s account is part of this as well, which has support for the integration of OAuth clients as well. So if you want your app to talk to twitter and would like to integrate twitter’s OAuth service into your app, you can set that up so that when your users do something in your app and they want to post a tweet about it, they can authenticate through twitter’s OAuth service and BAM! Your app now can talk to twitter for the user! (If you haven’t noticed yet, I like using the BAM! phrase a lot. Just call me Emeril)

As a note, you can see here that I have added a custom field to my profile called “Cat’s Pajamas.” That’s cause the OT Framework is the Cat’s Pajamas baby!
User Access Roles
This will save you boatloads of time. Our user access role section puts the power of managing application roles in the hands of the application admin. Using Zend_Acl, we have setup an interface to allow dynamic creation of new roles, setting of permissions for those roles, and assignment of those roles to users. And it looks pretty too…

Basically, it will allow you to setup a role that has access to certain parts of the application but not others. It supports inheritance as well, so you can build roles off of one another.
Version Information
Pretty self explanatory, but this will tell you the versions of the frameworks you are using. Currently it reports the OT Framework version, the Zend Framework version, the jQuery version and the jQuery UI version. More on jQuery in a sec…
Other stuff
There is plenty of things in the OT Framework that you don’t see in the menus.
jQuery UI integration
jQuery UI is amazing. The OT Framework utilizes jQuery UI heavily in almost every module because it is just so great. Sliders, accordions, modal windows, oh my! You can also set whatever theme for the jQuery UI themable widgets through our theme section…
Theme Support
That’s right, the OT Framework supports themes! By default, we ship with the theme you see in all the screen shots, as well as one that looks like the OIT website, but you can create as many unique themes as you want! Each theme also includes it’s own version of the jQuery UI theme so all the dynamic elements are customized to however you want them, even in the admin sections! And all that without changing a single line of any code!
Language Support
Want to translate your app to work in Spanish? How about Chinese? Russian? Yep, we can do that. If more than one language is found, a user get’s a nice little drop-down box at the top of the page which allows them to select their language.
We also use language support to do something a little different. As a developer, nothing aggravates you more than to have to go through an entire development release because an application admin wants to change the static text on a page, or you have a typo, or you want to add more text. We have integrated a custom translation handler that allows the application admin to override the default text on the page. By integrating this with the translations, we can be sure that they can set their custom text in any language available.

A few other notes about the OT Framework. We have centralized the deployment of this as well, so that we don’t have 30+ versions of the same code floating around out there. Basically, we create symlinks in each application to point to a central location of this code. That way, we can have a central version of the code running and every app uses the same one. This is helpful when fixing a bug in the framework. Change it in one place and it propagates everywhere.
The OT Framework is constantly improving and growing. We welcome additional thoughts and ideas, and if you want to actually write some code, let us know and we can get you setup!
We hope that this little bit of insight is helpful for all of you to understand the OT Framework and how it works. We will be doing this series about all the apps that we have created that use the OT Framework, but to understand how cool it all is, we needed to tell you about the foundation that all our apps are built on. By showing you the wide range of our apps, you will see how truly flexible this setup is…oh yeah, and how cool it is

[...] Outreach TechnologyCoordinating Loosely Associated Factions of Warring Parties. Meet the App: OT Framework [...]