[Catalyst] New plugin: Catalyst::Plugin::Devel::ModuleVersions

2008-07-03 Thread Andreas Marienborg

Hello


I needed to compare version numbers on two different systems, and  
after some light conversation on IRC, the following plugin emerged.


It basically appends another section to the debug-screen that shows  
you each module loaded with version.



http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Plugin-Devel-ModuleVersions/1.000/trunk/


There is also a version appearing on a CPAN mirror close to you soon.


Feedback welcome :p


- andreas


___
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] Suggestions for CatalystX::Installer

2008-05-14 Thread Andreas Marienborg


On May 14, 2008, at 7:16 AM, Paul Cain wrote:


I've been examining everything, and was ponder about a few things:

PAR looks like a great way to archive a Catalyst app, but it doesn't
look like it is possible to un-archive it to where it is back to its
original state in case some changes need to be made. Of course, that
could be accomplished with a tar.gz file(created by make dist). I'm
not sure if that is really a problem or not.

It appears that all that CatalystX::Installer should need to deploy a
database is a valid schema.

After getting a list of required modules(using Module::ScanDeps), do I
just add them to makefile.PL?



I would say that making sure the deps are correct would not be the job  
of CatalystX::Installer, but the developer of the app.


What I hope CatalystX::Installer will be, is something that I can use  
in my apps to make them easier to set up for people installing the app.


This for me includes:

- dependency handling
any deps the app needs, that isn't available, or the wrong version  
should be installed / helped installed. For instance, a debian user  
might want suggestions for debian packages to install (quite large  
scope :p) For me it should not infer deps automaticly at this time,  
that the developer should do before releasing his app.


- app configuration
Databases, paths, etc. This needs to be very customizable/pluggable.  
For instance in easycms2, I have a config setting for what resizes to  
make of pictures. It would be classy if I could easily map this to  
some webform using CatalystX::Installer :p


- schema deployment / upgrades
Deploy or upgrade the given database-configuration. This sort of  
infers that the CatalystX::Installer also can be used for upgrades :p


- example configurations
For apache, lighty, nginx, perlbal(?), http-server, fastcgi etc.
Perhaps it could even go as far as trying to put config under the  
propper /etc/apache/conf-enabled or whatever (this becomes distro- 
specific, and probably needs to be pluggable)


- Running tests.
This I think is a cool idea, to optionally run tests against the  
finished setup. The author should perhaps specify which tests to run



- andreas


___
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] Controlling Location of Footer On Page

2008-05-13 Thread Andreas Marienborg


On May 14, 2008, at 12:11 AM, Robert L Cochran wrote:

I have a database table with 11,929 rows. When these rows are  
displayed

as part of an html table, I notice that the footer seems stuck at
approximately line 20 of the web page, and the the table content
continues (to the true end of the table, 11,909 or so rows later.) I
looked at the ttsite.css code for the footer is keeping the footer
"stuck" to output row 20 or so because of the 'position: absolute'
property.

It seems to me that for long streams of tabular output like this there
are two solutions:

1. Use breadcrumb trails to break the result set into separate  
physical

web pages.

2. Position the footer at the true end of the table just before the
 tag.

How can I fix the css so the footer displays properly?



The natural thing to do would be to use paging for instance, to split  
it into pages of 20 each or something.


If you want the footer to come at the end of your document, make sure  
the DOM node is at the end, and remove the position: absolute from the  
css. If the footer isn't at the end of the document, there really  
isn't any CSS-way to move it there


- andreas

___
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] session in DB example in Catalyst book

2008-05-11 Thread Andreas Marienborg


On May 11, 2008, at 7:14 AM, Andrew wrote:

And I'm doing everything exactly as the book states except the  
config change of putting the database path in the YAML file - it's  
still in the AddressDB.pm file.


I looked in the DBIC.pm file which is generating the error message  
and the method that is causing the error is below:


sub session_store_model {
   my ($c, $id) = @_;

   my $dbic_class = $c->session_store_dbic_class;
   $c->model($dbic_class, $id) or die "Couldn't find a model named  
$dbic_class";

}

My question is where does $c->session_store_dbic_class come from?   
Is it a class that I'm suppose to define or is it a class that is  
suppose to be included in the DBIC module?




It is a config setting:

http://cpansearch.perl.org/~danieltwc/Catalyst-Plugin-Session-Store-DBIC-0.06/lib/Catalyst/Plugin/Session/Store/DBIC.pm#session_store_dbic_class

- andreas



___
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] session in DB example in Catalyst book

2008-05-09 Thread Andreas Marienborg


On May 10, 2008, at 3:53 AM, Andrew wrote:

Using the Rockway's Catalyst book to help bring me up to speed on  
Catalyst and I've got a problem that I can't figure out.


On page 59, where it uses a database to store the session key, I've  
made all the code changes, but when I start the server it gives me  
the following error:


"Couldn't find a model named DBIC::Session at /usr/local/share/perl/ 
5.8.8/Catalyst/Plugin/Session/Store/DBIC.pm line 143.
Compilation failed in require at script/addressbook_server.pl line  
53."


You don't seem to have the Model you configured the session store to  
use. Do you have the MyApp/Model/DBIC/Session.pm file?



- andreas___
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] CSS file how to?

2008-05-09 Thread Andreas Marienborg
If what you want is to serve the css-file as an external css-file, and  
link it from your html with , then I would  
put it under /root/static/main.css


and serve it using Static::Simple (which is the default for /static/)

- andreas

On May 9, 2008, at 8:06 PM, gaurav001 wrote:



THanks for quick reply...
yes, i could see css file in text format in browser...
but any how i made it using [% PROCESS course/static.css %] in tt2  
file

you have any better idea?
thanks


Mitch Jackson wrote:


When you try to visit the css file in the browser, what kind of  
output

do you get?
http://localhost:3000/src/course/static.css

/Mitchell Jackson

On Fri, May 9, 2008 at 10:27 AM, gaurav001 <[EMAIL PROTECTED]>  
wrote:


Hello Gurus,
I am facing problem defining CSS file.
my view.fb file is

name: Overview
method: post
stylesheet: 'http://localhost:3000/src/course/static.css',

and CSS file is like this::


.fb_menutitle{
cursor:pointer;
margin-bottom: 5px;
background-color:#33;
color:#00;
width:140px;
padding:2px;
text-align:center;
font-weight:bold;
/*/*/border:1px solid #00;/* */
}

.fb_submenu{
margin-bottom: 0.5em;
background-color:#FFCC66;
color:#00;
width:140px;
padding:2px;
}

.fb_content{
position: absolute;
left: 200px;
top: 50px;
}

.fb_rightcontent{
position: absolute;
left: 775px;
top: 50px;
}

=
I defined correctly in HTML file...it doesnt call my static.css
file...how
can i ?

Plz help me
Thank you



--
View this message in context:
http://www.nabble.com/CSS-file-how-to--tp17150479p17150479.html
Sent from the Catalyst Web Framework mailing list archive at  
Nabble.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/



___
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/




--
View this message in context: 
http://www.nabble.com/CSS-file-how-to--tp17150479p17153401.html
Sent from the Catalyst Web Framework mailing list archive at  
Nabble.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/



___
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] More Catalyst Template Toolkit examples?

2008-05-03 Thread Andreas Marienborg


On May 3, 2008, at 3:52 AM, Ryan Grace wrote:


Hi All,

I'm working my way through the Catalyst tutorial and am currently in  
Part* Advanced CRUD.  In this section HTML::Widget is introduced,  
along with examples of using TT2 with H::W.


One line in an example of a TT2 template near the bottom of the page  
uses:


[% FOREACH element = widget_result.elements %]


I'm having a hard time figuring this out because I can't find  
mention of the

.elements method anywhere.

Does someone have a pointer to more advanced examples of using TT2  
with H::W and Catalyst?


Or a pointer to documentation about the available options in  
C::P::H::W?  .elements isn't mentioned in the H::W documentation  
anywhere that I can find.


Your widget_result is an object of the class HTMl::Widget::Result.

http://cpansearch.perl.org/~cfranks/HTML-Widget-1.11/lib/HTML/Widget/Result.pm#elements

I would recommend trying to use for instance HTML::FormFu instead of  
HTML::Widget, as HTML::Widget is no longer activly maintained



- andreas

___
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: How to print/display some data in an end action

2008-05-01 Thread Andreas Marienborg


On Apr 30, 2008, at 4:16 PM, Emmanuel Quevillon wrote:


Aristotle Pagaltzis wrote:

* Emmanuel Quevillon <[EMAIL PROTECTED]> [2008-04-30 15:05]:

Catalyst always try to wrap the action result 'display' into a
template.

No, it doesn’t. If that happens in your app, then you have set it
up to happen like that. But the code you pasted does not include
that portion, so no one will be able tell you what to do instead.
Regards,



Thanks Aristotle,


Maybe I can clarify the situation.

In controller Foo I have 2 methods:

sub bar : LocalRegex ('^(\d+)$') {

   my($self, $c) = @_;

   my $id = $c->req->captures->[0];
   $c->detach(qw/Root _softwareError/,
  ["An id is required to get related genes."])
 unless $id;

   $c->stash()->{url}  = $c->uri_for("/admin/rg/$id");
   $c->stash()->{template} = 'admin/relatedgenes.tt2';
   $c->detach('View::TT');

}

sub rg : Local : Args(1) {


   my($self, $c) = @_;

   my $id = $c->req->args->[0];
   $c->detach(qw/Root _softwareError/,
  ["An id is required to get related genes."])
 unless $id;

   my $gr = GeneRelations->new(
   %{$c->config()->{dbinfos}},
   org  => $c->session()->{org}->{id_org},
  );

   my $t = $gr->display_graph(type => 'id_gene', value => $id);
   $c->res->write($t);
   $c->forward('Root', 'end');

}


Template 'admin/relatedgenes.tt2' contains an  tag as :



with [% url %] value coming from 'Foo::bar'
here: http:///rg/">

I know that  tag can contain an url to be call on load, and  
that's what I want to do with My app to avoid storing svg files. If  
I put url for a svg image it works fine. But I don't want to store  
temp files.


I hope the situation will be clearer like this and someone will be  
able to give clues or solutions.



Most likely your Root's end action forwards to a view. If you use the  
RenderView action-class, it shouldn't do that if the body is set.


I would change the rg actions last few lines to something like this:


$c->res->body($t);
$c->res->content_type('your/content-type');
}

No point in forwarding to end, since that is done automaticly.

If you don't use RenderView, you need to post your roots end action if  
we are to help you figure out whats up there.


- andreas


___
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] How to print/display some data in an end action

2008-04-30 Thread Andreas Marienborg


On Apr 30, 2008, at 11:51 AM, Emmanuel Quevillon wrote:


Hi,

I'd like to incorporate an action into an  tag that only  
prints some data (XML SVG).

I have an action in a controller Foo that do this :

sub display : Local : Args(1) {
   
   my $t = $object->display_graph();
   $c->detach('Foo', 'end', [$t]);
}

sub end : Private {
   my($self, $c) = @_;
   my $g = $c->req->args()->[0];
   print $g;
}



Never use print.

use $c->res->write[2], or set $c->res->body[1].


- andreas

[1]: http://cpansearch.perl.org/~mramberg/Catalyst-Runtime-5.7012/lib/Catalyst/Response.pm#$res-%3Ebody(%3C$text 
|$fh|$iofh_object)

[2]: 
http://cpansearch.perl.org/~mramberg/Catalyst-Runtime-5.7012/lib/Catalyst/Response.pm#$res-%3Ewrite(_$data_)

___
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] How can it be - wrong model returned?

2008-03-06 Thread Andreas Marienborg

Include the model-name, not only the table

$c->model('DBIC::Pwuser') for instance

- andreas

On Mar 6, 2008, at 12:12 PM, Alex Povolotsky wrote:


Hello!

I've made a simple many-to-many relationship for user/roles  
authentication, and suddenly found that


  my $model = $c->model('Pwuser')->search()->all();
  my $roles = $c->model('Role')->search()->all();
  my $ur = $c->model('UserRole')->search()->all();

results in

SELECT me.uid, me.login, me.password FROM pwuser me:
SELECT me.uid, me.rid FROM user_role me:
SELECT me.uid, me.rid FROM user_role me:

nothing get selected from role table, and $c->model('Role')->search- 
>all selects from wrong table.


How can it be and what can I do?...

Alex.


___
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/



___
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] installing authentication modules

2008-03-05 Thread Andreas Marienborg


On Mar 4, 2008, at 4:01 PM, rahed wrote:


Hi,

