[Jifty-commit] r1712 - in jifty/branches/moose: . doc/talks lib lib/Jifty lib/Jifty/Test/WWW lib/Jifty/View/Mason lib/Jifty/View/Static lib/Jifty/Web lib/Jifty/Web/Session plugins/Login/lib/Jifty/Plugin/Login/Notification plugins/ProfileBehaviour plugins/ProfileBehaviour/doc plugins/ProfileBehaviour/lib plugins/ProfileBehaviour/lib/Jifty plugins/ProfileBehaviour/lib/Jifty/Plugin plugins/ProfileBehaviour/lib/Jifty/Plugin/ProfileBehaviour/Action plugins/ProfileBehaviour/lib/Jifty/Plugin/ProfileBehaviour/Model plugins/ProfileBehaviour/share plugins/ProfileBehaviour/share/po plugins/ProfileBehaviour/share/web plugins/ProfileBehaviour/share/web/static plugins/ProfileBehaviour/share/web/static/css plugins/ProfileBehaviour/share/web/static/js plugins/ProfileBehaviour/share/web/templates plugins/ProfileBehaviour/t plugins/REST plugins/REST/lib plugins/REST/lib/Jifty plugins/REST/lib/Jifty/Plugin plugins/REST/lib/Jifty/Plugin/REST plugins/REST/t share/web/static/css share/web/static/images/silk share/web/static/js share/web/templates/__jifty/admin share/web/templates/__jifty/admin/_elements t/TestApp-Plugin-REST t/TestApp-Plugin-REST/bin t/TestApp-Plugin-REST/etc t/TestApp-Plugin-REST/lib t/TestApp-Plugin-REST/lib/TestApp t/TestApp-Plugin-REST/lib/TestApp/Plugin t/TestApp-Plugin-REST/lib/TestApp/Plugin/REST t/TestApp-Plugin-REST/lib/TestApp/Plugin/REST/Action t/TestApp-Plugin-REST/lib/TestApp/Plugin/REST/Model t/TestApp-Plugin-REST/share t/TestApp-Plugin-REST/t t/TestApp-Plugin-REST/var t/TestApp-Plugin-REST/var/mason t/TestApp-Plugin-REST/var/mason/cache t/TestApp-Plugin-REST/var/mason/obj

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Mon Jul 31 03:35:28 EDT 2006


Author: audreyt
Date: Mon Jul 31 03:35:23 2006
New Revision: 1712

Added:
   jifty/branches/moose/lib/Jifty/Web/Session/
   jifty/branches/moose/lib/Jifty/Web/Session/ClientSide.pm
   jifty/branches/moose/plugins/ProfileBehaviour/
   jifty/branches/moose/plugins/ProfileBehaviour/Makefile.PL
   jifty/branches/moose/plugins/ProfileBehaviour/doc/
   jifty/branches/moose/plugins/ProfileBehaviour/lib/
   jifty/branches/moose/plugins/ProfileBehaviour/lib/Jifty/
   jifty/branches/moose/plugins/ProfileBehaviour/lib/Jifty/Plugin/
   jifty/branches/moose/plugins/ProfileBehaviour/lib/Jifty/Plugin/ProfileBehaviour/
   jifty/branches/moose/plugins/ProfileBehaviour/lib/Jifty/Plugin/ProfileBehaviour.pm
   jifty/branches/moose/plugins/ProfileBehaviour/lib/Jifty/Plugin/ProfileBehaviour/Action/
   jifty/branches/moose/plugins/ProfileBehaviour/lib/Jifty/Plugin/ProfileBehaviour/Dispatcher.pm
   jifty/branches/moose/plugins/ProfileBehaviour/lib/Jifty/Plugin/ProfileBehaviour/Model/
   jifty/branches/moose/plugins/ProfileBehaviour/share/
   jifty/branches/moose/plugins/ProfileBehaviour/share/po/
   jifty/branches/moose/plugins/ProfileBehaviour/share/web/
   jifty/branches/moose/plugins/ProfileBehaviour/share/web/static/
   jifty/branches/moose/plugins/ProfileBehaviour/share/web/static/css/
   jifty/branches/moose/plugins/ProfileBehaviour/share/web/static/css/behaviour-profile.css
   jifty/branches/moose/plugins/ProfileBehaviour/share/web/static/js/
   jifty/branches/moose/plugins/ProfileBehaviour/share/web/static/js/behaviour.js
   jifty/branches/moose/plugins/ProfileBehaviour/share/web/templates/
   jifty/branches/moose/plugins/ProfileBehaviour/t/
   jifty/branches/moose/plugins/REST/
   jifty/branches/moose/plugins/REST/Makefile.PL
   jifty/branches/moose/plugins/REST/lib/
   jifty/branches/moose/plugins/REST/lib/Jifty/
   jifty/branches/moose/plugins/REST/lib/Jifty/Plugin/
   jifty/branches/moose/plugins/REST/lib/Jifty/Plugin/REST/
   jifty/branches/moose/plugins/REST/lib/Jifty/Plugin/REST.pm
   jifty/branches/moose/plugins/REST/lib/Jifty/Plugin/REST/Dispatcher.pm
   jifty/branches/moose/plugins/REST/t/
   jifty/branches/moose/share/web/static/images/silk/cancel_grey.png   (contents, props changed)
   jifty/branches/moose/t/TestApp-Plugin-REST/
   jifty/branches/moose/t/TestApp-Plugin-REST/bin/
   jifty/branches/moose/t/TestApp-Plugin-REST/bin/jifty   (contents, props changed)
   jifty/branches/moose/t/TestApp-Plugin-REST/etc/
   jifty/branches/moose/t/TestApp-Plugin-REST/etc/config.yml
   jifty/branches/moose/t/TestApp-Plugin-REST/lib/
   jifty/branches/moose/t/TestApp-Plugin-REST/lib/TestApp/
   jifty/branches/moose/t/TestApp-Plugin-REST/lib/TestApp/Plugin/
   jifty/branches/moose/t/TestApp-Plugin-REST/lib/TestApp/Plugin/REST/
   jifty/branches/moose/t/TestApp-Plugin-REST/lib/TestApp/Plugin/REST/Action/
   jifty/branches/moose/t/TestApp-Plugin-REST/lib/TestApp/Plugin/REST/Action/DoSomething.pm
   jifty/branches/moose/t/TestApp-Plugin-REST/lib/TestApp/Plugin/REST/Dispatcher.pm
   jifty/branches/moose/t/TestApp-Plugin-REST/lib/TestApp/Plugin/REST/Model/
   jifty/branches/moose/t/TestApp-Plugin-REST/lib/TestApp/Plugin/REST/Model/User.pm
   jifty/branches/moose/t/TestApp-Plugin-REST/share/
   jifty/branches/moose/t/TestApp-Plugin-REST/t/
   jifty/branches/moose/t/TestApp-Plugin-REST/t/00-model-User.t   (contents, props changed)
   jifty/branches/moose/t/TestApp-Plugin-REST/t/00-prototype.t   (contents, props changed)
   jifty/branches/moose/t/TestApp-Plugin-REST/t/01-config.t   (contents, props changed)
   jifty/branches/moose/t/TestApp-Plugin-REST/t/02-basic-use.t   (contents, props changed)
   jifty/branches/moose/t/TestApp-Plugin-REST/var/
   jifty/branches/moose/t/TestApp-Plugin-REST/var/mason/
   jifty/branches/moose/t/TestApp-Plugin-REST/var/mason/cache/
   jifty/branches/moose/t/TestApp-Plugin-REST/var/mason/obj/
   jifty/branches/moose/t/TestApp-Plugin-REST/var/mason/obj/.__obj_create_marker
Modified:
   jifty/branches/moose/   (props changed)
   jifty/branches/moose/Changelog
   jifty/branches/moose/MANIFEST
   jifty/branches/moose/MANIFEST.SKIP
   jifty/branches/moose/META.yml
   jifty/branches/moose/Makefile.PL
   jifty/branches/moose/SIGNATURE
   jifty/branches/moose/doc/talks/oscon.2006.xul   (contents, props changed)
   jifty/branches/moose/lib/Jifty.pm
   jifty/branches/moose/lib/Jifty/ClassLoader.pm
   jifty/branches/moose/lib/Jifty/Dispatcher.pm
   jifty/branches/moose/lib/Jifty/Notification.pm
   jifty/branches/moose/lib/Jifty/Test/WWW/Mechanize.pm
   jifty/branches/moose/lib/Jifty/View/Mason/Handler.pm
   jifty/branches/moose/lib/Jifty/View/Static/Handler.pm
   jifty/branches/moose/lib/Jifty/Web.pm
   jifty/branches/moose/lib/Jifty/Web/Session.pm
   jifty/branches/moose/plugins/Login/lib/Jifty/Plugin/Login/Notification/ConfirmAddress.pm
   jifty/branches/moose/share/web/static/css/notices.css
   jifty/branches/moose/share/web/static/js/behaviour.js
   jifty/branches/moose/share/web/static/js/calendar.js
   jifty/branches/moose/share/web/templates/__jifty/admin/_elements/nav
   jifty/branches/moose/share/web/templates/__jifty/admin/index.html

