SalsaScript for DemocracyInAction
From Devsummit08.aspirationtech.org
Facilitated by Brian Harrington, WiredForChange
Brian will introduce SalsaScript, DIA's powerful new scripting language for creative custom pages and workflows. He'll demo examples, and explain how to get the most out of your SalsaScripting. Topics will include an intro to SalsaScript (what it is, what it can do, & how you can be writing code today), a Salsa API Q&A, and MySQL administration for Layfolks.
NOTES
salsa script intro
history - crappy code, useful service. rewrite was called salsa
tapas - tools, applications .... salsa
java and jsp - initial code. security implications, users wanting to upload code
java was a bad idea for this. jsp marginally better, barrier of entry.
rhino - javascript execution engine - j2ee java stack. allows execution of code
initially only basic computing tasks allowed. then built custom objects - two - that exists everywhere inside rhino. db - allows all kinds of database quesries. methods hanging off that - single output, all table, left joins. dumbed it down enough, people do not have to know sql to get info out but power is there salsa - allows for salsa related things. key - prints reports.
questions - jeffrey - chandler coder. curious about the framework. how do you do sandbox? suzy - radical designs software integrates with dia, better every day. wants to learn more. matthew - developer, interested in modular abilities to run thiings on the server. ??? - advises nonprofit who is on get active scott - used dia very early on. josue - katrinaaction.org - lots of groups that are interested. wants to know more. ??? - alternative perhaps to civicrm.
dia - a crm. you can import your list. send an email blast. email vs email blast? good blasts prevent being identified as spam. merge fields available to personalize emails.
salsa script being added into email. instead of ten email blasts, you can send one that then sends different emails to different groups.
take action - you can put a link in an email that sends them directly to a page to "take action." statistics tracked.
practical applications - embed into a donation page, so that when an identified person comes to a page it will show higher dollars amount for giving than for someone who has given less amounts. ab landing page - testing reactions to different segments of your audience by showing different photos or terms or etc.
you can send an email to 25% of your list. if it works, send to the rest. if it does not work, try something different.
trying to make more than a list, but not a social network.
concept of supporters, campaign managers, admins. now there is a member in between supporter and campaign manager. can begin limiting things just to members. can do ticketing thru the system.
with this membership level, this much is tax deductible. when they made purchase, triggered email that sent receipt with tax deductible amount. can store how long members, can query this info and customize messages on a web page.
all development is now happening in salsa script.
crm - content relational management
civicrm and dia - all api can be accessed to simple get post. need to store cookie somewhere. curl - set temp
synchronizing between the two is feasible.
build your own custom api calls -
svn server that dia uses for all actual coding. go to salsacommons.org, sign up for developer account. builds sample org, svn account, can check code in and out. running live once checked in. serverside makes it impossible to check code locally. allow to mount svn-checkout via web dav. auto commits when you save.
some web dav clients make svn crazy, butit generally works. dav-svn on linux tested. other fuse extensions in linux also tested. native windows dav stuff one developer. mac os also tested. big problem - does not support submitting a comment. use svn client as a work around. for a css engineer, maybe not a big deal. just get people to start using version control. comments next, but first use it.
try to cater to both individuals familiar with the tech and those who just want it to work.
salsa script - really just the objects and functions. pure java script. libraries available. straight javascript with no DOM. no worries about document write.
there are individuals who have written DOMs for this stuff. we don't use it.
you write this salsa script in line, or just as print commands.
you can treat it as php code. <?=variable name>
can you do includes? - we do have includes. since we have to generate the error messages, forsee all the ways you can do something wrong, error messages not always helpful.
forget to close a tag, thinks you are tryingto generate xml and gives you error message warning that you are not creating valid xml.
db, salsa, crawler-
crawler - you can retrieve and post remote data. including json.
"post to this next page" which then sends an email...
how do you bind a salsa script to a url for a dia action? call some of the action code into the page. there are methods off of the salsa to retrieve
salsa render action - generate basic action page, throw action code in there to start manipulating pages.
we also, everything in the system has a save object.
when you are building a form you can make it /save.
salsa commons - besides the sandbox, is it a community where people can share scripts?
yes! three components - forums where people can post code system where there is a marketplace. list of things someone created with a checkbox for using it. can give away or charge for packages? 3. given a url that will give you access.