I installed Catalyst and other additional modules. When starting
myapp_fastcgi.pl I got the message:

Can't locate Catalyst/Plugin/Authentication/Store/DBIx/Class in @INC.
Actually I had to install Catalyst::Authentication::Store::DBIx::Class
to fix it.

I am a bit perplexed by the docs about authentication/authorization
modules - which should be installed and which are deprecated.



I think its like this.

Catalyst::Plugin::Authentication is good.

Anything else (Store,  Credential etc) should be without Plugin::-part
and you should only load the Catalyst::Plugin::Authentication from  
your application

and then the rest is loaded based on the config

- andreas


___
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] On HTML::FormFu rendering

2008-03-05 Thread Andreas Marienborg


On Mar 5, 2008, at 4:03 PM, Alex Povolotsky wrote:


Hello!

I'm trying to use Catalyst::Controller::HTML::FormFu

Code is quite simple for this time
=== from controller ===
sub add : Local FormConfig {
  my ($self, $c) = @_;
  my $form : Stashed;
}
=== cut ===

=== TT template ===
[% META title = 'Add user' %]
[% Form.render %]
=== cut ===

=== YML template ===
---
elements:
- type: Text
  name: login
  label: 'Login:'
- type: Password
  name: pass1
  label: 'Password:'
- type: Password
  name: pass2
  label: 'Repeat password:'
- type: Submit

=== cut ===

However, form does not get rendered. form.render works, but should  
Form.render be better?


And can I produce much nicer forms as FormBuilder do by default?



Catalyst::Controller::HTML::FormFu puts the form-object in the stash  
variable 'form' by default. Form is not something  
Catalyst::Controller::HTML::FormFu puts in your stash, so unless you  
do that yourself, your problem with Form.render is probably that Form  
is undefined. TT silently ignores undefined.


http://code.google.com/p/html-formfu/source/browse/trunk/HTML-FormFu/examples/

Here are two examples, with CSS, that might help you get started.  
HTML::FormFu attempts to output html that can be flexibly styled using  
CSS.



- andreas


___
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] SQL authentification

2008-02-28 Thread Andreas Marienborg


On Feb 28, 2008, at 5:27 PM, Ferruccio Zamuner wrote:


Genadijus Paleckis wrote:

Hello, I'm new on this list and on Catalyst itself also.

I want to migrate our application to catalyst from cgi and I've  
came to question. Is it possible to authenticate users directly by  
SQL server user base ? I mean to make connection with speciffic  
user and authorization leave to PostgreSQL GRANT's to users/groups?


Thank you.
Actually there is not any  
Catalyst::Plugin::Authentication::Credential::PostgreSQL but it's  
possible to write one as well as another like  
Catalyst::Plugin::Authentication::Credential::IMAPAuth for IMAP  
authentication.


I'm sure that both of them can be usefull.

Hey Cat guys, which is the best fit C::P::Authentication::Credential  
module to start from?


Start with 
http://cpansearch.perl.org/~jayk/Catalyst-Plugin-Authentication-0.10006/lib/Catalyst/Plugin/Authentication/Internals.pod

I'm actually not sure if PostgreSQL and IMAP are stores or  
credentials, but perhas Jay K can chime in with some extra information.


Also, both stores and credentials should no longer be Plugins, but  
live under Catalyst::Authentication::Store and  
Catalyst::Authentication::Credential


- andreas


___
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] debug mode or debug levels?

2008-02-28 Thread Andreas Marienborg
The internal logger is quite "simple" in that it logs with different  
levels, but don't really care much aside from that.


A very common construction in my programs is:

$c->log->debug("amg, nevah show this in prod please") if $c->debug

myapp_server.pl -d only sets $c->debug to true, but the default logger  
doesn't care much.


A good/better alternative comes with Catalyst::Log::Log4perl, which  
converts $c->log into a Log::Log4perl logger (more or less at least),  
which lets you configure at a nice granularity what gets logged where  
and when.



- andreas

On Feb 25, 2008, at 10:25 PM, Tyler Bird wrote:

hi I want to only show certain log messages to my console based on  
the log level 'debug'
I believe catalyst supports log levels, but this doesn't seem to be  
working



if ( $c->is_debug() )
{
  $c->log("log message here..");
}


It seems to be sending the log message no matter if ( $c->is_fatal() )