Log:
 r16679 at 12-46-55-49 (orig r1667):  trs | 2006-07-25 10:52:25 -0700
  r14751 at zot:  tom | 2006-07-25 13:48:15 -0400
  Fix bug that didn't allow calendar months to be changed
 
 r16680 at 12-46-55-49 (orig r1668):  audreyt | 2006-07-25 12:59:57 -0700
 * Jifty::Web::Session::ClientSide - Client-side sessions.
 r16682 at 12-46-55-49 (orig r1669):  trs | 2006-07-25 13:06:52 -0700
  r14755 at zot:  tom | 2006-07-25 16:06:44 -0400
  Fix typo
 
 r16683 at 12-46-55-49 (orig r1670):  audreyt | 2006-07-25 13:30:34 -0700
 * Jifty::Web::Session::ClientSide: Re-assemble split cookies (>4K) correctly.
   "logout" now works transparently.
 r16695 at 12-46-55-49 (orig r1671):  srl | 2006-07-25 14:01:18 -0700
  r6427 at kootenai:  srl | 2006-07-25 16:58:14 -0400
  Clarify POD.
 
 r16696 at 12-46-55-49 (orig r1672):  srl | 2006-07-25 14:01:21 -0700
  r6428 at kootenai:  srl | 2006-07-25 16:59:05 -0400
  Autoformat message bodies for notifications.
 
 r16697 at 12-46-55-49 (orig r1673):  zev | 2006-07-25 15:25:50 -0700
  r11919 at truegrounds:  zev | 2006-07-25 18:25:37 -0400
  * doc fix
 
 r16698 at 12-46-55-49 (orig r1674):  ishigaki | 2006-07-26 07:43:45 -0700
 * Win32 requires File::ShareDir 0.04
 r16707 at 12-46-55-49 (orig r1679):  jesse | 2006-07-26 14:44:49 -0700
  r14517 at pinglin:  jesse | 2006-07-26 14:42:59 -0700
   * oscon talk final version
 
 r16723 at 12-46-55-49 (orig r1680):  audreyt | 2006-07-26 21:29:52 -0700
 * mimetype for oscon talk
 r16730 at 12-46-55-49 (orig r1681):  nelhage | 2006-07-27 11:21:33 -0700
 Plugin static roots should take precendence over jifty's
 r16731 at 12-46-55-49 (orig r1682):  nelhage | 2006-07-27 11:36:31 -0700
 Removing profiling code from behaviour.js
 r16733 at 12-46-55-49 (orig r1684):  nelhage | 2006-07-27 14:23:23 -0700
 Adding a ProfileBehaviour plugin to aid profiling Javascript
 Behaviours (see app_behaviour.js in the Jifty source for some more
 information)
 r16739 at 12-46-55-49 (orig r1685):  trs | 2006-07-28 10:01:43 -0700
  r14863 at zot:  tom | 2006-07-28 13:00:52 -0400
  Make the POD name match the actual package name
 
 r16743 at 12-46-55-49 (orig r1686):  jesse | 2006-07-28 18:32:40 -0700
 * fixing a resource fork issue
 r16744 at 12-46-55-49 (orig r1687):  jesse | 2006-07-28 18:32:58 -0700
 * fixing a resource fork issue
 r16745 at 12-46-55-49 (orig r1688):  audreyt | 2006-07-28 19:16:31 -0700
 * Dispatcher did not have a ->{cgi}, so ->method certainly could not
   work.  Use the env variable for now.
 r16746 at 12-46-55-49 (orig r1689):  audreyt | 2006-07-28 19:21:02 -0700
 * skeleton for plugin rest
 r16747 at 12-46-55-49 (orig r1690):  audreyt | 2006-07-28 19:55:59 -0700
 * REST Dispatcher skeleton that actually works
   ...now actually moving stuff from RPS to it...
 r16748 at 12-46-55-49 (orig r1691):  jesse | 2006-07-28 20:45:20 -0700
  r14603 at pinglin:  jesse | 2006-07-28 20:44:35 -0700
   * Basic placeholder for REST plugin tests
 
 r16749 at 12-46-55-49 (orig r1692):  audreyt | 2006-07-28 20:50:42 -0700
 * REST Dispatcher: model list reflection
 r16750 at 12-46-55-49 (orig r1693):  audreyt | 2006-07-28 20:52:21 -0700
 * Jifty.pm: Change all __PACKAGE__ to Jifty.
 * Jifty::ClassLoader: provide ->models accessor to list the model classes.
 r16751 at 12-46-55-49 (orig r1694):  audreyt | 2006-07-28 20:55:46 -0700
 * __jifty/admin: use ->models reflection to build the nav bar.
 r16752 at 12-46-55-49 (orig r1695):  audreyt | 2006-07-28 20:57:02 -0700
 * ditto for the index.
 r16753 at 12-46-55-49 (orig r1696):  audreyt | 2006-07-28 21:04:30 -0700
 * even less code for jifty admin console
 r16754 at 12-46-55-49 (orig r1697):  audreyt | 2006-07-28 21:18:54 -0700
 * admin models: Add the ->isa('Jifty::Record') back
 r16755 at 12-46-55-49 (orig r1698):  jesse | 2006-07-28 21:24:32 -0700
  r14611 at pinglin:  jesse | 2006-07-28 21:23:41 -0700
  * First tests!
 
 r16756 at 12-46-55-49 (orig r1699):  jesse | 2006-07-28 21:34:40 -0700
  r14615 at pinglin:  jesse | 2006-07-28 21:34:25 -0700
  * test for audrey's next unimplemented feature 'describe this model class'
 
 r16757 at 12-46-55-49 (orig r1700):  jesse | 2006-07-28 21:36:26 -0700
  r14617 at pinglin:  jesse | 2006-07-28 21:36:12 -0700
  * tests were wrong. hard to see that before we have runnign code
 
 r16758 at 12-46-55-49 (orig r1701):  jesse | 2006-07-28 22:03:22 -0700
  r14619 at pinglin:  jesse | 2006-07-28 21:58:47 -0700
  * Next REST Test pass
 
 r16759 at 12-46-55-49 (orig r1702):  audreyt | 2006-07-28 22:08:46 -0700
 * Jifty::Plugin::REST::Dispatcher - model fetch actually works!
 r16761 at 12-46-55-49 (orig r1703):  srl | 2006-07-29 05:26:32 -0700
 Removed Text::Autoformat dependency and usage.
 r16800 at 12-46-55-49 (orig r1704):  audreyt | 2006-07-29 20:07:11 -0700
 * Jifty::Plugin::REST - test passes; release it! :)
 r16801 at 12-46-55-49 (orig r1705):  audreyt | 2006-07-29 20:12:59 -0700
 * squash some uninitialized warnings when emitting empty columns
 r16804 at 12-46-55-49 (orig r1706):  audreyt | 2006-07-30 00:40:06 -0700
 * Jifty::Dispatcher: abort(404) now works as the doc promised.
 r16805 at 12-46-55-49 (orig r1707):  audreyt | 2006-07-30 00:45:34 -0700
 * J::P::REST::Dispatcher - all GET model URLs work, with 404s.
 r16806 at 12-46-55-49 (orig r1708):  audreyt | 2006-07-30 00:46:03 -0700
 * Update the REST plugin tests to match.
 r16807 at 12-46-55-49 (orig r1709):  audreyt | 2006-07-30 11:15:06 -0700
 * MIME type fixup:
     application/json
     application/x-perl
     text/x-yaml
 r16814 at 12-46-55-49 (orig r1710):  trs | 2006-07-30 22:36:03 -0700
  r14982 at zot:  tom | 2006-07-31 01:12:32 -0400
  Update the dismiss button styles
 


Modified: jifty/branches/moose/Changelog
==============================================================================
--- jifty/branches/moose/Changelog	(original)
+++ jifty/branches/moose/Changelog	Mon Jul 31 03:35:23 2006
@@ -1,3 +1,29 @@
+0.60728
+
+* Adding a ProfileBehaviour plugin to aid profiling Javascript
+* Behaviours (see app_behaviour.js in the Jifty source for some more information)
+* Removing profiling code from behaviour.js
+* Plugin static roots should take precendence over jifty's
+* Win32 requires File::ShareDir 0.04
+* Autoformat message bodies for notifications.
+* Jifty::Web::Session::ClientSide: Re-assemble split cookies (>4K) correctly.
+  "logout" now works transparently.
+* Jifty::Web::Session::ClientSide - Client-side sessions.
+* Fix bug that didn't allow calendar months to be changed
+* Jifty::Manual::Continuations: reflect tangent() in the manual.
+* Dispatcher: Support tangent($url) as sugar for Jifty->web->tangent(url=>$url).
+* Dispatcher: Allow "**" in glob pattern to mean anychar including slash.
+* Jifty->web->return in void context is now an immediate return.
+* Jifty::ClassLoader - Make Jifty::Handle a CL'ed module as well,
+  so MyApp::Handle can implement scary magick of its own.
+* Don't blow up when trying to check if action mixins are autogenerated
+* Show calendar widget on focus and hide it on blur
+* Gzip compress the squished CSS and JS if possible.  The static handler usually deals with this, but we're not serving squished CSS/JS from the static root.
+* Fix placeholders on browser forward/back
+* Replace hard tabs with spaces for consistency
+* If we don't have XMLHttpRequest, fall back on page loads
+* Win32 complains when you try to unlink open DB
+
 0.60722
 
 * Dispatcher fixes to deal with the better canonicalization we started doing in

Modified: jifty/branches/moose/MANIFEST
==============================================================================
--- jifty/branches/moose/MANIFEST	(original)
+++ jifty/branches/moose/MANIFEST	Mon Jul 31 03:35:23 2006
@@ -128,6 +128,7 @@
 lib/Jifty/Web/Menu.pm
 lib/Jifty/Web/PageRegion.pm
 lib/Jifty/Web/Session.pm
+lib/Jifty/Web/Session/ClientSide.pm
 lib/Jifty/YAML.pm
 Makefile.PL
 MANIFEST			This list of files
@@ -171,6 +172,11 @@
 plugins/Nothing/lib/Jifty/Plugin/Nothing.pm
 plugins/Nothing/lib/Jifty/Plugin/Nothing/Dispatcher.pm
 plugins/Nothing/Makefile.PL
+plugins/ProfileBehaviour/lib/Jifty/Plugin/ProfileBehaviour.pm
+plugins/ProfileBehaviour/lib/Jifty/Plugin/ProfileBehaviour/Dispatcher.pm
+plugins/ProfileBehaviour/Makefile.PL
+plugins/ProfileBehaviour/share/web/static/css/behaviour-profile.css
+plugins/ProfileBehaviour/share/web/static/js/behaviour.js
 README
 share/dtd/xhtml-lat1.ent
 share/dtd/xhtml-special.ent

