--- trunk/lib/Frey/Manual.pod 2008/12/04 22:31:06 721 +++ trunk/lib/Frey/Manual.pod 2008/12/04 22:37:26 722 @@ -2,6 +2,100 @@ This page describes how to use and develop with L +=head1 Designing user interaction flows + +Frey is all about creating Moose classes as your interaction with pages. +Each page is instance of class with some parametars received with post or +get request. + +If you want to access those parameters in your object, you have to define +attributes for it using L + +You can also generate result in three different forms: + +=over 20 + +=item as_markup + +HTML content + +=item as_sponge + +Tabular output + +FIXME link to description + +=item as_data + +Any perl hash structure + +=back + +Frey doesn't have html templates. Since your methods are part of REST URIs, +it doesn't make sense to separate html from object itself, which represent +web page. L provides role which has a bunch of helpful things +when creating html. + +Basically, if html you are generating in readable code semantically correct +to you, it the right track. + +You don't even have to create initial entry form as L, +which will start your L classes, will call L +for help and generate initial form for you. + +Creating files is mess, so L will +create class and test skeleton for you. + +If I did it right, it should read similar to human language, like SmallTalk. + +To make things simple, there are few convertions (with nod to Ruby on Rails) +which will help you get started: + +=head2 default parametars + +=head2 html markup + +HTML markup should be enclosed in C< qq| > and C< | > quotes. There is also +funny but very readable convention of multi line html when you have to +intermix confitions: + + my $html + = qq|

First

| + . ( $is_second ? qq|

Second

| : '' ) + . qq|

Third

| + ; + +This will be checked and reported at some point. Ideally, I would like to +write just + + my $html + = qq|

First

| + . $is_second ? qq|

Second

| : '' + . qq|

Third

| + ; + +which is valid perl syntax but doesn't work as expected. + +=head2 examples + +To help you get started, here are few implemented flows in Frey: + +=over 20 + +=item L + +Simple interaction with C + +=item L + +Gather data, display selection form with checkboxes + +=item L + +Display a huge amount of icons with single HTTP request + +=back + =head1 Command-line integration One of key points is that L runs under your user. This means it has