I even start the server with myapp_server.pl -d debug

What am I missing here does catalyst only have debug log level or  
not debug log level and not log levels in general?


___
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/



___
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] multiple database model support

2008-02-28 Thread Andreas Marienborg

./script/myapp_create.pl model DB1
./script/myapp_create.pl model DB2

add on more options if you want to


- andreas

On Feb 26, 2008, at 11:41 PM, Tyler Bird wrote:


hi

I just developed a catalyst application
and I was wondering how I could get it to support multiple databases.

Instead of just one per application.

Tyler

___
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/



___
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] Catalyst::Authentication::Store::LDAP confusion

2008-02-27 Thread Andreas Marienborg


On Feb 27, 2008, at 7:30 AM, Richardson, Matthew wrote:


Hello,

I am trying to following the documentation from CPAN on this, but I  
am confused. In MyApp.pm I have the following:


use Catalyst qw/-Debug ConfigLoader Static::Simple
Session
Session::State::Cookie
Session::Store::FastMmap
Authentication
Authentication::Store::LDAP
Authentication::Credential::Password/;

However when I start the Catalyst server with myapp_server.pl -r -d - 
k the following is ouput:


...
[debug] Loaded plugins:
..
| Catalyst::Plugin::Authentication   
0.10005  |
|  
Catalyst 
::Plugin::Authentication::Credential::Password |
| Catalyst::Plugin::Authentication::Store::LDAP   
0.0601  |
| Catalyst::Plugin::ConfigLoader   
0.14   |
| Catalyst::Plugin::Session   
0.19|
| Catalyst::Plugin::Session::State::Cookie   
0.09 |
| Catalyst::Plugin::Session::Store::FastMmap   
0.05   |
| Catalyst::Plugin::Static::Simple   
0.19 |

''
...

I don't understand why Catalyst::Plugin::Authentication::Store::LDAP  
(deprecated) is being loaded. My expectation is that  
Catalyst::Authentication::Store::LDAP would be loaded. Where is  
the ::Plugin:: coming from? Do I need to load the  
Catalyst::Authentication::Store::LDAP differently?




Its beeing loading, because you tell Catalyst to load it. The new  
Catalyst::Plugin::Authentication preferes to load its own stores and  
credential-modules, so removing them from the Plugin list is a good  
idea.


(
use Catalyst qw/Debug ConfigLoader Static::Simple
Session
Session::State::Cookie
Session::Store::FastMmap
Authentication/;

might be what you are looking for)


- andreas

___
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] Submitting Multiple Arrays

2008-01-30 Thread Andreas Marienborg

http://cpansearch.perl.org/~jrobinson/DBIx-Class-0.08009/lib/DBIx/Class/Ordered.pm#Unique_Constraints

might be applying to you, and if not, Ordered might help you.

- andreas

On 31. jan.. 2008, at 02.35, Jay Varner wrote:


In short, I'm new to Catalyst and a near intermediate Perl programmer.
I've converted (and vastly improved) my app from CGI::Application to
Catalyst within an amount of time that made me feel like I wasted
those months I spent prior to using Catalyst. However, the past few
days I have been struggling with this one function that I just can't
get.

Honestly, I feel the easiest way for me to explain is to say that this
headache began by me trying to translate this bit of PHP code to
Perl/Catalyst: 
http://www.gregphoto.net/index.php/2007/01/16/scriptaculous-sortables-with-ajax-callback/

I'm just stuck. I've tried many things. My current/pressing attempt to
implement this is in a newsletter app where there is a "has many"
relationship between a Newsletter table and a table for Articles. The
join table has 3 columns – newsletter_id, article_id and ordering. So
I want to use that PHP and Ajax to allow a user to set the order that
articles will appear in a given newsletter. However, some articles
might appear in multiple newsletters. I might be going about this all
wrong and I would love to hear any suggestion of a better way.

For what it is worth, here is my current effort. I don't know if this
is the closest I've gotten, but it's where I'm at right now. This is
not actually my attempt at the the above, it's really just a scaled
back attempt to just figure out the DBIx for it begin sent by a basic
HTML form and not any Ajax shenanigans.

sub reorder : Local {
   my ($self, $c ) = @_;

	# This just gets the the value for the later redirect to stay on  
the same page

my $link = $c->request->params->{link};

	# This is from a hidden value in a loop in the template [%  
article.id %]

