AppPad Help
AppPad provides a set of tools for building online applications (or "apps"). You can run apps on AppPad.com, or embed them on your own webpage. AppPad applications are comprised of HTML+JavaScript source and Object Type data. You define Object Types to hold data for your application. Each Object Type has a name and a list of fields. The first field will always be the "key", a unique identifying value for each object. All of the methods to create, save, get, and delete objects are provided for you by AppPad.
Applications [top]
AppPad users can create applications from their My Account page. Click on "Create Application" to add an application then click "Edit App" to customize the application. You may edit the name, description, and Object Type properties by simply clicking over them. Your applications can be run directly on AppPad, or you can embed and share them on
other websites. You can also view the author's page or feedback page (coming soon) for each application.
Object Types [top]
Each AppPad application is able to store data according to defined Object Types. You may define any number of Object Types for each application. Each Object Type is defined with a name, list of fields, and read/edit permissions. Additionally, Object Types for each application will always follow these criteria:
- Object Types must have one or more fields. The first field of each Object Type will be the key field. Object Type names must be alpha-numeric no-spaces, and unique per
application (50 char max). Field names must be alpha-numeric no-spaces,
and unique per Object Type (200 char max for all fields combined).
- The key field value will be used to uniquely identify Object Type items for save, delete, and get operations. The key field will always be saved as a string value (non-string types
will be converted for you). The key field value must be between 1 and 200 characters.
After your Object Types are defined, you are able to create, save, get, and delete them within your App with the API functions that AppPad provides for you. See the "Functions" section for more. You can edit or export the data for your Object Types from the "Options" menu of each type. Object Type PermissionsEach Object Type has permissions settings which will control what data users are able to access. The following settings are available for both read and edit respectively:
- Anybody - Anyone (even anonymous users who aren't logged on to AppPad) can access this Object Type's data.
- Item Owners - AppPad Users can only access the Object Type data that they have created.
- Only Me - Only the owner of an application can access the Object Type data.
Visit the AppPad API Reference to see detailed descriptions of functions, their parameters, returns, and descriptions.
A Simple Example [top]
Say you wanted to create an application to manage an online To-Do list. You first need to create an Object Type for your application's data, such as the following:
Name
|
Fields
|
ToDo
|
task priority
|
Now you can use this object with Javascript in AppPad. The first field in the Fields list will always be the "key" used to save, get, and delete object data. Let's say you created new ToDo's in your application like so:
//create new ToDos with ToDo(task, priority) var myToDo1 = new ToDo('take out the trash', 2); var myToDo2 = new ToDo('pay the bills', 1); var myToDo3 = new ToDo('grocery shopping', 3);
The ToDo constructor method is provided for you automatically. Now, the 3 objects you've created can be accessed by their fields.
document.writeln('myToDo1 is: ' + myToDo1.task + ', with a priority of: ' + myToDo1.priority); //this will write "myToDo1 is: take out the trash, with a priority of: 2"
You can save these objects to AppPad, so your application can access them later.
appSaveItem('ToDo', myToDo1); appSaveItem('ToDo', myToDo2); appSaveItem('ToDo', myToDo3);
The code below will fetch your saved objects and display them.
var myToDos = appGetList('ToDo'); var key; for (var key in myToDos){ document.writeln('Task is: ' + myToDos[key].task + ', with a priority of: ' + myToDos[key].priority); }
You could add an AppPad provided sort function before the for-loop above to sort the displayed results. myToDos = appSortObjects(myToDos,'priority', 1);
You can also get, delete, and update objects by their key. In the example below, we want to delete 'grocery shopping' and reduce the priority of 'pay the bills'.
appDeleteItem('ToDo', 'grocery shopping'); var myNewToDo = appGetItem('ToDo', 'pay the bills'); myNewToDo.priority = 3; appSaveItem('ToDo', myNewToDo);
You'll want to piece the entire application together with HTML DOM objects (like Inputs and Divs) to code Javascript against to handle user input and display data. See the full working ToDo application and the ToDo application source.
Tips & Tricks [top]
- Visit the AppPad discussions to read answers and ask questions of other users.
- Javascript is easy to learn. Check out some of these links to get started:
- Debug your applications by turning on display for Javascript errors in your browser.
- Use the <script src=""/> tag to include your favorite Javascript library like prototype, jquery, etc.
- You can make all sorts of interesting mashup-type applications with AppPad, using services like Yahoo! Pipes. For example, you could import external RSS, Atom, or XML or other data as Javascript objects by using the provided appLoadYahooPipe function.
|