[Jifty-commit] r4954 - in jifty/branches/jquery: . debian lib/Jifty lib/Jifty/Action lib/Jifty/Action/Record lib/Jifty/Manual lib/Jifty/Mason lib/Jifty/Plugin/Chart lib/Jifty/Plugin/Chart/Renderer lib/Jifty/Plugin/Chart/Renderer/GD lib/Jifty/Plugin/CompressedCSSandJS lib/Jifty/Plugin/REST lib/Jifty/Web share/web/static/css share/web/static/js share/web/templates/__jifty t/Continuations/lib/Continuations t/Mapper/lib/Mapper t/TestApp-Plugin-Chart/etc t/TestApp-Plugin-OAuth/etc t/TestApp-Plugin-PasswordAuth/t t/TestApp-Plugin-REST/lib/TestApp/Plugin/REST t/TestApp/etc t/TestApp/t

Jifty commits jifty-commit at lists.jifty.org
Mon Jan 28 07:02:02 EST 2008


Author: gugod
Date: Mon Jan 28 07:01:59 2008
New Revision: 4954

Added:
   jifty/branches/jquery/t/Mapper/lib/Mapper/Dispatcher.pm
Modified:
   jifty/branches/jquery/   (props changed)
   jifty/branches/jquery/AUTHORS
   jifty/branches/jquery/Changelog
   jifty/branches/jquery/META.yml
   jifty/branches/jquery/Makefile.PL
   jifty/branches/jquery/debian/control
   jifty/branches/jquery/lib/Jifty/API.pm
   jifty/branches/jquery/lib/Jifty/Action/Record.pm
   jifty/branches/jquery/lib/Jifty/Action/Record/Create.pm
   jifty/branches/jquery/lib/Jifty/Action/Record/Update.pm
   jifty/branches/jquery/lib/Jifty/ClassLoader.pm
   jifty/branches/jquery/lib/Jifty/Dispatcher.pm
   jifty/branches/jquery/lib/Jifty/Manual/AccessControl.pod
   jifty/branches/jquery/lib/Jifty/Mason/Halo.pm
   jifty/branches/jquery/lib/Jifty/Param.pm
   jifty/branches/jquery/lib/Jifty/Plugin.pm
   jifty/branches/jquery/lib/Jifty/Plugin/Chart/Renderer.pm
   jifty/branches/jquery/lib/Jifty/Plugin/Chart/Renderer/GD/Graph.pm
   jifty/branches/jquery/lib/Jifty/Plugin/Chart/Renderer/XMLSWF.pm
   jifty/branches/jquery/lib/Jifty/Plugin/CompressedCSSandJS/Dispatcher.pm
   jifty/branches/jquery/lib/Jifty/Plugin/Halo.pm
   jifty/branches/jquery/lib/Jifty/Plugin/REST/Dispatcher.pm
   jifty/branches/jquery/lib/Jifty/Plugin/SQLQueries.pm
   jifty/branches/jquery/lib/Jifty/Record.pm
   jifty/branches/jquery/lib/Jifty/Result.pm
   jifty/branches/jquery/lib/Jifty/TestServer.pm
   jifty/branches/jquery/lib/Jifty/Web.pm
   jifty/branches/jquery/lib/Jifty/Web/Menu.pm
   jifty/branches/jquery/lib/Jifty/Web/Session.pm
   jifty/branches/jquery/share/web/static/css/halos.css
   jifty/branches/jquery/share/web/static/js/halo.js
   jifty/branches/jquery/share/web/templates/__jifty/halo
   jifty/branches/jquery/t/Continuations/lib/Continuations/Dispatcher.pm
   jifty/branches/jquery/t/TestApp-Plugin-Chart/etc/config.yml
   jifty/branches/jquery/t/TestApp-Plugin-OAuth/etc/config.yml
   jifty/branches/jquery/t/TestApp-Plugin-PasswordAuth/t/01-tokengen.t
   jifty/branches/jquery/t/TestApp-Plugin-REST/lib/TestApp/Plugin/REST/Dispatcher.pm
   jifty/branches/jquery/t/TestApp/etc/config.yml
   jifty/branches/jquery/t/TestApp/t/05-editactions-Cachable.t
   jifty/branches/jquery/t/TestApp/t/05-editactions-Record.t
   jifty/branches/jquery/t/TestApp/t/15-template-subclass.t
   jifty/branches/jquery/t/TestApp/t/16-template-region.t

