CPIA -- Chandler Presentation and Interaction Architecture -- Tutorials
This document will provide example code on how CPIA and CPIA Script are used.
Songs Tutorial (John)
I'd like to start with a tutorial on how to add a kind of item and display it with a block. I'd like to use Andi's idea of adding an attribute to a kind that is the UI (or tree of blocks) to display the Item. I'd like to extend the example to a tree of blocks that is used to display a type of collection in the sidebar. Finally, I'd like to have the example populate the repository with lots of data of the new kind. I'm open to ideas for the kind, but one possibility is a song. There are lots of interesting possibilities to extend the example furter: a full text search that updates a collection of songs or auto discovery of songs on the computer's disk.
Plan so far :
- Add new kind for songs (schema) and "import songs" menu item (CPIA). Demonstrate basic repository API (required for anything in CPIA).
- Simple detail view for songs : title and play button. Demonstrate definition and use of a simple independent tree of CPIA blocks.
- DV within the existing DV : title and play button with the existing markup bar. Demonstrate how to plug a tree of blocks in an existing tree of blocks (DV). Introduces and demonstrate how to use Attribute Editors.
- Kind viewer : replace summary view with songs list (a la iTunes, TBD). Demonstrate how to create a more complex viewer a la summary view.
CPIA Script "Hello World" (Donn)
CPIA Script has the simplest "Hello World":
print "Hello world!"
Seriously, we need to think about a more substantial Hello world sample to do in CPIA Script. One suggestion would be to revamp the "Stock Ticker" parcel and write it as a single script, in much the way that
KindBuilder would generate it. This would give an example of creating a 'Stock' Kind, a 'Stocks' Collection, and allow the user to create new 'Stock' Items. The 'ticker' part would simply be the same snippet of Python code that fetches a delayed quote from the internet, and it would be in the script associated with the 'Stock' class, so they would display their price automatically.
Attribute Editor
- Demo the exisiting AE, list them
- How to create new AE
Kind Builder (Donn)
See the
KindBuilder wiki for details about the Kind Builder proposal. In general, once Kind Builder is there, building a "Hello World" example will be very easy, and it will provide guidance for some of the categories above. Specifically, when you build a Kind, the Detail View in Kind Builder will provide UI choices to let you decide what attributes your kind should have, and how to display those attributes in a Detail View. You will also get a preview of the code generated by those UI choices, so it can act as an online reference if you forget the syntax for defining schema or AEBlocks, etc.
Smallest Common Denominator Parcel
We feel there a need for a simple parcel at the intersection of Amazon, Flickr, Zaoboa. Something that would demo the basic of parcels. Somewhat unrelated to CPIA though. To be discussed with Katie.