Modified: jifty/branches/moose/MANIFEST.SKIP
==============================================================================
--- jifty/branches/moose/MANIFEST.SKIP	(original)
+++ jifty/branches/moose/MANIFEST.SKIP	Mon Jul 31 03:35:23 2006
@@ -20,3 +20,4 @@
 var/*
 t/*/var/*
 doc/talks/*
+^\.

Modified: jifty/branches/moose/META.yml
==============================================================================
--- jifty/branches/moose/META.yml	(original)
+++ jifty/branches/moose/META.yml	Mon Jul 31 03:35:23 2006
@@ -14,6 +14,7 @@
     - inc
 requires: 
   App::CLI: 0.03
+  CGI::Cookie::Splitter: 0
   CSS::Squish: 0.05
   Cache::Cache: 0
   Calendar::Simple: 0
@@ -22,6 +23,8 @@
   Class::Container: 0
   Class::Data::Inheritable: 0
   Compress::Zlib: 0
+  Crypt::CBC: 0
+  Crypt::Rijndael: 0
   DBD::SQLite: 1.11
   Data::Page: 0
   Date::Manip: 0

Modified: jifty/branches/moose/Makefile.PL
==============================================================================
--- jifty/branches/moose/Makefile.PL	(original)
+++ jifty/branches/moose/Makefile.PL	Mon Jul 31 03:35:23 2006
@@ -1,7 +1,6 @@
 use inc::Module::Install 0.46;
 name('Jifty');
 license('Perl');
-# this is a dev version, CPAN.pm will not install by default
 requires(perl => '5.8.3');  
 requires('App::CLI' => 0.03 ); # App::CLI::Command::Help App::CLI::Command
 requires('Cache::Cache'); #Cache::FileCache
@@ -9,6 +8,9 @@
 requires('Class::Accessor::Named'); 
 requires('Class::Container');
 requires('Class::Data::Inheritable');
+requires('CGI::Cookie::Splitter');
+requires('Crypt::CBC');
+requires('Crypt::Rijndael');
 requires('Compress::Zlib');
 requires('CSS::Squish' => 0.05 );
 requires('DBD::SQLite' => 1.11 );
@@ -23,7 +25,7 @@
 requires('Exporter::Lite');
 requires('File::Find::Rule');
 requires('File::MMagic');
-requires('File::ShareDir');
+requires('File::ShareDir' => '0.04');
 requires('HTML::Entities');
 requires('HTML::Mason' => 1.3101);           # HTML::Mason::Exceptions HTML::Mason::FakeApache HTML::Mason::MethodMaker HTML::Mason::Request HTML::Mason::Utils
 requires('HTML::Mason::Plugin');

Modified: jifty/branches/moose/SIGNATURE
==============================================================================
--- jifty/branches/moose/SIGNATURE	(original)
+++ jifty/branches/moose/SIGNATURE	Mon Jul 31 03:35:23 2006
@@ -15,11 +15,11 @@
 Hash: SHA1
 
 SHA1 8a1668319fec7d4608a8766e731e4c11098a362f AUTHORS
-SHA1 e933361984e8b712b90c7b9c9a2801c357b30c52 Changelog
-SHA1 313ac6fa56fefcc7e30f36516659896bd36f4566 MANIFEST
-SHA1 ef79154bdd753b6bc03a2919356e0e904b4b9ba2 MANIFEST.SKIP
-SHA1 a66635ea6823676d009d092b3174df6e9f5e5204 META.yml
-SHA1 bdf2e6a311a5857142e246616acfb33fe8d4672c Makefile.PL
+SHA1 6519400f0ca2fe996330e3d558daaa15c8215dde Changelog
+SHA1 a4fc6fc04bd5661fc91d6aee1c48f098dad9c2cf MANIFEST
+SHA1 3b4d530597ac2e3a9eca178a83dc71ef10f54897 MANIFEST.SKIP
+SHA1 371a37a47c66081da34cf99866629218d7e301e9 META.yml
+SHA1 3ba8ad6a41054bfd89e902a2dbb6e41d60bbda23 Makefile.PL
 SHA1 e395a2eabaf8faf8266dedc664c1eb52c6c589cf README
 SHA1 aaf8f7a1025fc97077072672f325e2a5f3c03a41 bin/build_par
 SHA1 a7dc1f376cac630ea28d2965e561469deb951cc7 bin/jifty
@@ -56,7 +56,7 @@
 SHA1 7eb44b00058c44795038d7fa4c0c77470f20a7f8 inc/Module/Install/Win32.pm
 SHA1 6d05967a5e1680b5f118315aaa6b8a1e143d79d8 inc/Module/Install/WriteAll.pm
 SHA1 c17e8f3cf8ebe1eb4929fd2bd2fd530a9de1abd0 lib/Email/Send/Jifty/Test.pm
-SHA1 aec0a78576b85191626741b91510258ac2cd2cc3 lib/Jifty.pm
+SHA1 2a3817f442745aa41b54ae03e7f25f49aa0f6ea6 lib/Jifty.pm
 SHA1 97b88e634644b2634bcd5c96d21a9fbb02bc135c lib/Jifty/API.pm
 SHA1 b88fa39d416114e24b434b38edd86b0cff86104b lib/Jifty/Action.pm
 SHA1 a6d9d87b4fa06cfab36f249a67946b45669dcee7 lib/Jifty/Action/Autocomplete.pm
@@ -66,14 +66,14 @@
 SHA1 6eda031083567c5cfe9d434e1bdc31bb16ba087c lib/Jifty/Action/Record/Update.pm
 SHA1 c99a798acc9c65baf4e750a70487c192980e0c54 lib/Jifty/Action/Redirect.pm
 SHA1 cf349fcfe9ee28216eae2213ab0016ceaffaf2a7 lib/Jifty/Bootstrap.pm
-SHA1 5f5c4895999d303bcfeea8dc86553e8dec13688c lib/Jifty/ClassLoader.pm
+SHA1 c36f035b08bceae69347f37f17bc4cedb6d19e81 lib/Jifty/ClassLoader.pm
 SHA1 8630d9cfbc56fa66229e975743ecfab25337720b lib/Jifty/Client.pm
 SHA1 8b4824481d003c667434223ba1432e18422431e7 lib/Jifty/Collection.pm
 SHA1 1164429483ccf9d6fb9bf21d87c5d11d942dd115 lib/Jifty/Config.pm
 SHA1 40fbe5939099501bd4fbae6fc8b1b65aaa815010 lib/Jifty/Continuation.pm
 SHA1 15970f85b57eab885568a71f164dc627c791287c lib/Jifty/CurrentUser.pm
 SHA1 b4f56fb42e62e5712f2c382a3daf72532b09aa63 lib/Jifty/DateTime.pm
-SHA1 4002b796a33386e5729d36a3e6a27e6b193e1cce lib/Jifty/Dispatcher.pm
+SHA1 c96d8a112653a5aab2779c0f8d7c3b6a4a356960 lib/Jifty/Dispatcher.pm
 SHA1 aa71ff8e4bd2b2652254eb63272c1edf9664f270 lib/Jifty/Everything.pm
 SHA1 f4285964bfa60f300d7f572868af745737396320 lib/Jifty/Handle.pm
 SHA1 61af0bde25c3eee4b72198dbc79fee93fb63673a lib/Jifty/Handler.pm
@@ -83,7 +83,7 @@
 SHA1 f47496ea9779b3ba77bffccf16f923bb3be52682 lib/Jifty/Logger.pm
 SHA1 c2ef5f9cfac7a0adff5c492bfdd005d42e489173 lib/Jifty/Manual/AccessControl.pod
 SHA1 ddeb3174dd4b5deded7257f397b814ff86042050 lib/Jifty/Manual/Actions.pod
-SHA1 19b55c02fb61a54a3b72efefef8657a2b46558fc lib/Jifty/Manual/Continuations.pod
+SHA1 64af8b16b24cfc4a5a812ec72caf7b49872e57b8 lib/Jifty/Manual/Continuations.pod
 SHA1 b706c85c0d68ea72e9aac27b4970e9271d6d5811 lib/Jifty/Manual/Cookbook.pod
 SHA1 0f95658ca3d4ed3deb1951f514774446a583247f lib/Jifty/Manual/Glossary.pod
 SHA1 1204d70c868084ac3114fae277e98a756f83f819 lib/Jifty/Manual/ObjectModel.pod
@@ -94,7 +94,7 @@
 SHA1 809ace5bafff5ad2461d5495464863ba808dfd19 lib/Jifty/Model/Metadata.pm
 SHA1 36de25464ae4eb07675f453cc590b634c6ff5a37 lib/Jifty/Model/Session.pm
 SHA1 0efcdf22d66e521cf250c1398caf3aba93ed795d lib/Jifty/Model/SessionCollection.pm
-SHA1 a08cad548e0c3a8e7020c3d28b397cd829d6f2dc lib/Jifty/Notification.pm
+SHA1 cab1c5e93c794b0c2bb55ce326dd91aff9487556 lib/Jifty/Notification.pm
 SHA1 dbde3807a964ad4f792bffc08fac49d8daea8017 lib/Jifty/Object.pm
 SHA1 fe40079f81fd0929ce416506620a803977710cad lib/Jifty/Param.pm
 SHA1 05ed23b70fff7823482140dc691f52ec55dfdc8f lib/Jifty/Param/Schema.pm
@@ -115,18 +115,18 @@
 SHA1 3d64cec7b94114377438a33dc4708675132a57cf lib/Jifty/Script/Model.pm
 SHA1 5f83918df18adf655da5a5119ef136789a61956e lib/Jifty/Script/Plugin.pm
 SHA1 4268d0e323c346773bc8f700c4b61abe9b608507 lib/Jifty/Script/Po.pm
-SHA1 b5d2f7108d962c9248aef01e4cc6e4dbecf03e3a lib/Jifty/Script/Schema.pm
+SHA1 86185ddd497483ee974c723f2bbd016c333ac371 lib/Jifty/Script/Schema.pm
 SHA1 84fb7443024ef5a86463ea3a5ae2c726b4fb62d3 lib/Jifty/Script/Server.pm
 SHA1 0646a96ca5f3da1585e3fb1dcc9b3540d2b8f50f lib/Jifty/Server.pm
 SHA1 f525e25ccb57b4f11f33a35c234d46280180c353 lib/Jifty/Test.pm
-SHA1 28e075057f01fdb79aa79706e1de5665604e54fb lib/Jifty/Test/WWW/Mechanize.pm
+SHA1 ded0711f1a00234606e0e94ff26c6c0d4db2084a lib/Jifty/Test/WWW/Mechanize.pm
 SHA1 733fe172a33d77ebbf1202ab02632c5d896f16f8 lib/Jifty/TestServer.pm
 SHA1 7561e9fb302562617853fcc2a9be665a67ffc4d8 lib/Jifty/Upgrade.pm
 SHA1 cd2a8612b1b7204d321b80eea365036c29702fc2 lib/Jifty/Upgrade/Internal.pm
 SHA1 0b22153c9912d6bfcf82f7615c96cffafb346bed lib/Jifty/Util.pm
 SHA1 f66bcdc226c855a95fd99b3bef1b6175330ea896 lib/Jifty/View/Mason/Handler.pm
-SHA1 d0aa38f5fd528d499de91da1e8c411f39f922bb2 lib/Jifty/View/Static/Handler.pm
-SHA1 463169e333ac334b026c3395fa06b982a76dbae5 lib/Jifty/Web.pm
+SHA1 d5a32130776a865dfa039933b79a4f3f10fb928c lib/Jifty/View/Static/Handler.pm
+SHA1 a5332f0fb33923ec8754a7df84196b5ac114a190 lib/Jifty/Web.pm
 SHA1 1efc063a47d726c98d2b4a4e3104dab9765caff4 lib/Jifty/Web/Form.pm
 SHA1 853ce15ee3efe007c649338b667885b44434044c lib/Jifty/Web/Form/Clickable.pm
 SHA1 f0536868d6915a7d2972a811a5feec14e278c24a lib/Jifty/Web/Form/Element.pm
@@ -148,7 +148,8 @@
 SHA1 1f162c264cef4c395b500cf71f6c9eb40f2aca89 lib/Jifty/Web/Form/Link.pm
 SHA1 31bcb079f01fb208fb0b2a4d41fde1044bb3a295 lib/Jifty/Web/Menu.pm
 SHA1 c5a1a65313ab58792634581786167279b033a29f lib/Jifty/Web/PageRegion.pm
-SHA1 8c7c78fb97daf25e74e60c6de5a5adee1659b7da lib/Jifty/Web/Session.pm
+SHA1 2c4de20759a2e8201f0e23fdfb4fda62c63d39c5 lib/Jifty/Web/Session.pm
+SHA1 8ff5fe8c3f09d4ff5da3c12ecbd313bd53a0781c lib/Jifty/Web/Session/ClientSide.pm
 SHA1 ec239a461310c3eb36cc4d3d2df3c020b1cab3fb lib/Jifty/YAML.pm
 SHA1 e8ce16205eccb1b99224ca81d3a3496163a98864 plugins/EditInPlace/Makefile.PL
 SHA1 312dfe93d52daa4c72257cf2299aee35f61b0a16 plugins/EditInPlace/lib/Jifty/Plugin/EditInPlace.pm
@@ -180,7 +181,7 @@
 SHA1 81875f6ab2d807bfe4671af084b4f238d383464c plugins/Login/lib/Jifty/Plugin/Login/CurrentUser.pm
 SHA1 6ed1349bb1d9f833bfd5c02b8aee94cc2f93da5f plugins/Login/lib/Jifty/Plugin/Login/Dispatcher.pm
 SHA1 9b6923b6718443dded533bffc0b03c55453322ee plugins/Login/lib/Jifty/Plugin/Login/Model/User.pm
-SHA1 bff7b7aac5d7ee0e35277ed1366714c1800a43ca plugins/Login/lib/Jifty/Plugin/Login/Notification/ConfirmAddress.pm
+SHA1 d4eec56bd790a8f61dde946aa44133704c945097 plugins/Login/lib/Jifty/Plugin/Login/Notification/ConfirmAddress.pm
 SHA1 cf9c995f10d81a5b124f278756808ad3418818e5 plugins/Login/share/web/templates/let/confirm_email
 SHA1 df53aef4fd346d763025380e4ac05d441c1d7501 plugins/Login/share/web/templates/login
 SHA1 e38eaf6f5d52cf5050df5803cf13623b14ecd96d plugins/Login/share/web/templates/logout
@@ -188,6 +189,11 @@
 SHA1 6a8008c78f6f0985542b8c42ef3327508b798897 plugins/Nothing/Makefile.PL
 SHA1 514f77cd3c01a1fea159187fde9fa8ab78b0b75c plugins/Nothing/lib/Jifty/Plugin/Nothing.pm
 SHA1 ceeff321fbe0e12b7a4a2421320db57b8bee8732 plugins/Nothing/lib/Jifty/Plugin/Nothing/Dispatcher.pm
+SHA1 d6cbace955b9546e82780a4c070a96265fb788a1 plugins/ProfileBehaviour/Makefile.PL
+SHA1 f315c0902c3f5102ab8ca3159d201a1475074a5e plugins/ProfileBehaviour/lib/Jifty/Plugin/ProfileBehaviour.pm
+SHA1 145948e25dc1be742b76d870a20d13383f902f49 plugins/ProfileBehaviour/lib/Jifty/Plugin/ProfileBehaviour/Dispatcher.pm
+SHA1 19b38e4ff033d01503a5e8c27dc00f730effec44 plugins/ProfileBehaviour/share/web/static/css/behaviour-profile.css
+SHA1 dc2e0c7d2234afda7bae3e3b542d1ae9a5c7e1f3 plugins/ProfileBehaviour/share/web/static/js/behaviour.js
 SHA1 2c5d29ea2981cc759cc5f5b27cf7c536d4ea9384 share/dtd/xhtml-lat1.ent
 SHA1 62229286e03ec35c922c8a7f9f3bb68412a78a55 share/dtd/xhtml-special.ent
 SHA1 e7749f99989ec8a9608f6cfbd41a5e5dddc18aec share/dtd/xhtml-symbol.ent
@@ -223,9 +229,9 @@
 SHA1 2f84cd8d3f46ffe9eb1406a4f6337fa5b5e2bcd1 share/web/static/images/silk/pencil_add.png
 SHA1 eb756c931be8ef70fc27ba0046375f32022e3b6d share/web/static/js/app.js
 SHA1 e919b502c93ea84b87749d3ec05d4e7755a9a04d share/web/static/js/app_behaviour.js
-SHA1 86484ce84ddeb7488563eae5c2dc0b94b3c9a5eb share/web/static/js/behaviour.js
+SHA1 2b28f63068ff486e7fd7937f725f47e886d01831 share/web/static/js/behaviour.js
 SHA1 094b2109587bbb33cb401c4dcf6bdea352739c6b share/web/static/js/bps_util.js
-SHA1 f1e525a957d32dfad2da6cac393d0c9b28b19299 share/web/static/js/calendar.js
+SHA1 6da851c376988a215caee34c06798de339cdad98 share/web/static/js/calendar.js
 SHA1 e9f9931abe8ddf86cf5cfddd1f0e963bb5bf0ccb share/web/static/js/combobox.js
 SHA1 cc50df358f5554be8b40ae58780a117b7a3296ab share/web/static/js/context_menu.js
 SHA1 b03b1f06f9c972cfb083c3d87b3dc74e4d85bf77 share/web/static/js/css_browser_selector.js
@@ -236,7 +242,7 @@
 SHA1 e72565db2119b617c9ca0af948956a399caa5720 share/web/static/js/dom-drag.js
 SHA1 4553f3cb184b09228ed4362898e9d30200a2a585 share/web/static/js/formatDate.js
 SHA1 a1d2c6292d656c275383b97aad6ca913b8a1b031 share/web/static/js/halo.js
-SHA1 94fa23b1cfc931576e854394dc4b0d3cec8f48cb share/web/static/js/jifty.js
+SHA1 21469caefbbf5917ca5ec9492bf8cf920f67935a share/web/static/js/jifty.js
 SHA1 29fe34f11192976f1a388562188b1eb9af7f4497 share/web/static/js/jifty_smoothscroll.js
 SHA1 12d8200d7c97c107dd202aa9759e2441d2d079fe share/web/static/js/jifty_utils.js
 SHA1 49478568d1f258c9d061faa30c2181fd999b07f0 share/web/static/js/jsTrace.js
@@ -265,13 +271,13 @@
 SHA1 0a362343ac62b44343ae26168e99612e23286880 share/web/templates/__jifty/admin/action/dhandler
 SHA1 1b55e3945405d09df59f0a40182f06f8f59a2e97 share/web/templates/__jifty/admin/autohandler
 SHA1 3c8ff6047be102649211764dc72266793fedb89f share/web/templates/__jifty/admin/fragments/list/list
-SHA1 e09203ce9b000484c8f7c4e49d16dd0e172243b5 share/web/templates/__jifty/admin/fragments/list/new_item
+SHA1 3fac6b0c3005e74e1a084463d66fd155bb29ce32 share/web/templates/__jifty/admin/fragments/list/new_item
 SHA1 b970c440cc6411c3327fcd6ac5108968f5b8889d share/web/templates/__jifty/admin/fragments/list/update
 SHA1 55799a284dbeb54b8cc12f41da854e460b3a8216 share/web/templates/__jifty/admin/fragments/list/view
-SHA1 d807fdcdff346c540f2a20ac83f407725b754173 share/web/templates/__jifty/admin/index.html
+SHA1 4160c0e1be928687f7698ecc2a4483d8daaa6d09 share/web/templates/__jifty/admin/index.html
 SHA1 c78d4b3267acdf98a39c864fd0a1b4fbdc4d390c share/web/templates/__jifty/admin/model/dhandler
 SHA1 bdaeeff0c2522a8509d4da45be703d1e8cf5c96c share/web/templates/__jifty/autocomplete.xml
-SHA1 66b1ce378bc36715f7e6395a8c4ee57a2fcd359e share/web/templates/__jifty/css/dhandler
+SHA1 bfeb6c28df0bc0c78119c9ff90f8051e5f6adcc2 share/web/templates/__jifty/css/dhandler
 SHA1 da39a3ee5e6b4b0d3255bfef95601890afd80709 share/web/templates/__jifty/empty
 SHA1 f85d8cae8a2df3ee51b868a744a9e9af21925e0c share/web/templates/__jifty/error/_elements/error_text
 SHA1 e2d761b0b92f818eb2bbb91a15cef0a2471d2245 share/web/templates/__jifty/error/_elements/wrapper
@@ -280,7 +286,7 @@
 SHA1 78e1e0af483fa3bdac2de4e5a9d82486d67b8537 share/web/templates/__jifty/error/error.css
 SHA1 63596a50acfd1e56b1e7d3572628222576afe7b7 share/web/templates/__jifty/error/mason_internal_error
 SHA1 b8793db1dd47943dc83173f02f2227f9ca310235 share/web/templates/__jifty/halo
-SHA1 dc95abf6889f2bf8b1e8a9b6ec2708d9bf67bf3f share/web/templates/__jifty/js/dhandler
+SHA1 7fbdc70a9c0481d1e67b6154178173d434206fd9 share/web/templates/__jifty/js/dhandler
 SHA1 6a50927b6d7c7f5f2048a691299585cb2dd05677 share/web/templates/__jifty/online_docs/autohandler
 SHA1 d0116574b44622720db7a9efc7fafdf4002ed012 share/web/templates/__jifty/online_docs/content.html
 SHA1 bd81ff4e458c5e1a76c131dce40ffd71fd6a76f7 share/web/templates/__jifty/online_docs/index.html
@@ -365,7 +371,7 @@
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.3 (Darwin)
 
-iD8DBQFEwr8GEi9d9xCOQEYRAhlBAJ0VBXeKiMVCOFBiV6BLGSmv19yIAQCeJAxq
-HHOmOquVy6ciOfI7CMl6oeU=
-=UVjm
+iD8DBQFEykb4Ei9d9xCOQEYRApk/AJ9s1dcIrJ7DbB3/WcDnbfSIFt28TgCdHQ7S
+I2V82/pdoS5BVOm8JdVN+Js=
+=Ugr+
 -----END PGP SIGNATURE-----

Modified: jifty/branches/moose/doc/talks/oscon.2006.xul
==============================================================================
Binary files. No diff available.

Modified: jifty/branches/moose/lib/Jifty.pm
==============================================================================
--- jifty/branches/moose/lib/Jifty.pm	(original)
+++ jifty/branches/moose/lib/Jifty.pm	Mon Jul 31 03:35:23 2006
@@ -5,7 +5,7 @@
 use encoding 'utf8';
 # Work around the fact that Time::Local caches thing on first require
 BEGIN { local $ENV{'TZ'} = "GMT";  require Time::Local;}
-$Jifty::VERSION = '0.60722';
+$Jifty::VERSION = '0.60728';
 
 =head1 NAME
 
@@ -62,7 +62,7 @@
 use base qw/Jifty::Object/;
 use Jifty::Everything;
 
-use vars qw/$HANDLE $CONFIG $LOGGER $HANDLER $API @PLUGINS/;
+use vars qw/$HANDLE $CONFIG $LOGGER $HANDLER $API $CLASS_LOADER @PLUGINS/;
 
 =head1 METHODS
 
@@ -106,11 +106,10 @@
     );
 
     # Load the configuration. stash it in ->config
-    __PACKAGE__->config( Jifty::Config->new() );
+    Jifty->config( Jifty::Config->new() );
 
     Jifty::I18N->new(); # can't do this before we have the config set up
 
-
     # Now that we've loaded the configuration, we can remove the temporary 
     # Jifty::DBI::Record baseclass for records and insert our "real" baseclass,
     # which is likely Record::Cachable or Record::Memcached
@@ -118,7 +117,7 @@
     Jifty::Util->require( Jifty->config->framework('Database')->{'RecordBaseClass'});
     push @Jifty::Record::ISA, Jifty->config->framework('Database')->{'RecordBaseClass'};
 
-    __PACKAGE__->logger( Jifty::Logger->new( $args{'logger_component'} ) );
+    Jifty->logger( Jifty::Logger->new( $args{'logger_component'} ) );
 
     # Set up plugins
     my @plugins;
@@ -131,14 +130,19 @@
     }
 
     # Get a classloader set up
-    Jifty::ClassLoader->new(base => Jifty->config->framework('ApplicationClass'))->require;
+    my $class_loader = Jifty::ClassLoader->new(
+        base => Jifty->config->framework('ApplicationClass')
+    );
+
+    Jifty->class_loader($class_loader);
+    $class_loader->require;
 
-    __PACKAGE__->plugins(@plugins);
-    __PACKAGE__->handler(Jifty::Handler->new());
-    __PACKAGE__->api(Jifty::API->new());
+    Jifty->plugins(@plugins);
+    Jifty->handler(Jifty::Handler->new());
+    Jifty->api(Jifty::API->new());
 
     # Let's get the database rocking and rolling
-    __PACKAGE__->setup_database_connection(%args);
+    Jifty->setup_database_connection(%args);
 
     # Call the application's start method to let it do anything
     # application specific for startup
@@ -235,6 +239,19 @@
     return @PLUGINS;
 }
 
+=head2 class_loader
+
+An accessor for the L<Jifty::ClassLoader> object that stores the loaded
+classes for the application.
+
+=cut
+
+sub class_loader {
+    my $class = shift;
+    $CLASS_LOADER = shift if (@_);
+    return $CLASS_LOADER;
+}
+
 =head2 setup_database_connection
 
 Set up our database connection. Optionally takes a param hash with a
@@ -259,15 +276,15 @@
     my %args = (no_handle =>0,
                 @_);
     unless ( $args{'no_handle'}
-        or __PACKAGE__->config->framework('SkipDatabase')
-        or not __PACKAGE__->config->framework('Database') )
+        or Jifty->config->framework('SkipDatabase')
+        or not Jifty->config->framework('Database') )
     {
 
         my $handle_class = (Jifty->config->framework('ApplicationClass') . "::Handle");
         Jifty::Util->require( $handle_class );
-        __PACKAGE__->handle( $handle_class->new );
-        __PACKAGE__->handle->connect();
-        __PACKAGE__->handle->check_schema_version();
+        Jifty->handle( $handle_class->new );
+        Jifty->handle->connect();
+        Jifty->handle->check_schema_version();
     }
 }
 

Modified: jifty/branches/moose/lib/Jifty/ClassLoader.pm
==============================================================================
--- jifty/branches/moose/lib/Jifty/ClassLoader.pm	(original)
+++ jifty/branches/moose/lib/Jifty/ClassLoader.pm	Mon Jul 31 03:35:23 2006
@@ -194,8 +194,10 @@
         except  => qr/\.#/,
         inner   => 0
     );
-    $self->{models}{$_} = 1 for grep {/^($base)::Model::(.*)$/ and not /Collection$/} $self->plugins;
-    for my $full (keys %{$self->{models}}) {
+    my %models;
+    $models{$_} = 1 for grep {/^($base)::Model::(.*)$/ and not /Collection$/} $self->plugins;
+    $self->models(sort keys %models);
+    for my $full ($self->models) {
         my($short) = $full =~ /::Model::(.*)/;
         Jifty::Util->require($full . "Collection");
         Jifty::Util->require($base . "::Action::" . $_ . $short)
@@ -203,4 +205,21 @@
     }
 }
 
+=head2 models
+
+Accessor to the list of models this application has loaded.
+
+In scalar context, returns a mutable array reference; in list context,
+return the content of the array.
+
+=cut
+
+sub models {
+    my $self = shift;
+    if (@_) {
+        $self->{models} = ref($_[0]) ? $_[0] : \@_;
+    }
+    wantarray ? @{ $self->{models} ||= [] } : $self->{models};
+}
+
 1;

Modified: jifty/branches/moose/lib/Jifty/Dispatcher.pm
==============================================================================
--- jifty/branches/moose/lib/Jifty/Dispatcher.pm	(original)
+++ jifty/branches/moose/lib/Jifty/Dispatcher.pm	Mon Jul 31 03:35:23 2006
@@ -237,6 +237,8 @@
 
 Abort the request; this skips straight to the cleanup stage.
 
+If C<$code> is specified, it's used as the HTTP status code.
+
 =head2 redirect $uri
 
 Redirect to another URI.
@@ -714,6 +716,16 @@
 sub _do_abort {
     my $self = shift;
     $self->log->debug("Aborting processing");
+    if (@_) {
+        # This is the status code
+        my $status = shift;
+        my $apache = Jifty->handler->apache;
+        $apache->header_out(Status => $status);
+        $apache->send_http_header;
+
+        require HTTP::Status;
+        print STDOUT $status, ' ' , HTTP::Status::status_message($status);
+    }
     $self->_abort;
 }
 
@@ -902,8 +914,8 @@
 
 sub _match_method {
     my ( $self, $method ) = @_;
-    $self->log->debug("Matching URL ".$self->{cgi}->method." against ".$method);
-    lc( $self->{cgi}->method ) eq lc($method);
+    $self->log->debug("Matching URL $ENV{REQUEST_METHOD} against ".$method);
+    lc( $ENV{REQUEST_METHOD} ) eq lc($method);
 }
 
 sub _match_plugin {

Modified: jifty/branches/moose/lib/Jifty/Notification.pm
==============================================================================
--- jifty/branches/moose/lib/Jifty/Notification.pm	(original)
+++ jifty/branches/moose/lib/Jifty/Notification.pm	Mon Jul 31 03:35:23 2006
@@ -209,7 +209,6 @@
 
 sub send {
     my $self = shift;
-
     my $currentuser_object_class = Jifty->config->framework('ApplicationClass')."::CurrentUser";
     for my $to ( grep {defined} ($self->to, $self->to_list) ) {
         if ($to->can('id')) {

Modified: jifty/branches/moose/lib/Jifty/Test/WWW/Mechanize.pm
==============================================================================
--- jifty/branches/moose/lib/Jifty/Test/WWW/Mechanize.pm	(original)
+++ jifty/branches/moose/lib/Jifty/Test/WWW/Mechanize.pm	Mon Jul 31 03:35:23 2006
@@ -46,6 +46,17 @@
 If there is only one action of type ACTION, be sure not to pass
 any more arguments to this method, or the method will return undef.
 
+NOTE that if you're using this in a series of different pages or forms, 
+you'll need to run it again for each new form:
+
+    $mech->fill_in_action_ok($mech->moniker_for('MyApp::Action::UpdateInfo'), 
+                             owner_id => 'someone');
+    $mech->submit_html_ok(value => 'Save');  
+
+    is($mech->action_field_value($mech->moniker_for("MyApp::Action::UpdateInfo"),
+			     'owner_id'), 
+       'someone',
+       "Owner was reassigned properly to owner 'someone'");
 
 =cut
 
@@ -419,4 +430,5 @@
     return $object;
 }
 
+
 1;

Modified: jifty/branches/moose/lib/Jifty/View/Mason/Handler.pm
==============================================================================
--- jifty/branches/moose/lib/Jifty/View/Mason/Handler.pm	(original)
+++ jifty/branches/moose/lib/Jifty/View/Mason/Handler.pm	Mon Jul 31 03:35:23 2006
@@ -112,6 +112,7 @@
     my $ref = shift;
     my $val = $$ref;
     use bytes;
+    no warnings 'uninitialized';
     $val =~ s/&/&#38;/g;
     $val =~ s/</&lt;/g;
     $val =~ s/>/&gt;/g;

Modified: jifty/branches/moose/lib/Jifty/View/Static/Handler.pm
==============================================================================
--- jifty/branches/moose/lib/Jifty/View/Static/Handler.pm	(original)
+++ jifty/branches/moose/lib/Jifty/View/Static/Handler.pm	Mon Jul 31 03:35:23 2006
@@ -100,16 +100,19 @@
 
 =head2 file_path $path
 
-Returns the system path for C<$path>, inside the application's static root or, failing that, Jifty's static root.
-Returns undef if it can't find the file in either path.
+Returns the system path for C<$path>, searching inside the
+application's static root, loaded plugins' static roots, and finally
+Jifty's static root.  Returns undef if it can't find the file in any
+path.
 
 =cut
 
 sub file_path {
     my $self    = shift;
     my $file    = shift;
-    my @options = map {Jifty->config->framework('Web')->{$_}} (qw(StaticRoot DefaultStaticRoot));
+    my @options = (Jifty->config->framework('Web')->{StaticRoot});
     push @options, grep {$_} map {$_->static_root} Jifty->plugins;
+    push @options, (Jifty->config->framework('Web')->{DefaultStaticRoot});
 
     # Chomp a leading "/static" - should this be configurable?
     $file =~ s/^\/*?static//; 

Modified: jifty/branches/moose/lib/Jifty/Web.pm
==============================================================================
--- jifty/branches/moose/lib/Jifty/Web.pm	(original)
+++ jifty/branches/moose/lib/Jifty/Web.pm	Mon Jul 31 03:35:23 2006
@@ -391,7 +391,7 @@
 
 Creates a new action (an instance of a subclass of L<Jifty::Action>)
 
-C<CLASS> is L<qualified|Jifty::Util/qualify>, and an instance of that
+C<CLASS> is L<qualified|Jifty::API/qualify>, and an instance of that
 class is created, passing the C<Jifty::Web> object, the C<MONIKER>,
 and any other arguments that C<new_action> was supplied.
 
@@ -886,6 +886,7 @@
 =cut
 
 sub escape {
+    no warnings 'uninitialized';
     my $self = shift;
     return join '', map {my $html = $_; Jifty::View::Mason::Handler::escape_utf8( \$html ); $html} @_;
 }
@@ -897,6 +898,7 @@
 =cut
 
 sub escape_uri {
+    no warnings 'uninitialized';
     my $self = shift;
     return join '', map {my $uri = $_; Jifty::View::Mason::Handler::escape_uri( \$uri ); $uri} @_;
 }

Modified: jifty/branches/moose/lib/Jifty/Web/Session.pm
==============================================================================
--- jifty/branches/moose/lib/Jifty/Web/Session.pm	(original)
+++ jifty/branches/moose/lib/Jifty/Web/Session.pm	Mon Jul 31 03:35:23 2006
@@ -20,7 +20,15 @@
 
 sub new {
     my $class = shift;
-    return bless {}, $class;
+
+    my $session_class = Jifty->config->framework('Web')->{'SessionClass'};
+    if ($session_class and $class ne $session_class) {
+        Jifty::Util->require( $session_class );
+        return $session_class->new(@_);
+    }
+    else {
+        return bless {}, $class;
+    }
 }
 
 =head2 id
@@ -48,9 +56,9 @@
 
     unless ($session_id) {
         my %cookies    = CGI::Cookie->fetch();
-        my $cookiename = $self->cookie_name;
+        my $cookie_name = $self->cookie_name;
         $session_id
-            = $cookies{$cookiename} ? $cookies{$cookiename}->value() : undef;
+            = $cookies{$cookie_name} ? $cookies{$cookie_name}->value() : undef;
     }
 
     my $session = Jifty::Model::Session->new;
@@ -285,14 +293,14 @@
 =head2 cookie_name
 
 Returns the current session's cookie_name -- it is the same for all
-users, but various accorting to the port the server is running on.
+users, but varies according to the port the server is running on.
 
 =cut
 
 sub cookie_name {
     my $self = shift;
-    my $cookiename = "JIFTY_SID_" . ( $ENV{'SERVER_PORT'} || 'NOPORT' );
-    return ($cookiename);
+    my $cookie_name = "JIFTY_SID_" . ( $ENV{'SERVER_PORT'} || 'NOPORT' );
+    return ($cookie_name);
 }
 
 =head2 expires [VALUE]

Added: jifty/branches/moose/lib/Jifty/Web/Session/ClientSide.pm
==============================================================================
--- (empty file)
+++ jifty/branches/moose/lib/Jifty/Web/Session/ClientSide.pm	Mon Jul 31 03:35:23 2006
@@ -0,0 +1,225 @@
+package Jifty::Web::Session::ClientSide;
+
+=head1 NAME
+
+Jifty::Web::Session - Session handler for client-side sessions
+
+=head1 SYNOPSIS
+
+In your F<etc/config.yml>:
+
+  framework:
+    Web:
+      SessionClass: Jifty::Web::Session::ClientSide
+      SessionSecret: secret_passphrase
+
+=cut
+
+use strict;
+use warnings;
+use base 'Jifty::Web::Session';
+use Jifty::Model::Session();
+use Jifty::YAML ();
+use Compress::Zlib ();
+use Crypt::CBC ();
+use Crypt::Rijndael ();
+use CGI::Cookie::Splitter ();
+
+my $session_key;
+my $splitter = CGI::Cookie::Splitter->new;
+
+=head2 new
+
+Returns a new, empty session handler, subclassing L<Jifty::Web::Session>.
+
+=cut
+
+sub new {
+    my $class = shift;
+    my $session_key = Jifty->config->framework('Web')->{'SessionSecret'}
+        or die "Please set SessionSecret in your framework/Web settings";
+    my $cipher = Crypt::CBC->new(
+        -key    => $session_key,
+        -cipher => 'Rijndael',
+    );
+    bless { _cipher => $cipher, _session => undef }, $class;
+}
+
+=head2 _cipher
+
+Accessor to the underlying L<Crypt::CBC> object that encapsulates the
+server-side secret.
+
+=cut
+
+sub _cipher {
+    my $self = shift;
+    $self->{'_cipher'} = shift if (@_);
+    return ( $self->{'_cipher'} );
+}
+
+=head2 id
+
+Returns the session's id if it has been loaded, or C<undef> otherwise.
+
+=cut
+
+sub id {
+    my $self = shift;
+    return $self->loaded ? $self->_session->{session_id} : undef;
+}
+
+=head2 load [ID]
+
+Load up the current session from the given C<ID>, or the appropriate
+cookie (see L<Jifty::Web::Session/cookie_name>) otherwise.
+
+If both of those fail, creates a session in memory.
+
+=cut
+
+sub load {
+    my $self       = shift;
+    my $session_id = shift;
+    my %cookies    = CGI::Cookie->fetch();
+
+    unless ($session_id) {
+        my $cookie_name = $self->cookie_name;
+        $session_id = $cookies{$cookie_name}
+            ? $cookies{$cookie_name}->value()
+            : Jifty::Model::Session->new_session_id,
+    }
+
+    my ($data) = grep {
+        $_->name eq "JIFTY_DAT_$session_id"
+    } $splitter->join(values %cookies);
+    if ($data) {
+        local $@;
+        eval {
+            $self->_session(
+                Jifty::YAML::Load(
+                    Compress::Zlib::uncompress(
+                        $self->_cipher->decrypt(
+                            $data->value
+                        )
+                    )
+                )
+            );
+            die "Session id mismatch"
+                unless $self->_session->{session_id} eq $session_id;
+            1;
+        } and return;
+        warn $@ if $@;
+    }
+
+    $self->_session({
+        session_id   => $session_id,
+        continuation => {},
+        metadata     => {},
+        key          => {},
+    });
+}
+
+=head2 get KEY [TYPE]
+
+See L<Jifty::Web::Session/get>.
+
+=cut
+
+sub get {
+    my $self     = shift;
+    my $key      = shift;
+    my $key_type = shift || "key";
+
+    return undef unless $self->loaded;
+    return $self->_session->{$key_type}{$key};
+}
+
+=head2 set KEY => VALUE, [TYPE]
+
+See L<Jifty::Web::Session/set>.
+
+=cut
+
+sub set {
+    my $self     = shift;
+    my $key      = shift;
+    my $value    = shift;
+    my $key_type = shift || "key";
+
+    return undef unless $self->loaded;
+    $self->_session->{$key_type}{$key} = $value;
+
+    # XXX - delay until the very last moment?
+    $self->flush;
+}
+
+=head2 remove KEY, [TYPE]
+
+See L<Jifty::Web::Session/remove>.
+
+=cut
+
+sub remove {
+    my $self     = shift;
+    my $key      = shift;
+    my $key_type = shift || "key";
+
+    return undef unless $self->loaded;
+    delete $self->_session->{$key_type}{$key};
+}
+
+=head2 continuations
+
+See L<Jifty::Web::Session/continuations>.
+
+=cut
+
+sub continuations {
+    my $self     = shift;
+    return () unless $self->loaded;
+    return %{ $self->_session->{continuation} };
+}
+
+=head2 unload
+
+See L<Jifty::Web::Session/unload>.
+
+=cut
+
+sub unload {
+    my $self = shift;
+    $self->flush;
+    $self->_session(undef);
+}
+
+=head2 flush
+
+Outputs the client-side session as one or more cookies.
+
+=cut
+
+sub flush {
+    my $self = shift;
+    my $session_id = $self->id or return;
+
+    my $data_cookie = CGI::Cookie->new(
+        -name    => "JIFTY_DAT_$session_id",
+        -expires => $self->expires,
+        -value   => $self->_cipher->encrypt(
+            Compress::Zlib::compress(
+                Jifty::YAML::Dump(
+                    $self->_session
+                )
+            )
+        )
+    );
+
+    foreach my $cookie ($splitter->split( $data_cookie )) {
+        Jifty->web->response->add_header(
+            'Set-Cookie' => $cookie->as_string
+        );
+    }
+}
+
+1;

Modified: jifty/branches/moose/plugins/Login/lib/Jifty/Plugin/Login/Notification/ConfirmAddress.pm
==============================================================================
--- jifty/branches/moose/plugins/Login/lib/Jifty/Plugin/Login/Notification/ConfirmAddress.pm	(original)
+++ jifty/branches/moose/plugins/Login/lib/Jifty/Plugin/Login/Notification/ConfirmAddress.pm	Mon Jul 31 03:35:23 2006
@@ -6,7 +6,7 @@
 
 =head1 NAME
 
-Hiveminder::Notification::ConfirmAddress
+Jifty::Plugin::Login::Notification::ConfirmAddress
 
 =head1 ARGUMENTS
 

Added: jifty/branches/moose/plugins/ProfileBehaviour/Makefile.PL
==============================================================================
--- (empty file)
+++ jifty/branches/moose/plugins/ProfileBehaviour/Makefile.PL	Mon Jul 31 03:35:23 2006
@@ -0,0 +1,8 @@
+use inc::Module::Install;
+name('Jifty-Plugin-ProfileBehaviour');
+version('0.01');
+requires('Jifty' => '0.60722');
+
+install_share;
+
+WriteAll;

Added: jifty/branches/moose/plugins/ProfileBehaviour/lib/Jifty/Plugin/ProfileBehaviour.pm
==============================================================================
--- (empty file)
+++ jifty/branches/moose/plugins/ProfileBehaviour/lib/Jifty/Plugin/ProfileBehaviour.pm	Mon Jul 31 03:35:23 2006
@@ -0,0 +1,10 @@
+use strict;
+use warnings;
+
+package Jifty::Plugin::ProfileBehaviour;
+use base qw/Jifty::Plugin/;
+
+# Your plugin goes here.  If takes any configuration or arguments, you
+# probably want to override L<Jifty::Plugin/init>.
+
+1;

Added: jifty/branches/moose/plugins/ProfileBehaviour/lib/Jifty/Plugin/ProfileBehaviour/Dispatcher.pm
==============================================================================
--- (empty file)
+++ jifty/branches/moose/plugins/ProfileBehaviour/lib/Jifty/Plugin/ProfileBehaviour/Dispatcher.pm	Mon Jul 31 03:35:23 2006
@@ -0,0 +1,9 @@
+use strict;
+use warnings;
+
+package Jifty::Plugin::ProfileBehaviour::Dispatcher;
+use Jifty::Dispatcher -base;
+
+# Put any plugin-specific dispatcher rules here.
+
+1;

Added: jifty/branches/moose/plugins/ProfileBehaviour/share/web/static/css/behaviour-profile.css
==============================================================================
--- (empty file)
+++ jifty/branches/moose/plugins/ProfileBehaviour/share/web/static/css/behaviour-profile.css	Mon Jul 31 03:35:23 2006
@@ -0,0 +1,67 @@
+#behaviour-profile-data {
+    width: 90%;
+    height: 90%;
+    position: absolute;
+    left: 5%;
+    top: 5%;
+    background-color: white;
+    border: 2px solid black;
+    overflow: scroll;
+}
+
+#behaviour-profile-data div.title {
+    font-size: 200%;
+    border-bottom: 2px solid black;
+}
+
+#behaviour-profile-data .section .title {
+   font-size: 150%;
+}
+
+#behaviour-profile-data .title .close {
+   font-size: 80%;
+   text-align: right;
+   text-decoration:none;
+   position: absolute:
+   right: 10px;
+   top: 10px;
+}
+
+#behaviour-profile-data .code code {
+    position: absolute;
+    background-color: lightgrey;
+    border: 1px solid black;
+    z-index: 100;
+    white-space: pre;
+    text-align: left;
+}
+
+#behaviour-profile-data table td.time {
+    text-align:center;
+}
+
+#behaviour-profile-data table td.selector {
+    text-align:right;
+}
+
+#behaviour-profile-data table tr,
+#behaviour-profile-data table td,
+#behaviour-profile-data table th {
+    text-align:center;
+    padding: 0px 5px;
+}
+
+#behaviour-profile-data table .time {
+    border-left: 1px solid black;
+}
+
+#behaviour-profile-data table .total {
+    border-right: 1px solid black;
+}
+
+
+#show-behaviour-profile {
+    position: absolute;
+    left: 0;
+    bottom: 0;
+}

Added: jifty/branches/moose/plugins/ProfileBehaviour/share/web/static/js/behaviour.js
==============================================================================
--- (empty file)
+++ jifty/branches/moose/plugins/ProfileBehaviour/share/web/static/js/behaviour.js	Mon Jul 31 03:35:23 2006
@@ -0,0 +1,225 @@
+/*
+   Modified to fix some bugs, use a different css query engine, and to
+   to use JSAN classes.
+   
+   Based on Behaviour v1.1 by Ben Nolan, June 2005, which was based
+   largely on the work of Simon Willison.
+ 
+   Usage:   
+   
+    var myrules = {
+        'b.someclass' : function(element){
+            element.onclick = function(){
+                alert(this.innerHTML);
+            }
+        },
+        '#someid u' : function(element){
+            element.onmouseover = function(){
+                this.innerHTML = "BLAH!";
+            }
+        }
+    };
+    
+    Behaviour.register(myrules);
+    
+    // Call Behaviour.apply() to re-apply the rules (if you
+    // update the dom, etc).
+
+
+    This Behaviour has been modified to keep track of timing
+    information and render it to an on-screen display for profiling
+    purposes
+*/   
+
+JSAN.use("DOM.Events");
+JSAN.use("Upgrade.Array.push");
+
+var Behaviour = {
+    profileData: {
+	calls: [],
+	applyTime: 0,
+	searchTime: 0,
+	numCalls: 0
+    },
+    list: new Array(),
+    
+    register: function(sheet) {
+        Behaviour.list.push(sheet);
+    },
+    
+    apply: function() {
+	var root = arguments[0];
+	if(root) root = $(root);
+	var _applyStart = new Date();
+	var profile = {
+	    searchTimes: {},
+	    applyTimes: {},
+	    funcs: {},
+	    searchTime: 0,
+	    applyTime: 0,
+	    caller: Behaviour.apply.caller
+	};
+
+        for (var h = 0; sheet = Behaviour.list[h]; h++) {
+            for (var selector in sheet) {
+		var start = new Date();
+                var elements = cssQuery(selector, root);
+		var searchDone = new Date();
+		profile.searchTimes[selector] = searchDone - start;
+		profile.searchTime += profile.searchTimes[selector];
+                
+                if ( !elements ) continue;
+
+                for (var i = 0; element = elements[i]; i++) {
+                    sheet[selector](element);
+		}
+		profile.applyTimes[selector] = new Date() - searchDone;
+		profile.applyTime += profile.applyTimes[selector];
+		profile.funcs[selector] = sheet[selector];
+            }
+        }
+
+	Behaviour.profileData.calls.push(profile);
+	Behaviour.profileData.numCalls++;
+	Behaviour.profileData.searchTime += profile.searchTime;
+	Behaviour.profileData.applyTime += profile.applyTime;
+    },
+
+    showProfile: function() {
+	var pane = this.createElement('div');
+	pane.id = 'behaviour-profile-data';
+
+	var title = this.createElement('div');
+	title.appendChild(document.createTextNode('Behaviour profiling information'));
+	title.className = 'title';
+	var close = this.createElement('a', 'close', '[close]');
+	close.href = '#';
+	close.onclick = function() { Element.remove($('behaviour-profile-data')); }
+
+	pane.appendChild(close);
+	pane.appendChild(title);
+	
+	pane.appendChild(Behaviour._callData());
+
+	document.getElementsByTagName('body')[0].appendChild(pane);
+
+    },
+
+    _callData: function() {
+	list = this.createElement('ul', 'section');
+
+	for( var i = 0; i <  Behaviour.profileData.calls.length; i++ ) {
+	    var call = Behaviour.profileData.calls[i];
+	    var item = this.createElement('li', 'call');
+	    var text = call.caller.length == 0 ? ' (Page load)' : ' (AJAX)';
+	    var title = this.createElement('div', 'title', 'Call ' + i + text);
+	    item.appendChild(title);
+	    
+	    var table = this.createElement('table');
+	    var head = this.createElement('tr');
+	    head.appendChild(this.createElement('th', 'selector', 'Selector'));
+	    head.appendChild(this.createElement('th', 'time search', 'cssQuery time'));
+	    head.appendChild(this.createElement('th', 'time apply', 'Function time'));
+	    head.appendChild(this.createElement('th', 'time total', 'Total time'));
+	    head.appendChild(this.createElement('th'));
+	    table.appendChild(head);
+
+	    var searchTimes = $H(call.searchTimes).keys().sort(function(a,b) {
+		    var timeA = call.searchTimes[a] + call.applyTimes[a];
+		    var timeB = call.searchTimes[b] + call.applyTimes[b];
+		
+		    if(timeA < timeB) {
+			return 1;
+		    } else if(timeA > timeB) {
+			return -1;
+		    } else {
+			return 0;
+		    }
+		});
+	    
+	    for(var j = 0; j < searchTimes.length; j++) {
+		var k = searchTimes[j];
+		var tr = this.createElement('tr');
+		tr.appendChild(this.createElement('td', 'selector', k));
+		tr.appendChild(this.createElement('td', 'time search', call.searchTimes[k]));
+		tr.appendChild(this.createElement('td', 'time apply', call.applyTimes[k]));
+		tr.appendChild(this.createElement('td', 'time total', call.searchTimes[k] + call.applyTimes[k]));
+
+		var code  = this.createElement('td', 'code');
+		var a = this.createElement('a', null, '[code]');
+		a.href = '#';
+		var src = this.createElement('code', null, call.funcs[k]);
+		var id =  'code-' + i + '-' + j;
+		src.id = id;
+		src.style.display = 'none';
+		// Kludge to make the onclick function close over id properly
+		(function (id) {
+		    a.onclick = function() { Element.toggle($(id)); return false; }
+		})(id);
+
+		var div = this.createElement('div');
+		div.appendChild(src);
+		code.appendChild(div);
+		code.appendChild(a);
+		tr.appendChild(code);
+		table.appendChild(tr);
+	    }
+
+	    item.appendChild(table);
+
+	    item.appendChild(this.createElement('div','totals',
+						'Total: '
+						+ call.searchTime + ' search, '
+						+ call.applyTime + ' apply, '
+						+ (call.searchTime + call.applyTime) + ' total'));
+					   
+	    
+	    list.appendChild(item);
+	}
+	
+	return list;
+    },
+
+
+    // Convenience method for the above
+    createElement: function (elt, className, text) {
+	elt = elt ? elt : 'div';
+	var d = document.createElement(elt);
+	if(className) d.className = className;
+	if(text) d.appendChild(document.createTextNode(text));
+	return d;
+    },
+
+    onLoad: function () {
+	// Make sure we only run once
+	if(Behaviour.loaded) return;
+	Behaviour.loaded = true;
+	Behaviour.apply();
+
+	// Add the profiling CSS to the document
+	var head = document.getElementsByTagName('head')[0];
+	var link = document.createElement('link');
+	link.rel = 'stylesheet';
+	link.type = 'text/css';
+	link.href = '/css/behaviour-profile.css';
+	head.appendChild(link);
+
+	var open = this.createElement('a', null, '[Behaviour profile]');
+	open.id = 'show-behaviour-profile';
+	open.href ='#';
+	open.onclick = function() { Behaviour.toggleProfile() }
+	document.getElementsByTagName('body')[0].appendChild(open);
+    },
+
+    toggleProfile: function () {
+	var e = $('behaviour-profile-data');
+	if(e) {
+	    Element.remove(e);
+	} else {
+	    this.showProfile();
+	}
+    }
+}
+
+
+DOM.Events.addListener( window, "load", function() { Behaviour.onLoad() } );