Log:
 r8690 at GOP (orig r4899):  sartak | 2008-01-22 19:56:37 +0800
  r50655 at onn:  sartak | 2008-01-22 06:55:54 -0500
  Force result->success to be 0 or 1, for the benefit of REST users
 
 r8691 at GOP (orig r4900):  jesse | 2008-01-23 02:42:34 +0800
  r75538 at pinglin:  jesse | 2008-01-22 13:40:40 -0500
  * Compressed CSS and JS caching backout
 
 r8692 at GOP (orig r4903):  bokutin | 2008-01-23 05:28:50 +0800
 Add myself to AUTHORS
 
 r8693 at GOP (orig r4905):  sartak | 2008-01-23 06:58:50 +0800
  r50681 at onn:  sartak | 2008-01-22 17:58:12 -0500
  Template::Declare halos! (you'll need a bleeding edge TD though)
 
 r8694 at GOP (orig r4906):  jesse | 2008-01-23 22:42:03 +0800
 
 r8695 at GOP (orig r4907):  jesse | 2008-01-23 22:42:29 +0800
  r75584 at pinglin:  jesse | 2008-01-23 09:41:37 -0500
  * 'unexpected dispatch on REST' fixed -  Patch from bokutin
 
 r8696 at GOP (orig r4908):  sartak | 2008-01-24 03:37:27 +0800
 
 r8697 at GOP (orig r4909):  sartak | 2008-01-24 03:37:41 +0800
  r50687 at onn:  sartak | 2008-01-23 14:37:13 -0500
  REST's _resolve needs to take into account that we use :: as a seperator, but we give . as the separator
 
 r8698 at GOP (orig r4910):  sartak | 2008-01-24 03:53:38 +0800
  r50690 at onn:  sartak | 2008-01-23 14:53:24 -0500
  REST: Qualifying the entire model/action name will fail because it will have no leading ::
 
 r8699 at GOP (orig r4911):  sartak | 2008-01-24 04:12:47 +0800
  r50692 at onn:  sartak | 2008-01-23 15:12:29 -0500
  Awright! Plugins can now fiddle with (TD) halos as they wish.
  
  As an example, query logging is activated only if you use the SQLQueries plugin. Which also fixes a bug where any queries caught by the Halo plugin would be lost to SQLQueries.
 
 r8700 at GOP (orig r4912):  sartak | 2008-01-24 04:32:40 +0800
  r50694 at onn:  sartak | 2008-01-23 15:32:26 -0500
  Some refactoring of Jifty::Mason::Halo. Now it too can support plugins munging the halo data. And its query logging is now off unless the SQLQueries plugin is used
 
 r8701 at GOP (orig r4913):  sartak | 2008-01-24 07:37:23 +0800
  r50696 at onn:  sartak | 2008-01-23 18:37:06 -0500
  Now each halo has a proper header. You can now toggle between rendered output and HTML source. It's ugly as sin, but it works.
  Other misc cleanups.
 
 r8702 at GOP (orig r4914):  sartak | 2008-01-24 08:39:00 +0800
  r50698 at onn:  sartak | 2008-01-23 19:36:03 -0500
  Split between "Draw halos" and "Page info". Make halos look less offensive as well.
 
 r8703 at GOP (orig r4916):  sartak | 2008-01-24 09:11:27 +0800
  r50702 at onn:  sartak | 2008-01-23 20:11:08 -0500
  Add some support for dumping the Perl code of templates. For now, only for TD. And DDS is currently giving us a lot of extraneous bits (oh well)
 
 r8704 at GOP (orig r4917):  sartak | 2008-01-24 18:51:46 +0800
  r50704 at onn:  sartak | 2008-01-24 05:51:18 -0500
  Distinguish between *runnable* actions and *visible* actions in Jifty::API.
  This distinction will be used in the REST interface shortly. You should hide
  an action if the user will never be able to run it. You should deny actions if
  conditions aren't right for this request (such as during a GET). For example:
  
  Only administrators should be able to see a PublishNews action.
      Jifty->api->hide('PublishNews') unless Jifty->web->current_user->is_admin
  
  Only users can run CreateGame (though nonusers can still inspect the action).
      Jifty->api->deny('CreateGame') unless Jifty->web->current_user->user_object
 
 r8705 at GOP (orig r4918):  sartak | 2008-01-24 18:55:50 +0800
  r50706 at onn:  sartak | 2008-01-24 05:55:35 -0500
  BEHAVIOR CHANGE: REST will now list visible actions, not just runnable actions.
  This is because you generally want to disable actions during GET, but that
  breaks GET /=/action/
  
  So if you have actions you really mean to hide, then you'll need to update your application.
 
 r8706 at GOP (orig r4919):  sartak | 2008-01-24 19:18:49 +0800
  r50708 at onn:  sartak | 2008-01-24 06:18:02 -0500
  Allowing actions also shows them. Fix the defaults so that "weird" actions
  (such as Jifty::Action) are hidden.
 
 r8707 at GOP (orig r4920):  sartak | 2008-01-24 19:18:56 +0800
  r50709 at onn:  sartak | 2008-01-24 06:18:31 -0500
  Make TD halos show up only if DevelMode is on, consistent with Mason halos
 
 r8708 at GOP (orig r4921):  sartak | 2008-01-24 19:46:12 +0800
  r50712 at onn:  sartak | 2008-01-24 06:45:38 -0500
  Fix some test failures caused by halo output in TD generated images. Anyone have any better ideas?
 
 r8709 at GOP (orig r4922):  sartak | 2008-01-24 21:13:53 +0800
  r50714 at onn:  sartak | 2008-01-24 08:13:32 -0500
  Security fix: Deny all actions (except Autocomplete and Redirect) on GET. You must whitelist actions known to be safe, such as with:
      before '*' => run { Jifty->api->allow('CustomSearch') };
 
 r8710 at GOP (orig r4923):  sartak | 2008-01-24 21:39:38 +0800
  r50746 at onn:  sartak | 2008-01-24 08:39:25 -0500
  Add t/Mapper/lib/Mapper/Dispatcher.pm which whitelists the GetGrail and CrossBridge actions
 
 r8711 at GOP (orig r4924):  yves | 2008-01-24 23:16:13 +0800
 debian packaging
 
 r8712 at GOP (orig r4925):  ishigaki | 2008-01-24 23:51:27 +0800
 Jifty::Web: removed long-gone loc.js (deleted at #4324) from javascript_libs
 r8713 at GOP (orig r4926):  sartak | 2008-01-25 00:31:49 +0800
  r50748 at onn:  sartak | 2008-01-24 11:30:28 -0500
  Complain loudly about back-compat when an action is denied.
  Changelog the Jifty::API changes.
 
 r8714 at GOP (orig r4927):  sterling | 2008-01-25 00:56:39 +0800
  r14924 at riddle:  andrew | 2008-01-24 10:55:28 -0600
  Check the database connection before handling requests.
 
 r8715 at GOP (orig r4929):  sterling | 2008-01-25 01:20:12 +0800
  r14931 at riddle:  andrew | 2008-01-24 11:18:56 -0600
  Backing out the previous commit as this has been moved up into Jifty::DBI.
 
 r8716 at GOP (orig r4930):  ishigaki | 2008-01-25 01:32:17 +0800
 Jifty::TestServer: explicitly ignore ClassLoader objects in @INC while stringifying
 r8717 at GOP (orig r4931):  alexmv | 2008-01-25 04:49:50 +0800
  r27023 at zoq-fot-pik:  chmrr | 2008-01-24 15:48:04 -0500
   * Fix tests for new region styling
 
 r8718 at GOP (orig r4932):  alexmv | 2008-01-25 04:50:41 +0800
  r27024 at zoq-fot-pik:  chmrr | 2008-01-24 15:48:29 -0500
   * Now with more running under "use strict"
 
 r8719 at GOP (orig r4934):  trs | 2008-01-25 05:11:34 +0800
 
 r8720 at GOP (orig r4935):  alexmv | 2008-01-25 05:12:16 +0800
  r27030 at zoq-fot-pik:  chmrr | 2008-01-24 16:11:14 -0500
   * Protected and private columns and models
   * Force values in REST handler, so we get real values
 
 r8721 at GOP (orig r4936):  trs | 2008-01-25 05:12:18 +0800
  r31384 at zot:  tom | 2008-01-24 16:07:44 -0500
  * YUI classes weren't getting properly attached because $class changed to $args{class} (why didn't strict/warnings catch this?)
  * Attach the proper yuimenu(bar)?itemlabel class to links
 
 r8722 at GOP (orig r4938):  alexmv | 2008-01-25 05:35:17 +0800
  r27030 at zoq-fot-pik:  chmrr | 2008-01-24 16:11:14 -0500
   * Protected and private columns and models
   * Force values in REST handler, so we get real values
 
 r8723 at GOP (orig r4939):  alexmv | 2008-01-25 05:35:21 +0800
  r27047 at zoq-fot-pik:  chmrr | 2008-01-24 16:34:56 -0500
   * Bump JDBI dep
 
 r8724 at GOP (orig r4941):  bokutin | 2008-01-26 15:14:00 +0800
 fix Jifty->web->session->continuations.
 change accessor from $_->key to $_->data_key.
 Jifty::Model::Session schema was changed by revision 990.
 
 r990 | alexmv | 2006-05-05 05:25:00 +0900 (Fri, 05 May 2006) | 3 lines
 Changed paths:
    M /jifty/trunk
    M /jifty/trunk/lib/Jifty/Handle.pm
    M /jifty/trunk/lib/Jifty/Model/Metadata.pm
    M /jifty/trunk/lib/Jifty/Model/Session.pm
    M /jifty/trunk/lib/Jifty/Script/Schema.pm
    M /jifty/trunk/lib/Jifty/Upgrade/Internal.pm
    M /jifty/trunk/lib/Jifty/Upgrade.pm
    M /jifty/trunk/lib/Jifty/Web/Session.pm
    M /jifty/trunk/lib/Jifty.pm
 
  r12829 at zoq-fot-pik:  chmrr | 2006-05-04 16:24:18 -0400
   * Rename 'key' to 'data_key'
 
 r8725 at GOP (orig r4943):  sartak | 2008-01-27 08:21:46 +0800
  r50748 at onn:  sartak | 2008-01-24 11:30:28 -0500
  Complain loudly about back-compat when an action is denied.
  Changelog the Jifty::API changes.
 
 r8726 at GOP (orig r4944):  sartak | 2008-01-27 08:22:17 +0800
 
 r8727 at GOP (orig r4945):  sartak | 2008-01-27 08:22:41 +0800
  r50939 at onn:  sartak | 2008-01-26 19:21:25 -0500
  Let Jifty::Param::Schema actions define documentation for paramters.
  Have the REST dispatcher use "documentation" meta-attribute in models and columns
 
 r8728 at GOP (orig r4946):  sartak | 2008-01-27 08:30:08 +0800
  r50944 at onn:  sartak | 2008-01-26 19:29:36 -0500
  Steal documentation from the model class in Jifty::Action::Record
 
 r8729 at GOP (orig r4947):  sartak | 2008-01-27 09:16:16 +0800
  r50946 at onn:  sartak | 2008-01-26 20:14:41 -0500
  REST: bug in some old code: if (ref $x eq 'ARRAY') { %$x }
 
 r8731 at GOP (orig r4949):  sartak | 2008-01-27 20:13:42 +0800
  r51069 at onn:  sartak | 2008-01-27 07:13:17 -0500
  Revert a mismerge
 
 r8734 at GOP (orig r4952):  bokutin | 2008-01-28 15:23:05 +0800
 fix pods.
 WARN - DEPRECATED: renderer argument to Chart plugin is deprecated. Use DefaultRenderer instead. at trunk/lib/Jifty/Plugin/Chart.pm line 96.
 


Modified: jifty/branches/jquery/AUTHORS
==============================================================================
--- jifty/branches/jquery/AUTHORS	(original)
+++ jifty/branches/jquery/AUTHORS	Mon Jan 28 07:01:59 2008
@@ -36,3 +36,4 @@
 Todd Chapman <todd at chaka.net>
 Jason May <jason.a.may at gmail.com>
 Stanislav Sinyagin <ssinyagin at k-open.com>
+Tomohiro Hosaka <bokutin at bokut.in>

Modified: jifty/branches/jquery/Changelog
==============================================================================
--- jifty/branches/jquery/Changelog	(original)
+++ jifty/branches/jquery/Changelog	Mon Jan 28 07:01:59 2008
@@ -1,3 +1,13 @@
+Jifty $NEXT
+
+BACKWARDS COMPATIBILITY
+====
+ * Deny all actions during GET requests. Applications must now whitelist safe
+   actions. - Sartak
+ * The action API is now split between "runnable" and "inspectable". The REST
+   interface used to use the former, now it uses the latter. - Sartak
+
+
 Jifty 0.71129
 
 I18N

Modified: jifty/branches/jquery/META.yml
==============================================================================
--- jifty/branches/jquery/META.yml	(original)
+++ jifty/branches/jquery/META.yml	Mon Jan 28 07:01:59 2008
@@ -28,6 +28,7 @@
   Class::Accessor::Named: 0
   Crypt::OpenSSL::RSA: 0
   DBD::SQLite: 0
+  Data::Dump::Streamer: 0
   Devel::Cover: 0
   Devel::EvalContext: 0
   Devel::Events::Objects: 0.02
@@ -42,12 +43,13 @@
   Module::Install::Admin: 0.50
   Module::Refresh: 0.09
   Net::LDAP: 0
-  Net::OAuth::Request: 0.04
+  Net::OAuth::Request: 0.05
   Net::OpenID::Consumer: 0
   Net::Server::Fork: 0
   Net::Server::PreFork: 0
   PAR::Dist::FromCPAN: 0
   Proc::ProcessTable: 0
+  Template::Declare: 0.28
   Test::Base: 0.44
   Test::HTML::Lint: 0
   Test::HTTP::Server::Simple: 0.02

Modified: jifty/branches/jquery/Makefile.PL
==============================================================================
--- jifty/branches/jquery/Makefile.PL	(original)
+++ jifty/branches/jquery/Makefile.PL	Mon Jan 28 07:01:59 2008
@@ -50,7 +50,7 @@
 requires('Hook::LexWrap');
 requires('IPC::PubSub' => '0.23' );
 requires('IPC::Run3');
-requires('Jifty::DBI' => '0.47' );            # Jifty::DBI::Collection Jifty::DBI::Handle Jifty::DBI::Record::Cachable Jifty::DBI::SchemaGenerator
+requires('Jifty::DBI' => '0.49' );            # Jifty::DBI::Collection Jifty::DBI::Handle Jifty::DBI::Record::Cachable Jifty::DBI::SchemaGenerator
 requires('Locale::Maketext::Extract' => '0.20');
 requires('Locale::Maketext::Lexicon' => '0.60');
 requires('Log::Log4perl' => '1.04');
@@ -180,7 +180,12 @@
     'CAS Plugin' => [
         -default => 0,
         recommends('Authen::CAS::Client')
-    ]
+    ],
+    'Improved halos' => [
+        -default => 0,
+        recommends('Template::Declare' => '0.28'),
+        recommends('Data::Dump::Streamer'),
+    ],
 );
 
 

Modified: jifty/branches/jquery/debian/control
==============================================================================
--- jifty/branches/jquery/debian/control	(original)
+++ jifty/branches/jquery/debian/control	Mon Jan 28 07:01:59 2008
@@ -60,7 +60,7 @@
  libdbd-sqlite3-perl, libdata-page-perl, libossp-uuid-perl,
  libdatetime-perl, libdatetime-format-builder-perl, 
  libdate-manip-perl, libemail-folder-perl,
