| Library: appjet | The global appjet object contains access to the AppJet runtime, app meta-data, and other information. |
| Library: dispatching | Helper functions for path-based dispatching of the request. |
| Library: page | The page object is what gets rendered by default at the end of a request. |
| Library: printing | Helper functions for working with strings and easily formatting objects as HTML. |
| Library: request | Helpers for reading data from the HTTP request. |
| Library: response | Helpers for the HTTP response. |
| Library: tags | Functional HTML tag writing. |
| Library: utilities | A collection of miscellaneous utilities. |
| Library: cron | A collection of utilities for scheduling tasks in the future. |
| Library: dns | Library for DNS operations such as looking up IP addresses and hostnames. These are similar to the PHP functions gethostbyname() and gethostbyaddr(). |
| Library: facebook | Library for building facebook apps. |
| Library: quickforms | EXPERIMENTAL: Library for easy forms. This library is incomplete and skeletal. Feel free to play around with it, but we may or may not improve it in future versions of the AppJet libraries. |
| Library: storage | Easy way to persist data between requests. |
|
object
appjet
|
more details... |
|
object
appjet._native
|
This is the interface to the native AppJet VM. more details... |
|
boolean
appjet.isPreview
|
Holds whether the current request is a preview request. more details... |
|
boolean
appjet.isShell
|
Holds whether we are currently executing in a shell session. more details... |
|
string
appjet.mainDomain
|
The domain this app is running on. more details... |
|
number
appjet.encodedAppKey
|
The current app's encoded app key. more details... |
|
String
appjet.appName
|
Holds the name of the current app. more details... |
|
schedule(date, path, params, published, mailOnError)
Schedules a CRON request to execute once at an exact date in the future. more details... |
|
scheduleRepeating(date, period, path, params, published, mailOnError)
Schedules a CRON request to execute every |
|
listAll()
Returns an array of objects describing all scheduled CRON tasks. more details... |
|
unschedule(name)
Unschedules the CRON task identified by |
|
unscheduleAll()
Unschedules all CRON tasks. more details... |
|
dispatch(opts)
Converts the path into a function name and calls that function. more details... |
|
patternDispatch(pattern1, pattern2, patternN, optional404)
Similar to dispatch(), but you provide your own mapping of regular expresions to functions. more details... |
|
gethostbyname(hostname)
Converts a hostname string (such as "appjet.com") to an IP address, returned as a string (such as "74.86.117.106"). more details... |
|
gethostbyaddr(ipaddr)
Converts an IP address string (such as "74.86.117.106") to a hostname (such as "appjet.com"). more details... |
|
fb.redirect(url)
Tells facebook to redirect the user to a new URL. more details... |
|
fb.requireAdd()
Ensures that the current user has added this app. more details... |
|
fb.init()
Every facebook app should call fb.init() immediately after import("facebook"). more details... |
|
fb.call(cmd, params)
Executes a remote facebook API call. more details... |
|
fb.sendNotification(users, notificationFBML)
Convenience function for sending a notification to 1 or more users. more details... |
|
fb.setProfileFBML(uid, markup)
Convenience function for setting a user's profile FBML. more details... |
|
fb.authenticateRequest()
Checks post parameters against fb_sig to verify that the reqest came from facebook servers and not a haxxor. more details... |
|
object
fb
|
The FaceBook object. more details... |
|
string
fb.uid
|
The facebook uid of the current user of this app. more details... |
|
string
fb.sessionKey
|
The current facebook sessionKey. more details... |
|
array[string]
fb.friends
|
List of the uids of the current user's friends. more details... |
|
string
fb.fullCanvasUrl
|
contains "http://apps.facebook.com/<the_canvasl_url>/" more details... |
|
page.setMode(newMode)
Changes the mode of response output to something other than HTML. more details... |
|
page.setTitle(newTitle)
sets the HTML title tag of the page. more details... |
|
page.showRenderTime(show)
sets whether or not to print the number of milliseconds taken to render the page in the page's footer. more details... |
|
page.body.write(rawText)
append a raw string to the page's BODY section. more details... |
|
page.head.write(rawText)
append raw text to the page's HEAD section. more details... |
|
page.render()
Renders the entire current page to a string. more details... |
|
object
page
|
more details... |
|
print(thing1, thing2, etc)
HTML-aware printing. more details... |
|
printp(thing1, thing2, etc)
Like print(...), but prints its arguments inside an HTML p (paragraph) tag. more details... |
|
printf(formatString, arg1, arg2, arg3)
Prints a string with any number of variables substituted in, as popularized by C's function of the same name. more details... |
|
sprintf(formatString, arg1, arg2, arg3)
Just like printf, but returns the string instead of printing it. more details... |
|
supplant(data, str)
Replaces keys of data found in string with their corresponding values. more details... |
|
raw(text)
Used for printing un-escaped HTML, such as your own HTML tags. more details... |
|
toHTML(x)
This function is used by print(...) to convert a string or object into nice-looking printable HTML. more details... |
|
link(url, optionalText)
Helper function for printing a link (A HREF tag). more details... |
| QuickButton |
Creates a QuickButton, a self-contained button that when pressed submits a form that contains a bunch of parameter/value pairs. more details... |
| QuickForm |
Creates a new, empty QuickForm. more details... |
|
QuickForm.addHeading(id, text)
Adds a heading in bold type that introduces a section of the form. more details... |
|
QuickForm.addInputText(id, opts)
Creates a one-line text box for entering a small amount of text. more details... |
|
QuickForm.addInputTextArea(id, opts)
Creates a rectangular, multi-line box for entering text. more details... |
|
QuickForm.addInputFile(id, opts)
Creates a control that allows the user to select a file for upload. more details... |
|
QuickForm.addInputHidden(id, val)
Adds a hidden field to the form which does not affect display, but causes an additional parameter to be submitted with the form. more details... |
|
QuickForm.addSubmit(id, text)
Adds a submit button to this form. more details... |
|
QuickForm.validate()
Does basic checking to determine whether the current request is a valid submission of this form. more details... |
|
QuickForm.getInput()
Assuming that the current request is a form submission of this QuickForm, assembles an object with a property for each form field. more details... |
|
QuickForm.toHTML()
Converts this QuickForm to HTML mark-up. more details... |
|
QuickButton.toHTML()
Converts this QuickButton to HTML mark-up. more details... |
|
request.toHTML()
Enables pretty-printing of request object for debugging. more details... |
|
object
request
|
Note: you can call print(request) to see a nice display for debugging. more details... |
|
string
request.path
|
The request path following the hostname. more details... |
|
string
request.query
|
The value request query string. more details... |
|
string
request.method
|
Either "GET" or "POST" (uppercase). more details... |
|
boolean
request.isGet
|
Whether the curent HTTP request is a GET request. more details... |
|
boolean
request.isPost
|
Whether the current HTTP request is a POST request. more details... |
|
string
request.clientAddr
|
Holds the IP address of the user making the request. more details... |
|
object
request.params
|
Parameters associated with the request, either from the query string or from the contents of a POST, e.g. more details... |
|
object
request.headers
|
Used to access the HTTP headers of the current request. more details... |
|
object
request.cookies
|
Contains a map of name:value of all the cookies sent with the request. more details... |
|
response.forbid()
Halts the program immediately and returns 403 Forbidden error to the user. more details... |
|
response.stop(renderCurrentPage)
Halts the program immediately, optionally printing the page so far. more details... |
|
response.notFound()
Halts the program immediately and returns a 404 not found error to the user. more details... |
|
response.redirect(path)
Halts the program immediately and sends an HTTP redirect response (302), redirecting to the given path (relative or absolute). more details... |
|
response.setStatusCode(newCode)
Sets the status code in the HTTP response. more details... |
|
response.setHeader(name, value)
Sets any header of the HTTP response. more details... |
|
response.addHeader(name, value)
Adds the name,value pair to the headers. more details... |
|
response.write(data)
Low-level hook for writing raw data to the response. more details... |
|
response.setCookie(cookieObject)
Set a cookie in the response. more details... |
|
response.deleteCookie(name)
Tells the client to delete the cookie of the given name (by setting its expiration time to zero). more details... |
|
response.setContentType(contentType)
Sets the Content-Type header of the response. more details... |
|
response.setCacheable(cacheable)
Tells the client to cache the page. more details... |
|
object
response
|
more details... |
| StorableCollection |
A StorableCollection persistently stores other StorableObjects. more details... |
| StorableObject |
An object that can be stored directly, and is backed by our database. more details... |
|
getStorable(id)
Gets a StorableObject or StorableCollection by id. more details... |
|
StorableCollection.add(obj)
Adds a StorableObject to this collection. more details... |
|
StorableCollection.remove(obj)
Removes StorableObjects from this collection. more details... |
|
StorableCollection.filter(match)
Filters this collection based on a matching object. more details... |
|
StorableCollection.sort(compare)
Sorts this collection based on a sorting function. more details... |
|
StorableCollection.forEach(f)
Executes a function once on each member of this collection. more details... |
|
StorableCollection.size()
Returns the number of elements in a collection. more details... |
|
string
StorableObject.id
|
The id of a StorableObject is auto-generated. more details... |
|
importTags(scopeObj, tagArray)
Imports a specified list of tags. more details... |
| HttpRequestError |
The error thrown by wget and wpost if there's a problem retrieveing the requested URL. more details... |
| HttpResponse |
Description of an object containing the properties of the HTTP response returned by |
| StringSet |
Constructor for an object that holds a set of strings, with basic set operations. more details... |
|
md5(x)
Returns a string version of the MD5 signature of x. more details... |
|
eachProperty(obj, func)
Iterator convenience for JavaScript Objects. more details... |
|
object(parent)
Douglas Crockford's "object" function for prototypal inheritance, taken from http://javascript.crockford.com/prototypal.html more details... |
|
keys(obj)
Creates an array of the properties of |
|
cmp(a, b)
Comparator that returns -1, +1, or 0 depending on whether ab, or neither, respectively. more details... |
|
trim(str)
Removes leading and trailing whitespace from a string. more details... |
|
StringSet.contains(x)
Returns whether this set contains the given string. more details... |
|
StringSet.add(x)
Adds the given string to the set if it is not already in it. more details... |
|
StringSet.remove(x)
Removes the given string from the set if it is contained in it. more details... |
|
StringSet.forEach(f)
Iterators over the strings in the set, calling the provided function on each element. more details... |
|
wget(url, params, options)
Fetches the text of a URL and returns it as a string. more details... |
|
wpost(url, params, options)
Simple way to POST data to a URL and get back the response. more details... |
|
sendEmail(toAddress, subject, body, headers)
Simple way to send an email to a single recipient. more details... |
|
number
HttpResponse.status
|
The status code of the server's response, or an internal status code if connecting to the server failed. more details... |
|
string
HttpResponse.statusInfo
|
An explanation of the status code if it is an internal code (that is, less than 0) more details... |
|
string
HttpResponse.data
|
The data returned by the server, if any. more details... |
|
string
HttpResponse.contentType
|
The content type returned by the server, if any. more details... |
|
object
HttpResponse.headers
|
An object containing property names and values corresponding to the headers returned by the server. more details... |