Added: jifty/branches/moose/plugins/REST/Makefile.PL
==============================================================================
--- (empty file)
+++ jifty/branches/moose/plugins/REST/Makefile.PL	Mon Jul 31 03:35:23 2006
@@ -0,0 +1,8 @@
+use inc::Module::Install;
+name('Jifty-Plugin-REST');
+version('0.01');
+requires('Jifty' => '0.60507');
+
+#install_share;
+
+WriteAll;

Added: jifty/branches/moose/plugins/REST/lib/Jifty/Plugin/REST.pm
==============================================================================
--- (empty file)
+++ jifty/branches/moose/plugins/REST/lib/Jifty/Plugin/REST.pm	Mon Jul 31 03:35:23 2006
@@ -0,0 +1,7 @@
+use strict;
+use warnings;
+
+package Jifty::Plugin::REST;
+use base qw/Jifty::Plugin/;
+
+1;

Added: jifty/branches/moose/plugins/REST/lib/Jifty/Plugin/REST/Dispatcher.pm
==============================================================================
--- (empty file)
+++ jifty/branches/moose/plugins/REST/lib/Jifty/Plugin/REST/Dispatcher.pm	Mon Jul 31 03:35:23 2006
@@ -0,0 +1,194 @@
+use strict;
+use warnings;
+
+package Jifty::Plugin::REST::Dispatcher;
+use CGI qw( start_html end_html ul li a dl dt dd );
+use Jifty::Dispatcher -base;
+use Jifty::YAML ();
+use Jifty::JSON ();
+use Data::Dumper ();
+
+#before '/=/**' => run {
+#    authenticate_user();
+#    tangent('/login') unless Jifty->web->current_user->id;
+#};
+
+before qr{^ (/=/ .*) \. (js|json|yml|yaml|perl|pl) $}x => run {
+    $ENV{HTTP_ACCEPT} = $2;
+    dispatch $1;
+};
+
+before POST qr{^ (/=/ .*) ! (DELETE|PUT|GET|POST|OPTIONS|HEAD|TRACE|CONNECT) $}x => run {
+    $ENV{REQUEST_METHOD} = $2;
+    dispatch $1;
+};
+
+on GET    '/=/model/*/*/*/*' => \&show_item_field;
+on GET    '/=/model/*/*/*'   => \&show_item;
+on GET    '/=/model/*/*'     => \&list_model_items;
+on GET    '/=/model/*'       => \&list_model_columns;
+on GET    '/=/model'         => \&list_models;
+
+on PUT    '/=/model/*/*/*' => \&replace_item;
+on DELETE '/=/model/*/*/*' => \&delete_item;
+
+on GET    '/=/action/*'    => \&list_action_params;
+on GET    '/=/action'      => \&list_actions;
+on POST   '/=/action/*'    => \&run_action;
+
+sub list {
+    my $prefix = shift;
+    outs($prefix, \@_)
+}
+
+sub outs {
+    no warnings 'utf8';
+
+    my $prefix = shift;
+    my $accept = ($ENV{HTTP_ACCEPT} || '');
+    my $apache = Jifty->handler->apache;
+    my $url    = Jifty->web->url(path => join '/', '=', map { 
+        Jifty::Web->escape_uri($_)
+    } @$prefix);
+
+    if ($accept =~ /ya?ml/i) {
+        $apache->header_out('Content-Type' => 'text/x-yaml; charset=UTF-8');
+        $apache->send_http_header;
+        print Jifty::YAML::Dump(@_);
+    }
+    elsif ($accept =~ /json/i) {
+        $apache->header_out('Content-Type' => 'application/json; charset=UTF-8');
+        $apache->send_http_header;
+        print Jifty::JSON::objToJson( @_, { singlequote => 1 } );
+    }
+    elsif ($accept =~ /j(?:ava)?s|ecmascript/i) {
+        $apache->header_out('Content-Type' => 'application/javascript; charset=UTF-8');
+        $apache->send_http_header;
+        print 'var $_ = ', Jifty::JSON::objToJson( @_, { singlequote => 1 } );
+    }
+    elsif ($accept =~ /perl/i) {
+        $apache->header_out('Content-Type' => 'application/x-perl; charset=UTF-8');
+        $apache->send_http_header;
+        print Data::Dumper::Dumper(@_);
+    }
+    elsif (ref($_[0]) eq 'ARRAY') {
+        print start_html(-encoding => 'UTF-8', -declare_xml => 1, -title => 'models'),
+              ul(map {
+                li(a({-href => "$url/".Jifty::Web->escape_uri($_)}, Jifty::Web->escape($_)))
+              } @{$_[0]}),
+              end_html();
+    }
+    elsif (ref($_[0]) eq 'HASH') {
+        print start_html(-encoding => 'UTF-8', -declare_xml => 1, -title => 'models'),
+              dl(map {
+                  dt(a({-href => "$url/".Jifty::Web->escape_uri($_)}, Jifty::Web->escape($_))),
+                  dd(html_dump($_[0]->{$_})),
+              } sort keys %{$_[0]}),
+              end_html();
+    }
+    else {
+        print start_html(-encoding => 'UTF-8', -declare_xml => 1, -title => 'models'),
+              Jifty::Web->escape($_[0]),
+              end_html();
+    }
+
+    last_rule;
+}
+
+sub html_dump {
+    if (ref($_[0]) eq 'ARRAY') {
+        ul(map {
+            li(html_dump($_))
+        } @{$_[0]});
+    }
+    elsif (ref($_[0]) eq 'HASH') {
+        dl(map {
+            dt(Jifty::Web->escape($_)),
+            dd(html_dump($_[0]->{$_})),
+        } sort keys %{$_[0]}),
+    }
+    else {
+        Jifty::Web->escape($_[0]);
+    }
+}
+
+sub model {
+    my $model = shift;
+    return $model if $model->isa('Jifty::Record');
+
+    $model =~ s/\W+/\\W+/g;
+
+    foreach my $cls (Jifty->class_loader->models) {
+        return $cls if $cls =~ /$model$/i;
+    }
+
+    abort(404);
+}
+
+sub list_models {
+    list(['model'], Jifty->class_loader->models);
+}
+
+sub list_model_columns {
+    my ($model) = model($1);
+    outs(['model', $model], { map { $_->name => { %$_ } } $model->new->columns });
+}
+
+sub list_model_items {
+    # Normalize model name - fun!
+    my ($model, $column) = (model($1), $2);
+    my $col = $model->new->collection_class->new;
+    $col->unlimit;
+    $col->columns($column);
+    $col->order_by(column => $column);
+
+    list(
+        ['model', $model, $column],
+        map { $_->__value($column) } @{ $col->items_array_ref || [] }
+    );
+}
+
+sub show_item_field {
+    my ($model, $column, $key, $field) = (model($1), $2, $3, $4);
+    my $rec = $model->new;
+    $rec->load_by_cols( $column => $key );
+    $rec->id or abort(404);
+    exists $rec->{values}{$field} or abort(404);
+    outs(
+        ['model', $model, $column, $key, $field],
+        $rec->{values}{$field}
+    );
+}
+
+sub show_item {
+    my ($model, $column, $key) = (model($1), $2, $3);
+    my $rec = $model->new;
+    $rec->load_by_cols( $column => $key );
+    $rec->id or abort(404);
+    outs(
+        ['model', $model, $column, $key],
+        $rec->{values}
+    );
+}
+
+sub replace_item {
+    die "hey replace item";
+}
+
+sub delete_item {
+    die "hey delete item";
+}
+
+sub list_actions {
+    die "hey list actions";
+}
+
+sub list_action_params {
+    die "hey action params";
+}
+
+sub run_action {
+    die "run action";
+}
+
+1;