- libemail-messageid-perl, libemail-mime-perl, libemail-mime-encodings-perl, libemail-mime-perl, libemail-mime-encodings-perl, libemail-mime-contenttype-perl, libemail-simple-perl, libemail-mime-modifier-perl, libemail-mime-creator-perl, libemail-mime-createhtml-perl,
+ libemail-messageid-perl, libemail-mime-perl (>> 1.861), libemail-mime-encodings-perl, libemail-mime-perl, libemail-mime-encodings-perl, libemail-mime-contenttype-perl, libemail-simple-perl, libemail-mime-modifier-perl, libemail-mime-creator-perl, libemail-mime-createhtml-perl,
  libemail-localdelivery-perl (>> 0.217), 
  libemail-send-perl (>> 2.003), 
  libemail-simple-creator-perl, libexporter-lite-perl,
@@ -75,11 +75,11 @@
  libmime-types-perl, libmodule-pluggable-perl (>> 3.5),
  libmodule-corelist-perl, libmodule-refresh-perl,
  libmodule-scandeps-perl, libobject-declare-perl (>> 0.22),
- libparams-validate-perl, libscalar-defer-perl (>> 0.10),
+ libparams-validate-perl, libscalar-defer-perl (>> 0.14),
  libpadwalker-perl,
  libstring-koremutake-perl, libsql-reservedwords-perl,
  libtemplate-declare-perl (>> 0.26), 
- libtest-base-perl, libtest-log4perl-perl, 
+ libtest-base-perl, libtest-log4perl-perl, libtest-www-selenium-perl, 
  libuniversal-require-perl, liburi-perl,
  libxml-writer-perl (>> 0.601), libxml-simple-perl,
  libxml-xpath-perl, libversion-perl, libyaml-syck-perl (>> 0.72), 

Modified: jifty/branches/jquery/lib/Jifty/API.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/API.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/API.pm	Mon Jan 28 07:01:59 2008
@@ -20,15 +20,28 @@
      Jifty->api->deny('FooBarDeleteTheWorld');
  }
 
+ # New users cannot even see some actions
+ if (Jifty->web->current_user->age < 18) {
+     Jifty->api->hide(qr/Vote|PurchaseTobacco/);
+ }
+
  # Fetch the class names of all the allowed actions
  my @actions = Jifty->api->actions;
 
+ # Fetch all of the visible actions (some of which may not be allowed)
+ my @visible = Jifty->api->visible_actions;
+
  # Check to see if an action is allowed
  if (Jifty->api->is_allowed('TrueFooBar')) {
      # do something...
  }
 
- # Undo all allow/deny/restrict calls
+ # Check to see if an action is visible
+ if (Jifty->api->is_visible('SpamOurUsers')) {
+     SpamBot->be_annoying;
+ }
+
+ # Undo all allow/deny/restrict/hide calls
  Jifty->api->reset;
 
 =head1 DESCRIPTION
@@ -103,8 +116,8 @@
 
 Resets which actions are allowed to the defaults; that is, all of the
 application's actions, L<Jifty::Action::Autocomplete>, and
-L<Jifty::Action::Redirect> are allowed; everything else is denied.
-See L</restrict> for the details of how limits are processed.
+L<Jifty::Action::Redirect> are allowed and visible; everything else is denied
+and hidden. See L</restrict> for the details of how limits are processed.
 
 =cut
 
@@ -116,22 +129,41 @@
 
     # These are the default action limits
     $self->action_limits(
-        [   { deny => 1, restriction => qr/.*/ },
-            {   allow       => 1,
-                restriction => qr/^\Q$app_actions\E/,
-            },
-            { allow => 1, restriction => 'Jifty::Action::Autocomplete' },
-            { allow => 1, restriction => 'Jifty::Action::Redirect' },
+        [
+            { hide => 1, deny => 1, restriction => qr/.*/ },
+            { allow => 1, show => 1, restriction => qr/^\Q$app_actions\E/ },
+            { allow => 1, show => 1, restriction => 'Jifty::Action::Autocomplete' },
+            { allow => 1, show => 1, restriction => 'Jifty::Action::Redirect' },
         ]
     );
 }
 
+=head2 deny_for_get
+
+Denies all actions except L<Jifty::Action::Autocomplete> and
+L<Jifty::Action::Redirect>. This is to protect against a common cross-site
+scripting hole. In your C<before> dispatcher rules, you can whitelist actions
+that are known to be read-only.
+
+This is called automatically during any C<GET> request.
+
+=cut
+
+sub deny_for_get {
+    my $self = shift;
+    $self->deny(qr/.*/);
+    $self->allow("Jifty::Action::Autocomplete");
+    $self->allow("Jifty::Action::Redirect");
+}
+
 =head2 allow RESTRICTIONS
 
 Takes a list of strings or regular expressions, and adds them in order
 to the list of limits for the purposes of L</is_allowed>.  See
 L</restrict> for the details of how limits are processed.
 
+Allowing actions also L</show> them.
+
 =cut
 
 sub allow {
@@ -152,16 +184,44 @@
     $self->restrict( deny => @_ );
 }
 
+=head2 hide RESTRICTIONS
+
+Takes a list of strings or regular expressions, and adds them in order
+to the list of limits for the purposes of L</is_visible>.  See
+L</restrict> for the details of how limits are processed.
+
+Hiding actions also L</deny> them.
+
+=cut
+
+sub hide {
+    my $self = shift;
+    $self->restrict( hide => @_ );
+}
+
+=head2 show RESTRICTIONS
+
+Takes a list of strings or regular expressions, and adds them in order
+to the list of limits for the purposes of L</is_visible>.  See
+L</restrict> for the details of how limits are processed.
+
+=cut
+
+sub show {
+    my $self = shift;
+    $self->restrict( show => @_ );
+}
+
 =head2 restrict POLARITY RESTRICTIONS
 
-Method that L</allow> and L</deny> call internally; I<POLARITY> is
-either C<allow> or C<deny>.  Allow and deny limits are evaluated in
-the order they're called.  The last limit that applies will be the one
-which takes effect.  Regexes are matched against the class; strings
-are fully L</qualify|qualified> and used as an exact match against the
-class name.  The base set of restrictions (which is reset every
-request) is set in L</reset>, and usually modified by the
-application's L<Jifty::Dispatcher> if need be.
+Method that L</allow>, L</deny>, L</hide>, and L</show> call internally;
+I<POLARITY> is one of C<allow>, C<deny>, C<hide>, or C<show>. Limits are
+evaluated in the order they're called. The last limit that applies will be the
+one which takes effect. Regexes are matched against the class; strings are
+fully L</qualify|qualified> and used as an exact match against the class name.
+The base set of restrictions (which is reset every request) is set in
+L</reset>, and usually modified by the application's L<Jifty::Dispatcher> if
+need be.
 
 If you call:
 
@@ -181,15 +241,16 @@
 
 =cut
 
+my %valid_polarity = map { $_ => 1 } qw/allow deny hide show/;
+
 sub restrict {
     my $self         = shift;
     my $polarity     = shift;
     my @restrictions = @_;
 
     # Check the sanity of the polarity
-    die "Polarity must be 'allow' or 'deny'"
-        unless $polarity eq "allow"
-        or $polarity     eq "deny";
+    die "Polarity must be one of: " . join(', ', sort keys %valid_polarity)
+        unless $valid_polarity{$polarity};
 
     for my $restriction (@restrictions) {
 
@@ -206,6 +267,18 @@
         # Add to list of restrictions
         push @{ $self->action_limits },
             { $polarity => 1, restriction => $restriction };
+
+        # Hiding an action also denies it
+        if ($polarity eq 'hide') {
+            push @{ $self->action_limits },
+                { deny => 1, restriction => $restriction };
+        }
+
+        # Allowing an action also shows it
+        if ($polarity eq 'allow') {
+            push @{ $self->action_limits },
+                { show => 1, restriction => $restriction };
+        }
     }
 }
 
@@ -218,15 +291,49 @@
 =cut
 
 sub is_allowed {
+    my $self   = shift;
+    my $action = shift;
+
+    $self->decide_action_polarity($action, 'allow', 'deny');
+}
+
+=head2 is_visible CLASS
+
+Returns true if the I<CLASS> name (which is fully qualified if it is
+not already) is allowed to be seen.  See L</restrict> above for
+the rules that the class name must pass.
+
+=cut
+
+sub is_visible {
+    my $self   = shift;
+    my $action = shift;
+
+    $self->decide_action_polarity($action, 'show', 'hide');
+}
+
+=head2 decide_action_polarity CLASS, ALLOW, DENY
+
+Returns true if the I<CLASS> name it has the ALLOW restriction, false if it has
+the DENY restriction. This is a helper method used by L</is_allowed> and
+L</is_visible>.
+
+If no restrictions apply to this action, then false will be returned.
+
+=cut
+
+sub decide_action_polarity {
     my $self  = shift;
     my $class = shift;
+    my $allow = shift;
+    my $deny  = shift;
 
     # Qualify the action
     $class = $self->qualify($class);
 
     # Assume that it doesn't pass; however, the real fallbacks are
     # controlled by L</reset>, above.
-    my $allow = 0;
+    my $valid = 0;
 
     # Walk all of the limits
     for my $limit ( @{ $self->action_limits } ) {
@@ -236,18 +343,24 @@
             or ( $class eq $limit->{restriction} ) )
         {
 
-            # If the restriction passes, set the current allow/deny
+            # If the restriction passes, set the current $allow/$deny
             # bit according to if this was a positive or negative
             # limit
-            $allow = $limit->{allow} ? 1 : 0;
+            if ($limit->{$allow}) {
+                $valid = 1;
+            }
+            if ($limit->{$deny}) {
+                $valid = 0;
+            }
         }
     }
-    return $allow;
+
+    return $valid;
 }
 
 =head2 actions
 
-Lists the class names of all of the allowed actions for this Jifty
+Lists the class names of all of the B<allowed> actions for this Jifty
 application; this may include actions under the C<Jifty::Action::>
 namespace, in addition to your application's actions.
 
