My favorites | Sign in
Logo
                
Search
for
Updated Oct 21, 2009 by jasvir
CajaCajole  
"Cajoling" is what we call the process of turning Caja input into JavaScript.

Obtain a Caja build

To cajole your input, first build Caja from source.

Download. The source is in SVN. We assume you have downloaded it to a directory called:

./google-caja

Compile. Ensure you have version 1.7 of Apache Ant. Then compile as follows:

cd google-caja/src
ant jars

You should now have a directory called ant-jars, relative to your current directory. Go back to your google-caja directory:

cd ..

Cajole your input

OpenSocial. To cajole an OpenSocial gadget, do the following:

bin/cajole_gadget -i <sourceGadgetUrl> -o <targetGadgetFile>

where:

<sourcegadgeturl>
- The absolute URL of a gadget spec, such as http://example.com/listfriends.xml or file:/Users/example/listfriends.xml.
<targetgadgetfile>
- The file path where you want your Cajoled gadget spec to be stored, such as ./listfriends-cajoled.xml.

Plain HTML. To cajole a plain HTML snippet, do the following:

bin/cajole_html -i <inputHtmlUrl> -o <targetJsFile>

where:

<inputhtmlfile>
- The absolute URL of the input HTML snippet, such as file:/Users/example/test.html.
<targetjsfile>
- The file path where you want your
JavaScript module function to be stored, such as ./test-cajoled.js.

Sign in to add a comment