Modified: jifty/branches/moose/share/web/static/css/notices.css
==============================================================================
--- jifty/branches/moose/share/web/static/css/notices.css	(original)
+++ jifty/branches/moose/share/web/static/css/notices.css	Mon Jul 31 03:35:23 2006
@@ -28,10 +28,10 @@
 #dismiss_errors
 {
     padding-left: 16px;
-    background: url(/static/images/silk/cancel.png) no-repeat;
+    background: url(/static/images/silk/cancel_grey.png) no-repeat;
     position: absolute;
-    top: 1px;
-    right: 1px;
+    top: 0.4em;
+    right: 2px;
     width: 0;
     display: block;
     text-indent: -9999em;

Added: jifty/branches/moose/share/web/static/images/silk/cancel_grey.png
==============================================================================
Binary file. No diff available.

Modified: jifty/branches/moose/share/web/static/js/behaviour.js
==============================================================================
--- jifty/branches/moose/share/web/static/js/behaviour.js	(original)
+++ jifty/branches/moose/share/web/static/js/behaviour.js	Mon Jul 31 03:35:23 2006
@@ -31,10 +31,7 @@
 JSAN.use("Upgrade.Array.push");
 
 var Behaviour = {
-    searchTimes: {},
-    applyTimes: {},
-    elements: {},
-    list: new Array(),
+    list: [],
     
     register: function(sheet) {
         Behaviour.list.push(sheet);
@@ -43,40 +40,19 @@
     apply: function() {
 	var root = arguments[0];
 	if(root) root = $(root);
-	var _applyStart = new Date();
 
         for (var h = 0; sheet = Behaviour.list[h]; h++) {
             for (var selector in sheet) {
 		var start = new Date();
                 var elements = cssQuery(selector, root);
-		var searchDone = new Date();
-		Behaviour.searchTimes[selector] = searchDone - start;
-		Behaviour.elements[selector] = elements;
-                
+
                 if ( !elements ) continue;
 
                 for (var i = 0; element = elements[i]; i++) {
                     sheet[selector](element);
 		}
-		Behaviour.applyTimes[selector] = new Date() - searchDone;
             }
         }
-	if(0) {
-	    document.write('<h2>Search times:</h2>');
-	    document.write('<pre>');
-	    for(var k in Behaviour.searchTimes) {
-		document.write(Behaviour.searchTimes[k] + '\t' + k + '<br />');
-	    }
-	    document.write('</pre>');
-	    
-	    document.write('<h2>Apply times:</h2>');
-	    document.write('<pre>');
-	    for(var k in Behaviour.applyTimes) {
-		document.write(Behaviour.applyTimes[k] + '\t' + k + '<br />');
-	    }
-	    document.write('</pre>');
-	}
-	//alert("Applied behaviours in " + (new Date() - _applyStart) + "ms");
     }
 }    
 

Modified: jifty/branches/moose/share/web/static/js/calendar.js
==============================================================================
--- jifty/branches/moose/share/web/static/js/calendar.js	(original)
+++ jifty/branches/moose/share/web/static/js/calendar.js	Mon Jul 31 03:35:23 2006
@@ -66,6 +66,13 @@
             input.value = cal.getSelectedDates()[0].formatDate("Y-m-d");
             Jifty.Calendar.hideOpenCalendar();
         };
+
+        cal["_onChangePage"] = cal["onChangePage"];
+        cal["onChangePage"]  = function() {
+            Jifty.Calendar._blurredCalendar = null;
+            cal["_onChangePage"]();
+        };
+        
         cal.render();
         
         Jifty.Calendar.openCalendar = wrapId;
@@ -95,7 +102,7 @@
     },
 
     _doneBlurOnce: false,