my @articles = $c->request->params->{article_id};

	# Value for the newsletter we're working on. Again, this is from a  
hidden value

my $newsletter_id = $c->request->params->{newsletter_id};

	# This is obviously where I start trying shit to see if I can get  
it to work
	# The basic goal is to drop in the new value for ordering for each  
unique

# article_id and newsletter_id in turn
foreach my $article ( @articles ) {
   	my $newsletter  = $c->model('SASSDB::ArticleNewsletter')- 
>search(

   {
   article_id => $article,
   newsletter_id =>  
$newsletter_id

   }
   );
my @orderings = $c->request->params->{ordering};
foreach my $ordering ( @orderings ) {
$newsletter->update(
{
ordering => $ordering
}
);


}
}

	$c->response->redirect($c->uri_for("/admin/newsletters/ 
picked_articles/$link"));


}

This reasonably gives me the following:
DBIx::Class::ResultSet::update(): DBI Exception: DBD::mysql::st
bind_param failed: Illegal parameter number [for Statement "UPDATE
articles_newsletters SET ordering = 1 WHERE ( ( ( article_id = ? ) OR
( article_id = ? ) ) AND newsletter_id = ? )" with ParamValues:
1='12', 0='2', 2='18'] at ../lib/SASS/Controller/Admin/Newsletters.pm
line 200

Line 200 is  "$newsletter->update("

The body_parameters are:
body_parameters  => {
   _submit => "Update",
   _submitted_edit_menu => 1,
   "_submitted_form_create" => 1,
   article_id => [12, 18],
   id => 1,
   "link" => "Test",
   newsletter_id => 1,
   ordering => [1, 2],
 },

Let me know if you want to see anything else.

Humbly placing myself on the mercy of the community,
Jay

___
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/



___
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] javascript in Catalyst using Template Toolkit

2007-12-21 Thread Andreas Marienborg


On 22. des.. 2007, at 06.37, Kieren Diment wrote:



On 22 Dec 2007, at 16:25, John Romkey wrote:

Since uri_for() won't help with static file paths, is there any  
convention for storing the path for static files in the config, or  
getting access to it in some other way?


Actually I've wanted a relative_uri_for() for a while.  Not that  
badly apparently, otherwise I would have established that either a.   
something with this funcitonality already exists, or b.  I would  
have implemented it and sent patches back in.  All it is is the  
relative URI without the host name to be honest, so I guess it would  
be pretty straightforward to implement.




not sure I understand you, but c.uri_for('something/ 
something').path_part (I think that is the name of the method)



- andreas

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


Re: [Catalyst] DBIC ResultSet - what columns in it?

2007-12-18 Thread Andreas Marienborg

Wrong list, but $rs->result_source->columns might give you that?

http://cpansearch.perl.org/~ash/DBIx-Class-0.08008/lib/DBIx/Class/ResultSource.pm#columns


- andreas

On 19. des.. 2007, at 06.09, Silvio Almeida wrote:


I was looking for a way to get column names from a ResultSet.

If I have a table with columns id, to, from, subject which is mapped  
into Email then if I do


$c->model('Email')->{_source_handle}{schema}{source_registrations} 
{Reuniao}{_ordered_columns}


then I get [ qw/ id to from subject / ] indeed, but it would be nice  
to have a simpler method to get there.



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



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


Re: [Catalyst] configurable base url?

2007-12-06 Thread Andreas Marienborg


On 6. des.. 2007, at 18.32, Pablo Collins wrote:


Hi all,

I some catalyst apps whose different versions I'd like to make  
available by base path, like


http://mydomain/myspecialapp/version1.2/
http://mydomain/myspecialapp/version1.3/
etc.

I was planning on using a lighttpd or apache proxy to several  
Catalyst::Engine::HTTP processes running the different versions.  
That part is straightforward.


What I'm hung up on is how to tell catalyst to throw away the / 
myspecialapp/version1.3 part of the url and start the controller  
matching from there. I'd like to not have to change the names and  
namespaces of the controllers based on their versions if possible.


Instead I'd like to be able to put the application root url in the  
config and have it just work.


Is this possible / relatively easy to do?

Thanks much.

-Pablo



Uhm, if you configure your webserver to send /version12/ to one  
instance of HTTP (I would use fastcgi), and then in your application  
use uri_for to generate urls, the root should be set and appended  
automaticly. I rely on this all the time when developing, and it works  
quite nicely, untill someone forgets to use uri_for in one place :)