@@ -258,6 +371,19 @@
     return sort grep { $self->is_allowed($_) } $self->_actions;
 }
 
+=head2 visible_actions
+
+Lists the class names of all of the B<visible> actions for this Jifty
+application; this may include actions under the C<Jifty::Action::>
+namespace, in addition to your application's actions.
+
+=cut
+
+sub visible_actions {
+    my $self = shift;
+    return sort grep { $self->is_visible($_) } $self->_actions;
+}
+
 =head1 SEE ALSO
 
 L<Jifty>, L<Jifty::Web>, L<Jifty::Action>

Modified: jifty/branches/jquery/lib/Jifty/Action/Record.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Action/Record.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Action/Record.pm	Mon Jan 28 07:01:59 2008
@@ -274,7 +274,7 @@
         $info->{'ajax_canonicalizes'} ||= $ajax_canonicalizes;
 
         # If we're hand-coding a render_as, hints or label, let's use it.
-        for ( qw(render_as label hints max_length mandatory sort_order container)) {
+        for ( qw(render_as label hints max_length mandatory sort_order container documentation)) {
             if ( defined( my $val = $column->$_ ) ) {
                 $info->{$_} = $val;
             }
@@ -497,13 +497,13 @@
 =head2 possible_fields
 
 Returns the list of fields on the object that the action can update.
-This defaults to all of the fields of the object.
+This defaults to all of the non-C<private> fields of the object.
 
 =cut
 
 sub possible_fields {
     my $self = shift;
-    return map { $_->name } grep { $_->container || $_->type ne "serial" } $self->record->columns;
+    return map { $_->name } grep { $_->container || $_->type ne "serial" and not $_->private and not $_->virtual } $self->record->columns;
 }
 
 =head2 take_action

Modified: jifty/branches/jquery/lib/Jifty/Action/Record/Create.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Action/Record/Create.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Action/Record/Create.pm	Mon Jan 28 07:01:59 2008
@@ -120,6 +120,19 @@
     $self->result->message(_("Created"))
 }
 
+=head2 possible_fields
+
+Create actions do not provide fields for columns marked as C<private>
+or C<protected>.
+
+=cut
+
+sub possible_fields {
+    my $self = shift;
+    my @names = $self->SUPER::possible_fields;
+    return map {$_->name} grep {not $_->protected} map {$self->record->column($_)} @names;
+}
+
 =head1 SEE ALSO
 
 L<Jifty::Action::Record>, L<Jifty::Record>

Modified: jifty/branches/jquery/lib/Jifty/Action/Record/Update.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Action/Record/Update.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Action/Record/Update.pm	Mon Jan 28 07:01:59 2008
@@ -36,7 +36,7 @@
     my $arguments = $self->SUPER::arguments(@_);
 
     # Mark read-only columns for read-only display
-    for my $column ( $self->record->columns ) {
+    for my $column ( map {$self->record->column($_)} $self->possible_fields ) {
         if ( not $column->writable and $column->readable ) {
             $arguments->{$column->name}{'render_mode'} = 'read';
         }
@@ -205,6 +205,20 @@
     $self->result->message(_("Updated"))
 }
 
+
+=head2 possible_fields
+
+Update actions do not provide fields for columns marked as C<private>
+or C<protected>.
+
+=cut
+
+sub possible_fields {
+    my $self = shift;
+    my @names = $self->SUPER::possible_fields;
+    return map {$_->name} grep {not $_->protected} map {$self->record->column($_)} @names;
+}
+
 =head1 SEE ALSO
 
 L<Jifty::Action::Record>, L<Jifty::Record>

Modified: jifty/branches/jquery/lib/Jifty/ClassLoader.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/ClassLoader.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/ClassLoader.pm	Mon Jan 28 07:01:59 2008
@@ -67,7 +67,7 @@
 
 =item I<Application>::Action::I<[Verb]>I<[Something]>
 
-If I<Application>::Model::I<Something> is a valid model class and I<Verb> is one of "Create", "Search", "Update", or "Delete", then it creates a subclass of I<Application>::Action::Record::I<Verb>
+If I<Application>::Model::I<Something> is a valid model class and I<Verb> is one of "Create", "Search", "Update", or "Delete", then it creates a subclass of I<Application>::Action::Record::I<Verb>  Models can control which actions are generated by overriding L<Jifty::Record/autogenerate_action>.  See also L<Jifty::Record/is_private> and L<Jifty::Record/is_protected>.
 
 =item I<Application>::Action::I<Something>
 
@@ -226,13 +226,14 @@
 
         # Don't generate the action unless it really is a model
         if ( eval { $modelclass->isa('Jifty::Record') } ) {
-
-            $AUTOGENERATED{$module} = 1;
-            return $self->return_class(
-                  "package $module;\n"
-                . "use base qw/$base\::Action::Record::$1/;\n"
-                . "sub record_class { '$modelclass' };\n"
-            );
+            if ($modelclass->autogenerate_action($1)) {
+                $AUTOGENERATED{$module} = 1;
+                return $self->return_class(
+                      "package $module;\n"
+                    . "use base qw/$base\::Action::Record::$1/;\n"
+                    . "sub record_class { '$modelclass' };\n"
+                );
+            }
         }
 
     }
@@ -373,7 +374,7 @@
     my($short) = $full =~ /::Model::(\w*)/;
     Jifty::Util->require($full . "Collection");
     Jifty::Util->require($base . "::Action::" . $_ . $short)
-        for qw/Create Update Delete Search/;
+        for grep {$full->autogenerate_action($_)} qw/Create Update Delete Search/;
 }
 
 

Modified: jifty/branches/jquery/lib/Jifty/Dispatcher.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Dispatcher.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Dispatcher.pm	Mon Jan 28 07:01:59 2008
@@ -838,6 +838,9 @@
 
     $self->log->debug("Dispatching request to ".$self->{path});
 
