views:

86

answers:

2

The web application my organization has written to perform customer care functions doesn't have this ability. I know there are Firefox plugins to automate the browser, but what I'd like to do is provide a framework and facility to manage and execute scripts through our web application.

The user would write scripts that checked on commissions for their sales, perhaps alerted them to orders that were pending after a certain length of time, or automated common comments that policy requires them to attach to each order. I used to do this sort of thing in Reflection, accessing a CCA application on a mainframe when I was a CSR.

Where should I start? How do I keep it secure? Can I provide script-authoring functionality right in the browser? What parts of the object model do I expose, or do I craft a script-accessible layer just for this? What language(s) should/can I support?

EDIT: "Don't do that!" is not a helpful answer.

+2  A: 

Firstly, let me tell you, from experience with similar requests, this will not be used the way you want; inevitably you will end up writing these functions for them, or correcting mistakes that they make.

These people are not programmers - you are a programmer. You are the scripting interface. They can request programs by asking you, and you will implement them (correctly).

Do not provide a scripting language interface. Do not go and write a custom DSL using boo or a similar 'cool' language.

Take a reasonable approach; take a sensible approach, and write these things for them.

Noon Silk
My thoughts are quite aligned with silky. This sounds challenging as a colleage project, but realistically speaking, it can come back and bite you before you knew it.
o.k.w
I don't see a significant difference between this functionality and user-generated reporting. Many shrinkwrapped applications support scripting. Lots of web applications expose an API.
Chris McCall
+1  A: 

Take a look at Jint:

Jint is a script engine based on the Javascript language. Using Jint, developers can provide fully scriptable applications, execute .NET code without compiling, or create external configuration logic, using the most used script language.

chaiwalla