Re: [Catalyst] HTML::FormFu form elements

2009-02-12 Thread Jens Schwarz

 I've run into a scenario where I need to be able to build an 
 HTML::FormFu form and then only display portions of it in my template. 
 (So, the typical [% form %] in the template will be replaced by 
 something else, at least in my ideal world.)

What I do in this context:

The template remains untouched. But in my Controller, I manually remove the 
desired elements:

$form-remove_element($form-get_element({ name = 'element_name' }));

Jens
-- 
Jetzt 1 Monat kostenlos! GMX FreeDSL - Telefonanschluss + DSL 
für nur 17,95 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] HTML::FormFu form elements

2009-02-12 Thread onken

On Thu, 12 Feb 2009 09:38:18 +0100, Jens Schwarz blacky6...@gmx.de
wrote:
 I've run into a scenario where I need to be able to build an 
 HTML::FormFu form and then only display portions of it in my template. 
 (So, the typical [% form %] in the template will be replaced by 
 something else, at least in my ideal world.)
 
 What I do in this context:
 
 The template remains untouched. But in my Controller, I manually remove
the
 desired elements:
 
 $form-remove_element($form-get_element({ name = 'element_name' }));
 
 Jens

Did you try

form.get_all_element()? get_element returns top-level elements, only.

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Re: loading data types from Oracle DB with DBIx::Class::Schema::Loader

2009-02-12 Thread Zbigniew Lukasiak
On Wed, Feb 11, 2009 at 1:47 PM, Karl Forner karl.for...@gmail.com wrote:
 I believe I fixed the problem (cf my post bug found in and tentatively
 fixed in DBIx::Class::Schema::Loader::DBI::Oracle::_tables_list in the dbix
 mailing list).

 Here's a copy :

 We had a problem because DBIx::Class::Schema::Loader did not get the
 column_info for our Oracle database : no data_types, is_nullable, default
 etc.. attributes were set.
 We traced the problem down to DBIx::Class::Schema::Loader::
 DBI::Oracle::_tables_list, that changed the table names to lowercase.

 So just commenting the line  69 : $table = lc $table;
 seems to fix the problem.

 The test is either to call the _tables_list and check the table names,
 or to create a schema on a n oracle db using
 DBIx::Class::Schema::Loader::make_schema_at, and to check that the generated
 DBIx::Class objects have
 the column attributes such asdata_type,  default_value , is_nullable ,
 size etc...


 Here are some details:
 DBIx::Class::Schema::Loader $VERSION = '0.04004'
  perl, v5.8.8 built for i486-linux-gnu-thread-multi

 diff:
 --- Oracle.pm2009-02-11 13:35:08.0 +0100
 +++ Oracle.pm.fixed2009-02-11 13:35:04.0 +0100
 @@ -66,7 +66,7 @@
  $table =~ s/\w+\.//;

  next if $table eq 'PLAN_TABLE';
 -$table = lc $table;
 +# $table = lc $table; # removed by kf

Hmm - it was just the first version of that code that I worken on -
but I remember that there some problems when the metadata was saved
under a hash key different from the table name, because it is referred
in other places.   Not that I am sure it applies here - but this might
be something you should  check.



-- 
Zbigniew Lukasiak
http://brudnopis.blogspot.com/
http://perlalchemy.blogspot.com/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] HTML::FormFu form elements

2009-02-12 Thread Carl Franks
2009/2/12 Greg Coates gcoa...@csuchico.edu:
 I've run into a scenario where I need to be able to build an HTML::FormFu
 form and then only display portions of it in my template. (So, the typical
 [% form %] in the template will be replaced by something else, at least in
 my ideal world.)

 I tried doing this in the template:
 [% form.get_element('name' = 'element_name') %]

 I didn't get an error, but it didn't display.

 Does anyone know if what I'm trying to do is possible, and if so, how to do
 it?

[% form.get_field('name') %]

Does exactly what you'd expect.
None of the get_* methods die if there's no elements found.