+    # Disable most actions on GET requests
+    Jifty->api->deny_for_get() if $self->_match_method('GET');
+
     # Setup -- we we don't abort out of setup, then run the
     # actions and then the RUN stage.
     if ($self->_handle_stage('SETUP')) {

Modified: jifty/branches/jquery/lib/Jifty/Manual/AccessControl.pod
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Manual/AccessControl.pod	(original)
+++ jifty/branches/jquery/lib/Jifty/Manual/AccessControl.pod	Mon Jan 28 07:01:59 2008
@@ -21,7 +21,7 @@
 if C<current_user_can('write')> returns false.
 
 
-On C<delete()>, we reject the operation  if C<current_user_can('delete')>
+On C<delete()>, we reject the operation if C<current_user_can('delete')>
 returns false.
 
 Out of the box, C<current_user_can> returns 1. When you want to actually 

Modified: jifty/branches/jquery/lib/Jifty/Mason/Halo.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Mason/Halo.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Mason/Halo.pm	Mon Jan 28 07:01:59 2008
@@ -2,8 +2,9 @@
 use strict;
 package Jifty::Mason::Halo;
 use base qw/HTML::Mason::Plugin/;
-use Time::HiRes ();
-Jifty->handle->log_sql_statements(1);
+use Time::HiRes 'time';
+use Class::Trigger;
+use Jifty::Plugin::Halo;
 
 =head1 NAME
 
@@ -28,38 +29,33 @@
     my $self    = shift;
     my $context = shift;
 
-    return if ($context->comp->path && $context->comp->path eq "/__jifty/halo");
+    return if ($context->comp->path || '') eq "/__jifty/halo";
 
-    Jifty->handler->stash->{ '_halo_index_stack' } ||= [];
+    my $ID          = Jifty->web->serial;
+    my $STACK       = Jifty->handler->stash->{'_halo_stack'} ||= [];
+    my $INDEX_STACK = Jifty->handler->stash->{'_halo_index_stack'} ||= [];
+    my $DEPTH       = ++Jifty->handler->stash->{'_halo_depth'};
 
-    my $DEPTH = Jifty->handler->stash->{'_halo_depth'} || 0;
-    my $STACK = Jifty->handler->stash->{'_halo_stack'} ||= [];
-        
-    my $INDEX_STACK = Jifty->handler->stash->{'_halo_index_stack'};
-
-    my $halo_base = Jifty->web->serial;
-
-    Jifty->handler->stash->{'_halo_depth'} = ++$DEPTH;
-    if ($STACK->[-1]) {
-        push @{$STACK->[-1]->{sql_statements}}, Jifty->handle->sql_statement_log;
-        Jifty->handle->clear_sql_statement_log;
-    }
-
-    push @$STACK, {
-        id           => $halo_base,
+    my $frame = {
+        id           => $ID,
         args         => [map { eval { defined $_ and fileno( $_ ) }  ? "*GLOB*" : $_} @{$context->args}],
-        start_time   => Time::HiRes::time(),
+        start_time   => time,
         path         => $context->comp->path || '',
-        subcomponent => (  $context->comp->is_subcomp() ? 1:0),
-        name         => $context->comp->name || '(Unamed component)',
-        proscribed   => ($self->_unrendered_component($context) ? 1 :0 ),
-        depth        => $DEPTH
+        subcomponent => $context->comp->is_subcomp() ? 1 : 0,
+        name         => $context->comp->name || '(Unnamed component)',
+        proscribed   => $self->_unrendered_component($context) ? 1 : 0,
+        depth        => $DEPTH,
     };
 
-    push @$INDEX_STACK, $#{$STACK};
+    my $previous = $STACK->[-1];
+    push @$STACK, $frame;
+    push @$INDEX_STACK, $#$STACK;
+
     return if $self->_unrendered_component($context);
 
-    $context->request->out(qq{<div id="halo-@{[$halo_base]}">});
+    $self->call_trigger('halo_pre_template', frame => $frame, previous => $previous);
+
+    $context->request->out(Jifty::Plugin::Halo->halo_header($frame));
 }
 
 =head2 end_component_hook CONTEXT_OBJECT
@@ -67,53 +63,35 @@
 When we're done rendering a component, record how long it took
 and close off the halo C<span> if we have one.
 
-
 =cut
 
 sub end_component_hook {
     my $self    = shift;
     my $context = shift;
 
-    return if ($context->comp->path && $context->comp->path =~ "^/__jifty/halo");
+    return if ($context->comp->path || '') eq "/__jifty/halo";
 
-    my $STACK = Jifty->handler->stash->{'_halo_stack'};
+    my $STACK       = Jifty->handler->stash->{'_halo_stack'};
     my $INDEX_STACK = Jifty->handler->stash->{'_halo_index_stack'};
-    my $DEPTH = Jifty->handler->stash->{'_halo_depth'};
-
-    my $FRAME_ID = pop @$INDEX_STACK;
+    my $FRAME_ID    = pop @$INDEX_STACK;
 
     my $frame = $STACK->[$FRAME_ID];
-    $frame->{'render_time'} = int((Time::HiRes::time - $frame->{'start_time'}) * 1000)/1000;
+    $frame->{'end_time'} = time;
 
-    push @{$frame->{sql_statements}}, Jifty->handle->sql_statement_log;
-    Jifty->handle->clear_sql_statement_log;
+    my $previous = $FRAME_ID ? $STACK->[$FRAME_ID - 1] : {};
 
+    $self->call_trigger('halo_post_template', frame => $frame, previous => $previous);
 
-    Jifty->handler->stash->{'_halo_depth'} = $DEPTH-1 ;
+    --Jifty->handler->stash->{'_halo_depth'};
 
-    # If 
     return if $self->_unrendered_component($context);
 
     # print out the div with our halo magic actions.
     # if we didn't render a beginning of the span, don't render an end
     unless ( $frame->{'proscribed'} ) {
         my $comp_name = $frame->{'path'};
-        $context->request->out('</div>');
-        $context->request->out(
-            Jifty->web->link(
-                label   => _( 'Edit %1', $comp_name ),
-                class => 'inline_edit',
-                onclick => [
-                    {   element      => "#halo-" . $frame->{id},
-                        replace_with =>
-                            '/__jifty/edit_inline/mason_component/'.$comp_name
-                    }
-                ]
-            )
-            )
-            if 0 and ( $frame->{'path'} and $frame->{'path'} !~ /^\/?__jifty/ );
+        $context->request->out(Jifty::Plugin::Halo->halo_footer($frame));
     }
-
 }
 
 =head2 _unrendered_component CONTEXT
@@ -152,7 +130,7 @@
     my @stack = @{ Jifty->handler->stash->{'_halo_stack'} };
 
     for (@stack) {
-        $_->{'render_time'} = int((Time::HiRes::time - $_->{'start_time'}) * 1000)/1000
+        $_->{'render_time'} = int((($_->{'end_time'}||time) - $_->{'start_time'}) * 1000)/1000
           unless defined $_->{'render_time'};
     }
 

Modified: jifty/branches/jquery/lib/Jifty/Param.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Param.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Param.pm	Mon Jan 28 07:01:59 2008
@@ -76,7 +76,7 @@
 use base qw/Class::Accessor::Fast/;
 use constant ACCESSORS => (
     Jifty::Web::Form::Field->accessors,
-    qw(constructor valid_values available_values sort_order),
+    qw(constructor valid_values available_values sort_order documentation),
 );
 
 __PACKAGE__->mk_accessors(ACCESSORS);

Modified: jifty/branches/jquery/lib/Jifty/Plugin.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Plugin.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Plugin.pm	Mon Jan 28 07:01:59 2008
@@ -59,6 +59,32 @@
 
     # XXX TODO: Add .po path
     $self->init(@_);
+
+    # XXX: If we have methods for halos, add them. Some way of detecting "are
+    # we going to be using halos" would be superb. As it stands right now,
+    # plugins are loaded, initialized, and prereq-examined in the order they're
+    # listed in the config files. Instead, each phase should be separate.
+    Jifty::Util->require("Jifty::Plugin::Halo");
+    Jifty::Util->require("Jifty::Mason::Halo");
+
+    if ($self->can('halo_pre_template')) {
+        Jifty::Plugin::Halo->add_trigger(
+            halo_pre_template => sub { $self->halo_pre_template(@_) },
+        );
+        Jifty::Mason::Halo->add_trigger(
+            halo_pre_template => sub { $self->halo_pre_template(@_) },
+        );
+    }
+
+    if ($self->can('halo_post_template')) {
+        Jifty::Plugin::Halo->add_trigger(
+            halo_post_template => sub { $self->halo_post_template(@_) },
+        );
+        Jifty::Mason::Halo->add_trigger(
+            halo_post_template => sub { $self->halo_post_template(@_) },
+        );
+    }
+
     return $self;
 }
 

Modified: jifty/branches/jquery/lib/Jifty/Plugin/Chart/Renderer.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Plugin/Chart/Renderer.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Plugin/Chart/Renderer.pm	Mon Jan 28 07:01:59 2008
@@ -13,7 +13,7 @@
 
   Plugins:
     - Chart:
-        renderer: MyApp::Renderer;
+        DefaultRenderer: MyApp::Renderer
 
 In F<lib/MyApp/Renderer.pm>:
 

Modified: jifty/branches/jquery/lib/Jifty/Plugin/Chart/Renderer/GD/Graph.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Plugin/Chart/Renderer/GD/Graph.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Plugin/Chart/Renderer/GD/Graph.pm	Mon Jan 28 07:01:59 2008
@@ -14,7 +14,7 @@
 
   Plugins:
     - Chart:
-        renderer: Jifty::Plugin::Chart::Renderer::GD::Graph
+        DefaultRenderer: Jifty::Plugin::Chart::Renderer::GD::Graph
 
 =head1 DESCRIPTION
 

Modified: jifty/branches/jquery/lib/Jifty/Plugin/Chart/Renderer/XMLSWF.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Plugin/Chart/Renderer/XMLSWF.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Plugin/Chart/Renderer/XMLSWF.pm	Mon Jan 28 07:01:59 2008
@@ -16,7 +16,7 @@
 
   Plugins:
     - Chart:
-        renderer: XMLSWF
+        DefaultRenderer: XMLSWF
         license_key: YOUR_OPTIONAL_LICENSE_KEY
 
 =head1 METHODS

Modified: jifty/branches/jquery/lib/Jifty/Plugin/CompressedCSSandJS/Dispatcher.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Plugin/CompressedCSSandJS/Dispatcher.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Plugin/CompressedCSSandJS/Dispatcher.pm	Mon Jan 28 07:01:59 2008
@@ -41,11 +41,8 @@
         return;
     }
 
-
     Jifty->handler->apache->content_type("application/x-javascript");
-    Jifty->handler->apache->header_out( 'Cache-Control' => 'max-age=259200, public' );
-    Jifty->handler->apache->header_out( Expires => HTTP::Date::time2str( time() + 31536000 ) ) ;    # Expire in a year
-    Jifty->handler->apache->header_out( 'Last-Modified' => HTTP::Date::time2str($^T) );
+    Jifty->handler->apache->header_out( 'Expires' => HTTP::Date::time2str( time + 31536000 ) );
 
     # XXX TODO: If we start caching the squished JS in a file somewhere, we
     # can have the static handler serve it, which would take care of gzipping
@@ -86,9 +83,7 @@
     }
 
     Jifty->handler->apache->content_type("text/css");
-    Jifty->handler->apache->header_out( 'Cache-Control' => 'max-age=259200, public' );
-    Jifty->handler->apache->header_out( Expires => HTTP::Date::time2str( time() + 31536000 ) ) ;    # Expire in a year
-    Jifty->handler->apache->header_out( 'Last-Modified' => HTTP::Date::time2str($^T) );
+    Jifty->handler->apache->header_out( 'Expires' => HTTP::Date::time2str( time + 31536000 ) );
 
     # XXX TODO: If we start caching the squished CSS in a file somewhere, we
     # can have the static handler serve it, which would take care of gzipping

Modified: jifty/branches/jquery/lib/Jifty/Plugin/Halo.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Plugin/Halo.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Plugin/Halo.pm	Mon Jan 28 07:01:59 2008
@@ -3,10 +3,8 @@
 
 package Jifty::Plugin::Halo;
 use base qw/Jifty::Plugin/;
-
-# Your plugin goes here.  If takes any configuration or arguments, you
-# probably want to override L<Jifty::Plugin/init>.
-
+use Time::HiRes 'time';
+use Class::Trigger;
 
 =head1 NAME
 
@@ -20,5 +18,120 @@
 
 =cut
 