- andreas

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


Re: [Catalyst] Re: Encoding problem - ?fastcgi?

2007-10-08 Thread Andreas Marienborg
I had some problems with fastcgi and encoding, specificly stuff getting
double encoded when I ran it under fastcgi and apache (external fastcgi
was what I used).

What ended up solving it for me (and breaking it whenever I forgot to
follow the guideline later) was the following

this failed:

$href = {
apejens => "some value",
};

# this worked
$href = {
'apejens' => "some value",
};

So quoting the keys in all hashes worked for me then, which to seems
like a rather magical solution, but I figured I might as well share it
if it somehow helps someone else


- andreas

On Mon, 2007-10-08 at 16:50 +0100, Richard Robinson wrote:
> On Mon, Oct 08, 2007 at 02:07:18PM +0200, A. Pagaltzis wrote:
> > Hi Richard,
> > 
> > did you ever get this sorted? Quoting in full since you seem to
> > have been warnocked. I have no idea what to suggest but am
> > curious about this issue as a matter of personal interest.
> 
> Nice word, I hadn't met it before. Exactly - is no-one else doing this, or
> is everyone else doing it with no problem ?
> 
> No, I haven't got any further, I'm kind of stuck on it. The workaround makes
> it go away for now & there are other things I need to be sorting out too, so
> I'm just kind of waiting for an idea to appear from somewhere ... 
> 
> 
> 
> > * Richard Robinson <[EMAIL PROTECTED]> [2007-09-20 20:15]:
> > > I got my all-singing all-dancing Catalyst app onto a proper
> > > server a few days ago. It's all going much better than I
> > > thought it might, a couple of friendly guinea-pigs, a fine crop
> > > of helpful comments, glitches getting spotted & fixed, a
> > > thriving TODO list ... and one problem which worries me - I
> > > prefer bugs to be in my code, because then I can fix them and
> > > end of story, but I don't think this is.
> > > 
> > > There is a point where I send data out as a variety of other
> > > mime-types. This is either text, in a small range of iso-8859
> > > encodings (I work in utf8 internally, "of course", so this is
> > > encoded specifically). or binary, generated from that text as a
> > > temporary file by external programs and read in from that. This
> > > is output with, eg,
> > > 
> > > $c->res->content_type('application/pdf');
> > > $c->res->body($data);
> > > 
> > > Developing & testing this on my machine at home, this works as
> > > it should. On the remote server, I can view the files directly,
> > > and they're as they should be; I can request the data through
> > > :3000 from script/appname_server.pl, and again, it's correct;
> > > but hand it out through script/appname_fastcgi.pl +
> > > mod_fastcgi/apache and it's broken; each single byte with the
> > > high bit set is replaced by a "0xC3 0xsomethingelse" pair -
> > > it's been recoded into utf8, with values that assume it was
> > > Latin 1 to start with (regardless of anything I put in the
> > > Content-Type). Workaround is to replace the code above with a
> > > redirect to the temporary file, which then goes out through
> > > Static::Simple and arrives uncorrupted.
> > > 
> > > The data leaves my code with the utf8 flag unset, and is
> > > handled properly by C::P::Unicode. So I think it must be in the
> > > fastcgi conversation ? Has anybody else seen this, or have any
> > > ideas ?  I can't see any changes in C::E::FastCGI.pm that offer
> > > any Clue, and I'm really not sure where to go next.
> > > 
> > > System at home, where it doesn't happen, is Apache/2.0.54 with
> > > Catalyst modules from, I think, last January or thereabout (the
> > > new Debian stable caught me by suprise, bringing the home box
> > > up to date is going to be a big job & I have other things I'd
> > > rather be doing).  Remote system, where it does happen, is
> > > Apache/2.2.3 with cpan upgrade a few days ago. mod_fastcgi is
> > > the same on both (2.4.2)
> > 
> > Regards,
> > -- 
> > Aristotle Pagaltzis // 
> > 
> > ___
> > List: Catalyst@lists.scsys.co.uk
> > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> > Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
> > Dev site: http://dev.catalyst.perl.org/
> 


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