Please move any further discussion onto the FormFu mailing list - this
has nothing to do with Catalyst
- Cheers,

Carl

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] check_user_roles [ $user ], @roles ?

2009-02-12 Thread Jens Schwarz
  in my Catalyst app I use $c-check_user_roles(qw/Admin/) to determine,
 if the currently logged in user is part of the Admin role. Works fine.
 
  Now I want to check if _another_ (currently _not_ logged in user) is
 part of the Admin role. I read the documentation of
 Catalyst::Plugin::Authorization::Roles and found that check_user_roles can 
 optionally take $user as
 additional parameter. But it does not work as I suspected: With ...
 
  $c-log-info(  . $c-check_user_roles( some_other_user ,
 qw/Admin/ ));
 
  ... Catalyst debug just gives me ...
 
  [debug] Role denied: some_other_user, Admin
  [info] 
 
  ... where I expected something like ...
 
  [info]  1
 
  some_other_user is a username string, in the column username of my
 user table. myapp/myapp.conf ist setup accordingly (i.e.: user_class
 myapp::user and id_field username).
 
  What am I doing wrong?
 
 $c-check_user_roles expects a user object not a username string (how
 would it distinguish a user name from a role name?). You can get a
 user object via $c-find_user.

You mean something like ...

my $foo = $c-find_user({ username = some_other_user }, my_realm);
$c-log-info(  . $c-check_user_roles($foo, qw/Admin/));

?
This gives me nearly the same output as before - i.e.:

[debug] Role denied: 
Catalyst::Authentication::Store::DBIx::Class::User=HASH(0x9abd318), Admin
[info]   

I guess I am misundestanding something. Any hints?
-- 
Jetzt 1 Monat kostenlos! GMX FreeDSL - Telefonanschluss + DSL 
für nur 17,95 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] [OT]? Extends TheSchwartz

2009-02-12 Thread Rodrigo
On Wed, Feb 11, 2009 at 5:38 PM, Lindolfo Lorn Rodrigues
lorn...@gmail.comwrote:

 Hi, sorry for the off-topic but i'm search at google and the uniq list that
 i found ( http://groups.google.com/group/theschwartz ) dont have nothing.
 I need a something like TheSchwartz::Scheduler, i was thinking in change
 TheSchwartz-work method, they will look the time to run a job  and execute
 the job only when is the rigth time
 Does anyone have some tips? I looked at CPAN but dont find anything like
 this.


I've been using TheSchwartz::Moosified in my Catalyst app to schedule jobs.
Something along these lines:

package MyApp::Worker;
use base 'TheSchwartz::Moosified::Worker';
sub work {
my ($class, $job) = @_;
print WORKING:. $job-dump();
$job-completed;
}

package main;
use strict;
require MyApp;
use TheSchwartz::Moosified;
my $client = TheSchwartz::Moosified-new( verbose = 1);
MyApp-model('DBIC')-storage-dbh_do(
sub {
my ($storage, $dbh) = @_;
$client-databases([$dbh]) or die $!;
} );

use Date::Manip; Date_Init( TZ=CET);
## schedule a job
my $job = TheSchwartz::Moosified::Job-new(
funcname = 'MyApp::Worker',
run_after= UnixDate(ParseDate('2009-02-12 13:00:00'), '%s' ),  ##
run_after expects a secs since epoch value
  ## you may also wanna set grabbed_until
arg  = [ foo = 'bar' ],
);
$client-insert($job) or die $!;
$client-can_do('MyApp::Worker');
$client-work();


-rodrigo
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] RFC FYI: HTML::FormFu::ExtJS

2009-02-12 Thread Kevin Monceaux


On Wed, 27 Aug 2008, Moritz Onken wrote:

There is no difference in the form config file. You simply replace 
HTML::FormFu-new with HTML::FormFu::ExtJS-new and you are done.