-    _blurredCalendar: '',
+    _blurredCalendar: null,
     doBlur: function(ev) {
         if ( Jifty.Calendar.openCalendar && !Jifty.Calendar._doneBlurOnce ) {
             Jifty.Calendar._doneBlurOnce    = true;
@@ -109,7 +116,7 @@
             Jifty.Calendar.hideOpenCalendar();
         }
         Jifty.Calendar._doneBlurOnce    = false;
-        Jifty.Calendar._blurredCalendar = '';
+        Jifty.Calendar._blurredCalendar = null;
     }
 };
 

Modified: jifty/branches/moose/share/web/templates/__jifty/admin/_elements/nav
==============================================================================
--- jifty/branches/moose/share/web/templates/__jifty/admin/_elements/nav	(original)
+++ jifty/branches/moose/share/web/templates/__jifty/admin/_elements/nav	Mon Jul 31 03:35:23 2006
@@ -1,35 +1,8 @@
 <%init>
 
-# Set up application-specific parts
-my $ApplicationClass = Jifty->config->framework('ApplicationClass');
-
-my @models;   
-
-# This creates a sub "jifty_app_models" which when called, finds packages under
-# $ApplicationClass::Model, requires them, and returns a list of their
-# names.
-Module::Pluggable->import(
-    require     => 1,
-    except      => qr/\.#/,
-    search_path => [  $ApplicationClass . "::Model" ],
-    sub_name    => 'jifty_app_models',
-);
-
-for my $model ( __PACKAGE__->jifty_app_models ) {
-
-    # We don't want to get the Collections, or models that have a
-    # 'since' that is after the current application version.
-
-    # TODO XXX FIXME:
-    #   This *will* try to generate SQL for abstract base classes you might
-    #   stick in $AC::Model::.
-    next unless $model->isa( 'Jifty::Record' );
-    next if $model =~ /::SUPER$/;
-    push @models, $model;
-}
-
 my $nav = Jifty->web->navigation->child("Administration" => url => '/__jifty/admin/');