+sub init {
+    my $self = shift;
+    return if $self->_pre_init;
+    return unless Jifty->config->framework('DevelMode');
+
+    # 0.28 added around_template instrumentation
+    eval { Template::Declare->VERSION('0.28'); 1 }
+        or do {
+            Jifty->log->debug("Template::Declare 0.28 required for TD halos.");
+            return;
+        };
+
+    warn "Overwriting an existing Template::Declare->around_template"
+        if Template::Declare->around_template;
+
+    Template::Declare->around_template(sub { $self->around_template(@_) });
+
+}
+
+# parts of why this is.. weird is because we want to play nicely with Mason
+# halos
+sub around_template {
+    my ($self, $orig, $path, $args, $code) = @_;
+
+    my $ID          = Jifty->web->serial;
+    my $STACK       = Jifty->handler->stash->{'_halo_stack'} ||= [];
+    my $DEPTH       = ++Jifty->handler->stash->{'_halo_depth'};
+
+    # for now, call the last piece of the template's path the name
+    $path =~ m{.*/(.+)};
+    my $name = $1 || $path;
+
+    my $deparsed = eval {
+        require Data::Dump::Streamer;
+        Data::Dump::Streamer::Dump($code)->Out;
+    };
+
+    my $frame = {
+        id           => $ID,
+        args         => [ %{ Jifty->web->request->arguments } ], # ugh :)
+        start_time   => time,
+        path         => $path,
+        subcomponent => 0,
+        name         => $name,
+        proscribed   => 0,
+        depth        => $DEPTH,
+        perl         => $deparsed,
+    };
+
+    # if this is the first frame, discard anything from the previous queries
+    my $previous = $STACK->[-1] || {};
+
+    push @$STACK, $frame;
+    my $STACK_INDEX = $#$STACK;
+
+    $self->call_trigger('halo_pre_template', frame => $frame, previous => $previous);
+
+    Template::Declare->buffer->append($self->halo_header($frame));
+    $orig->();
+    Template::Declare->buffer->append($self->halo_footer($frame));
+
+    $frame->{'end_time'} = time;
+
+    $self->call_trigger('halo_post_template', frame => $frame, previous => $previous);
+
+    --Jifty->handler->stash->{'_halo_depth'};
+}
+
+sub halo_header {
+    my $self  = shift;
+    my $frame = shift;
+    my $id    = $frame->{id};
+    my $perl  = $frame->{perl} || '';
+    my $name  = $frame->{name};
+
+    for ($perl, $name) {
+        $_ = Jifty->web->escape($_);
+    }
+
+    my $perl_link = $perl ? qq{ | <a id="halo-button-perl-$id" onclick="halo_perl('$id'); return false" href="#">P</a> } : '';
+    my $perl_div = $perl ? qq{<div id="halo-perl-$id" class="halo_perl"><pre>$perl</pre></div>} : '';
+
+    return << "    HEADER";
+        <div id="halo-$id" class="halo">
+            <div class="halo_header">
+                <span class="halo_rendermode">
+                    [
+                    <a style="font-weight: bold"
+                       id="halo-button-render-$id"
+                       onclick="halo_render('$id'); return false"
+                       href="#">R</a>
+                    |
+                    <a id="halo-button-source-$id"
+                       onclick="halo_source('$id'); return false"
+                       href="#">S</a>
+                    $perl_link
+                    ]
+                </span>
+                <div class="halo_name">$name</div>
+            </div>
+            $perl_div
+            <div id="halo-inner-$id">
+    HEADER
+}
+
+sub halo_footer {
+    my $self  = shift;
+    my $frame = shift;
+
+    return << "    FOOTER";
+            </div>
+        </div>
+    FOOTER
+}
+
 
 1;

Modified: jifty/branches/jquery/lib/Jifty/Plugin/REST/Dispatcher.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Plugin/REST/Dispatcher.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Plugin/REST/Dispatcher.pm	Mon Jan 28 07:01:59 2008
@@ -94,7 +94,7 @@
 
 HTML is output only if the Accept: header or an extension does not request a
 specific format.
-    };
+};
     last_rule;
 }
 