Does anyone have examples of using HTML::FormFu::ExtJS with Catalyst?  Is 
there a Catalyst::Controller::HTML::FormFu::ExtJS plugin anywhere?  I 
couldn't find one on cpan.  I like the look of the HTML::FormFu::ExtJS 
forms, and being able to activate a WYSIWYG textarea editor with just a:


   - type: Textarea
 attrs_xml:
   wysiwyg: 1

would be really nice.  I tried unsuccessfully to hack 
Catalyst::Controller::HTML::FormFu to use HTML::FormFu::ExtJS.  It doesn't 
seem to be quite as simple as replacing HTML::FormFu-new with 
HTML::FormFu::ExtJS-new.




Kevin
http://www.RawFedDogs.net
http://www.WacoAgilityGroup.org
Bruceville, TX

Si hoc legere scis nimium eruditionis habes.
Longum iter est per praecepta, breve et efficax per exempla!!!


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] RFC FYI: HTML::FormFu::ExtJS

2009-02-12 Thread onken

On Thu, 12 Feb 2009 08:29:37 -0600 (CST), Kevin Monceaux
ke...@rawfeddogs.net wrote:
 On Wed, 27 Aug 2008, Moritz Onken wrote:
 
 There is no difference in the form config file. You simply replace 
 HTML::FormFu-new with HTML::FormFu::ExtJS-new and you are done.
 
 Does anyone have examples of using HTML::FormFu::ExtJS with Catalyst?  Is

 there a Catalyst::Controller::HTML::FormFu::ExtJS plugin anywhere?  I 
 couldn't find one on cpan.  I like the look of the HTML::FormFu::ExtJS 
 forms, and being able to activate a WYSIWYG textarea editor with just a:
 
 - type: Textarea
   attrs_xml:
 wysiwyg: 1
 
 would be really nice.  I tried unsuccessfully to hack 
 Catalyst::Controller::HTML::FormFu to use HTML::FormFu::ExtJS.  It
doesn't 
 seem to be quite as simple as replacing HTML::FormFu-new with 
 HTML::FormFu::ExtJS-new.
 
Hi Kevin,

I'm using HTML::FormFu::ExtJS with Catalyst. But I do not use a custom
controller.

My methods look like

sub form : Local {
  my ($self, $c) = shift;
  my $form = new HTML::FormFu::ExtJS;
  $form-load_config_file(...);
  $form-process($c-req);
  ...


I'd be glad to have a Catalyst::Controller::HTML::FormFu. You can contact
Carl via the html-formfu mailing list and ask what tweaks are necessary.


What kind of error occur when you replace HTML::FormFu-new with 
HTML::FormFu::ExtJS-new in _form?

Cheers,

Moritz

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] RFC FYI: HTML::FormFu::ExtJS

2009-02-12 Thread onken

On Thu, 12 Feb 2009 08:29:37 -0600 (CST), Kevin Monceaux
ke...@rawfeddogs.net wrote:
 
 would be really nice.  I tried unsuccessfully to hack 
 Catalyst::Controller::HTML::FormFu to use HTML::FormFu::ExtJS.  It
doesn't 
 seem to be quite as simple as replacing HTML::FormFu-new with 
 HTML::FormFu::ExtJS-new.
 
 

Have a look at
http://html-formfu.googlecode.com/svn/trunk/Catalyst-Controller-HTML-FormFu-ExtJS/.

There are no tests yet but t/01basic-form.t already passes :-)
(don't run make test, most of them will fail, they are just copied from
C::C::HTML::FormFu)

I'd be glad if you try this out.

Moritz

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] RFC FYI: HTML::FormFu::ExtJS

2009-02-12 Thread Kevin Monceaux

Moritz,

On Thu, 12 Feb 2009, on...@houseofdesign.de wrote:


What kind of error occur when you replace HTML::FormFu-new with
HTML::FormFu::ExtJS-new in _form?