-foreach my $model (@models) {
+foreach my $model (Jifty->class_loader->models) {
+    next unless $model->isa('Jifty::Record');
     next unless ($model =~ /^(?:.*)::(.*?)$/);
     my $type = $1;
     $nav->child($type   => url => '/__jifty/admin/model/'.$type);

Modified: jifty/branches/moose/share/web/templates/__jifty/admin/index.html
==============================================================================
--- jifty/branches/moose/share/web/templates/__jifty/admin/index.html	(original)
+++ jifty/branches/moose/share/web/templates/__jifty/admin/index.html	Mon Jul 31 03:35:23 2006
@@ -1,34 +1,3 @@
-<%init>
-
-# Set up application-specific parts
-my $ApplicationClass = Jifty->config->framework('ApplicationClass');
-
-my @models;   
-
-# This creates a sub "jifty_app_models" which when called, finds packages under
-# $ApplicationClass::Model, requires them, and returns a list of their
-# names.
-Module::Pluggable->import(
-    require     => 1,
-    except      => qr/\.#/,
-    search_path => [  $ApplicationClass . "::Model" ],
-    sub_name    => 'jifty_app_models',
-);
-
-for my $model ( __PACKAGE__->jifty_app_models ) {
-
-    # We don't want to get the Collections, or models that have a
-    # 'since' that is after the current application version.
-
-    # TODO XXX FIXME:
-    #   This *will* try to generate SQL for abstract base classes you might
-    #   stick in $AC::Model::.
-    next unless $model->isa( 'Jifty::Record' );
-    next if $model =~ /::SUPER$/;
-    push @models, $model;
-}
-
-</%init>
 <&|/_elements/wrapper, title => 'Jifty Administrative Console' &>
 
 <h1><%_('Database Administration')%></h1>
@@ -39,7 +8,8 @@
     
 <h2><%_('Models')%></h2>
 <ul>
-% foreach my $model (@models) {
+% foreach my $model (Jifty->class_loader->models) {
+% next unless $model->isa('Jifty::Record');
 % next unless ($model =~ /^(?:.*)::(.*?)$/);
 % my $type = $1;
 <li><% Jifty->web->link( url => '/__jifty/admin/model/'.$type, label => $type)%>

Added: jifty/branches/moose/t/TestApp-Plugin-REST/bin/jifty
==============================================================================
--- (empty file)
+++ jifty/branches/moose/t/TestApp-Plugin-REST/bin/jifty	Mon Jul 31 03:35:23 2006
@@ -0,0 +1,15 @@
+#!/usr/bin/env perl
+use warnings;
+use strict;
+use File::Basename qw(dirname); 
+use UNIVERSAL::require;
+
+BEGIN {
+    Jifty::Util->require or die $UNIVERSAL::require::ERROR;
+    my $root = Jifty::Util->app_root;
+    unshift @INC, "$root/lib" if ($root);
+}
+
+use Jifty::Script;
+$SIG{INT} = $SIG{TERM} = sub { warn "Stopped\n"; exit; };
+Jifty::Script->dispatch();

Added: jifty/branches/moose/t/TestApp-Plugin-REST/etc/config.yml
==============================================================================
--- (empty file)
+++ jifty/branches/moose/t/TestApp-Plugin-REST/etc/config.yml	Mon Jul 31 03:35:23 2006
@@ -0,0 +1,3 @@
+framework:
+    Plugins:
+        - REST: {}

Added: jifty/branches/moose/t/TestApp-Plugin-REST/lib/TestApp/Plugin/REST/Action/DoSomething.pm
==============================================================================
--- (empty file)
+++ jifty/branches/moose/t/TestApp-Plugin-REST/lib/TestApp/Plugin/REST/Action/DoSomething.pm	Mon Jul 31 03:35:23 2006
@@ -0,0 +1,38 @@
+package Test::Plugin::REST::Action::DoSomething;
+
+use Jifty::Param::Schema;
+use Jifty::Action schema {
+
+param email =>
+    label is 'Email',
+    ajax canonicalizes,
+    ajax validates;
+
+};
+
+sub canonicalize_email {
+    my $self = shift;
+    my $address = shift;
+    
+    return lc($address);
+}
+
+sub validate_email {
+    my $self = shift;
+    my $address = shift;
+
+    if($address =~ /bad\@email\.com/) {
+        return $self->validation_error('email', "Bad looking email");
+    } elsif ($address =~ /warn\@email\.com/) {
+        return $self->validation_warning('email', "Warning for email");
+    }
+    return $self->validation_ok('email');
+}
+
+sub take_action {
+    my $self = shift;
+
+    $self->result->message("Something happened!");
+}
+
+1;

Added: jifty/branches/moose/t/TestApp-Plugin-REST/lib/TestApp/Plugin/REST/Dispatcher.pm
==============================================================================
--- (empty file)
+++ jifty/branches/moose/t/TestApp-Plugin-REST/lib/TestApp/Plugin/REST/Dispatcher.pm	Mon Jul 31 03:35:23 2006
@@ -0,0 +1,4 @@
+package TestApp::Plugin::REST::Dispatcher;
+use Jifty::Dispatcher -base;
+
+1;

Added: jifty/branches/moose/t/TestApp-Plugin-REST/lib/TestApp/Plugin/REST/Model/User.pm
==============================================================================
--- (empty file)
+++ jifty/branches/moose/t/TestApp-Plugin-REST/lib/TestApp/Plugin/REST/Model/User.pm	Mon Jul 31 03:35:23 2006
@@ -0,0 +1,24 @@
+package TestApp::Plugin::REST::Model::User::Schema;
+use Jifty::DBI::Schema;
+
+# Your column definitions go here.  See L<Jifty::DBI::Schema> for
+# documentation about how to write column definitions.
+
+column 'name' =>
+  type is 'text',
+  is mandatory;
+column 'email' =>
+  type is 'text',
+  is mandatory;
+column 'tasty' =>
+  type is 'boolean',
+  is immutable;
+
+
+package TestApp::Plugin::REST::Model::User;
+use base qw/TestApp::Plugin::REST::Record/;
+
+# Your model-specific methods go here.
+
+1;
+

Added: jifty/branches/moose/t/TestApp-Plugin-REST/t/00-model-User.t
==============================================================================
--- (empty file)
+++ jifty/branches/moose/t/TestApp-Plugin-REST/t/00-model-User.t	Mon Jul 31 03:35:23 2006
@@ -0,0 +1,54 @@
+#!/usr/bin/env perl
+use warnings;
+use strict;
+
+=head1 DESCRIPTION
+
+A basic test harness for the User model.
+
+=cut
+
+use lib 'plugins/REST/lib';
+
+use lib 't/lib';
+use Jifty::SubTest;
+
+use Jifty::Test tests => 12;
+# Make sure we can load the model
+use_ok('TestApp::Plugin::REST::Model::User');
+
+# Grab a system use
+my $system_user = TestApp::Plugin::REST::CurrentUser->superuser;
+ok($system_user, "Found a system user");
+
+# Try testing a create
+my $o = TestApp::Plugin::REST::Model::User->new(current_user => $system_user);
+my ($id) = $o->create( name => $$, email => $$ );
+ok($id, "User create returned success");
+ok($o->id, "New User has valid id set");
+is($o->id, $id, "Create returned the right id");
+is($o->name, $$, "Created object has the right name");
+
+# And another
+$o->create( name => $$, email => $$ );
+ok($o->id, "User create returned another value");
+isnt($o->id, $id, "And it is different from the previous one");
+
+# Searches in general
+my $collection =  TestApp::Plugin::REST::Model::UserCollection->new(current_user => $system_user);
+$collection->unlimit;
+is($collection->count, 2, "Finds two records");
+
+# Searches in specific
+$collection->limit(column => 'id', value => $o->id);
+is($collection->count, 1, "Finds one record with specific id");
+
+# Delete one of them
+$o->delete;
+$collection->redo_search;
+is($collection->count, 0, "Deleted row is gone");
+
+# And the other one is still there
+$collection->unlimit;
+is($collection->count, 1, "Still one left");
+

Added: jifty/branches/moose/t/TestApp-Plugin-REST/t/00-prototype.t
==============================================================================
--- (empty file)
+++ jifty/branches/moose/t/TestApp-Plugin-REST/t/00-prototype.t	Mon Jul 31 03:35:23 2006
@@ -0,0 +1,20 @@
+#!/usr/bin/env perl
+
+use warnings;
+use strict;
+
+=head1 DESCRIPTION
+
+This is a template for your own tests. Copy it and modify it.
+
+=cut
+
+use lib 'plugins/REST/lib';
+use lib 't/lib';
+use Jifty::SubTest;
+
+use Jifty::Test tests => 1;
+
+ok(1, "Loaded the test script");
+1;
+

Added: jifty/branches/moose/t/TestApp-Plugin-REST/t/01-config.t
==============================================================================
--- (empty file)
+++ jifty/branches/moose/t/TestApp-Plugin-REST/t/01-config.t	Mon Jul 31 03:35:23 2006
@@ -0,0 +1,19 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+use lib 'plugins/REST/lib';
+
+#use Jifty::Test tests => 3;
+use Jifty::Test tests => 1;
+
+# todo: kevinr: these tests aren't right
+#is(Jifty->config->framework('ApplicationClass'), 'jifty');
+# is(Jifty->config->framework('LogConfig'), 't/btdttest.log4perl.conf');
+# Port is overridden by testconfig
+ok(Jifty->config->framework('Web')->{'Port'} >= 10000, "test nested config");
+
+
+1;
+
+

Added: jifty/branches/moose/t/TestApp-Plugin-REST/t/02-basic-use.t
==============================================================================
--- (empty file)
+++ jifty/branches/moose/t/TestApp-Plugin-REST/t/02-basic-use.t	Mon Jul 31 03:35:23 2006
@@ -0,0 +1,91 @@
+#!/usr/bin/env perl
+
+use warnings;
+use strict;
+
+=head1 DESCRIPTION
+
+This is a template for your own tests. Copy it and modify it.
+
+=cut
+
+use lib 'plugins/REST/lib';
+
+use lib 't/lib';
+use Jifty::SubTest;
+
+use Jifty::Test tests => 27;
+use Jifty::Test::WWW::Mechanize;
+
+my $server  = Jifty::Test->make_server;
+
+isa_ok($server, 'Jifty::Server');
+
+my $URL     = $server->started_ok;
+my $mech    = Jifty::Test::WWW::Mechanize->new();
+
+ok(1, "Loaded the test script");
+
+my $u1 = TestApp::Plugin::REST::Model::User->new(
+    current_user => TestApp::Plugin::REST::CurrentUser->superuser );
+$u1->create( name => 'test', email => 'test at example.com' );
+ok( $u1->id );
+
+# on GET    '/=/model'       => \&list_models;
+
+$mech->get_ok("$URL/=/model.yml", "Got model list");
+my $list = Jifty::YAML::Load($mech->content);
+is(scalar @$list, 1, "Got one model");
+is($list->[0],'TestApp::Plugin::REST::Model::User');
+
+# on GET    '/=/model/*'     => \&list_model_keys;
+$mech->get_ok('/=/model/User');
+is($mech->status,'200');
+$mech->get_ok('/=/model/user');
+is($mech->status,'200');
+$mech->get_ok('/=/model/TestApp::Plugin::REST::Model::User');
+is($mech->status,'200');
+$mech->get_ok('/=/model/TestApp.Plugin.REST.Model.User');
+is($mech->status,'200');
+$mech->get_ok('/=/model/testapp.plugin.rest.model.user');
+is($mech->status,'200');
+
+{
+    $mech->get('/=/model/Usery');
+    is($mech->status,'404');
+}
+
+
+$mech->get_ok('/=/model/User.yml');
+my %keys =  %{get_content()};
+
+is((0+keys(%keys)), 4, "The model has 4 keys");
+is_deeply([sort keys %keys], [sort qw/id name email tasty/]);
+
+
+# on GET    '/=/model/*/*'   => \&list_model_items;
+$mech->get_ok('/=/model/user/id.yml');
+my @rows = @{get_content()};
+is($#rows,0);
+
+
+# on GET    '/=/model/*/*/*' => \&show_item;
+$mech->get_ok('/=/model/user/id/1.yml');
+my %content = %{get_content()};
+is_deeply(\%content, { name => 'test', email => 'test at example.com', id => 1, tasty => undef });
+
+# on GET    '/=/model/*/*/*/*' => \&show_item_Field;
+$mech->get_ok('/=/model/user/id/1/email.yml');
+is(get_content(), 'test at example.com');
+
+# on PUT    '/=/model/*/*/*' => \&replace_item;
+# on DELETE '/=/model/*/*/*' => \&delete_item;
+# on GET    '/=/action'      => \&list_actions;
+# on GET    '/=/action/*'    => \&list_action_params;
+# on POST   '/=/action/*'    => \&run_action;
+# 
+
+sub get_content { return Jifty::YAML::Load($mech->content)}
+
+1;
+

Added: jifty/branches/moose/t/TestApp-Plugin-REST/var/mason/obj/.__obj_create_marker
==============================================================================


More information about the Jifty-commit mailing list