@@ -322,7 +322,7 @@
 sub html_dump {
     my $content = shift;
     if (ref($content) eq 'ARRAY') {
-        if (keys %$content) {
+        if (@$content) {
             return ul(map {
                 li(html_dump($_))
             } @{$content});
@@ -379,7 +379,7 @@
 =cut
 
 
-sub action {  _resolve($_[0], 'Jifty::Action', Jifty->api->actions) }
+sub action {  _resolve($_[0], 'Jifty::Action', Jifty->api->visible_actions) }
 
 =head2 model MODEL
 
@@ -387,17 +387,22 @@
 
 =cut
 
-sub model  { _resolve($_[0], 'Jifty::Record', Jifty->class_loader->models) }
+sub model  { _resolve($_[0], 'Jifty::Record', grep {not $_->is_private} Jifty->class_loader->models) }
 
 sub _resolve {
     my $name = shift;
     my $base = shift;
+
+    # we display actions as "AppName.Action.Foo", so we want to convert those
+    # heathen names to be Perl-style
+    $name =~ s/\./::/g;
+
     return $name if $name->isa($base);
 
-    $name =~ s/\W+/\\W+/g;
+    my $re = qr/(?:^|::)\Q$name\E$/i;
 
     foreach my $cls (@_) {
-        return $cls if $cls =~ /$name$/i;
+        return $cls if $cls =~ $re;
     }
 
     abort(404);
@@ -411,11 +416,18 @@
 =cut
 
 sub list_models {
-    list(['model'], map { s/::/./g; $_ } Jifty->class_loader->models);
+    list(['model'], map { s/::/./g; $_ } grep {not $_->is_private} Jifty->class_loader->models);
 }
 
+=head2 valid_column
+
+Returns true if the column is a valid column to observe on the model
+
+=cut
+
 our @column_attrs = 
 qw( name
+    documentation
     type
     default
     readable writable
@@ -430,6 +442,10 @@
     valid_values
 );
 
+sub valid_column {
+    my ( $model, $column ) = @_;
+    return scalar grep { $_->name eq $column and not $_->virtual and not $_->private } $model->new->columns;
+}
 
 =head2 list_model_columns
 
@@ -443,12 +459,14 @@
 
     my %cols;
     for my $col ( $model->new->columns ) {
+        next if $col->private or $col->virtual;
         $cols{ $col->name } = { };
         for ( @column_attrs ) {
             my $val = $col->$_();
-            $cols{ $col->name }->{ $_ } = $val
+            $cols{ $col->name }->{ $_ } = Scalar::Defer::force($val)
                 if defined $val and length $val;
         }
+        $cols{ $col->name }{writable} = 0 if exists $cols{$col->name}{writable} and $col->protected;
     }
 
     outs( [ 'model', $model ], \%cols );
@@ -467,6 +485,9 @@
     my $col = $model->new->collection_class->new;
     $col->unlimit;
 
+    # Check that the field is actually a column
+    abort(404) unless valid_column($model, $column);
+
     # If we don't load the PK, we won't get data
     $col->columns("id", $column);
     $col->order_by( column => $column );
@@ -492,7 +513,7 @@
     $rec->can($field) or abort(404);
 
     # Check that the field is actually a column (and not some other method)
-    abort(404) if not scalar grep { $_->name eq $field } $rec->columns;
+    abort(404) unless valid_column($model, $column);
 
     outs( [ 'model', $model, $column, $key, $field ],
           Jifty::Util->stringify($rec->$field()) );
@@ -509,6 +530,10 @@
 sub show_item {
     my ($model, $column, $key) = (model($1), $2, $3);
     my $rec = $model->new;
+
+    # Check that the field is actually a column
+    abort(404) unless valid_column($model, $column);
+
     $rec->load_by_cols( $column => $key );
     $rec->id or abort(404);
     outs( ['model', $model, $column, $key], $rec->jifty_serialize_format );
@@ -653,9 +678,8 @@
         my $item = $collection->first
             or return outs($ret, []);
 
-        # make sure $field exists and is a real column
-        $item->can($field)    or abort(404);
-        $item->column($field) or abort(404);
+        # Check that the field is actually a column
+        abort(404) unless valid_column($model, $field);
 
         my @values;
 
@@ -749,12 +773,12 @@
 
 =head2 list_actions
 
-Returns a list of all actions allowed to the current user. (Canonicalizes Perl::Style to Everything.Else.Style).
+Returns a list of all actions visible to the current user. (Canonicalizes Perl::Style to Everything.Else.Style).
 
 =cut
 
 sub list_actions {
-    list(['action'], map {s/::/./g; $_} Jifty->api->actions);
+    list(['action'], map {s/::/./g; $_} Jifty->api->visible_actions);
 }
 
 =head2 list_action_params
@@ -767,6 +791,7 @@
 
 our @param_attrs = qw(
     name
+    documentation
     type
     default_value
     label

Modified: jifty/branches/jquery/lib/Jifty/Plugin/SQLQueries.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Plugin/SQLQueries.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Plugin/SQLQueries.pm	Mon Jan 28 07:01:59 2008
@@ -6,6 +6,7 @@
 
 our @requests;
 our @slow_queries;
+our @halo_queries;
 
 =head1 NAME
 
@@ -102,7 +103,7 @@
     my $cgi = shift;
 
     my $total_time = 0;
-    my @log = Jifty->handle->sql_statement_log();
+    my @log = (splice @halo_queries), Jifty->handle->sql_statement_log();
     for (@log) {
         my ($time, $statement, $bindings, $duration, $results) = @$_;
 
@@ -129,6 +130,45 @@
     };
 }
 
+=head2 halo_pre_template
+
+Log any queries made to the previous template. Also, keep track of whatever
+queries made so the rest of the plugin can see them (since we clear the log)
+
+=cut
+
+sub halo_pre_template {
+    my $self = shift;
+    my $halo = shift;
+    my %args = @_;
+
+    push @{ $args{previous}{sql_statements} }, Jifty->handle->sql_statement_log;
+    push @halo_queries, Jifty->handle->sql_statement_log;
+
+    Jifty->handle->clear_sql_statement_log;
+}
+
+=head2 halo_post_template
+
+Log any queries made to the current template. Also, keep track of whatever
+queries made so the rest of the plugin can see them (since we clear the log)
+
+XXX: can this somehow be refactored into one function? If the same pattern
+occurs elsewhere I'll look into it.
+
+=cut
+
+sub halo_post_template {
+    my $self = shift;
+    my $halo = shift;
+    my %args = @_;
+
+    push @{ $args{frame}{sql_statements} }, Jifty->handle->sql_statement_log;
+    push @halo_queries, Jifty->handle->sql_statement_log;
+
+    Jifty->handle->clear_sql_statement_log;
+}
+
 =head1 COPYRIGHT AND LICENSE
 
 Copyright 2007 Best Practical Solutions

Modified: jifty/branches/jquery/lib/Jifty/Record.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Record.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Record.pm	Mon Jan 28 07:01:59 2008
@@ -853,4 +853,46 @@
     return \%data;
 }
 
+=head2 autogenerate_action
+
+Controls which of the L<Jifty::Action::Record> subclasses are
+automatically set up for this model; this subroutine is passed one of
+the strings C<Create>, C<Update>, C<Delete> or C<Search>, and should
+return a true value if that action should be autogenerated.
+
+The default method returns 0 for all action classes if the model is
+marked as L</is_private>.  It returns 0 for all actions that are not
+C<Search> if the model is marked as L</is_protected>; otherwise, it
+returns true.
+
+=cut
+
+sub autogenerate_action {
+    my $class = shift;
+    my($action) = @_;
+
+    return 0 if $class->is_private;
+    return 0 if $class->is_protected and $action ne "Search";
+
+    return 1;
+}
+
+=head2 is_private
+
+Override this method to return true to not generate any actions for
+this model, and to hide it from REST introspection.
+
+=cut
+
+sub is_private { 0 }
+
+=head2 is_protected
+
+Override this method to return true to only generate Search actions
+for this model.
+
+=cut
+
+sub is_protected { return shift->is_private }
+
 1;

Modified: jifty/branches/jquery/lib/Jifty/Result.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Result.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Result.pm	Mon Jan 28 07:01:59 2008
@@ -53,7 +53,8 @@
 
 sub success {
     my $self = shift;
-    return not $self->failure(map {not $_} @_);
+    return 0 if $self->failure(map {not $_} @_);
+    return 1;
 }
 
 =head2 action_class [MESSAGE]

Modified: jifty/branches/jquery/lib/Jifty/TestServer.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/TestServer.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/TestServer.pm	Mon Jan 28 07:01:59 2008
@@ -6,7 +6,9 @@
 use Test::Builder;
 my $Tester = Test::Builder->new;
 
-my $INC = [grep { defined } map { File::Spec->rel2abs($_) } @INC ];
+# explicitly ignore ClassLoader objects in @INC,
+# which'd be ignored in the end, though.
+my $INC = [grep { defined } map { File::Spec->rel2abs($_) } grep { !ref } @INC ];
 my @perl = ($^X, map { "-I$_" } @$INC);
 
 =head1 NAME

Modified: jifty/branches/jquery/lib/Jifty/Web.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Web.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Web.pm	Mon Jan 28 07:01:59 2008
@@ -46,7 +46,6 @@
     behaviour.js
     formatDate.js
     template_declare.js
-    loc.js
     jifty.js
     jifty_utils.js
     jifty_subs.js
@@ -358,6 +357,7 @@
                         . $request_action->class
                         . "'" );
                 Carp::cluck;
+                $self->log->error("NOTICE! A cross-site scriptng security fix has been installed so that actions are now by default DENIED during GET requests. You must specifically whitelist safe actions using this in your dispatcher: before '*' => run { Jifty->api->allow('SafeAction') }; - We apologize for the inconvenience.");
                 push @denied_actions, $request_action;
                 next;
             }

Modified: jifty/branches/jquery/lib/Jifty/Web/Menu.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Web/Menu.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Web/Menu.pm	Mon Jan 28 07:01:59 2008
@@ -1,5 +1,9 @@
 package Jifty::Web::Menu;
 
+use strict;
+use warnings;
+
+
 use base qw/Class::Accessor::Fast/;
 use URI;
 use Scalar::Util qw(weaken);
@@ -372,21 +376,39 @@
     my %args = ( class => 'yuimenu', first => 0, id => undef, @_ );
     my @kids = $self->children or return;
     
+    # Add the appropriate YUI class to each kid
+    for my $kid ( @kids ) {
+        # Skip it if it's a group heading
+        next if $kid->render_children_inline and $kid->children;
+
+        # Figure out the correct object to be setting the class on
+        my $object =   ( defined $kid->link
+                     and ref $kid->link
+                     and $kid->link->can('class') )
+                         ? $kid->link : $kid;
+
+        my $class = defined $object->class ? $object->class . ' ' : '';
+        $class .= "$args{class}itemlabel";
+        $object->class( $class );
+    }
+
+    # We're rendering this inline, so just render a UL (and any submenus as normal)
     if ( $self->render_children_inline ) {
         Jifty->web->out( $args{'first'} ? '<ul class="first-of-type">' : '<ul>' );
         for my $kid ( @kids ) {
-            Jifty->web->out( qq{<li class="${class}item } . ($kid->active? 'active' : '') . qq{">});
+            Jifty->web->out( qq(<li class="$args{class}item ) . ($kid->active? 'active' : '') . qq{">});
             Jifty->web->out( $kid->as_link );
             $kid->_render_as_yui_menu_item( class => 'yuimenu' );
             Jifty->web->out( qq{</li>});
         }
         Jifty->web->out('</ul>');
     }
+    # Render as normal submenus
     else {
         Jifty->web->out(
             qq{<div}
             . ($args{'id'} ? qq( id="$args{'id'}") : "")
-            . qq{ class="$class"><div class="bd">}
+            . qq( class="$args{class}"><div class="bd">)
         );
 
         my $count    = 1;
@@ -394,6 +416,9 @@
         my $openlist = 0;
 
         for my $kid ( @kids ) {
+            # We want to render the children of this child inline, so close
+            # any open <ul>s, render it as an <h6>, and then render it's
+            # children.
             if ( $kid->render_children_inline and $kid->children ) {
                 Jifty->web->out('</ul>') if $openlist;
                 
@@ -412,12 +437,13 @@
                 $openlist = 0;
                 $count_h6++;
             }
+            # It's a normal child
             else {
                 if ( not $openlist ) {
                     Jifty->web->out( $count == 1 ? '<ul class="first-of-type">' : '<ul>' );
                     $openlist = 1;
                 }
-                Jifty->web->out( qq{<li class="${class}item } . ($kid->active? 'active' : '') . qq{">});
+                Jifty->web->out( qq(<li class="$args{class}item ) . ($kid->active? 'active' : '') . qq{">});
                 Jifty->web->out( $kid->as_link );
                 $kid->_render_as_yui_menu_item( class => 'yuimenu' );
                 Jifty->web->out( qq{</li>});

Modified: jifty/branches/jquery/lib/Jifty/Web/Session.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Web/Session.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Web/Session.pm	Mon Jan 28 07:01:59 2008
@@ -304,7 +304,7 @@
     $conts->limit( column => "session_id", value => $self->id );
 
     my %continuations;
-    $continuations{ $_->key } = $_->value while $_ = $conts->next;
+    $continuations{ $_->data_key } = $_->value while $_ = $conts->next;
     return %continuations;
 }
 

Modified: jifty/branches/jquery/share/web/static/css/halos.css
==============================================================================
--- jifty/branches/jquery/share/web/static/css/halos.css	(original)
+++ jifty/branches/jquery/share/web/static/css/halos.css	Mon Jan 28 07:01:59 2008
@@ -1,3 +1,28 @@
+.halo {
+    border-color: #ffd700;
+    border-style: solid;
+    border-width: 0;
+    margin: 0;
+}
+
+.halo_header {
+    display: none;
+    border-bottom: 1px dashed #ffd700;
+    background: #fff;
+}
+
+.halo_rendermode {
+    float: right;
+}
+
+.halo_source, .halo_perl {
+    font-family: monospace;
+}
+
+.halo_perl {
+    display: none;
+}
+
 .halo_actions {
     position: fixed;
     border: 1px solid black;
@@ -96,7 +121,7 @@
 
 #render_info {
     position: fixed;
-    right:0.5em;
+    right:.5em;
     bottom:0;
 }
 

Modified: jifty/branches/jquery/share/web/static/js/halo.js
==============================================================================
--- jifty/branches/jquery/share/web/static/js/halo.js	(original)
+++ jifty/branches/jquery/share/web/static/js/halo.js	Mon Jan 28 07:01:59 2008
@@ -1,4 +1,5 @@
 var halo_shown = null;
+var halos_drawn = null;
 
 var halo_top;
 var halo_left;
@@ -62,3 +63,74 @@
     window.style.width = newWidth;
     grip.xFrom = x;
 }
+
+function draw_halos() {
+    var halo_header_display = 'none';
+    var halo_border_width   = '0';
+    var halo_margin         = '0';
+
+    halos_drawn = !halos_drawn;
+
+    if (halos_drawn) {
+        halo_header_display = 'block';
+        halo_border_width   = '1px';
+        halo_margin         = '2px';
+    }
+
+    YAHOO.util.Dom.getElementsByClassName("halo_header", null, null,
+        function (e) {
+            e.style.display = halo_header_display;
+        }
+    );
+
+    YAHOO.util.Dom.getElementsByClassName("halo", null, null,
+        function (e) {
+            e.style.borderWidth = halo_border_width;
+            e.style.margin = halo_margin;
+        }
+    );
+}
+
+function render_info_tree() {
+    Element.toggle("render_info_tree");
+}
+
+function halo_render(id) {
+    halo_reset(id);
+    $('halo-button-render-'+id).style.fontWeight = 'bold';
+
+    var e = $('halo-inner-'+id);
+    if (e.halo_rendered) {
+        e.innerHTML = e.halo_rendered;
+        e.halo_rendered = null;
+    }
+}
+
+function halo_source(id) {
+    halo_reset(id);
+    $('halo-button-source-'+id).style.fontWeight = 'bold';
+
+    var e = $('halo-inner-'+id);
+    if (!e.halo_rendered) {
+        e.halo_rendered = e.innerHTML;
+        e.innerHTML = '<div class="halo_source">' + e.innerHTML.escapeHTML() + '</div>';
+    }
+}
+
+function halo_perl(id) {
+    halo_reset(id);
+    $('halo-button-perl-'+id).style.fontWeight = 'bold';
+    $('halo-inner-'+id).style.display   = 'none';
+    $('halo-perl-'+id).style.display    = 'block';
+
+}
+
+function halo_reset(id) {
+    $('halo-button-perl-'+id).style.fontWeight   = 'normal';
+    $('halo-button-source-'+id).style.fontWeight = 'normal';
+    $('halo-button-render-'+id).style.fontWeight = 'normal';
+
+    $('halo-inner-'+id).style.display     = 'block';
+    $('halo-perl-'+id).style.display      = 'none';
+}
+

Modified: jifty/branches/jquery/share/web/templates/__jifty/halo
==============================================================================
--- jifty/branches/jquery/share/web/templates/__jifty/halo	(original)
+++ jifty/branches/jquery/share/web/templates/__jifty/halo	Mon Jan 28 07:01:59 2008
@@ -1,4 +1,7 @@
-<div><a href="#" id="render_info" onclick="Element.toggle('render_info_tree'); return false"><%_('Page info')%></a></div>
+<div id="render_info">
+    <a href="#" onclick="draw_halos(); return false"><%_('Draw halos')%></a>
+    <a href="#" onclick="render_info_tree(); return false"><%_('Page info')%></a>
+</div>
 <div style="display: none" id="render_info_tree">
 % foreach my $item (@stack) {
 %     if ( $item->{depth} > $depth ) {
@@ -142,7 +145,7 @@
 @args = sort {$a->[0] cmp $b->[0]} @args;
 
 my $prev = '';
-my @stmts = @{$frame->{'sql_statements'}};
+my @stmts = @{$frame->{'sql_statements'} || []};
 
 </%init>
 </%def>

Modified: jifty/branches/jquery/t/Continuations/lib/Continuations/Dispatcher.pm
==============================================================================
--- jifty/branches/jquery/t/Continuations/lib/Continuations/Dispatcher.pm	(original)
+++ jifty/branches/jquery/t/Continuations/lib/Continuations/Dispatcher.pm	Mon Jan 28 07:01:59 2008
@@ -1,6 +1,12 @@
 package Continuations::Dispatcher;
 use Jifty::Dispatcher -base;
 
+# whitelist these read-only actions
+before '*' => run {
+    Jifty->api->allow('GetGrail');
+    Jifty->api->allow('CrossBridge');
+};
+
 my $before = 0;
 before '/tutorial' => run {
     unless (Jifty->web->session->get('got_help')) {

Added: jifty/branches/jquery/t/Mapper/lib/Mapper/Dispatcher.pm
==============================================================================
--- (empty file)
+++ jifty/branches/jquery/t/Mapper/lib/Mapper/Dispatcher.pm	Mon Jan 28 07:01:59 2008
@@ -0,0 +1,12 @@
+#!/usr/bin/env perl
+package Mapper::Dispatcher;
+use Jifty::Dispatcher -base;
+
+before '*' => run {
+    Jifty->api->allow('GetGrail');
+    Jifty->api->allow('CrossBridge');
+};
+
+
+1;
+

Modified: jifty/branches/jquery/t/TestApp-Plugin-Chart/etc/config.yml
==============================================================================
--- jifty/branches/jquery/t/TestApp-Plugin-Chart/etc/config.yml	(original)
+++ jifty/branches/jquery/t/TestApp-Plugin-Chart/etc/config.yml	Mon Jan 28 07:01:59 2008
@@ -15,7 +15,7 @@
     RecordUUIDs: active
     User: ''
     Version: 0.0.1
-  DevelMode: 1
+  DevelMode: 0
   L10N: 
     PoDir: share/po
   LogLevel: INFO

Modified: jifty/branches/jquery/t/TestApp-Plugin-OAuth/etc/config.yml
==============================================================================
--- jifty/branches/jquery/t/TestApp-Plugin-OAuth/etc/config.yml	(original)
+++ jifty/branches/jquery/t/TestApp-Plugin-OAuth/etc/config.yml	Mon Jan 28 07:01:59 2008
@@ -14,7 +14,7 @@
     RecordBaseClass: Jifty::DBI::Record::Cachable
     User: ''
     Version: 0.0.1
-  DevelMode: 1
+  DevelMode: 0
   L10N: 
     PoDir: share/po
   LogLevel: INFO

Modified: jifty/branches/jquery/t/TestApp-Plugin-PasswordAuth/t/01-tokengen.t
==============================================================================
--- jifty/branches/jquery/t/TestApp-Plugin-PasswordAuth/t/01-tokengen.t	(original)
+++ jifty/branches/jquery/t/TestApp-Plugin-PasswordAuth/t/01-tokengen.t	Mon Jan 28 07:01:59 2008
@@ -13,7 +13,7 @@
 use lib 't/lib';
 use Jifty::SubTest;
 
-use Jifty::Test tests => 6;
+use Jifty::Test tests => 5;
 use Jifty::Test::WWW::Mechanize;
 
 my $server  = Jifty::Test->make_server;
@@ -26,8 +26,7 @@
 
 # {{{ Get token for logging in with a JS-based md5-hashed password
 my $service='/__jifty/webservices/yaml';
-my $service_request ="$URL$service?J:A-moniker=GeneratePasswordToken&J:A:F-email-moniker=gooduser\@example.com"; 
-$mech->get_ok($service_request, "Token-generating webservice $service_request exists");
+$mech->post("$URL/$service", {"J:A-moniker" => "GeneratePasswordToken", "J:A:F-email-moniker" => 'gooduser at example.com'});
 
 # XXX needs to be more precise in checking for the token, but this works
 # as long as we're using time() for the token

Modified: jifty/branches/jquery/t/TestApp-Plugin-REST/lib/TestApp/Plugin/REST/Dispatcher.pm
==============================================================================
--- jifty/branches/jquery/t/TestApp-Plugin-REST/lib/TestApp/Plugin/REST/Dispatcher.pm	(original)
+++ jifty/branches/jquery/t/TestApp-Plugin-REST/lib/TestApp/Plugin/REST/Dispatcher.pm	Mon Jan 28 07:01:59 2008
@@ -1,4 +1,8 @@
 package TestApp::Plugin::REST::Dispatcher;
 use Jifty::Dispatcher -base;
 
+before '*' => run {
+    Jifty->api->allow('DoSomething');
+};
+
 1;

Modified: jifty/branches/jquery/t/TestApp/etc/config.yml
==============================================================================
--- jifty/branches/jquery/t/TestApp/etc/config.yml	(original)
+++ jifty/branches/jquery/t/TestApp/etc/config.yml	Mon Jan 28 07:01:59 2008
@@ -1,4 +1,7 @@
 ---
+framework:
+    DevelMode: 0
+
 application:
     ThisConfigFile: etc/config.yml
     EtcConfig: 1

Modified: jifty/branches/jquery/t/TestApp/t/05-editactions-Cachable.t
==============================================================================
--- jifty/branches/jquery/t/TestApp/t/05-editactions-Cachable.t	(original)
+++ jifty/branches/jquery/t/TestApp/t/05-editactions-Cachable.t	Mon Jan 28 07:01:59 2008
@@ -7,7 +7,7 @@
 use Jifty::SubTest;
 BEGIN { $ENV{'JIFTY_CONFIG'} = 't/config-Cachable' }
 
-use Jifty::Test tests => 8;
+use Jifty::Test tests => 7;
 use Jifty::Test::WWW::Mechanize;
 
 # Make sure we can load the model
@@ -31,7 +31,14 @@
 my $mech    = Jifty::Test::WWW::Mechanize->new();
 
 # Test action to update
-$mech->get_ok($URL.'/editform?J:A-updateuser=TestApp::Action::UpdateUser&J:A:F:F-id-updateuser=1&J:A:F-name-updateuser=edituser&J:A:F-email-updateuser=newemail at example.com', "Form submitted");
+$mech->post($URL.'/editform', {
+    'J:A-updateuser' => 'TestApp::Action::UpdateUser',
+    'J:A:F:F-id-updateuser' => 1,
+    'J:A:F-name-updateuser' => 'edituser',
+    'J:A:F-email-updateuser' => 'newemail at example.com',
+    'J:A:F-tasty-updateuser' => '0'
+}, "Form submitted");
+
 undef $o;
 $o = TestApp::Model::User->new(current_user => $system_user);
 $o->flush_cache;

Modified: jifty/branches/jquery/t/TestApp/t/05-editactions-Record.t
==============================================================================
--- jifty/branches/jquery/t/TestApp/t/05-editactions-Record.t	(original)
+++ jifty/branches/jquery/t/TestApp/t/05-editactions-Record.t	Mon Jan 28 07:01:59 2008
@@ -7,7 +7,7 @@
 use Jifty::SubTest;
 BEGIN { $ENV{'JIFTY_CONFIG'} = 't/config-Record' }
 
-use Jifty::Test tests => 11;
+use Jifty::Test tests => 10;
 use Jifty::Test::WWW::Mechanize;
 # Make sure we can load the model
 use_ok('TestApp::Model::User');
@@ -32,7 +32,14 @@
 my $mech    = Jifty::Test::WWW::Mechanize->new();
 
 # Test action to update
-$mech->get_ok($URL.'/editform?J:A-updateuser=TestApp::Action::UpdateUser&J:A:F:F-id-updateuser=1&J:A:F-name-updateuser=edituser&J:A:F-email-updateuser=newemail at example.com&J:A:F-tasty-updateuser=0', "Form submitted");
+$mech->post($URL.'/editform', {
+    'J:A-updateuser' => 'TestApp::Action::UpdateUser',
+    'J:A:F:F-id-updateuser' => 1,
+    'J:A:F-name-updateuser' => 'edituser',
+    'J:A:F-email-updateuser' => 'newemail at example.com',
+    'J:A:F-tasty-updateuser' => '0'
+}, "Form submitted");
+
 undef $o;
 $o = TestApp::Model::User->new(current_user => $system_user);
 $o->load($id);

Modified: jifty/branches/jquery/t/TestApp/t/15-template-subclass.t
==============================================================================
--- jifty/branches/jquery/t/TestApp/t/15-template-subclass.t	(original)
+++ jifty/branches/jquery/t/TestApp/t/15-template-subclass.t	Mon Jan 28 07:01:59 2008
@@ -59,7 +59,7 @@
 sub in_region {
     qq|<script type="text/javascript">
 new Region('$_[0]',{},'$_[1]',null);
-</script><div id="region-$_[0]">$_[2]</div>|;
+</script><div id="region-$_[0]" class="jifty-region">$_[2]</div>|;
 }
 
 plan tests => 2 + scalar(@tests) * 2;

Modified: jifty/branches/jquery/t/TestApp/t/16-template-region.t
==============================================================================
--- jifty/branches/jquery/t/TestApp/t/16-template-region.t	(original)
+++ jifty/branches/jquery/t/TestApp/t/16-template-region.t	Mon Jan 28 07:01:59 2008
@@ -14,7 +14,7 @@
 <span>1</span>
 <span>2</span><script type="text/javascript">
 new Region('special',{'id':3},'/foo/item',null);
-</script><div id="region-special">
+</script><div id="region-special" class="jifty-region">
 <span>3</span></div>|
     },
 


More information about the Jifty-commit mailing list