I wasn't getting an error.  It did partially work.  I know pretty much 
nothing about ExtJS.  I think [% form %] was only outputting part of the 
needed JavaScript.  From all the examples I found it looks like the 
JavaScript in question needed to be in the head and my [% form %] was in 
the body.  I moved it into a [% head.extra = BLOCK %] ... [% END %] block, 
which I use to add things to the head section of my wrapper, and think I 
almost had the additional JavaScript that was needed right, but couldn't 
get it to render the form.  And I've since backed out all the ExtJS stuff 
I added to the form.


I'm leaning towards jQuery.  It's masked input plugin works more like I 
prefer than any others I've tried so far.  With a quick search I found a 
WYSIWYG jQuery plugin that I'm trying out now.  After adding the needed 
.js and .css files to the head of the page I added:


 attributes:
class:  wysiwyg

to the form's TextArea element, and:

script type=text/javascript
$(document).ready(function() {
$('.wysiwyg').wysiwyg();
});
/script

to the page and I have a WYSIWYG textarea editor.



Kevin
http://www.RawFedDogs.net
http://www.WacoAgilityGroup.org
Bruceville, TX

Si hoc legere scis nimium eruditionis habes.
Longum iter est per praecepta, breve et efficax per exempla!!!


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] RFC FYI: HTML::FormFu::ExtJS

2009-02-12 Thread onken

On Thu, 12 Feb 2009 09:42:20 -0600 (CST), Kevin Monceaux
ke...@rawfeddogs.net wrote:
 Moritz,
 
 On Thu, 12 Feb 2009, on...@houseofdesign.de wrote:
 
 I wasn't getting an error.  It did partially work.  I know pretty much 
 nothing about ExtJS.  I think [% form %] was only outputting part of the 
 needed JavaScript.  From all the examples I found it looks like the 
 JavaScript in question needed to be in the head and my [% form %] was
in 
 the body.  I moved it into a [% head.extra = BLOCK %] ... [% END %]
block, 
 which I use to add things to the head section of my wrapper, and think
I 
 almost had the additional JavaScript that was needed right, but couldn't 
 get it to render the form.  And I've since backed out all the ExtJS stuff

 I added to the form.
 
 I'm leaning towards jQuery.  It's masked input plugin works more like I 
 prefer than any others I've tried so far.  With a quick search I found a 
 WYSIWYG jQuery plugin that I'm trying out now.  After adding the needed 
 .js and .css files to the head of the page I added:
 
   attributes:
  class:  wysiwyg
 
 to the form's TextArea element, and:
 
 script type=text/javascript
 $(document).ready(function() {
  $('.wysiwyg').wysiwyg();
  });
 /script
 
 to the page and I have a WYSIWYG textarea editor.
 

Try this in your head:

script
Ext.onReady(function(){
var simple = [% form %];
simple.render(document.body);
});
/script




___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] RFC FYI: HTML::FormFu::ExtJS

2009-02-12 Thread Kevin Monceaux

Moritz,

On Thu, 12 Feb 2009, on...@houseofdesign.de wrote:


I'd be glad if you try this out.


It almost works.  The form looks great, but seems to ignore the submit 
button.



Kevin
http://www.RawFedDogs.net
http://www.WacoAgilityGroup.org
Bruceville, TX

Si hoc legere scis nimium eruditionis habes.
Longum iter est per praecepta, breve et efficax per exempla!!!


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Current state of Catalyst::Model::IMAP

2009-02-12 Thread Tomas Doran


On 12 Feb 2009, at 17:56, Alex Povolotsky wrote:

Can anyone tell me about current status of Catalyst::Model::IMAP?


I don't see why this needs a Catalyst specific wrapper?

Surely you pick which ever of Net::IMAP::Client / IMAP::Client /  
Net::IMAP / Net::IMAP::Simple / Email::Folder::IMAP you want to,  
shake the Catalyst::Model::Adaptor stick at it and you're done..


Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Google Summer of Code

2009-02-12 Thread Kieren Diment
Google Summer of Code is Coming again.  Students and mentors are  
encouraged to start thinking about projects etc.


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/