Re: [Catalyst] More detailed proposal for changes related to content negotiation and REST

2013-08-13 Thread Alexander Hartmaier
nse->body( 
>> $c->model('My::Model')->my_method_JSON );
>>
>> -
>>
>> With an AJAX call I retrieve the JSON
>>
>> //
>> // GET SOME JSON  VIA AJAX //
>> /
>> var myJSON;
>>
>> function myAJAXFunction()
>> {
>>
>> // call AJAX
>> makeRequest('/my_controller/my_method_JSON ','',set_JSON);
>> }
>>
>> function setJSON(json)
>> {
>> // store JSON returned from AJAX call
>> myJSON = $.parseJSON(json);
>>
>> }
>>
>> 
>>
>> This is working fine, what shift in paradigm are you trying to create and 
>> how 
>> would it affect / alter what I currently do, or indeed make it any easier / 
>> simpler, I can't see it  getting much simpler than the few lines of code I 
>> already have, can it?
>>
>> Or am I doing something wrong?
>>
>> Cheers,
>>
>> Craig Chant.
>>
>>
>> -Original Message-
>> From: John Napiorkowski [mailto:jjn1...@yahoo.com]
>> Sent: 12 August 2013 21:27
>> To: The elegant MVC web framework
>> Subject: Re: [Catalyst] More detailed proposal for changes related to 
>> content 
>> negotiation and REST
>>
>>
>>
>>
>>
>>
>>>  On Monday, August 12, 2013 2:33 PM, Alexander Hartmaier 
>>  wrote:
>>>  > On 2013-08-12 16:58, John Napiorkowski wrote:
>>>>   Hey Bill (and the rest of you lurkers!)
>>>>
>>>>   I just updated the spec over at
>>>  https://github.com/perl-catalyst/CatalystX-Proposals-REStandContentNeg
>>>  otiation/blob/master/README.pod
>>>>   I decided to remove regular expression matching from the body parser
>>>>  stuff,
>>>  which I think resolves the merging questions (since now there will not
>>>  be a possibility that more that one can match the request).  I think
>>>  we can add this back eventually using some standard request content
>>>  negotiation, using mime type patterns and quality settings, so that we
>>>  can have some rules that dictate what is the best match, rather than try 
>>> to 
>> invent our own.  For example:
>>>>
>>>>  https://metacpan.org/module/HTTP::Headers::ActionPack::ContentNegotia
>>>>  tion
>>>>
>>>>
>>>>   The idea would be to not reinvent.  I think we could instead of
>>>>  doing an
>>>  equality match here we just use something like this to figure out what
>>>  the best match is works pretty well.  Thoughts?
>>>>   jnap
>>>  Hi John,
>>>  I thought about it for the last few days and wonder why the, lets call
>>>  it rendering, of the data isn't left to the view as defined by the MVC
>>>  pattern?
>>>  I'd expect that a different view is used depending on the negotiated
>>>  content-type.
>>>  How do other MVC frameworks choose the view to use?
>>>  Should a single action be able to limit the output format or is
>>>  controller level granular enough?
>>>
>>>  Best regards, Alex
>>>
>> Alex,
>>
>> I think you put your finger on one of the major uneasiness I (and others) 
>> have 
>> around the idea of having in the global application model all these 
>> registered 
>> formatters.  Yes, in theory it feels like we are cheating on the View side 
>> of 
>> MVC.  I have personally always thought that Catalyst doesn't exactly get it 
>> right the way it is (I think C and V are actually a little too detached for 
>> one 
>> thing) and that leads to odd code sometimes.  The commonly used 
>> Catalyst::Action::Renderview is a bit too detached for my taste.  And what 
>> we 
>> call a View tends to mostly just be a View handler (or factory I guess).  On 
>> the 
>> other hand the basic idea of separation of concerns is sound.
>>
>> I think the main thing is that this is not intended to replace view, but for 
>> the 
>> simple cases where people just want to quickly serialize data (like for all 
>> those ajax endpoints you need to do nowadays, not full on RESTful APIs but 
>> quick 
>> and dirty communication between the back and front end.  Maybe that's not a 
>> great thing for Catalyst (and honestly I put this out there in the hopes of 
>> provocation some strong reactions.
>>
>> Personally I prefer 

Re: [Catalyst] More detailed proposal for changes related to content negotiation and REST

2013-08-12 Thread Alexander Hartmaier
On 2013-08-12 22:26, John Napiorkowski wrote:
>
>
>
>
>> On Monday, August 12, 2013 2:33 PM, Alexander Hartmaier 
>>  wrote:
>>> On 2013-08-12 16:58, John Napiorkowski wrote:
>>>  Hey Bill (and the rest of you lurkers!)
>>>
>>>  I just updated the spec over at 
>> https://github.com/perl-catalyst/CatalystX-Proposals-REStandContentNegotiation/blob/master/README.pod
>>>  I decided to remove regular expression matching from the body parser 
>>> stuff, 
>> which I think resolves the merging questions (since now there will not be a 
>> possibility that more that one can match the request).  I think we can add 
>> this 
>> back eventually using some standard request content negotiation, using mime 
>> type 
>> patterns and quality settings, so that we can have some rules that dictate 
>> what 
>> is the best match, rather than try to invent our own.  For example:
>>>  https://metacpan.org/module/HTTP::Headers::ActionPack::ContentNegotiation
>>>
>>>
>>>  The idea would be to not reinvent.  I think we could instead of doing an 
>> equality match here we just use something like this to figure out what the 
>> best 
>> match is works pretty well.  Thoughts?
>>>  jnap
>> Hi John,
>> I thought about it for the last few days and wonder why the, lets call
>> it rendering, of the data isn't left to the view as defined by the MVC
>> pattern?
>> I'd expect that a different view is used depending on the negotiated
>> content-type.
>> How do other MVC frameworks choose the view to use?
>> Should a single action be able to limit the output format or is
>> controller level granular enough?
>>
>> Best regards, Alex
>>
>>>  
> Alex,
First thanks for the extensive and quick answer!
>
> I think you put your finger on one of the major uneasiness I (and others) 
> have around the idea of having in the global application model all these 
> registered formatters.  Yes, in theory it feels like we are cheating on the 
> View side of MVC.  I have personally always thought that Catalyst doesn't 
> exactly get it right the way it is (I think C and V are actually a little too 
> detached for one thing) and that leads to odd code sometimes.  The commonly 
> used Catalyst::Action::Renderview is a bit too detached for my taste.  And 
> what we call a View tends to mostly just be a View handler (or factory I 
> guess).  On the other hand the basic idea of separation of concerns is sound.
>
> I think the main thing is that this is not intended to replace view, but for 
> the simple cases where people just want to quickly serialize data (like for 
> all those ajax endpoints you need to do nowadays, not full on RESTful APIs 
> but quick and dirty communication between the back and front end.  Maybe 
> that's not a great thing for Catalyst (and honestly I put this out there in 
> the hopes of provocation some strong reactions.
>
> Personally I prefer to use templates even for creating JSON output, I think 
> you get cleaner separation that is easier to maintain over time (I really 
> don't like when I see something like ->body (json_encode 
> $sql->run->get_all_rows).  That feels fragile to me.  On the other hand I see 
> the attraction of some of the more lightweight web frameworks where they make 
> it easy to just spew out JSON.
What I have done in my largest Catalyst app, that feeds data to ExtJS
using Catalyst::Controler::DBIC::API, is a custom DBIC ResultClass that
transforms the values in the HRI-like data structure before it gets
serialized to JSON.
That extra step of transforming data before serializing it belongs imho
into the View, not the controller, because different output formats
might need different transformations e.g. datetime format.

If content negotiation is the feature to add I'd define which View is
responsible for which mime-type. The View class would then become more
than a mere glue for e.g. JSON encoding.
That should be definable per app, overridden by the Controller config
which can be overridden by an action too by e.g. setting a stash or
other config var.
>
> This is partly why I sketched out an action/controller level alternative, 
> with the proposed response->body_format thing and the proposed new action 
> subroutine attributes  (just to recap)
>
> sub myaction :Local {
>   My ($self, $c) = @_;
>
>   # ...
>   # ...
>
>   $c->response->format(
>  'application/json' => sub {  json_encode $stuff },
>  # ...
>  # ...
>   );
> }
>
> I think this approach feels similar to how some other frameworks operate.  
> Some offer more sugary syntax for 

Re: [Catalyst] More detailed proposal for changes related to content negotiation and REST

2013-08-12 Thread Alexander Hartmaier
On 2013-08-12 16:58, John Napiorkowski wrote:
> Hey Bill (and the rest of you lurkers!)
>
> I just updated the spec over at 
> https://github.com/perl-catalyst/CatalystX-Proposals-REStandContentNegotiation/blob/master/README.pod
>
> I decided to remove regular expression matching from the body parser stuff, 
> which I think resolves the merging questions (since now there will not be a 
> possibility that more that one can match the request).  I think we can add 
> this back eventually using some standard request content negotiation, using 
> mime type patterns and quality settings, so that we can have some rules that 
> dictate what is the best match, rather than try to invent our own.  For 
> example:
>
> https://metacpan.org/module/HTTP::Headers::ActionPack::ContentNegotiation
>
>
> The idea would be to not reinvent.  I think we could instead of doing an 
> equality match here we just use something like this to figure out what the 
> best match is works pretty well.  Thoughts?
>
> jnap

Hi John,
I thought about it for the last few days and wonder why the, lets call
it rendering, of the data isn't left to the view as defined by the MVC
pattern?
I'd expect that a different view is used depending on the negotiated
content-type.
How do other MVC frameworks choose the view to use?
Should a single action be able to limit the output format or is
controller level granular enough?

Best regards, Alex

>
>
>
>> On Friday, August 9, 2013 5:38 PM, John Napiorkowski  
>> wrote:
>>
>>
>>
>> On Friday, August 9, 2013 4:52 PM, Bill Moseley  wrote:
>>
>>
>>>
>>> On Fri, Aug 9, 2013 at 12:11 PM, John Napiorkowski 
>> wrote:
>>>
>> What's the use case you have in mind?  Something like first check for
>> something like 'application/vnd.mycompany.user+json' and then fall back
>> to 'application/(?:vmd.*+)?json' if you don't find it?  Is that an
>> actual case you've come across?
>>>
>>> Ya, that's kind of what I was thinking.   Or also having a final
>> fallback parser that tries to figure out the type by other means than just
>> looking at the Content type provided in the request.  Or even a '.'
>> final match-anything that does some special logging.
>>>
>>> It would be easy enough to find out if application/json was in the array
>> more than once by mistake.
>>>
>> Seems like a reasonable use case then, although I would encourage future
>> development to aim at putting more specificity in the controller, rather than
>> rely on the global application.  The primary reason to have anything here at 
>> all
>> is to have a base people can build on.  I do fear the globalness of it, but 
>> it
>> seems not an unreasonable compromise based on how Catalyst actually works 
>> today.
>>
>>>
>>>
 We've spoken before about the parsing larger incoming and chunked
>> data thing before.  I would love to address this, but right now it seems like
>> something we need better agreement on in the psgi level.  For example, since
>> star man already buffers incoming input, it feels silly to me to have 
>> catalyst
>> then try to re-stream that.  You've already paid the full price of buffering
>> in terms of memory, and performance right?  Or am I not understanding?
>>>
>>> I added a Plack middleware to handle chunked encoded requests -- I needed it
>> for the Catalyst dev server and for Apache/mod_perl.   Yes, Starman already
>> de-chunks and buffers and works perfectly.
>>>
>>> Apache actually de-chunks the request, but doesn't update the
>> Content-Length header and leaves on the Transfer-Encoding: chunked header.  
>> So,
>> sadly, I do flush this to a temporary file only to get the content-length to
>> make Catalyst happy.
>>>
>> Right, so I think in the end we all agreed it was psgi that should be
>> responsible for dealing with chunks or whatever (based on the http level 
>> support
>> of the server).  The only think would be could there be some sane approach 
>> that
>> exposed the input stream as a non blockable file handle that has not already
>> been read into a buffer (memory or otherwise).  I do see the possible 
>> advantage
>> there for processing efficiently large POST or PUT.  However again this 
>> needs to
>> be done at the PSGI level, something like input.stream or similar.  That 
>> would
>> smooth over chucked versus non chunked and expose a readable stream of the 
>> input
>> that has not yet been buffered.
>>
>>>
>>> I'd really like to have something at the Catalyst level that sanely
>> acheives this end, but I think part of the price we paid when going to PSGi 
>> at
>> the core, is that most of the popular plack handlers are pre loading and
>> buffering input, even large request input.  This seems to be an area where it
>> might behoove us to work with the psgi group to find something stable.  Even 
>> the
>> optional psgix.io isn't always going to work out, since some people
>> don't want to support that in the handler (its a somewhat vague definition I
>> guess and makes people uncomfortable).
 Until them, or u

Re: [Catalyst] How to avoid repeating methods in controllers ?

2013-07-17 Thread Alexander Hartmaier
Hi,
generally if you have some classes that have a common number of attributes 
and/or methods you'd move those in a base class or in more recent time 
construct it out of roles which are like lego blocks.

For your specific case https://metacpan.org/module/CatalystX::Resource looks to 
be the solution you are looking for.

BR Alex

On 2013-07-17 04:05, cc loo wrote:
Hi all, i'm a network engineer by trade and is picking up perl/catalyst to 
upgrade my skills :)

I have a couple of controllers each having same methods, chaining off their 
respective 'base' methods.

I build my controllers off this guide here: 
http://search.cpan.org/~ether/Catalyst-Manual-5.9007/lib/Catalyst/Manual/Tutorial/04_BasicCRUD.pod#Refactor_to_Use_a_'base'_Method_to_Start_the_Chains


So, i have

controller_a with a method 'list' , chaining off 'base'
controller_b with a method 'list', chaining off' 'base'

Is there a more graceful manner of inheriting this method instead of copy/paste 
on every controller i have ?




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




*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
___
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] Missing Catalyst/Plugin/Authentication/Roles.pm

2013-07-09 Thread Alexander Hartmaier
It might be a mistake in the book, the module's name is
Catalyst::Plugin::Authorization::Roles.

BR Alex

On 2013-07-09 11:59, Drew Poulin wrote:
> Hello Catalyst mavens,
>
> I'm working through the SneakyCat tutorial in chapter 8 of the The Definitive 
> Guide to Catalyst.  I've created and edited the files as described in the 
> book, but when I start the development server, it complains that it can't 
> find Catalyst::Plugin::Authentication::Roles.pm:
>
> jsocial@linux-b0go:‾/SneakyCat> script/sneakycat_server.pl -r -d
> Can't locate Catalyst/Plugin/Authentication/Roles.pm in @INC (@INC contains: 
> /home/jsocial/SneakyCat/script/../lib 
> /home/jsocial/perl5/lib/perl5/i586-linux-thread-multi 
> /home/jsocial/perl5/lib/perl5 
> /usr/lib/perl5/site_perl/5.14.2/i586-linux-thread-multi 
> /usr/lib/perl5/site_perl/5.14.2 
> /usr/lib/perl5/vendor_perl/5.14.2/i586-linux-thread-multi 
> /usr/lib/perl5/vendor_perl/5.14.2 
> /usr/lib/perl5/5.14.2/i586-linux-thread-multi /usr/lib/perl5/5.14.2 
> /usr/lib/perl5/site_perl .) at /usr/lib/perl5/site_perl/5.14.2/Class/Load.pm 
> line 177. Compilation failed in require at 
> /home/jsocial/perl5/lib/perl5/Catalyst/Restarter/Forking.pm line 20.
>
> Sure enough, it seems not to be on my machine:
>
> jsocial@linux-b0go:‾/perl5/lib/perl5/Catalyst/Plugin/Authentication> ls
> Credential  Internals.pod  Store  User  User.pm
>
> But when I try to install it, CPAN says it doesn't know anything about it:
>
> jsocial@linux-b0go:~> cpan Catalyst::Plugin::Authentication::Roles
> Reading '/home/jsocial/.cpan/Metadata'
>   Database was generated on Sun, 07 Jul 2013 16:41:02 GMT
> Warning: Cannot install Catalyst::Plugin::Authentication::Roles, don't know 
> what it is.
>
> I haven't been able to find anything indicating there's been a relevant 
> change in the distribution since the book was published.  I'm running Perl 
> 5.14.2 and Catalyst 5.9.  I would appreciate any suggestions.
>
> DP
>
>
>
>
>
> ___
> 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/



*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] CSV / UTF-8 / Unicode

2013-07-02 Thread Alexander Hartmaier
On 2013-07-02 19:26, Bill Moseley wrote:


On Tue, Jul 2, 2013 at 9:29 AM, Craig Chant 
mailto:cr...@homeloanpartnership.com>> wrote:
>> All the above seems overkill.   I suspect what you want is closer to this: 
>> (but see notes below).

Tried that, didn't work, ended up in a long Catalyst discussion where it was 
worked out that I needed to wrap any XLS output to an IO:FILE handle otherwise 
Catalyst dies with an "out of memory" error something to do with streaming data 
support issues in Catalyst so the work round is to wrap the output into an 
IO:File object.

$xls is a scalar you have in memory of the comma separated value data?



>>Second, be aware that $c->response->content_length(length($xls));

Yes, I was doing the encode then using Length (I did read on perldocs about 
requesting the length against the octet) , either way, the length was the least 
of my worries, keeping Catalyst from falling over with 'Wide Character' errors, 
or not getting garbage was my main concern.

And yes, the output is CSV not strictly XLS but I have been told and looked it 
up on the net that 'application/vnd.ms-excel'  Is the correct MIME header to 
pass for CSV that you want MS Excel to open.

http://www.ietf.org/rfc/rfc4180.txt, but how Windows decides how to open files 
is something I'm not familiar with.
That depends on the Browser setting per mime type and not the OS.
In Firefox you can define it in Preferences / Applications.



--
Bill Moseley
mose...@hank.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/




*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
___
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] CSV / UTF-8 / Unicode

2013-07-02 Thread Alexander Hartmaier
On 2013-07-02 14:20, Craig Chant wrote:
> Hi Alexander,
>
> I have read the DBD::ODBC docs and it seems Unicode is ON by default
>
> " Enabling and Disabling Unicode support
>
> On Windows Unicode support is enabled by default"
>
> So do I assume the data coming from the DB is Unicode encoded already?
>
> if so , why does decode fall over?
>
> I don't seem able to decode or encode without the app crashing?
>
> Do I have non-Unicode chars perhaps?
>
> Craig.
I'd suggest to test it outside of Catalyst with a simple standalone script.
I have neither experience with Perl on Windows nor with ODBC and MSSQL.
Ask on the DBIC list or on IRC, some guys use MSSQL successfully there.

BR Alex

>
> -Original Message-
> From: Alexander Hartmaier [mailto:alexander.hartma...@t-systems.at]
> Sent: 02 July 2013 12:53
> To: catalyst@lists.scsys.co.uk
> Subject: Re: [Catalyst] CSV / UTF-8 / Unicode
>
> On 2013-07-02 13:45, Craig Chant wrote:
>> Hi Mike,
>>
>> The data is coming from MS SQL 2008 R2, I have checked the DB and the column 
>> is defined as data type nvarchar(max) , so is set to Unicode and when 
>> viewing data via SQL Studio Manager, the Unicode characters display fine.
>>
>> I am accessing the DB via DBI and have set on the connection string..
>> {'RaiseError' => 1, 'mysql_enable_utf8' => 1}
> MSSQL != MySQL
>> Though I'm not sure if the utf8 setting has any affect when using an MS ODBC 
>> driver as the flag implies it's for mysql ?
> No it doesn't, read your DBD's docs.
>> I tried to apply  my $chars = decode('UTF-8', $xls); and I got an error 
>> saying you cannot decode a string with wide characters.
>>
>> I don't know what the string is, but when you try to decode you get a wide 
>> character error and when you try to encode you get a wide character error.
>>
>> If I don't do anything to it and just output it, no error, but the data is 
>> full of junk chars.
>>
>> Where do I go from here?
> Ensure that the data coming out from your database is properly decoded, then 
> make sure it's properly encoded when outputting it.
> Never mess with Perls' internal representation of the data by dis-/enabling 
> the utf-8 bit.
>> Thanks,
>> Craig.
>>
>>
>>
>> -Original Message-
>> From: Mike Whitaker [mailto:m...@altrion.org]
>> Sent: 02 July 2013 12:27
>> To: The elegant MVC web framework
>> Subject: Re: [Catalyst] CSV / UTF-8 / Unicode
>>
>>
>>>   # encode UTF8 octet
>>>use Encode qw(decode encode);
>>>my $octets = encode('UTF-8', $xls);
>> OUt of curiousity, where's the data in $xls come from, and what do you know 
>> about its encoding and bytes vs characters status?
>> ___
>> 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/ This Email and any attachments
>> contain confidential information and is intended solely for the individual 
>> to whom it is addressed. If this Email has been misdirected, please notify 
>> the author as soon as possible. If you are not the intended recipient you 
>> must not disclose, distribute, copy, print or rely on any of the information 
>> contained, and all copies must be deleted immediately. Whilst we take 
>> reasonable steps to try to identify any software viruses, any attachments to 
>> this e-mail may nevertheless contain viruses, which our anti-virus software 
>> has failed to identify. You should therefore carry out your own anti-virus 
>> checks before opening any documents. HomeLoan Partnership will not accept 
>> any liability for damage caused by computer viruses emanating from any 
>> attachment or other document supplied with this e-mail. HomeLoan Partnership 
>> reserves the right to monitor and archive all e-mail communications through 
>> its network. No representative or employee of HomeLoan Partnership has the 
>> authority to enter into any contract on behalf of HomeLoan Partnership by 
>> email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
>> registered in England and Wales with Registration Number 5011722. Registered 
>> office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
>> authorised and regulated by the Financial Conduct Authority.
>>
>> 

Re: [Catalyst] CSV / UTF-8 / Unicode

2013-07-02 Thread Alexander Hartmaier
On 2013-07-02 13:45, Craig Chant wrote:
> Hi Mike,
>
> The data is coming from MS SQL 2008 R2, I have checked the DB and the column 
> is defined as data type nvarchar(max) , so is set to Unicode and when viewing 
> data via SQL Studio Manager, the Unicode characters display fine.
>
> I am accessing the DB via DBI and have set on the connection string.. 
> {'RaiseError' => 1, 'mysql_enable_utf8' => 1}
MSSQL != MySQL
>
> Though I'm not sure if the utf8 setting has any affect when using an MS ODBC 
> driver as the flag implies it's for mysql ?
No it doesn't, read your DBD's docs.
>
> I tried to apply  my $chars = decode('UTF-8', $xls); and I got an error 
> saying you cannot decode a string with wide characters.
>
> I don't know what the string is, but when you try to decode you get a wide 
> character error and when you try to encode you get a wide character error.
>
> If I don't do anything to it and just output it, no error, but the data is 
> full of junk chars.
>
> Where do I go from here?
Ensure that the data coming out from your database is properly decoded,
then make sure it's properly encoded when outputting it.
Never mess with Perls' internal representation of the data by
dis-/enabling the utf-8 bit.
>
> Thanks,
> Craig.
>
>
>
> -Original Message-
> From: Mike Whitaker [mailto:m...@altrion.org]
> Sent: 02 July 2013 12:27
> To: The elegant MVC web framework
> Subject: Re: [Catalyst] CSV / UTF-8 / Unicode
>
>
>>   # encode UTF8 octet
>>use Encode qw(decode encode);
>>my $octets = encode('UTF-8', $xls);
> OUt of curiousity, where's the data in $xls come from, and what do you know 
> about its encoding and bytes vs characters status?
> ___
> 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/
> This Email and any attachments contain confidential information and is 
> intended solely for the individual to whom it is addressed. If this Email has 
> been misdirected, please notify the author as soon as possible. If you are 
> not the intended recipient you must not disclose, distribute, copy, print or 
> rely on any of the information contained, and all copies must be deleted 
> immediately. Whilst we take reasonable steps to try to identify any software 
> viruses, any attachments to this e-mail may nevertheless contain viruses, 
> which our anti-virus software has failed to identify. You should therefore 
> carry out your own anti-virus checks before opening any documents. HomeLoan 
> Partnership will not accept any liability for damage caused by computer 
> viruses emanating from any attachment or other document supplied with this 
> e-mail. HomeLoan Partnership reserves the right to monitor and archive all 
> e-mail communications through its network. No representative or employee of 
> HomeLoan Partnership has the authority to enter into any contract on behalf 
> of HomeLoan Partnership by email. HomeLoan Partnership is a trading name of H 
> L Partnership Limited, registered in England and Wales with Registration 
> Number 5011722. Registered office: 26-34 Old Street, London, EC1V 9QQ. H L 
> Partnership Limited is authorised and regulated by the Financial Conduct 
> Authority.
>
> ___
> 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/




*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Log::Log4perl::Catalyst

2013-05-15 Thread Alexander Hartmaier
On 2013-05-15 17:54, Duncan Garland wrote:
Hi,

Has anybody got some examples about how to use this.

It looks like you just have to put the following lines in the main package 
before __PACKAGE__->setup():

use Log::Log4perl::Catalyst;
__PACKAGE__->log(Log::Log4perl::Catalyst->new('/path/to/log4perl.conf'));

That works up to a point in that the log messages are formatted as I want. 
However they always go to the STDERR and not to the file given in 
log4perl.conf. I've used the conf file in a test, so I know it works outside 
Catalyst. I'm using the Catalyst development server, does that over-ride the 
logger?

The other thing is that I don't really want to hardcode the filename. It should 
be in the application's conf file. However, if I just stick it in there as so:

 
  conf_file 
/var/www/mymercedesservice.co.uk/fcgi/catalyst/mbfl2/lib/mbfl2/log4perl.conf


I can't access it via __PACKAGE__->config->{Log4perl}->{conf_file};
until after setup() has run.

Does that matter?

Thanks

Duncan

That's how I do it in all of our Catalyst apps:

In My::App:

=item finalize_config

Initializes the logger after the config file merging and loading is done.

=cut

sub finalize_config {
my $class = shift;
$class->next::method(@_);
$class->log(Log::Log4perl::Catalyst->new($class->config->{log}));
}

# Start the application
__PACKAGE__->setup;

around 'prepare' => sub {
my $orig = shift;
my $self = shift;

Log::Log4perl::MDC->remove();

my $c = $self->$orig(@_);

Log::Log4perl::MDC->put( "username", $c->user->username )
if $c->user_exists;

return $c;
};

This assumes that the l4p config is in the app config file under 'log' e.g. 
from one of my Config::General config files:


log4perl.logger "WARN, FILE, MAIL"
log4perl.appender.FILE  
"Log::Log4perl::Appender::File"
log4perl.appender.FILE.filename 
"/home/nac/log/nac-web-request.log"
log4perl.appender.FILE.utf8 1
log4perl.appender.FILE.syswrite 1
log4perl.appender.FILE.layout   
"Log::Log4perl::Layout::PatternLayout"
log4perl.appender.FILE.layout.ConversionPattern "%d{-MM-dd 
HH:mm:ss} %-5p %X{username} %m%n"
log4perl.appender.MAIL  
"Log::Dispatch::Email::MailSend"
log4perl.appender.MAIL.ThresholdERROR
log4perl.appender.MAIL.from 
"a...@t-systems.at"
log4perl.appender.MAIL.to   
"poor.bastard-aka...@ourcompany.com"
log4perl.appender.MAIL.subject  "[NAC::Web::Request] 
errors"
log4perl.appender.MAIL.buffered 0
log4perl.appender.MAIL.layout   "PatternLayout"
log4perl.appender.MAIL.layout.ConversionPattern "%d{-MM-dd 
HH:mm:ss} %-5p %X{username} %m%n"






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




*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
___
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] Out of Memory - File delivery issue

2013-05-02 Thread Alexander Hartmaier
On 2013-05-02 16:04, Lukas Thiemeier wrote:
> Hi again,
>
> FIRST:
>
> Your Controller Code looks good. I would use build-in  functionality
> whenever possible. In this case, using $c->res->content_type instead of
> setting the content type by hand. But your code should work just fine.
>
> Your are right. You  have to set the headers before using $c->res->print
> (or write). But this does not mean that you have to do this in the
> model.  You can set the headers in your Controller before running the
> model code.
>
> SECOND:
>
> IMO you are right about your concerns regarding the MVC architecture.
> The Model should provide the data and not deal with HTTP responses. On
> the other hand, the data has to be provided in some format. XML is a
> well known standard format for textual data presentation. Providing the
> data as XML is as good or as bad as providing the data as DBIC objects.
> (Well, not really. But close enough for this explanation).
>
> The cleanest (most MVC conform) way to do this would be to fetch the raw
> data from your model and create your XML in a special view. There are
> several ways to do this. You can create XML using a TT view. ( I have
> done this before, it works fine). Or you can use existing XML views like
> Catalyst::View::XML::Generator or Catalyst::View::XML::Hash::LX. (I have
> not used any of them, but the names are promising). I guess there are
> even more ways to do it...
>
> In your Case, you already have a Model which provides the XML Data
> (which is fine, as I said before). IMO, one of the great things about
> Catalyst is that it allows you to get the job done quickly. It makes
> reusing existing code easy. There is no reason to abandon your existing
> XML-creation code just because it doesn't fit the MVC layout. Doing so
> would be contra-productive.
>
> So, what can be done to re-use your XML Model and still fit into the MVC
> architecture? I see two ways:
>
> The first one would be to update your model that it writes its data to
> any IO::Handle compatible object. You can pass $c->res to your Model,
> which is IO::Handle compatible. Your model uses a Catalyst independent
> API to write out the data. Catalyst streams the data to the client. Your
> Model Code is still Catalyst independent and does not know that it is
> writing to a Catalyst::Response object. No tight coupling. You can reuse
> your model in non-catalyst applications and easily test its
> functionality using Test::More or any other test suite. ( I think this
> is more or less the way proposed by Neil)
>
> The second way (which I would prefer, since it is even more MVC conform)
> is the following: Update your Model to return an IO::Handle-style object
> instead of a string. You can fetch this object from the model in your
> controller, and pass it to $c->res->body. Catalyst will take care of
> streaming the data to the client in small chunks. You don't have to pass
> any Catalyst related objects to the model anymore. Your model returns
> the data as a well known standard object which happens to be suitable
> for streaming large amounts data with catalyst. No tight coupling at
> all. Problem solved. Have a Tea and celebrate.
>
> This is my opinion on this topic. I hope it helps you to find a way
> which fits your needs, and reduces your confusion about Models, Views
> and controllers in this specific case.
>
> Lukas

*Very great* content, thanks Lukas!

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



*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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 with HTTP authentication

2013-03-12 Thread Alexander Hartmaier
On 2013-03-11 16:37, Lukas Thiemeier wrote:
> >From reading the docs, I don't see why
> Catalyst::Authentication::Store::Htpasswd and
> Catalyst::Authentication::Credential::HTTP do not work together, but I
> have not used any of them.
>
> I am using Catalyst::Authentication::Credential::Remote in a current
> project. It lets the webserver do all the authentication. You can use
> any authentication method and storage which is supported by your
> webserver, including htpasswd files.
Having the webserver do the authentication means you are depending on it
to support the type of authentication you want to use.
I'd prefer having the authentication in the app with the exact same code
for production and testing over ::Remote.
>
> I am using Catalyst::Authentication::Credential::Testing for
> authentication when the webserver is not available (when running the
> catalyst test-server during development).
>
> Maybe this is an option for you...
>
> cheers, Lukas
>
> On 03/11/2013 03:10 PM, Robert Rothenberg wrote:
>> I have a project that requires using HTTP authentication.
>>
>> There is a Catalyst::Authentication::Credential::HTTP module, but from the
>> documentation, it does not seem to support using htpasswd files, which I
>> need, because a separate web site will be using that file.
>>
>> There is Catalyst::Authentication::Store::Htpasswd, but it does not work
>> with Catalyst::Authentication::Credential::HTTP.
>>
>> I'm not clear on how to do this, without having to write my own handlers for
>> HTTP authentication.
>>
>>
>> ___
>> 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/



*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] [ANNOUNCE] Catalyst-Runtime 5.90020

2013-02-28 Thread Alexander Hartmaier
The Catalyst team is proud to announce the latest version of Catalyst::Runtime.
John Napiorkowski wrote a great blog post [1] about its new features and asks 
for your comments and suggestions for upcoming features.

  ! Catalyst::Action now defines 'match_captures' so it is no long considered
an optional method.  This might break you code if you have made custom
action roles/classes where you define 'match_captures'.  You must change
your code to use a method modifier (such as 'around').
  - New match method "Method($HTTP_METHOD)" where $HTTP_METHOD in (GET, POST,
PUT, HEAD, DELETE, OPTION) and shortcuts in controllers called "GET, POST
PUT, HEAD, DELETE, OPTION").  Tests and documentation.  Please note if you
are currently using Catalyst::ActionRole::MatchRequestMethods there may
be compatibility issues.  You should remove that actionrole since the built
in behavior is compatible on its own.
  - Initial debug screen now shows HTTP Method Match info
  - security fixes in the way we handle redirects
  - Make Catalyst::Engine and Catalyst::Base immutable
  - Some test and documentation improvements

[1] 
http://jjnapiorkowski.typepad.com/modern-perl/2013/02/catalyst-built-in-support-for-http-method-dispatching-and-whats-next.html

--
Cheers, Alex


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
___
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 Actions precedence

2013-02-28 Thread Alexander Hartmaier
On 2013-02-28 10:53, Kieren Diment wrote:
>
> On 28/02/2013, at 8:25 PM, Nick Anderson wrote:
>
>> Hi Trevor,
>>
>> Many thanks for clarifying that. I guess I was hoping for some reliable and 
>> predictable outcome for ambiguous requests but it seems the statement "Don't 
>> do this" in the URL Path handling section does indeed sum it up! And 
>> although it does not explicitly mention chained actions, I presume any URL 
>> path ambiguity should/must be avoided.
>>
> I think making it clear(er?) in the docs that if you're using Chained in a 
> controller you shouldn't use any other dispatch type would be useful.  Where 
> is the correct place for that to go?
>
>> What I was trying to achieve was a catch-all facility for requests other 
>> than application defined actions, up to root level (i.e. for user-specified 
>> URLs which are then looked up in a database). For the life of me I can't 
>> remember why I avoided using the "default" action to achieve this, probably 
>> because I thought being more specific (even just by using a wildcard chain) 
>> was the most appropriate way to approach it and more structured.
>
> My preference is to keep Controller::Root very bare, but keep a default (i.e. 
> 404)  handler in there, and an index type action.
I'd suggest adding actions for those errors to the generated root
controller when creating new apps.

>
>
>> I presume then, that having a /*/... wildcard action to catch everything 
>> else is not advisable? Is using the default action the preferred method then 
>> to allow for unknown/dynamic URLs where an application defined action is 
>> unavailable?
>
> The usual thing to do with default is to catch 404 errors.
>
>
> ___
> 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/



*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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::Controller::REST and Serializer/Deserializer

2013-02-25 Thread Alexander Hartmaier
On 2013-02-25 08:44, Francisco Obispo wrote:
> This is what I usually do:
>
> 1) install Catalyst::View::JSON
>
> 2) Add the view to your app: ./script/myapp_create.pl view JSON JSON
>
> 3) in the .conf file add:
>
> 
>   allow_callback 0
>   expose_stash data
> 
>
> 4) in the controller:
>
> If the whole controller (.pm) will return JSON data, just add this to the end:
>
>
> sub end : Private {
>   my ( $self, $c ) = @_;
>   if ( $c->stash->{data} ) {
> $c->forward('View::JSON');
> return 1;
>   }
>
>   return;
> }
>
>
> if you want to selectively send it in a method:
>
>
> sub hello : Local {
>   my ($self,$c) = @_;
>
>   my $data={ hello => 'world!'};
>
>   $c->stash->{data} = $data;
>   $c->forward('View::JSON');
>
>   return 1;
>
> };
>
>
> Hope this helps
You missed his point, he isn't for a different way to implement his
webservice but a way to use it in his browser.

>
>
>
>
>
>
>
>
>
>
> On Feb 24, 2013, at 11:13 PM, Jean-Marc Choulet  wrote:
>
>> Hello,
>>
>> I'm new to Catalyst and I've certainly a stupid question... I use a 
>> Catalyst::Controller::REST to implement a web service. My question is : How 
>> can I force a application/json content-type response when I ask my ws with 
>> FF or Chrome... ?
>>
>> Thanks
>>
>> Jean-Marc
You have to do a background request mostly known as AJAX. The technical
correct term is XMLHTTPRequest [1].
jQuery has a method for it [2].
If you're using Firefox I recommend installing the Firebug addon which
can be used to easily view the request and response.

[1] http://www.w3.org/TR/XMLHttpRequest/
[2] http://api.jquery.com/jQuery.get/

>>
>> ___
>> 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/
> Francisco Obispo
> Director of Applications and Services - ISC
> email: fobi...@isc.org
> Phone: +1 650 423 1374 || INOC-DBA *3557* NOC
> PGP KeyID = B38DB1BE
>
>
> ___
> 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/



*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] DB values that change very rarely

2013-01-14 Thread Alexander Hartmaier
On 2013-01-11 19:05, Francisco Obispo wrote:
> You really don't want this in DBIx::Class, you want fine grain control of 
> when to fetch from the database, etc. Anyone can build their layer on top of 
> DBIx::Class to implement caching.
>
> Using something like memcached would save you some database hits, you can 
> either set the values to expire at a specified time / number of seconds, or 
> you can set/delete keys as part of the procedures at insert/update/delete on 
> the database.
>
> If you you Postgresql, you can actually take advantage of PgPool, which will 
> give you the option to enable a caching layer… 
>
> Francisco
Please don't top post!
I *do* want this in DBIC so that a prefetch specified in some query
doesn't hit the database if the table is cached schema-wide. Any other
caching technique would mean changing every piece of code whereas this
would be transparent. I do know DBIx::Class quite well and don't think
that's possible with a component.
>
>
>
> On Jan 11, 2013, at 4:01 AM, Alexander Hartmaier 
>  wrote:
>
>> On 2013-01-10 16:15, Jesse Sheidlower wrote:
>>> In one of my apps, I have a number of tables that contain values that
>>> change very rarely. Think of something like a "category" table in an
>>> e-commerce app--they're mostly static, but every now and then you need
>>> to change or add or delete a category. These occasional changes do,
>>> however, need to be made by a (privileged) user, rather than a
>>> developer, so I can't just put them in the config file and edit this and
>>> restart the app when necessary. Since I don't know when they might
>>> change, I don't know how I could cache them, because when a change is
>>> made it needs to take effect immediately.
>>>
>>> These tables are used on almost every request. The result is that most
>>> of my controllers end up looking something like this, or having
>>> something like this at the end of them:
>>>
>>> sub add : Local {
>>>   my ( $self, $c ) = @_;
>>>
>>>   $c->stash->{title} = 'Add a new lemma';
>>>
>>>   $c->stash->{batches} = $c->model('WordsDB::Batch')->search();
>>>   $c->stash->{statuses} = $c->model('WordsDB::Status')->search();
>>>   $c->stash->{regions} = $c->model('WordsDB::Region')->search();
>>>   $c->stash->{subjects} = $c->model('WordsDB::Subject')->search();
>>>
>>>   $c->stash->{template} = 'add.tt';
>>> }
>>>
>>> This means that almost every page generation hits the database a whole 
>>> bunch of
>>> unnecessary times, and that all of my controllers are cluttered.
>>>
>>> This must be a fairly common problem. What's the best way to deal with
>>> it--both the desire to persist what is mostly static data, and to keep
>>> my controllers clean?
>>>
>>> Thanks.
>>>
>>> Jesse Sheidlower
>>>
>>> ___
>>> 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/
>> I'd LOVE to see that functionality in DBIx::Class::Schema so prefetches
>> use the cached values to populate the related data instead of hitting
>> the database.
>>
>> --
>> Best regards, Alexander Hartmaier
>>
>>
>> *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
>> T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
>> Handelsgericht Wien, FN 79340b
>> *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
>> Notice: This e-mail contains information that is confidential and may be 
>> privileged.
>> If you are not the intended recipient, please notify the sender and then
>> delete this e-mail immediately.
>> *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
>>
>> ___
>> 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/
> Francisco Obispo 
> Director of Applications and Services - ISC
> email: fobi...@isc.org
> Phone: +1 650 423 1374 || INOC-DBA *3557* NOC
> PGP KeyID = B38DB1BE
>
>
> ___
> 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/

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


Re: [Catalyst] DB values that change very rarely

2013-01-11 Thread Alexander Hartmaier
On 2013-01-10 16:15, Jesse Sheidlower wrote:
> In one of my apps, I have a number of tables that contain values that
> change very rarely. Think of something like a "category" table in an
> e-commerce app--they're mostly static, but every now and then you need
> to change or add or delete a category. These occasional changes do,
> however, need to be made by a (privileged) user, rather than a
> developer, so I can't just put them in the config file and edit this and
> restart the app when necessary. Since I don't know when they might
> change, I don't know how I could cache them, because when a change is
> made it needs to take effect immediately.
>
> These tables are used on almost every request. The result is that most
> of my controllers end up looking something like this, or having
> something like this at the end of them:
>
> sub add : Local {
>my ( $self, $c ) = @_;
>
>$c->stash->{title} = 'Add a new lemma';
>
>$c->stash->{batches} = $c->model('WordsDB::Batch')->search();
>$c->stash->{statuses} = $c->model('WordsDB::Status')->search();
>$c->stash->{regions} = $c->model('WordsDB::Region')->search();
>$c->stash->{subjects} = $c->model('WordsDB::Subject')->search();
>
>$c->stash->{template} = 'add.tt';
> }
>
> This means that almost every page generation hits the database a whole bunch 
> of
> unnecessary times, and that all of my controllers are cluttered.
>
> This must be a fairly common problem. What's the best way to deal with
> it--both the desire to persist what is mostly static data, and to keep
> my controllers clean?
>
> Thanks.
>
> Jesse Sheidlower
>
> ___
> 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/
I'd LOVE to see that functionality in DBIx::Class::Schema so prefetches
use the cached values to populate the related data instead of hitting
the database.

--
Best regards, Alexander Hartmaier


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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 IIS7 Wiki Instructions

2012-11-09 Thread Alexander Hartmaier
On 2012-11-09 12:03, Craig Chant wrote:
Hi,

Don't know if this is the correct usage of the mailing list so I apologise now 
if it isn't.

As a thank you to the Catalyst community for all the help and support I have 
thus far received and as I promised to T0m as well as to help out MST, I have 
updated the Catalyst IIS7 Wiki page.

http://wiki.catalystframework.org/wiki/deployment/iis7_fastcgi

Not only have I replaced all the missing screen shots with new ones but also 
added additional information, made it more generic rather than 'Strawberry' 
Perl centric plus added  sub categories with further configuration information.

This will hopefully help others not struggle, as I did, when first setting up 
Catalyst on IIS7 Windows 2008 R2 environment and reduce the potential of stupid 
questions being asked on the mailing list or IRC.

Should you find any errors, omissions, inaccuracies or feel it could be 
improved in some way, please feel free to let me know and I will make any 
appropriate changes necessary.

I hope this helps the Catalyst community as well as others who wish to 
implement Catalyst over Windows / IIS7.
Thanks Craig!
I can't talk about its accuracy though because I don't have a Windows server 
here.


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
___
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] Access Catalyst context object from script

2012-10-31 Thread Alexander Hartmaier
On 2012-10-31 13:30, Anthony Gladdish wrote:
>> -Original Message-
>> From: Ian Docherty [mailto:catal...@iandocherty.com]
>> Sent: 31 October 2012 11:29
>> To: The elegant MVC web framework
>> Subject: Re: [Catalyst] Access Catalyst context object from script
>>
>> On 31 October 2012 10:41, Anthony Gladdish
>>  wrote:
>>> Hi,
>>>
>>> Got a lot of code in a controller that should be moved out and
>> into an external script (that's called by a cronjob) which calls
>> stuff from the Model and then emails it.
>>> The script can access the model fine and re-use a
>> Template::Toolkit template already written fine (I'm using
>> MIME::Lite::TT). However, in the template itself there's a lot of
>> calls to the Catalyst context object, in the form of:
>>> [% Catalyst.uri_for( ... ) %]
>>>
>>> ... which aren't displaying anything. I don't really want to hard
>> code the URIs, so is there a way to get access to the Catalyst
>> context object of a running app, in a separate external script?
>> I can understand the reluctance to hard-code URIs, however i
>> would be
>> reluctant to suggest that you bring in the whole of Catalyst just
>> to
>> satisfy this one requirement.
>>
>> What is the template? I presume it is an email, and that you are
>> putting links to locations within your Catalyst application into the
>> email?
> Correct. It's a bog standard .tt file printing text to be sent as an email,
> containing links to actions within the Cat app.
>
>> What form of uri_for are you using? If it is just to capture the
>> applications root then could you replace it with your own
>> convenience
>> routine that just implemented that aspect of what uri_for is
>> doing
>> without bringing in the whole of Catalyst?
>
> [% 
> Catalyst.uri_for(Catalyst.controller('MyController').action_for('myaction'), 
> [ some_id ] ) %]
>
> Could you offer an example, based on my uri_for example above?
I suggest to load your Catalyst app with a config that doesn't load
unnecessary stuff like the models and views, just the controllers and
use $c->uri_for_action.
Take a look at how Catalyst::Test::ctx_request does it or even use
Catalyst::Test...

>
> Thanks,
> Anthony
>
> ___
> 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/



*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Can't get view / template to work ?

2012-10-31 Thread Alexander Hartmaier
On 2012-10-31 13:28, Will Crawford wrote:
> On 31 October 2012 09:31, Craig Chant  wrote:
>> You're misread what I put where?
>>
>> It clearly states
>>
>> Edit lib/MyApp/View/HTML.pm and you should see something similar to the 
>> following:
>>
>> __PACKAGE__->config(
>> TEMPLATE_EXTENSION => '.tt',
>> render_die => 1,
>> );
>>
>>
>> And that's where I put the extension setting?
> Yet you claimed in your first message in this thread, to have added:
>
> TEMPLATE_EXTENSION => '.tp',
> 'View::HTML' => {
> #Set the location for templates files
> INCLUDE_PATH => [
> __PACKAGE__->path_to( 'root', 'src' ),
> ],
> },
>
> "... to the config section of MyApp.pm", and you're being told that's wrong.
Guys, Craig is on IRC now and I'm helping him to resolve the issue.
He is using Catalyst::View::HTML::Template not ::TT so the options are
different.
>
> ___
> 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/



*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Two questions about caching

2012-10-19 Thread Alexander Hartmaier
On 2012-10-19 09:57, Hugh Barnard wrote:
Hi folks

The first question is a little 'simple' but I need to be sure anyway:

1. If I go $c->cache->set("key", $value);  is that available to all other users 
within the catalyst instance or just for that user session? Sorry!
As you see the cache is on the $c catalyst app instance so it's the same 
regardless of other plugins like session.
You can create a special key that contains the user id if you need per user 
caching, but you are responsible for the security of the implementation.

2. FastMmap vs Memcached [something I know 'outside' Catalyst]. It looks as 
though Memcached has better performance for more complex structures?
Any comments or [better] benchmarks welcome, I seem to only have forum 
anecdotes that suggest this.
I'm using FastMmap since years without problems for our company apps but 
performance isn't critical because they have not much traffic.
Are you talking about using it for caching or session storage?
If session storage and you have your app balanced over multiple servers you 
need a common session storage anyways.

Thanks, in advance Hugh Barnard

--
http://www.hughbarnard.org
http://www.twitter.com/hughbarnard
http://www.big-wave-heuristics.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/




*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
___
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] Trapping added errors with the correct caller

2012-10-16 Thread Alexander Hartmaier
On 2012-10-15 18:55, Robert Rothenberg wrote:
> On 15/10/12 17:49 Alexander Hartmaier wrote:
>> On 2012-10-15 18:03, Robert Rothenberg wrote:
>>> On 15/10/12 15:21 Alexander Hartmaier wrote:
>>>> I recommend to use a logging module like Log::Log4perl::Catalyst and do
>>>> all your app logging there.
>>> I use Log::Dispatch. (The application is already deployed, and it's not
>>> feasible to change it to Log4perl now.)
>> If you're already using a logger but the default Catalyst one that's fine.
>>> I don't see where in your code you trap calls to $c->error() and log them.
>> All log messages are going to your logger object, Log::Dispatch in your
>> case, not just errors.
>> Just configure Log::Dispatch to do with them what you want it to do (log
>> to a separate file, mail them, etc. ).
> You don't seem to understand my original question.
>
> The "end" method of the Root controller looks for errors in $c->error() and
> logs them, then displays a custom error page.  The problem with doing that
> is that it does not say where the error occurred.  So I want to modify
> $c->error() to log it every time something is added, which is actually quite
> easy.  But I want to use something like Sub::Uplevel so that the logger does
> not say the wrapper module triggered the error.
You mean *your* end action code? You haven't showed it and my crystal
ball is broken.

Does it make a difference for you if the error is logged when it
occurred instead of the end of the request?
My apps normally die on the first error which gets logged. The die error
message includes the filename and line number which is sufficient for me.


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Trapping added errors with the correct caller

2012-10-16 Thread Alexander Hartmaier
On 2012-10-16 00:04, Kieren Diment wrote:
> I've had a lot of luck with Log::Contextual recently.  It's nice for easily 
> getting logging into model classes.
I'm going to use Log::Any for that in the future.
>
> On 16/10/2012, at 1:21 AM, Alexander Hartmaier wrote:
>
>> I recommend to use a logging module like Log::Log4perl::Catalyst and do
>> all your app logging there.
>>
>> My log package for NAC::Web:NAC looks like this:
>>
>> package NAC::Web::NAC::Log;
>> use Moose;
>> use Catalyst::Log;
>> use namespace::autoclean;
>>
>> BEGIN { extends 'Log::Log4perl::Catalyst'; }
>>
>> =head1 NAME
>>
>> NAC::Web::NAC::Log - Logger for NAC::Web::NAC
>>
>> =cut
>>
>> # import _dump method from Catalyst::Log
>> *_dump = \&Catalyst::Log::_dump;
>>
>> 1;
>>
>> My app uses it with:
>>
>> =item finalize_config
>>
>> Initializes the logger after the config file merging and loading is done.
>>
>> =cut
>>
>> sub finalize_config {
>>my $class = shift;
>>$class->next::method(@_);
>>$class->log(NAC::Web::NAC::Log->new($class->config->{log}));
>> }
>>
>> # Start the application
>> __PACKAGE__->setup();
>>
>> around 'prepare' => sub {
>>my $orig = shift;
>>my $self = shift;
>>
>>Log::Log4perl::MDC->remove();
>>
>>my $c = $self->$orig(@_);
>>
>>Log::Log4perl::MDC->put( "username", $c->user->username )
>>if $c->user_exists;
>>
>>return $c;
>> };
>>
>> And this is how the app's prod config file looks like:
>>
>> 
>>log4perl.logger "WARN, FILE, MAIL"
>>log4perl.appender.FILE
>> "Log::Log4perl::Appender::File"
>>log4perl.appender.FILE.filename
>> "/home/nac/log/nac-web-nac.log"
>>log4perl.appender.FILE.utf8 1
>>log4perl.appender.FILE.syswrite 1
>>log4perl.appender.FILE.layout
>> "Log::Log4perl::Layout::PatternLayout"
>>log4perl.appender.FILE.layout.ConversionPattern "%d{-MM-dd
>> HH:mm:ss} %-5p %X{username} %m%n"
>>log4perl.appender.MAIL
>> "Log::Dispatch::Email::MailSend"
>>log4perl.appender.MAIL.ThresholdERROR
>>log4perl.appender.MAIL.from "n...@domain.com"
>>log4perl.appender.MAIL.to
>> "app-err...@domain.com"
>>log4perl.appender.MAIL.subject  "[NAC::Web::NAC]
>> errors"
>>log4perl.appender.MAIL.buffered 0
>>log4perl.appender.MAIL.layout   "PatternLayout"
>>log4perl.appender.MAIL.layout.ConversionPattern "%d{-MM-dd
>> HH:mm:ss} %-5p %X{username} %m%n"
>> 
>>
>> Best regards, Alex (abraxxa)
>>
>> On 2012-10-11 14:38, Robert Rothenberg wrote:
>>> I would like to trap every error added to $c->error() and log it, noting the
>>> caller (filename, line number) in the logs.
>>>
>>> I've not gotten Catalyst::Plugin::ErrorCatcher to work, so I wrote my own
>>> plugin that overrides $c->error with the following method:
>>>
>>>  use MRO::Compat;
>>>  use namespace::autoclean;
>>>
>>>  sub error {
>>>my ($c, @args) = @_;
>>>
>>>foreach my $arg (@args) {
>>>if ($arg) {
>>>
>>>$c->log->error($arg);
>>>}
>>>}
>>>
>>>return $c->next::method(@args);
>>> }
>>>
>>> But this only logs errors as coming from my plugin.
>>>
>>> Using Sub::Uplevel or fiddling with $Log::Dispatch::CallerDepth or
>>> $Catalyst::Plugin::Log::Dispatch::CallerDepth doesn't seem to work.
>>>
>>> I also tried writing the plugin as a Moose::Role that adds my trap before
>>> error, but then it claims to be from one of the internal Moose classes in my
>>> logs.
>>>
>>> I can manually get the caller using caller(0) and add them to the log
>>> messages, but that's a bit clumsy (and overrides log formats that don't
>>> include the information).
>>>
>>> So... what is the best practice for trapping errors in a way that preserves
>>> caller informat

Re: [Catalyst] Trapping added errors with the correct caller

2012-10-15 Thread Alexander Hartmaier
On 2012-10-15 18:03, Robert Rothenberg wrote:
> On 15/10/12 15:21 Alexander Hartmaier wrote:
>> I recommend to use a logging module like Log::Log4perl::Catalyst and do
>> all your app logging there.
> I use Log::Dispatch. (The application is already deployed, and it's not
> feasible to change it to Log4perl now.)
If you're already using a logger but the default Catalyst one that's fine.
>
> I don't see where in your code you trap calls to $c->error() and log them.
All log messages are going to your logger object, Log::Dispatch in your
case, not just errors.
Just configure Log::Dispatch to do with them what you want it to do (log
to a separate file, mail them, etc. ).
>
>> My log package for NAC::Web:NAC looks like this:
>>
>> package NAC::Web::NAC::Log;
>> use Moose;
>> use Catalyst::Log;
>> use namespace::autoclean;
>>
>> BEGIN { extends 'Log::Log4perl::Catalyst'; }
>>
>> =head1 NAME
>>
>> NAC::Web::NAC::Log - Logger for NAC::Web::NAC
>>
>> =cut
>>
>> # import _dump method from Catalyst::Log
>> *_dump = \&Catalyst::Log::_dump;
>>
>> 1;
>>
>> My app uses it with:
>>
>> =item finalize_config
>>
>> Initializes the logger after the config file merging and loading is done.
>>
>> =cut
>>
>> sub finalize_config {
>> my $class = shift;
>> $class->next::method(@_);
>> $class->log(NAC::Web::NAC::Log->new($class->config->{log}));
>> }
>>
>> # Start the application
>> __PACKAGE__->setup();
>>
>> around 'prepare' => sub {
>> my $orig = shift;
>> my $self = shift;
>>
>> Log::Log4perl::MDC->remove();
>>
>> my $c = $self->$orig(@_);
>>
>> Log::Log4perl::MDC->put( "username", $c->user->username )
>> if $c->user_exists;
>>
>> return $c;
>> };
>>
>> And this is how the app's prod config file looks like:
>>
>> 
>> log4perl.logger "WARN, FILE, MAIL"
>> log4perl.appender.FILE
>> "Log::Log4perl::Appender::File"
>> log4perl.appender.FILE.filename
>> "/home/nac/log/nac-web-nac.log"
>> log4perl.appender.FILE.utf8 1
>> log4perl.appender.FILE.syswrite 1
>> log4perl.appender.FILE.layout
>> "Log::Log4perl::Layout::PatternLayout"
>> log4perl.appender.FILE.layout.ConversionPattern "%d{-MM-dd
>> HH:mm:ss} %-5p %X{username} %m%n"
>> log4perl.appender.MAIL
>> "Log::Dispatch::Email::MailSend"
>> log4perl.appender.MAIL.ThresholdERROR
>> log4perl.appender.MAIL.from "n...@domain.com"
>> log4perl.appender.MAIL.to
>> "app-err...@domain.com"
>> log4perl.appender.MAIL.subject  "[NAC::Web::NAC]
>> errors"
>> log4perl.appender.MAIL.buffered 0
>> log4perl.appender.MAIL.layout   "PatternLayout"
>> log4perl.appender.MAIL.layout.ConversionPattern "%d{-MM-dd
>> HH:mm:ss} %-5p %X{username} %m%n"
>> 
>>
>> Best regards, Alex (abraxxa)
>>
>> On 2012-10-11 14:38, Robert Rothenberg wrote:
>>> I would like to trap every error added to $c->error() and log it, noting the
>>> caller (filename, line number) in the logs.
>>>
>>> I've not gotten Catalyst::Plugin::ErrorCatcher to work, so I wrote my own
>>> plugin that overrides $c->error with the following method:
>>>
>>>   use MRO::Compat;
>>>   use namespace::autoclean;
>>>
>>>   sub error {
>>> my ($c, @args) = @_;
>>>
>>> foreach my $arg (@args) {
>>> if ($arg) {
>>>
>>> $c->log->error($arg);
>>> }
>>> }
>>>
>>> return $c->next::method(@args);
>>>  }
>>>
>>> But this only logs errors as coming from my plugin.
>>>
>>> Using Sub::Uplevel or fiddling with $Log::Dispatch::CallerDepth or
>>> $Catalyst::Plugin::Log::Dispatch::CallerDepth doesn't seem to work.
>>>
>>> I also tried writing the plugin as a Moose::Role that adds my trap before
>>> error, but then it claims to be from one of the internal Moose classes in my
>>> logs.
>>>
&

Re: [Catalyst] Trapping added errors with the correct caller

2012-10-15 Thread Alexander Hartmaier
I recommend to use a logging module like Log::Log4perl::Catalyst and do
all your app logging there.

My log package for NAC::Web:NAC looks like this:

package NAC::Web::NAC::Log;
use Moose;
use Catalyst::Log;
use namespace::autoclean;

BEGIN { extends 'Log::Log4perl::Catalyst'; }

=head1 NAME

NAC::Web::NAC::Log - Logger for NAC::Web::NAC

=cut

# import _dump method from Catalyst::Log
*_dump = \&Catalyst::Log::_dump;

1;

My app uses it with:

=item finalize_config

Initializes the logger after the config file merging and loading is done.

=cut

sub finalize_config {
my $class = shift;
$class->next::method(@_);
$class->log(NAC::Web::NAC::Log->new($class->config->{log}));
}

# Start the application
__PACKAGE__->setup();

around 'prepare' => sub {
my $orig = shift;
my $self = shift;

Log::Log4perl::MDC->remove();

my $c = $self->$orig(@_);

Log::Log4perl::MDC->put( "username", $c->user->username )
if $c->user_exists;

return $c;
};

And this is how the app's prod config file looks like:


log4perl.logger "WARN, FILE, MAIL"
log4perl.appender.FILE
"Log::Log4perl::Appender::File"
log4perl.appender.FILE.filename
"/home/nac/log/nac-web-nac.log"
log4perl.appender.FILE.utf8 1
log4perl.appender.FILE.syswrite 1
log4perl.appender.FILE.layout
"Log::Log4perl::Layout::PatternLayout"
log4perl.appender.FILE.layout.ConversionPattern "%d{-MM-dd
HH:mm:ss} %-5p %X{username} %m%n"
log4perl.appender.MAIL
"Log::Dispatch::Email::MailSend"
log4perl.appender.MAIL.ThresholdERROR
log4perl.appender.MAIL.from "n...@domain.com"
log4perl.appender.MAIL.to
"app-err...@domain.com"
log4perl.appender.MAIL.subject  "[NAC::Web::NAC]
errors"
log4perl.appender.MAIL.buffered 0
log4perl.appender.MAIL.layout   "PatternLayout"
log4perl.appender.MAIL.layout.ConversionPattern "%d{-MM-dd
HH:mm:ss} %-5p %X{username} %m%n"


Best regards, Alex (abraxxa)

On 2012-10-11 14:38, Robert Rothenberg wrote:
> I would like to trap every error added to $c->error() and log it, noting the
> caller (filename, line number) in the logs.
>
> I've not gotten Catalyst::Plugin::ErrorCatcher to work, so I wrote my own
> plugin that overrides $c->error with the following method:
>
>   use MRO::Compat;
>   use namespace::autoclean;
>
>   sub error {
> my ($c, @args) = @_;
>
> foreach my $arg (@args) {
> if ($arg) {
>
> $c->log->error($arg);
> }
> }
>
> return $c->next::method(@args);
>  }
>
> But this only logs errors as coming from my plugin.
>
> Using Sub::Uplevel or fiddling with $Log::Dispatch::CallerDepth or
> $Catalyst::Plugin::Log::Dispatch::CallerDepth doesn't seem to work.
>
> I also tried writing the plugin as a Moose::Role that adds my trap before
> error, but then it claims to be from one of the internal Moose classes in my
> logs.
>
> I can manually get the caller using caller(0) and add them to the log
> messages, but that's a bit clumsy (and overrides log formats that don't
> include the information).
>
> So... what is the best practice for trapping errors in a way that preserves
> caller information?
>
>
> ___
> 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/



*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Wiki is Temporarily Unavailable

2012-07-03 Thread Alexander Hartmaier
It was (1) if ntpd in the vm wasn't running according to what I've read.

BR Alex

Am 2012-07-03 08:39, schrieb Tomas Doran:
> On 2 Jul 2012, at 23:46, Darren Duncan wrote:
>> So is this the leap-second bug or the power outage or something else? -- 
>> Darren Duncan
> (1) or (3), not (2).
>
> VM had hard locked, no console output etc :(
>
> 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/




*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Plugin::Session lazy start

2012-05-23 Thread Alexander Hartmaier
Because I've just read perlvar: $REAL_USER_ID or $UID instead of $<.

- Alex


Am 2012-05-23 15:54, schrieb Ashley Pond V:
> On Wed, May 23, 2012 at 1:58 AM, Dag-Erling Smørgrav  wrote:
>> As an alternate solution, is there a way to have it use a different file
>> name every time it starts?
> Here's a snippet to do that:
>
> conf.yml
> --
> Plugin::Session:
>   storage: /tmp/some-prefix-__UID__.session
>
> MyApp.pm
> --
>  "Plugin::ConfigLoader" => {
>  substitutions => {
>  UID => sub { $< },
>  },
>  },
>
> https://metacpan.org/module/Catalyst::Plugin::ConfigLoader
>
> ___
> 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/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Getting hashref instead of value

2012-05-08 Thread Alexander Hartmaier
Am 2012-05-08 18:15, schrieb Kenneth S Mclane:
> Yes, in changing things back and forth I forgot about that. I got that
> fixed and changed the relationship names. I have tried with "search"
> and "search_rs" and still have the same result of getting the object
> instead of the value. Can I use "get_column" in TT?
Yes, you only have to use . instead of -> for method calls.
>
>
> From: Alexander Hartmaier 
> To:   
> Date: 05/08/2012 11:07 AM
> Subject:  Re: [Catalyst] Getting hashref instead of value
>
>
> 
>
>
>
> Am 2012-05-08 17:46, schrieb Kenneth S Mclane:
> In checking through docs on line I find that prefetch is a better way
> to go so I have changed ny sub thusly:
>
> sub list :Local {
>my ($self, $c, $page) = @_;
>$page = $c->req->param('page') || 1;
>my $rs = $c->model('ORANGES::Account')->search({}, {
>prefetch => 'progress',
>prefetch => 'compliance',
>prefetch => 'department_id',
>prefetch => 'metrics',
>order_by => 'account_code',
>rows => 15,
>page => $page,
> });
>$c->stash(accounts => $rs);
>$c->stash(pager => $rs->pager());
>$c->stash->{'template'}=>'accountview/list';
> }
> {} is a hashref in Perl. You're defining four values for the key
> 'prefetch', the last one overwrites the three previous ones.
> As already noted you need to specify the prefetch value as arrayref in
> your case:
> prefetch => [qw( progress compliance department_id metrics )],
> FYI: qw() does nothing but saving you to quote every element of the
> list. It's equal to
> prefetch => ['progress', 'compliance', 'department_id', 'metrics'],
>
> Note that this is all basic Perl and nothing specific of Catalyst or
> DBIx::Class.
>
> From: Frank Schwach __ <mailto:f...@sanger.ac.uk>
> To:   _catal...@lists.scsys.co.uk_ <mailto:catalyst@lists.scsys.co.uk>
> Date: 05/08/2012 10:36 AM
> Subject:  Re: [Catalyst] Getting hashref instead of value
>
>
>
> 
>
>
>
> not sure if this is a problem but you should also collapse your joins,
> selects and as' into ArrayRefs, as in
> join => [ qw( progress compliance department_id ...)]
>
> actually the last one looks suspicious. the relationships should be
> called something like "departments", not department_ids. If you have the
> same naming for accounts then an account_id is the name (presumably) of
> a field in accounts and also a relationship
> Frank
>
>
> On 08/05/12 16:25, Steve wrote:
> > The 'account.account_id' referenced in your template I believe is being
> > interpreted as an object. Try 'account.account_id.id' instead. I am
> > presuming that your DBIC relationship is called 'account_id', and that
> > is what you are referencing currently in your template.
> >
> > On 5/8/2012 11:13 AM, Kenneth S Mclane wrote:
> >> I am having a problem with my code and I cannot figure out why it is
> >> doing what it is doing. I have this sub:
> >>
> >> sub list :Local {
> >> my ($self, $c, $page) = @_;
> >> $page = $c->req->param('page') || 1;
> >> my $rs = $c->model('ORANGES::Account')->search({}, {
> >> join => 'progress',
> >> '+select' => ['progress.percent_complete'],
> >> '+as' => ['progress.percent_complete'],
> >> join => 'compliance',
> >> '+select' => ['compliance.percent_compliant'],
> >> '+as' => ['compliance.percent_compliant'],
> >> join => 'department_id',
> >> '+select' => ['department_id.department_id'],
> >> '+as' => ['department_id.department_id'],
> >> join => 'metrics',
> >> '+select' => ['metrics.num_servers','metrics.num_subsystems'],
> >> '+as' => ['metrics.num_servers','metrics.num_subsystems'],
> >> order_by => 'account_code',
> >> rows => 15,
> >> page => $page,
> >> });
> >>

Re: [Catalyst] Getting hashref instead of value

2012-05-08 Thread Alexander Hartmaier
Am 2012-05-08 17:46, schrieb Kenneth S Mclane:
In checking through docs on line I find that prefetch is a better way to go so 
I have changed ny sub thusly:

sub list :Local {
my ($self, $c, $page) = @_;
$page = $c->req->param('page') || 1;
my $rs = $c->model('ORANGES::Account')->search({}, {
prefetch => 'progress',
prefetch => 'compliance',
prefetch => 'department_id',
prefetch => 'metrics',
order_by => 'account_code',
rows => 15,
page => $page,
 });
$c->stash(accounts => $rs);
$c->stash(pager => $rs->pager());
$c->stash->{'template'}=>'accountview/list';
}
{} is a hashref in Perl. You're defining four values for the key 'prefetch', 
the last one overwrites the three previous ones.
As already noted you need to specify the prefetch value as arrayref in your 
case:
prefetch => [qw( progress compliance department_id metrics )],
FYI: qw() does nothing but saving you to quote every element of the list. It's 
equal to
prefetch => ['progress', 'compliance', 'department_id', 'metrics'],

Note that this is all basic Perl and nothing specific of Catalyst or 
DBIx::Class.


From:   Frank Schwach 
To: catalyst@lists.scsys.co.uk
Date:   05/08/2012 10:36 AM
Subject:Re: [Catalyst] Getting hashref instead of value





not sure if this is a problem but you should also collapse your joins,
selects and as' into ArrayRefs, as in
join => [ qw( progress compliance department_id ...)]

actually the last one looks suspicious. the relationships should be
called something like "departments", not department_ids. If you have the
same naming for accounts then an account_id is the name (presumably) of
a field in accounts and also a relationship
Frank


On 08/05/12 16:25, Steve wrote:
> The 'account.account_id' referenced in your template I believe is being
> interpreted as an object. Try 'account.account_id.id' instead. I am
> presuming that your DBIC relationship is called 'account_id', and that
> is what you are referencing currently in your template.
>
> On 5/8/2012 11:13 AM, Kenneth S Mclane wrote:
>> I am having a problem with my code and I cannot figure out why it is
>> doing what it is doing. I have this sub:
>>
>> sub list :Local {
>> my ($self, $c, $page) = @_;
>> $page = $c->req->param('page') || 1;
>> my $rs = $c->model('ORANGES::Account')->search({}, {
>> join => 'progress',
>> '+select' => ['progress.percent_complete'],
>> '+as' => ['progress.percent_complete'],
>> join => 'compliance',
>> '+select' => ['compliance.percent_compliant'],
>> '+as' => ['compliance.percent_compliant'],
>> join => 'department_id',
>> '+select' => ['department_id.department_id'],
>> '+as' => ['department_id.department_id'],
>> join => 'metrics',
>> '+select' => ['metrics.num_servers','metrics.num_subsystems'],
>> '+as' => ['metrics.num_servers','metrics.num_subsystems'],
>> order_by => 'account_code',
>> rows => 15,
>> page => $page,
>> });
>> $c->stash(accounts => $rs);
>> $c->stash(pager => $rs->pager());
>> $c->stash->{'template'}=>'accountview/list';
>>
>> }
>> Which I have tried in several different ways to fix this problem, but
>> none have worked so far. In my template file all my fields come up
>> with the valyes expected, except, I am trying to use the account_id
>> field value as part of a uri to take the user to a details page for
>> the row. Where I am expecting a uri such as
>> 'http://127.0.0.1:3000/accountdetails/detail/170'
>> I instead get a uri like this:
>>
>> http://127.0.0.1:3000/accountdetails/detail/dbms::Model::ORANGES::Account=HASH%280x5496460%29
>>
>>
>> This used to work when I was using a view as the basis for my list page.
>>
>> When I run the page I can see in the sub-queries that it runs that it
>> has the "account_id" value as it uses it, but when I try to access it
>> in my template I get the hash ref. None of the other fields do this.
>>
>> one of the sub queries using the account_id value:
>> SELECT me.account_id, me.account_code, me.percent_compliant FROM
>> HCDB_TEST.COMPLIANCE me WHERE ( me.account_id = ? ): '321'
>>
>>
>> My template that cretaes the uri:
>>
>> [% account.account_code %]
>>
>> If someone could point me in the right direction, Ive been fighting
>> this for days.
>>
>>
>>
>> ___
>> 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/

Re: [Catalyst] Getting hashref instead of value

2012-05-08 Thread Alexander Hartmaier
Am 2012-05-08 17:25, schrieb Ari Constancio:
> On Tue, May 8, 2012 at 4:13 PM, Kenneth S Mclane  wrote:
>> My template that cretaes the uri:
>>
>> [% account.account_code %]
>>
>> If someone could point me in the right direction, Ive been fighting this for
>> days.
> Hi Kenneth,
>
> I suppose you mean to use
>
> [% c.uri_for('/accountdetails/detail/', account.account_id) %]
>
> instead of
>
> [% c.uri_for('/accountdetails/detail/') %][% account.account_id %]
No he doesn't because he isn't using Chained but Local where the
dispatcher knows nothing about the number of args.

I assume that you have defined a relationship on the account_id column
without giving it a different name. This makes DBIx::Class inflate the
related row into an object.
Two solutions:
- use a different accessors for your relationships (that's what I'm doing)
- use acount.get_column('account_id') when you can to get the column
value instead of the related row

Also note that it's a common problem that Template Toolkit calls
everything in list context.
search_rs was added to DBIx::Class to make sure you always get a
resultset object and not a list of row objects.
>
> Regards,


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Stand-alone Scripts

2012-04-30 Thread Alexander Hartmaier
Note that you also can load your app to use its config file loading
capabilities and access MyApp->model('DB')->resultset('Foo').

BR Alex


Am 2012-04-27 15:25, schrieb Glen Diener:
> I'm new to Catalyst and have nearly completed the development of my first 
> Catalyst web site. I'm needing to implement scripts to do some off-line 
> database processing and would like to use the DBIx model created and 
> implemented for the Catalyst site. I'm sure this must be possible, but, I've 
> not been successful.
>
> This is what I have so far:
>
> use strict;
> use warnings;
> use Data::Dumper;
> use FindBin qw($Bin);
> use lib "$Bin/../lib";
> use DealerDemoSite::Schema::DemoDB;
>
>
> my $connect_info_args = [{
> dsn => 'dbi:Pg:dbname=dib',
> user => '...',
> password => '...',
> AutoCommit => q{1},
> }];
>
> my $schema = DealerDemoSite::Schema::DemoDB->connect($connect_info_args);
> print Dumper($schema);
>
> my $demo = $schema->resultset('DemoDB::DddDemo')->find({demoid => 30024});
>
>
> I'm getting the following error message:
>
> DBIx::Class::Schema::resultset(): Can't find source for DemoDB::DddDemo at 
> ./maint.pl line 28
>
> Within the Catalyst application I able to use the following successfully:
>
> my $demo = $c->model('DemoDB::emo')->find($demoid);
>
>
> Thanks for your help.
> - Glen
>
> ___
> 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/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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 5.90010 server must be in CWD to run?

2012-02-21 Thread Alexander Hartmaier
Checkout in the sense of a version control system.

Am 2012-02-20 22:25, schrieb Louis Erickson:
> Yes, I'm talking to myself.  It's that kind of day.
>
> The Changes file lists changes to Catalyst::Utils::home in 5.90009, and then 
> an update in 5.9.0010 to make it work better.  The change is to "find if the 
> application is a checkout in Catalyst::ScriptRunner."  Not sure what 
> "checkout" means there, but it's clearly changed how this works.
>
> In 5.90010, the call to Catalyst::Utils::home() is returning undef when the 
> working directory is MyApp/script, and data when it is MyApp.  Haven't 
> debugged into C::U::home() yet, to see if I can tell what the difference is.  
> Not sure what the goal of the change was yet.
>
> On Feb 20, 2012, at 11:00 AM, Louis Erickson wrote:
>
>> The call to:
>>
>> lib->import(File::Spec->catdir($FindBin::Bin, '..', 'lib'));
>>
>> on line 37 of Catalyst::ScriptRunner::run has been removed.
>>
>> So, I'd think this is deliberate.  It will also affect all the scripts.  
>> What is this going to do to myapp_fastcgi, when the webserver doesn't set 
>> the WD as expected?
>>
>> On Feb 20, 2012, at 10:52 AM, Louis Erickson wrote:
>>
>>> I noticed a changed behavior in Catalyst, and wondered if it was deliberate.
>>>
>>> I have some Catalyst apps running on the system Perl, which has a slightly 
>>> older Catalyst installed.  It's 5.90007.
>>>
>>> In that version, I can execute myapp_server from the scripts directory:
>>>
>>> wwonko@holly:~/projects/MyApp/script $ ./myapp_server.pl
>>> [debug] Debug messages enabled
>>> [debug] Statistics enabled
>>> [debug] Loaded plugins:
>>> ..
>>> | Catalyst::Plugin::ConfigLoader  0.30  
>>>  |
>>> ''
 ... lots more snipped, the app works fine ...
>>> I noticed that with 5.9.0010, installed via perlbrew, I get load failures:
>>>
>>> wwonko@holly:~/projects/MyApp/script $ perlbrew switch perl-5.14.2
>>> wwonko@holly:~/projects/MyApp/script $ ./myapp_server.pl
>>> Can't locate MyApp.pm in @INC (@INC contains: 
>>> /home/web/www.rdwarf.com/users/wwonko/TopazLib-v1.00.00/lib/site_perl/5.14.2//i686-linux
>>>  
>>> /home/web/www.rdwarf.com/users/wwonko/TopazLib-v1.00.00/lib/site_perl/5.14.2/
>>>  
>>> /home/wwonko/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/i686-linux
>>>  /home/wwonko/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2 
>>> /home/wwonko/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2/i686-linux 
>>> /home/wwonko/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2 .) at 
>>> /home/wwonko/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Module/Runtime.pm
>>>  line 317.
>>> at 
>>> /home/wwonko/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Catalyst/Script/Server.pm
>>>  line 239
>>>
>>>
>>> Both run properly if I run the script from the MyApp directory:
>>>
>>> wwonko@holly:~/projects/MyApp $ script/myapp_server.pl
>>> [debug] Debug messages enabled
>>> [debug] Statistics enabled
>>> [debug] Loaded plugins:
>>> ..
>>> | Catalyst::Plugin::ConfigLoader  0.30  
>>>  |
>>> ''
 ... lots more snipped, the app works fine ...
>>> Looking at @INC, it's clear that Catalyst no longer adds "$basename/../inc" 
>>> to the path - I haven't dug into the code to find where the change was.
>>>
>>> Is this a deliberate change?  Is there a reason for it?  Or is it an 
>>> unexpected change?
>>>
>>> I know all the help and samples have people run "script/myapp_server.pl", 
>>> but I never do; I run it from the script directory.  I'm also concerned 
>>> that having to be in the right CWD will allow loading of unexpected 
>>> modules, rather than being based on the app's location, as I'd expect.
>>>
>>> Anyone know what's going on?
>>> ___
>>> 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/
>
> ___
> 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/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria G

Re: [Catalyst] What are the best practices for using phrasebooks in Catalyst applications?

2012-01-27 Thread Alexander Hartmaier

Sounds like something similiar to what I18N does.
Your solution looks good to me.

Am 2012-01-27 14:19, schrieb Robert Rothenberg:

I am working on a project where the terminology we are using for "objects"
in the system is diverging from terminology that the client is using for
those things.  And it also seems that other clients may use different names
for these objects. (And this is just for English-language interfaces.)

So I would like to use some kind of phrasebook, so that the source code can
use the same, consistent terminology, but the clients see their terminology
in the UI.

I'd prefer not to maintain a separate set of templates for each client,
since that requires keeping changes to templates consistent across sets, and
requires keeping changes to terminology consistent in a set.

So... is there an existing plugin that is used for such things?

Otherwise, I am thinking of writing a plugin that makes use of
Data::Phrasebook (or something similar), allows for configuration of the
phrasebook in the configuration file, and adds a new method to the Catalyst
context variable for querying the phrasebook, e.g. the template may have
something like

   [% c.phrase('widgets') | html %]

Does this make sense, or is there a better way to do this?

Thanks,
Rob



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



*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Running multiple test servers together as the same app

2012-01-26 Thread Alexander Hartmaier

Mount them with Plack?

Am 2012-01-26 04:49, schrieb Bill Moseley:
A quick questions for the the collective wisdom here.

We have an app that is just getting too big and we are splitting it up into 
separate Catalyst apps (mostly based on feature) to allow groups of developers 
to work on features independently, develop tests independently and release 
independently.   Hopefully it will be a more scalable approach.

So, /foo and /bar might be on different apps, but all under the same domain in 
production.   But, if using the development servers they would be on different 
ports.

In production we can use the load balancer (or the web server) to direct requests to the 
right app.  But, I need suggestions for development.  Currently, the developers start up 
a proxy server that "points" to their development instances (one or more 
Catalyst apps).  But, that has its own problems (like Apache blocking for some amount of 
time when a Catalyst dev server is restarted and Apache thinks the server died.)

One option I was kicking around was wrapping uri_for to map requests to different paths 
to different development servers running on different ports.  That would simply be 
per-developer configuration -- meaning each developer has their own "port pool" 
to use in the case of developers working on the same dev machine.

Any other suggestions how to let developers work with related Catalyst apps 
(that need to link to each other) using the Catalyst development server?


Thanks,


--
Bill Moseley
mose...@hank.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/



*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
___
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] Setting the COMPILE_DIR for TT templates in the configuration file

2012-01-24 Thread Alexander Hartmaier

Yes it should and does.
Can you come on irc.perl.org to quicker fix your problem?

Am 2012-01-23 20:35, schrieb Robert Rothenberg:

On 23/01/12 17:39 André Walker wrote:

On 01/22/2012 06:16 PM, Robert Rothenberg wrote:

It doesn't quite look like what I expect. Excerpts:

"Plugin::Session" =>   {
   storage =>   "/tmp/myapp/session",
   },

   "View::TT"=>   {
   COMPILE_DIR =>   "/tmp/myapp/template_cache",
   },

Those are the defaults that are set in the module. I want to override them
in the conf file.

Hold on. Does it mean that you're setting COMPILE_DIR to
"/tmp/myapp/template_cache" on MyApp::View::TT and you're trying to override
it on the config file?
Can you show us View/TT.pm please? I'm pretty sure that changing the config
in the component module overrides the *.conf file, but couldn't find it in
the docs.

According to what I read in the docs, setting it in the conf file should
override the module.



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



*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Setting the COMPILE_DIR for TT templates in the configuration file

2012-01-23 Thread Alexander Hartmaier

Have you loaded Catalyst::Plugin::ConfigLoader?

Am 2012-01-23 10:29, schrieb Robert Rothenberg:

On 23/01/12 09:14 Alexander Hartmaier wrote:

Hi Robert,
what config format are you using?
If the file has the extension .conf Config::General is used and your
example should work.

I am using the general format, but it doesn't work.



*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Setting the COMPILE_DIR for TT templates in the configuration file

2012-01-23 Thread Alexander Hartmaier

Hi Robert,
what config format are you using?
If the file has the extension .conf Config::General is used and your
example should work.

Am 2012-01-22 21:16, schrieb Robert Rothenberg:

On 22/01/12 19:58 Tomas Doran wrote:

On 22 Jan 2012, at 18:54, Robert Rothenberg wrote:



COMPILE_DIR /var/opt/myapp/template_cache


where MyApp::View::TT is the name of the view module.

None of them work. How do I do this?

This should work.

http://localhost:3000/?dump_info=1

will dump the config that the app has actually read in and merged (assuming
you've got debug mode on and you're using the standard RenderView plugin).

Does the config dumped look like you expect? Can you show us?

It doesn't quite look like what I expect. Excerpts:

"Plugin::Session" =>  {
  storage =>  "/tmp/myapp/session",
  },

  "View::TT"=>  {
  COMPILE_DIR =>  "/tmp/myapp/template_cache",
  },

Those are the defaults that are set in the module. I want to override them
in the conf file.

But setting in the conf file:


   storage /var/opt/myapp/session


or similarly for  does not change those values. (I know setting
other things such as the DSN in the conf works, so it's the right file).

Rob




Are you customising your TT view in any way (i.e. adding extra code yourself
- specifically to the constructor). Do you have a make_immutable in there?
(Can you show us the whole file?)

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/


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



*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] uri_for method is returning relative URLs

2012-01-17 Thread Alexander Hartmaier

uri_for falls back to interpreting the passed string as plain string,
like a path to a static resource, not an action.
To make sure it returns an url for an action use uri_for_action instead
which will die if it can't the action.

Am 2012-01-17 18:43, schrieb Robert Rothenberg:

I have a Catalyst app that I have been working on with another developer.

In this application, the links in the templates use the uri_for method, e.g.

   Login

This works fine on two machines that we have been developing on.

I've recently installed it on a third machine with Perl 5.12.3 and Catalyst
5.90007.  On that machine, the method seems to be returning relative URLs,
e.g. on the page "/login", c.uri_for("/logout") returns a link to
"/login/logout" instead of "/logout".

Has anybody seen this issue before?





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



*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] post-deployment custom fields in application

2011-12-22 Thread Alexander Hartmaier

I'd use a nosql database or the xml feature of PostgreSQL/Oracle/... or
just have a large column that takes JSON.

Am 2011-12-22 20:01, schrieb bill hauck:

Hi.

I'm building an application--project management system--that I'd like to have 
the application administrators to be able to create custom fields for various 
tables after deployment.

For instance, instead of including a hard-coded field for every possible IM or chat system out 
there, I'd like the admins to be able to decide they only care about AIM and Skype, so they'd add 
"aim_name" and "skype_name" fields.  Other installations and admins might 
decide they only care about gtalk and facebook so they'd add those fields.

The other issue is that I don't want to simply add 10 extra fields and give the 
admins control of the display name.  I'd like to essentially have a secondary 
table that holds the custom fields for that table's primary table. So ...

The person table has a person_custom table to hold the custom fields and data.
The project table has a project_custom table to hold the custom fields and data.
Etc.

So my question really is what's the best approach?  A secondary table for every 
table I want custom fields for?  Or a set of static tables where the first 
holds the field information and the second holds the data related to those 
fields?  or is there a completely different way I'm not thinking of?

For the first way, custom table per table, how do I make DBIx::Class work with 
that?  I don't want to have to run the model creation script after adding or 
modifying a custom field; I'd like to have the field available on the fly.  Do 
I have to give up DBIC for the custom tables?

Any info is greatly appreciated.

Thanks,

bill


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



*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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: DBIC <-> JSON conversion for AJAX

2011-10-07 Thread Alexander Hartmaier

Catalyst::Controller::DBIC::API was written for exactly that use case.

Cheers, Alex

Am 2011-09-12 16:38, schrieb Roland Philibert:

Thanks all for your suggestions so far.
I was I guess on the right track with JSON:XS but I had also seen REST
but so far I am still unsure as what the best way to go.
Aptina (UK) Limited, Century Court, Millennium Way, Bracknell, Berkshire, RG12 
2XT. Registered in England No. 06570543.

This e-mail and any attachments contain confidential information and are solely 
for the review and use of the intended recipient. If you have received this 
e-mail in error, please notify the sender and destroy this e-mail and any 
copies.


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


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Recommended caching back-ends

2011-10-07 Thread Alexander Hartmaier

Hi Toby,
note that you can still use Cache::FastMmap with Catalyst::Plugin::Cache
(Config::General config file section):



class Cache::FastMmap
expires 3600
cache_size 8m



It took me also some time to find out which module is the 'old' and
which the 'new' one, docs need improvement for that.
I'm using it since years without a single segfault. You shouldn't use it
as a session *store* because it is a *cache* which means it can drop a
stored entry anytime if it runs out of memory for a new entry.

Cheers, Alex

Am 2011-10-07 03:52, schrieb Toby Corkindale:

Hey all,
I noticed today that Catalyst::Plugin::Cache::FastMmap has been
DEPRECATED for some now. (With dire warnings about it segfaulting or
discarding data randomly)

I just wondered what the recommended caching backend is now, to use
with Catalyst::Plugin::Cache.

(In my case, cached data doesn't need to be consistent between app
servers.. it's more just for performance so simple local-disk is fine
for caching, rather than memcached or database based solutions.)

Cheers,
Toby



*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] fastcgi script returns 404

2011-10-04 Thread Alexander Hartmaier

Static files should be in /root/static and configured to be served static.

Am 2011-09-26 08:32, schrieb Jorge Gonzalez:

El 24/09/11 13:23, Richard Thomas escribió:

On 24/09/2011, at 5:41 PM, Jorge Gonzalez wrote:


And this is my apache configuration for reverse proxying to Starman:

ProxyPass   /   http://localhost:3000/
ProxyPassReverse/   http://localhost:3000/

 Options FollowSymLinks
 AllowOverride None

Alias   /css/   /home/myapp/MyApp/root/css/
Alias   /img/   /home/myapp/MyApp/root/img/
Alias   /js//home/myapp/MyApp/root/js/

(I know this could be better :-)

For running the app from the main app directory:

starman -Ilib script/myapp.psgi -p 3000 --workers 3

No problems so far, using the same configuration in 4 applications
in heavy production use.

Regards
J.


There must be some Rewrite Rules in the mix here as well, surely? I'm
trying to get this set-up going, but am having two issues:

- All generated links refer to localhost:3000


You can avoid this by using Plugin::SmartURI in "relative" mode, AND
assuring ALL of your URLs in your app are generated via uri_for
method. No need for rewrite rules in Apache.


- The Catalyst app is still attempting to serve all the static content

Sorry, I pasted some prior Apache configuration version by mistake!
These are my real "Alias" sections for Apache:

Alias   /css/   /home/myapp/MyApp/root/css/

SetHandler default-handler


Alias   /img/   /home/myapp/MyApp/root/img/

SetHandler default-handler


Alias   /js//home/myapp/MyApp/root/js/

SetHandler default-handler


Hope it works for you.
Regards
J.


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


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] announcing DBICx::Generator::ExtJS::Model

2011-06-30 Thread Alexander Hartmaier

As a followup on SQL::Translator::Producer::ExtJS::Model::File (which I
won't develop further) I've finally found time to write
DBICx::Generator::ExtJS::Model which does the same but works on a
DBIx::Class instead of a SQL::Translator schema.
This has the advantage of knowing the relationship names.

What's missing is the serialization of the generated ExtJS models and
the output to one file per model as the ExtJS 4 docs suggest
(http://docs.sencha.com/ext-js/4-0/#/guide/application_architecture).

The code is hosted on github:
https://github.com/abraxxa/DBICx-Generator-ExtJS-Model

If you're interested get in touch with me via this list or irc #catalyst
or #dbix-class.

-- Alex (abraxxa)

*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Help System - Can a controller's index capture the remainder of the path as a series of arguments?

2011-05-10 Thread Alexander Hartmaier

If you want hostless uris take a look at Catalyst::Plugin::SmartURI.

Am 2011-03-31 19:35, schrieb Ronald J Kimball:

On Thu, Mar 31, 2011 at 1:31 PM, Octavian Rasnita  wrote:

In the templates where you will display the link to the Help file, you can use:

Help

What is the purpose of calling .path on the uri returned by
uri_for_action?  Is there some reason the href should be just the
path, instead of the full URI?

Ronald

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


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] announcing SQL::Translator::Producer::ExtJS::Model::File

2011-05-09 Thread Alexander Hartmaier

I'm cross-posting this to the DBIx::Class and the Catalyst mailing list
as both users might be interested in it.

I wanted to do this as soon as I've read the first blog post about the
ExtJS 4 data model and last Friday evening I've finally started writing it.
After a short discussion on #dbix-class on Friday I chose to implement
it as a SQL::Translator Producer so other ORM frameworks could just
write a SQL::T::Parser and use it too.
Personally I'll use the generated ExtJS classes with
Catalyst::Controller::DBIC::API in the backend.

The one drawback of making it a sqlt producer is that the dbic parser
loses the relationship names when creating the sqlt constraints.
This means that for using the resulting ExtJS classes with DBIC::API the
user has to change all relationship names.

What's your opinion on this issue? Should it be a different module that
directly parses dbic resultsources instead of using sqlt?

The code is hosted on github:
https://github.com/abraxxa/SQL-Translator-Producer-ExtJS-Model-File

Best regards, Alex (abraxxa)


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Job Queue recommendation

2011-01-21 Thread Alexander Hartmaier
t0m created CatalystX::JobServer which is currently only available on
github:
https://github.com/bobtfish/CatalystX-JobServer

--
Best regards, Alex


On Fri, 2011-01-21 at 15:49 +0100, Bill Moseley wrote:
>
>
> 2011/1/21 Octavian Rasnita 
> Hello,
>
> Can you recommend a job queue system that works under Windows
> (and which works with Oracle if it needs a database)?
>
>
> Have you looked at AMQP implementations?  RabbitMQ seems to have a
> Windows download.  But normally you would run the queue on its on
> machine (or machines) so might as well use Linux for that.  I suspect
> the Windows RabbitMQ is not as well used, but that's just a guess.
>
>
> http://www.rabbitmq.com/server.html
>
>
> http://qpid.apache.org/download.cgi
>
>
> It seems like there's some discussion around about if a database makes
> a good queue.  Grated, on the RabbitMQ site, so with a bias, but
> here's one:
> http://www.rabbitmq.com/resources/RabbitMQ_Oxford_Geek_Night.pdf
>
>
> A bit dated, but this is often cited when someone is comparing
> options:
>
>
> http://wiki.secondlife.com/wiki/Message_Queue_Evaluation_Notes
>
>
>
>
>
>
> --
> Bill Moseley
> mose...@hank.org


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Forcing scalar context in TT?

2011-01-20 Thread Alexander Hartmaier
http://template-toolkit.org/docs/manual/Plugins.html#section_Scalar
[% USE scalar %]
[% row.scalar.objects.count %]

But as DBIx::Class provides you with scalar-only _rs methods for
everything I use those instead.

--
Best regards, Alex


On Thu, 2010-12-23 at 18:04 +0100, Sam Kaufman wrote:
> You *could* do [% row.objects_rs.count %] to force resultset context.
> However, the fact that it's such a pain in the ass should tell you
> that you're doing something in the view that shouldn't be done there.
> Just stash the count from the controller, and you won't have to worry
> about scalar context ;)
>
> On Thu, Dec 23, 2010 at 11:44 AM, Moritz Onken
>  wrote:
> Use Template::Alloy and do
>
> [% $(row.objects).count %]
>
> Am 23.12.2010 um 16:53 schrieb Alex Povolotsky:
>
>
> > Hello!
> >
> > I'm writing an application that needs to count some related
> objects
> >
> > [% row.objects.count %] results in "select * from objects"
> > [% row.objects.scalar.count %] yields an error
> > [% row.search_related_rs('objects').count %] is UGLY
> >
> > Do I have any better solution?
> >
> > 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/
>
>


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] In HTML::FormHandler search form (no DB schema) -- how to populate a SELECT field via DBIx::Class?

2011-01-20 Thread Alexander Hartmaier
Why not solve it the exact same way?
Defined a schema attribute an pass your schema when constructing the
form object.
Maybe you only want to pass the country rs instead, whatever fits your
needs best.

Also note that HFH will automatically detect a belongs_to and populate
the Select without a need for the options_country sub!

Come to #formhandler if you have more questions.

--
Best regards, Alex


On Sun, 2011-01-16 at 16:41 +0100, will trillich wrote:
> Short version: If you have a HTML::FormHandler search form without a
> "has_field '+item_class'" (there's no data-base row corresponding to
> its contents) how to you reach your DBIx::Class schemas to populate a
> drop-down menu?
>
>
>
>
> Long version: This is in the context of a Catalyst app -- however, I
> do know this is either FormHandler question or a DBIC question, and
> not intrinsically a Catalyst question, but... hoping the wise folks
> here can nudge me in the right direction...
>
>
> We have several DBIC resultsets including Incident and Country. The
> Incident record has this relationship:
> __PACKAGE__->belongs_to( 'country' =>
> 'Incident::Schema::DB::Result::Country' );
>
>
> (And the country schema has_many incidents, of course)
>
>
> For the CRUD form related to the actual incident table, we have a
> matching HTML::FormHandler package with its
> has '+item_class'
> as expected. This makes it easy to create a
> sub options_country {
>   my $self = shift;
>   return unless $self->schema;
>   my $rs = $self->schema->resultset('Country');
>   #...
> }
> subroutine for the form, for populating a country drop-down menu in
> the HTML.
>
>
> But!
>
>
> For the SEARCH form, we are not interested in CRUD, plus we have extra
> fields (for example, we want the user to be able to bracket dates with
> a start-field and an end-field) so there's no one-to-one correlation
> with the database table -- meaning there's no "item_class" for the
> search form. And hence no schema to rely on.
>
>
> What we're looking for now -- unless there's a better more obvious
> paradigm -- is a way to get from an instance of the schema-object,
> back to the resultset, for searching.
> sub options_country {
>   my $self = shift; # note $c is not available here :(
>   # $self->schema will be UNDEF here
>   my $obj = Spill::Schema::DB::Result::Country->new; # Hard-wired,
> yes, is there a better way?
>   my $rs = $obj->???
>   # ?
> }
>
>
> I've looked at
> - $obj->result_source (Can't call method "resolve" on an undefined
> valued in DBIx/Class/Row)
> - $obj->result_source_instance->resultset (Can't call method
> "default_resultset_attributes" on an undef value in
> DBIx/Class/ResultSource)
> - $obj->result_source_instance->resultset_class->search({},{}) (Can't
> use string as a HASH ref in DBIx/Class/ResultSet)
> and a couple other dead ends.
>
>
> It's likely to be something obvious I've overlooked. :( Suggestions?
>
> --
> The first step towards getting somewhere is to decide that you are not
> going to stay where you are.  -- J.P.Morgan
>


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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: Trying out FormHandler, running into "maketext" error

2010-11-26 Thread Alexander Hartmaier
Exactly, because the widget class is
HTML::FormHandler::Widget::Field::Submit and not
HTML::FormHandler::Widget::Field::submit.

-- 
Best regards, Alex


On Tue, 2010-11-23 at 19:02 +0100, will trillich wrote:
> Not sure what your "case sensitive" remark refers to -- and if it's
> looking for something to be defined XXX that's defined xxx instead,
> that particular error message is really out of left field.
> 
> 
> Do you mean something like
>has_field 'submit'  => ( widget => 'submit' )
> should instead be
> has_field 'submit'  => ( widget => 'Submit' )
> with a capital S?
> 
> 
> The following is definitely working for us now:
> has_field 'submit' => (type => 'Submit', label => 'Submit',
> value=>'Submit', required => 0, )
> 
> 
> 
> 
> On Tue, Nov 23, 2010 at 11:47 AM, Alexander Hartmaier
>  wrote:
> Perl is case sensitive.
> 
> Also you should not have any non Catalyst::Controller
> subclasses in the
> Controller namespace of your app.
> Move you forms to My::App::Form for example.
> 
> --
> Best regards, Alex
> 
> 
> 
> On Mon, 2010-11-22 at 18:25 +0100, will trillich wrote:
> > Ooh, very nice! Thanks so much, that's lots better now. Woo
> hoo!
> >
> >
> > Yes indeed, the "undef error - Unable to do maketext on:
> > at /usr/local/share/perl/5.10.0/HTML/FormHandler/I18N.pm
> line 15."
> > error has gone away thanks to tweaks to the SUBMIT button on
> the
> > FormHandler definition.
> >
> >
> > Was there something in the Catalyst/FormHanlder intro that
> we missed?
> >
> >
> >
> > On Mon, Nov 22, 2010 at 5:16 PM, Hernan Lopes
> 
> > wrote:
> > will trillich,
> > that error happens when i use  has_field 'submit'
>  => ( widget
> > => 'submit' )
> >
> > can you test your form with this instead:
> > has_field 'submit' => (type => 'Submit', label =>
> 'Submit',
> > value=>'Submit', required => 0, )
> >
> > i bet your error will go away
> >
> >
> >
> >
> >
> >
> > On Mon, Nov 22, 2010 at 12:19 PM, will trillich
> >  wrote:
> > Our form-class includes
> >  has_field 'submit'  => ( widget =>
> 'submit' )
> >
> >
> > Do you mean type=>'submit' instead of
> > widget=>'submit'?
> >
> >
> > Interesting that you'd think of this as a
> suspect.
> > What's the rationale?
> >
> >
> >
> >
> > On Mon, Nov 22, 2010 at 9:16 AM, Hernan
> Lopes
> >  wrote:
> > will trilich, are you using widget
> type
> > submit ? try to replace with type =>
> 'Submit'
> >
> >
> > Hernan Lopes
> >
> >
> >
> > On Mon, Nov 22, 2010 at 1:38 AM,
> John Anderson
> >  wrote:
> >
> > On Nov 21, 2010, at 10:26
> PM, will
> > trillich wrote:
> >
> > > Pooh. Still no luck. When
> we try a
> > more more Moose-y approach,
> we do get
> > updated database records
> (stuffing the
> > URL with arguments to affect
> a
> > form-submit) but sti

Re: [Catalyst] Forward on to other actions after removing first path segment?

2010-11-23 Thread Alexander Hartmaier
Have you thought about making the date a parameter instead of part of
the uri?

--
Best regards, Alex


On Mon, 2010-11-15 at 20:10 +0100, Dorian Taylor (Lists) wrote:
> Hi Larry,
>
> On 15-Nov-10, at 10:55 AM, Larry Leszczynski wrote:
>
> > Hi Dorian -
> >
> >> OK, but the part that confuses me is why /foo doesn't resolve to
> >> MyApp::Foo::index with ->go or ->visit.
> >
> > Maybe this will help (I think in this case "index" works like
> > "default"):
> >
> >   http://wiki.catalystframework.org/wiki/wikicookbook/safedispatchusingpath
>
>
> According to your wiki page, my solution is thus:
>
> package MyApp;
>
> sub _date :Regex('^(\d{4}-\d{2}-\d{2})(.*)$') {
>  my ($self, $c) = @_;
>  my ($date, $rest) = @{$c->req->captures};
>  $c->req->path($rest);
>  $c->dispatcher->prepare_action($c);
>  $c->go($c->action, $c->req->args);
> }
>
> This exhibits exactly the behaviour I was looking for.
>
> Thanks,
>
> --
> Dorian Taylor
> Make things. Make sense.
> http://doriantaylor.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/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Begginer's question about application structure

2010-11-23 Thread Alexander Hartmaier
What's the advantage of Catalyst::Plugin::ConfigLoader::Multi over
setting the env var MY_APP_CONFIG_LOCAL_SUFFIX?
--
Best regards, Alex


On Mon, 2010-11-22 at 16:53 +0100, Martin Bendix wrote:
> > Have a look at this article
> > http://www.catalystframework.org/calendar/2007/14 which covers using
> > Catalyst models externally.
> > The code that goes with it is well out of date but should give you the
> > general idea using an external DBIC model class.
> >
> > Access to the model from a batch script:
> >http://dev.catalystframework.org/repos/Catalyst/trunk/examples/ExtJS/script/dump_bookings.pl
> >l
> >
> > Test script for model:
> >http://dev.catalystframework.org/repos/Catalyst/trunk/examples/ExtJS/t/10_schema.t
> >t
> >
> > Test scripts for web access:
> > http://dev.catalystframework.org/repos/Catalyst/trunk/examples/ExtJS/t/01app.t
>
> >http://dev.catalystframework.org/repos/Catalyst/trunk/examples/ExtJS/t/controller_ExtJS-Controller-ExtJS.t
> >t
> >
> > Some more pointers on testing:
> > http://dragonstaff.blogspot.com/2009/05/testing-with-perl-catalyst.html
> >
> >
> > Cheers, Peter
> > http://perl.dragonstaff.co.uk
>
> Hi Peter,
>
> Thanks for the great links.  I'd looked at the Advent Calendar articles
> previously, but hadn't remembered about the one you provided.  It looks very
> helpful, and I'll read it, and your information on testing, in more detail
> later.
>
>
>
> Martin
>
>
>
>
>
> ___
> 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/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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: Trying out FormHandler, running into "maketext" error

2010-11-23 Thread Alexander Hartmaier
Perl is case sensitive.

Also you should not have any non Catalyst::Controller subclasses in the
Controller namespace of your app.
Move you forms to My::App::Form for example.

--
Best regards, Alex


On Mon, 2010-11-22 at 18:25 +0100, will trillich wrote:
> Ooh, very nice! Thanks so much, that's lots better now. Woo hoo!
>
>
> Yes indeed, the "undef error - Unable to do maketext on:
> at /usr/local/share/perl/5.10.0/HTML/FormHandler/I18N.pm line 15."
> error has gone away thanks to tweaks to the SUBMIT button on the
> FormHandler definition.
>
>
> Was there something in the Catalyst/FormHanlder intro that we missed?
>
>
>
> On Mon, Nov 22, 2010 at 5:16 PM, Hernan Lopes 
> wrote:
> will trillich,
> that error happens when i use  has_field 'submit'  => ( widget
> => 'submit' )
>
> can you test your form with this instead:
> has_field 'submit' => (type => 'Submit', label => 'Submit',
> value=>'Submit', required => 0, )
>
> i bet your error will go away
>
>
>
>
>
>
> On Mon, Nov 22, 2010 at 12:19 PM, will trillich
>  wrote:
> Our form-class includes
>  has_field 'submit'  => ( widget => 'submit' )
>
>
> Do you mean type=>'submit' instead of
> widget=>'submit'?
>
>
> Interesting that you'd think of this as a suspect.
> What's the rationale?
>
>
>
>
> On Mon, Nov 22, 2010 at 9:16 AM, Hernan Lopes
>  wrote:
> will trilich, are you using widget type
> submit ? try to replace with type => 'Submit'
>
>
> Hernan Lopes
>
>
>
> On Mon, Nov 22, 2010 at 1:38 AM, John Anderson
>  wrote:
>
> On Nov 21, 2010, at 10:26 PM, will
> trillich wrote:
>
> > Pooh. Still no luck. When we try a
> more more Moose-y approach, we do get
> updated database records (stuffing the
> URL with arguments to affect a
> form-submit) but still can't render,
> with the same error as before:
>
>
> Have you looked at the docs for
> HTML::FormHandler::TraitFor::I18N?
> Based on that, you may want to see if
> you have something in
> $ENV{LANGUAGE_HANDLE} or try passing
> in a language handle to your form
> constructor -- or may try push_errors
> instead of add_errors, as that
> documentation suggests.
>
>
> j.
>
>
> 
> ___
> 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/
>
>
>
>
>
> --
> Failure is not important. How you overcome it, is.
> -- Nick Vujicic
>
>
> ___
> 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/
>
>
>
>
> --
> Failure is not important. How you overcome it, is.
> -- Nick Vujicic
>


*"*"*"*"*"*"*"*"*"*

Re: [Catalyst] Re: Organizing link generators

2010-11-12 Thread Alexander Hartmaier
To me company, lot and vin in the url look like arguments, not
PathParts.

--
Best regards, Alex


On Thu, 2010-11-11 at 11:48 +0100, Aristotle Pagaltzis wrote:
> * Alexander Hartmaier  [2010-11-11 09:00]:
> > I strongly advise to use
> > $c->controller('Auth')->action_for('edit') instead of
> > '/auth/company/lot/vin/edit' to not let Catalyst guess what you
> > mean. The string can fail if you have a typo in it and will be
> > hard to spot.
>
> No, that would be `$c->controller('Auth::Company::Lot::Vin')`.
>
> I use the action paths in our app and haven’t had any serious
> trouble.
>
> You can always wrap `uri_for_action` or `uri_for` in your
> application class to throw an error if it’s a real issue, anyway.
>
> Regards,


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Organizing link generators

2010-11-11 Thread Alexander Hartmaier
I strongly advise to use $c->controller('Auth')->action_for('edit')
instead of '/auth/company/lot/vin/edit' to not let Catalyst guess what
you mean.
The string can fail if you have a typo in it and will be hard to spot.

--
Best regards, Alex


On Sat, 2010-10-23 at 18:57 +0200, Eden Cardim wrote:
> > "Evan" == Evan Carroll  writes:
>
> Evan> My view often needs to generate complex links for chained
> Evan> actions.  Does anyone have a better way of doing this then
> Evan> recreating the link generators in the controller?
>
> $c->stash->{generate_link_edit} = sub {
>   my $vin = shift;
>   $c->uri_for_action(
>   '/auth/company/lot/vin/edit'
>   , [
> $c->stash->{chained_company_id}
> , $c->stash->{chained_lot_id}
> , $vin
>   ]
>   , ()
>   );
> };
>
> $c->stash->{generate_link_vehicle_add} = sub {
>   $c->uri_for_action(
>   '/auth/company/lot/inventory/add'
>   , [
> $c->stash->{chained_company_id}
> , $c->stash->{chained_lot_id}
>   ]
>   , ()
>   );
> };
>
> You should weaken the $c since that code will leak memory without
> it. And yes, that's currently the best way to generate urls (that I can
> think of anyway), although you can save some typing by using hash slices
> instead.
>


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Defining ARRAY in Config::General config

2010-10-08 Thread Alexander Hartmaier
If you're referring to Catalyst::Plugin::Email you shouldn't use that
any more as mailing doesn't need to be a plugin but a view.
Try Catalyst::View::Email(::Template)

--
Best regards, Alex


Am Dienstag, den 21.09.2010, 06:29 +0200 schrieb Pavel A. Karoukin:
> Hello,
>
>
> I am using Catalyst::Plugin::Mail and want to define email config in
> myapp.conf. But C::P::Mail expects email config variable to be array
> ref. How I can assign array value to config variable in myapp.conf?
>
>
> Regards,
> Pavel
>
>


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] best practices for handling forms?

2010-09-29 Thread Alexander Hartmaier
Take a look at HFH, especially this pod:
http://search.cpan.org/~gshank/HTML-FormHandler-0.32002/lib/HTML/FormHandler/Manual/Cookbook.pod

I tried both FormFu and FormHandler and the later is much cleaner code
and also a lot faster although it uses Moose.

--
Best regards, Alex


Am Montag, den 20.09.2010, 23:48 +0200 schrieb E R:
> Hi,
>
> I am curious what everyone thinks as being the best practices for
> handling forms in Catalyst. Are there any Catalyst applications you
> have run across which are good examples of how to use Catalyst's
> features to handle forms?
>
> To illustrate what I am getting at, below is typical Rails (v2)
> controller code which implements updating the attributes of an object:
>
>def edit
>   @book = Book.find(params[:id])
>   @subjects = Subject.find(:all)
>end
>def update
>   @book = Book.find(params[:id])
>   if @book.update_attributes(params[:book])
>  flash[:notice] = 'Book successfully updated.'
>  redirect_to :action => 'show', :id => @book
>   else
>  @subjects = Subject.find(:all)
>  render :action => 'edit'
>   end
>end
>
> In Catalyst, this would be appear something like (and please correct
> me if I have made any errors here):
>
> sub edit  :Args(1) {
>   my ($self, $c, $id) = @_;
>   ... set up $c->stash for template 'edit' ...
>   # no need to set $c->stash->{template} - will be set from the current action
> }
>
> sub update :Args(1) {
>   my ($self, $c, $id) = @_;
>   ...process form...
>   if (form is valid) {
> ...perform updates...
> $c->flash->{notice} = 'Book successfully updated.';
> $c->res->redirect('show', $id);
>   } else {
> ... set up $c->stash for 'edit' template ...
> $c->stash->{template} = 'edit';
>   }
> }
>
> Any comments on this architecture? Is there a better way? My main problems 
> are:
>
> 1. The code ... set up $c->stash for 'edit' template ... is duplicated
> in both edit and update (which is also true for the Rails code).
>
> 2. Having the template name defaulted from the current action is nice,
> but that means we have to explicitly set it in the update method. Is
> it better to always explicitly set the template name in a controller
> method? Then update could perform a $c->detach('edit', $id) or would
> you use $c->go('edit', $id)?
>
> Thanks,
> ER
>
> ___
> 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/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Make the money format macro globally available.

2010-09-29 Thread Alexander Hartmaier
Or use the awesome expose_methods config param introduced in version
0.35:
http://search.cpan.org/~bobtfish/Catalyst-View-TT-0.35/lib/Catalyst/View/TT.pm#expose_methods

--
Best regards, Alex


Am Mittwoch, den 22.09.2010, 12:47 +0200 schrieb Duncan Garland:
> Works like a charm. Thanks.
>
> -Original Message-
> From: Larry Leszczynski [mailto:lar...@emailplus.org]
> Sent: 21 September 2010 18:05
> To: The elegant MVC web framework; catalyst@lists.scsys.co.uk
> Subject: Re: [Catalyst] Make the money format macro globally available.
>
> Hi Duncan -
>
> On Tue, 21 Sep 2010 17:52 +0100, "Duncan Garland"
>  wrote:
> > How do you make the money macro available in all templates?
> >
> > [% USE money=format('%.2f') -%]
> >
> > Presumably something goes in here:
> >
> > __PACKAGE__->config(
> > TEMPLATE_EXTENSION => '.tt',
> > render_die => 1,
> > WRAPPER => 'wrapper.tt',
> > );
>
> You can put commonly used macros, formats, etc. in a file named e.g.
> "pre_process_config.tt" in your main templates directory, then add
> "PRE_PROCESS" to your config:
>
>
>   __PACKAGE__->config(
>   TEMPLATE_EXTENSION => '.tt',
>   render_die => 1,
>   WRAPPER => 'wrapper.tt',
>   PRE_PROCESS => 'pre_process_config.tt'.
>   );
>
>
> HTH,
> Larry
>
> ___
> 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/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] [Beginner] C::V::Email::Template does not render

2010-09-16 Thread Alexander Hartmaier
As you can see in the docs of C::View::Email::Template the view you
configure has to be TT, Web in your case, not Email::Template itself.

The rendered template looks fine to me besides the localize.
Does this work with your View::Web when generating a html page for the
browser?

--
Best regards, Alex


Am Mittwoch, den 15.09.2010, 22:23 +0200 schrieb Ekki Plicht (DF4OR):
> Sorry to be a PITA, but I can't make heads nor tails of this view
> thing.
>
> When I started my app I created a view like this
>
> $ script/wshop_create.pl view Web TT
>
> Since then Cat renders my web templates fine.
>
> Now I have followed the cookbook example, later the example from
> C::V::Email::Template docs to send mails:
>
> $ script/wshop_create.pl view Email::Template Email::Template
>
> So I have two view instances, as debug output shows:
>
> | wshop::View::Email::Template | instance |
>
> | wshop::View::Web | instance |
>
> Configured like this (the relevant part only):
>
> 
>
> 
>
> content_type text/plain
>
> charset utf-8
>
> view Email::Template
>
> 
>
> 
>
> Now when I want to use the Email::Template like this:
>
> $c->stash->{digest} = $newuser->get_column('digest');
>
> $c->stash->{email} = {
>
> to => $c->req->params->{'email'},
>
> from => $c->config->{mailfrom},
>
> subject => $c->localize( 'mm_registersubject' ),
>
> template => 'registermail.tt'
>
> };
>
> $c->forward( $c->view( 'Email::Template' ));
>
> return $c->res->redirect( $c->uri_for('/user/registerdone') );
>
> I get an error:
>
> Caught exception in wshop::View::Email::Template->process
> "C::V::Email::Template's configured view
> 'wshop::View::Email::Template=HASH(0x9c00890)' doesn't have a render
> method!
> at /usr/lib/perl5/site_perl/5.12.2/i686-linux/Class/MOP/Method/Wrapped.pm 
> line 159"
>
> Now that's most surprising. wshop::V::Email::Template doesn't have a
> render method? Hm. That's where I get lost...
>
> If I change the configuration to 'default view Web' (my other view),
> the email does get sent, but not rendered. A template like this
>
> [% c.localize('mm_reghello') %]
>
> [% c.localize('mm_regsent') %]
>
> [% c.uri_for('/user/registration') %][% c.digest %]
>
> [% c.localize('mm_regfinal') %]
>
> [% PROCESS mailsig.tt %]
>
> Context is [% c %]
>
> Base is [% base %]
>
> Name is [% name %]
>
> is turned into this:
>
> mm_reghello
> mm_regsent
> http://localhost:3000/user/registration
> mm_regfinal
> --
> Signature as intended (i.e. PROCESS works)
>
> Context is wshop=HASH(0xa229bc0)
> Base is http://localhost:3000/
> Name is wshop
>
>
> Any help is greatly appreciated, as I am really lost at the moment.
> TIA.
>
> Cheers,
>
> Ekki
>


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] working with strange port setups

2010-09-16 Thread Alexander Hartmaier
Please talk to your firewall admins (I'm one myself) to allow tcp/443.
I can't think of a reason they would deny that request.

Everything else is just sick and might hurt you later if an IPS tries to
verify that its http and can't decode it.

--
Best regards, Alex


Am Samstag, den 21.08.2010, 11:51 +0200 schrieb Darren Duncan:
> Hello,
>
> For context, I'm currently deploying/demoing a Catalyst app on a client 
> machine
> where it uses a contrived base url scheme to work around a restrictive 
> firewall
> setup.  To be specific, the Firewall blocks all ports except port 80 (plus a 
> few
> admin ports like SSH etc) and I want to run through HTTPS, so I've currently 
> got
> the machine's Apache running HTTPS through port 80 rather than 443.
>
> (My development machine isn't contrived at all, so no issue there.)
>
> The contrived url for my Catalyst app looks like this:
>
>https://example.com:80/MyApp/some/page
>
> My app initially works fine here using the FastCGI or CGI server script and 
> the
> urls produced by uri_for() are mostly what is needed here but not quite.
>
> An invocation of:
>
>https://example.com:80/MyApp/some/page
>
> ... would have page urls going to the likes of:
>
>https://example.com/MyApp/other/page
>
> ... which is correct except for the missing :80, because the result alone
> implies port 443 which isn't correct here.
>
> Now from running the first url with "?dump_info=1" shows that the FastCGI/CGI
> program, namely Catalyst, *does* receive the necessary information to produce
> correct base urls.
>
> Here's a relevant subset of "Request" details from dump_info:
>
> bless({
>base => bless(do{\(my $o = "https://example.com/MyApp/";)}, "URI::https"),
>headers => bless({
>  "host" => "example.com:80",
>  "https" => "on",
>}, "HTTP::Headers"),
>uri => bless(do{\(my $o =
> "https://example.com/MyApp/some/page?dump_info=1";)}, "URI::https"),
> }, "Catalyst::Request")
>
> The "base" and "uri" reflect the incorrect output, but the "headers" records 
> the
> fact that both port 80 was invoked and https is on.  Using the latter 2 bits 
> of
> information, Catalyst should be able to construct "https://example.com:80"; 
> urls.
>
> Therefore, can anyone tell me how to configure Catalyst so that it builds the
> urls I need, or alternately where in the Catalyst source I should look in 
> order
> to create a patch to enable this?
>
> Ideally this added smarts could make it into a CPAN release, if code changes 
> are
> needed, but I would like to have this working quite soon, so if I knew what to
> patch in the meantime to get this to work, I would appreciate it.
>
> Undoubtedly, Catalyst should simply handle this situation, but I'm not 
> surprised
> that it doesn't yet, considering this is an edge case that the developers may
> not have encountered before.
>
> Thank you. -- Darren Duncan
>
> ___
> 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/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Working with project configurationfileoutsideofCatalyst directory

2010-09-15 Thread Alexander Hartmaier
I'd suggest to remove the db connection settings from the myapp.conf
file entirely and create one additional config file with just the prod
db settings and one for the test db.
You control with *additional* config file is loaded with the
MYAPP_CONFIG_LOCAL_SUFFIX env var.

When you set this env var to 'testing' in your testing file (or better
library included in every test file) you prevent to ever run the test
code against the prod db...yes that happens... ;-(

--
Best regards, Alex


Am Sonntag, den 05.09.2010, 08:58 +0200 schrieb Octavian Rasnita:
> Hi Leandro,
>
> Have you tried to use in your main configuration file something like:
>
> 
> <>
> 
>
> and in your Catalyst configuration file something like:
>
> 
> <>
> 
>
> and in the db.conf:
>
>schema_class ...
>
>dsn ...
>username ...
>password ...
>AutoCommit 1
>
>
> Octavian
>
> - Original Message -
> From: "Leandro Hermida" 
> To: "The elegant MVC web framework" 
> Sent: Sunday, September 05, 2010 2:14 AM
> Subject: Re: [Catalyst] Working with project 
> configurationfileoutsideofCatalyst directory
>
>
> > Hi there,
> >
> > But none of these solutions solve the problem I mentioned in my
> > earlier email.  If for example you have your database connection
> > information in the parent project configuration file which would be
> > common since many things outside of Catalyst need to access the
> > database and in this file you would have it look like this:
> >
> > 
> >   schema_class ...
> >   
> >   dsn ...
> >   username ...
> >   password ...
> >   AutoCommit 1
> >   
> > 
> >
> > And in the Catalyst configuration file if you include the parent
> > config it won't work since Catalyst::Model::DBIC::Schema seems to need
> > the enclosing tags to start with Model:: i.e. 
> > .  Of course it doesn't make sense to use such tags in
> > the parent configuration.
> >
> > Does anyone know of a way to have Catalyst::Model::DBIC::Schema look
> > for a different set of tags in the Config::General file?
> >
> > best,
> > Leandro
> >
> > ___
> > 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/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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 share a database connection across multiple Catalyst apps?

2010-09-15 Thread Alexander Hartmaier
I guess the DBA's don't like it because Oracle starts one process per
connection unless you use connection pooling.
I think that's a listener setting, your DBA's should know.

--
Best regards, Alex


Am Mittwoch, den 08.09.2010, 16:54 +0200 schrieb Simon Miner:
> Thanks for the responses,
>
> Jason, I don't think reducing the number of database connections will
> hurt responsiveness.  Even though there are 3 separate Catalyst apps,
> each HTTP request will only involve one of them (since they all run
> out of the same web server), so there should never be contention
> between the apps for the shared database connection.  Does this make
> sense?
>
> Tom and Nicholas, I wish this was premature optimization, but my
> organization has experienced serious performance issues in the past
> related to multiple (Oracle) database connections per HTTP server
> process.  Extra Oracle connections are expensive to maintain,
> particularly on the database server, and so we've tried to ensure that
> a single server process only has a single connection to a given
> database (since that's all it should need at any given time).
>
> I've attached a Devel::NYTProf screenshot for one of the server
> processes I profiled this morning. Looks like it confirms the multiple
> database connections.
>
> So back to initial question -- How do I update the models of my three
> Catalyst apps to share a single Oracle database connection?
>
> Thanks again.  I really appreciate your feedback.
>
>  Simon
>
> On Tue, Sep 7, 2010 at 11:40 PM, Nicholas Wehr
>  wrote:
> I'm with Tom on this one. Unless you've narrowed all
> optimization efforts and this is all you have left - it could
> be worth a try.. but as Jason points out, you may not gain a
> thing. I'd recommend profiling your code and tracking down
> performance issues from that base level. Please post your
> results - I've very curious!
>
> -nw
>
>
>
> On Tue, Sep 7, 2010 at 7:21 PM, Tomas Doran
>  wrote:
>
> On 7 Sep 2010, at 18:59, Simon Miner wrote:
> All three of these apps run under a single
> Apache 1.3.42/mod_perl 1.31 server.
>
>
> Wow, mod_perl 1 Ok then :)
>
>
>  It appears that each server process creates a
> unique database connection variable for each
> of these apps. Although these database
> connections get reused from request to
> request, I would like to make things even more
> efficient by having a single database
> connection variable per server process which
> gets shared across all 3 Catalyst apps.
>
>
> Why do you think that this will help or affect
> anything?
>
> I.e. is this not premature optimisation?
>
> 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/
>
>
>
>
> ___
> 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/
>
>
>
>
> --
> -- Simon


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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::Controller::DBIC::API::REST warnings

2010-08-11 Thread Alexander Hartmaier
Moose::Role::BuildInstanceOf 0.07 fixes the problem so you can upgrade
again.

-- 
Best regards, Alex


Am Dienstag, den 10.08.2010, 19:06 +0200 schrieb Thiago Yukio Kikuchi
Oliveira:
> Thanks Florian and Alexander!
> 
> I just downgrade my Moose version to 1.08 and everthing works!
> 
> 
> 
> /Thiago Yukio Kikuchi Oliveira
> (=\
>   \=) Faculdade de Medicina de Ribeirão Preto
>/   Laboratório de Genética Molecular e Bioinformática
>   /=) -
> (=/   Centro de Terapia Celular/CEPID/FAPESP - Hemocentro de Rib. Preto
>   /Rua Tenente Catão Roxo, 2501 CEP 14151-140
> (=\   Ribeirão Preto - São Paulo
>   \=) Fone: 55 16 2101-9300   Ramal: 9603
>/   E-mail: stra...@lgmb.fmrp.usp.br
>   /=)strat...@gmail.com
> (=/
>   /Bioinformatic Team - BiT: http://lgmb.fmrp.usp.br
> (=\   Hemocentro de Ribeirão Preto: http://pegasus.fmrp.usp.br
>   \=)
>/  -----
> 
> 
> 
> On Tue, Aug 10, 2010 at 12:58 PM, Alexander Hartmaier
>  wrote:
> > Awesome, my module does have users!
> >
> > I'm improving test code coverage since YAPC and will upload the next
> > version in a couple of days (yes the very first test found a bug in
> > RPC).
> >
> > Like rafl explained just downgrade Moose to 1.08 for the moment and
> > you're fine.
> >
> > --
> > Best regards, Alex
> >
> >
> > Am Dienstag, den 10.08.2010, 17:09 +0200 schrieb Florian Ragwitz:
> >> Thiago Yukio Kikuchi Oliveira  writes:
> >> > I installed the last Catalyst::Controller::DBIC::API::REST from CPAN
> >> > but when I try to use it, the same shows the warning below.
> >> > I update all my Moose and MooseX modules but seems not work too.
> >>
> >> That's a bug in MooseX::Role::BuildInstanceOf, which is now exposed by 
> >> Moose
> >> being stricter about attributes that should coerce.
> >>
> >> > How to solve this?
> >>
> >> Either wait a couple of days for a new Moose::Role::BuildInstanceOf
> >> version to appear on CPAN, or downgrade Moose to a version which is less
> >> strict about those things.
> >
> >
> > *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
> > T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
> > Handelsgericht Wien, FN 79340b
> > *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
> > Notice: This e-mail contains information that is confidential and may be 
> > privileged.
> > If you are not the intended recipient, please notify the sender and then
> > delete this e-mail immediately.
> > *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
> >
> > ___
> > 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/


___
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::Controller::DBIC::API::REST warnings

2010-08-10 Thread Alexander Hartmaier
Awesome, my module does have users!

I'm improving test code coverage since YAPC and will upload the next
version in a couple of days (yes the very first test found a bug in
RPC).

Like rafl explained just downgrade Moose to 1.08 for the moment and
you're fine.

--
Best regards, Alex


Am Dienstag, den 10.08.2010, 17:09 +0200 schrieb Florian Ragwitz:
> Thiago Yukio Kikuchi Oliveira  writes:
> > I installed the last Catalyst::Controller::DBIC::API::REST from CPAN
> > but when I try to use it, the same shows the warning below.
> > I update all my Moose and MooseX modules but seems not work too.
>
> That's a bug in MooseX::Role::BuildInstanceOf, which is now exposed by Moose
> being stricter about attributes that should coerce.
>
> > How to solve this?
>
> Either wait a couple of days for a new Moose::Role::BuildInstanceOf
> version to appear on CPAN, or downgrade Moose to a version which is less
> strict about those things.


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] DBIC custom SQL hack stopped working after upgrading Catalyst

2010-08-10 Thread Alexander Hartmaier
Hi Tobias,

I've added a My::Model::Constants namespace which several modules
containing constants for different parts of my schema and include those
in my result(set) classes if needed and the cat apps using the model.

--
Best regards, Alex


Am Montag, den 09.08.2010, 17:04 +0200 schrieb Tobias Kremer:
> On Mon, Aug 9, 2010 at 12:24 PM, Tobias Kremer  
> wrote:
> >>> Couldn't load class (MyApp) because:
> >>> DBIx::Class::Row::throw_exception(): Can't locate object method
> >>> "register_source" via package "MyApp::Schema" at
> >>> xxx/MyApp/Schema/User.pm line 357 (see line below).
> >> Can you load Devel::SimpleTrace and get a full stack trace of the failure?
> > Is it possible that this has got something to do with me explicitly
> > use'ing some Schema classes in controllers because they have some
> > constants defined that I need to access?
>
> My suspicion was right: After removing all "use MyApp::Schema::*"
> occurrences from our controllers the app started. Nevertheless, I'm
> not sure if this is expected behaviour.
>
> I skimmed through the mailing list archive and found a thread about
> how best to arrange constants and the recommendation was to create a
> separate MyApp::Constants class. But to me it sounds more rational to
> store, say different role IDs as constants in the corresponding
> MyApp::Schema::Role model class...
>
> Any thoughts?
>
> --Tobias
>
> ___
> 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/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] rich ajax UI component libraries for Catalyst?

2010-07-26 Thread Alexander Hartmaier
I'm one of the guys using ExtJS with DBIC::API.

I tried Dojo about two years ago and docs didn't exist for it, don't
know if that has changed.
jQuery UI is lacking a *lot* of widgets compared to ExtJS which is
really awesome when it comes to subclassing components to build your
own.

--
Best regards, Alex


Am Samstag, den 24.07.2010, 18:31 +0200 schrieb Nick Perez:
> On Sat, 24 Jul 2010 16:43:58 +0200
> Leandro Hermida  wrote:
>
> > Hi everyone,
> >
> > Are there any rich ajax UI component libraries out there that would
> > interoperate well with Catalyst?
> >
> > thanks,
> > Leandro
>
> I've had success both with jquery-ui and also with extjs. A number of
> people I know that use Catalyst::Controller:DBIC::API also use those
> tools and report favorable experiences.
>


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Best practice for setting up database in a complex project?

2010-07-20 Thread Alexander Hartmaier
SQL::Translator generates constraints, indexes, ...
Deploying my test db was quite easy using it after I've fixed some
Oracle specific bugs.

--
Best regards, Alex


Am Freitag, den 16.07.2010, 20:07 +0200 schrieb Dave Rolsky:
> On Fri, 16 Jul 2010, Matija Grabnar wrote:
>
> > Do you write the database definition mysql/postgresql format, and then dump
> > schema to get the Perl classes, or do you write Perl class definitions and
> > use something else to output the table creation statements for the
> > database of your choice?
>
> Personally, I like to write the schema in SQL.
>
> My _reason_ for this is that I actually intend to fully use the database.
> That means defining custom types, adding table constraints, triggers, etc.
>
> The SQL schema file is the primary definition for the database.
>
> > And what do you do when the structure of the database changes (new tables,
> > new columns, new indexes or foreign keys) - do you use a DB versioning 
> > thing,
> > or do you do it by hand? If you do use a DB versioning tool,
> > which do you recommend?
>
> If you're using things like constraints, triggers, etc., then you'll
> almost certainly need to do this stuff by hand.
>
> I've written some tools to help with this as part of a wiki I'm working
> on. You can see it on CPAN (http://search.cpan.org/dist/Silki) or in my
> mercurial repo (http://hg.urth.org/hg/Silki).
>
> I'm pretty happy with how this works, and I've even written a framework to
> do automated tests of my migrations, which is very helpful. It's very easy
> to make mistakes when writing migrations, so tests are pretty valuable
> here.
>
>
> -dave
>
> /*
> http://VegGuide.org   http://blog.urth.org
> Your guide to all that's veg  House Absolute(ly Pointless)
> */
>
> ___
> 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/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Contributing code

2010-06-30 Thread Alexander Hartmaier
I'd prefer *much* more inline comments as well to make it easier to work
on code parts I've never touched before when debugging or adding
features as it's very hard to figure out what the methods do and how
they interact.

--
Best regards, Alex


Am Montag, den 21.06.2010, 16:55 +0200 schrieb J. Shirley:
> On Mon, Jun 21, 2010 at 7:43 AM, iain  wrote:
> > Ævar Arnfjörð Bjarmason wrote:
> >>
> >> It depends on what sort of comments you're making. Comments that
> >> explain tricky code that help with maintenance down the road are
> >> welcome everywhere. If you're just making comments that help someone
> >> completely unfamiliar with Catalyst to read the code it'll probably be
> >> more distracting than helpful to core devs.
> >>
> >>
> >
> > Surely the core devs can work with comments?
> >
> > Would having more comments not encourage more developers to contribute by
> > lowering the barrier for entry?
> >
>
> I don't think I can count as a core developer anymore, but really the
> more comments the better (provided they aren't there so you can
> practice your buddy career as a novelist).
>
> If you can't write sane comments, though, I don't think you can write
> sane code :)
>
> ___
> 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/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Chained actions with can't terminate with :PathPart('') ?

2010-05-08 Thread Alexander Hartmaier
Trevors example might overwhelm you a bit if you're not already that
familiar with chained.

The thing to understand is, every endpoint needs to end with an action
that uses Args, every part in the chain CaptureArgs, both might be (0).

So in your example you need a middle chain part for lot with two
endpoints, one with Args(0) to match just /lot and another one with
Args(1) that captures the lot id and matches /lot/5.

HTH

--
Best regards, Alex


Am Freitag, den 07.05.2010, 19:12 +0200 schrieb Evan Carroll:
> I have two destinations in my Catalyst app
>
> /auth/company/5/lot
> /auth/company/5/lot/5
>
> This works and is often seen in Catalyst apps to achive this effect.
> sub lot :Chained('/auth/company') :CaptureArgs(1) {
> sub view_lot :Chained('/auth/company') :PathPart('') :Args(1) {
>
> However, I would also expect the below to work; but, it seems it doesn't. I
> can only formulate the effect I want the above way. This is
> unfortunate because if all chained descendants of `lot` utilize a
> check provided here in the chain, then shouldn't `view_lot` also get
> to utilize that code? It would certainly be nice to eliminate
> redundant code here.
> sub lot :Chained('/auth/company') :CaptureArgs(1) {
> sub view_lot :Chained('/auth/company/lot') :PathPart('') :Args(0) {
>
> I think it is also confusing to those that first encounter it.
>
> I always know that I could just call it /view, and be done with it, but still.
> /auth/company/5/lot/5/view rather than, /auth/company/5/lot/5
>
> But, I just wanted to know what others thought of this.
>


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Using Jquery UI Autocomplete widget with Catalyst::View::JSON

2010-04-26 Thread Alexander Hartmaier
HRI will return prefetched rels too, get_columns won't.

--
Best regards, Alex


Am Montag, den 26.04.2010, 17:23 +0200 schrieb Ben van Staveren:
> Used it but at the same time, doing my $hashref =
> { $row->get_columns } got me more or less the same effect for a lot
> less hassle :)
>
> I actually do this for most my DB objects that get serialised to JSON,
> quite simple case of $c->stash->{json} = [ map { $_->get_columns }
> $rs->all ];
>
> In a similar vein, I haven't yet really seen/heard any sort of "best
> practices" when it comes to Catalyst and JSON, so maybe I'm going
> about it all wrong but eh :)
>
> Lee Aylward wrote:
> > On Mon, 26 Apr 2010 16:33:31 +0700
> > Ben van Staveren  wrote:
> >
> >
> > > Probably not the most pretty one but:
> > >
> > > Given you have a resultset obtained with, say,
> > >
> > > my $result_set = $c->model('DB::Somedata')->search_rs({...}, {...});
> > >
> > > $c->stash->{json} = [
> > >   map { id => $_->id, label => $_->name } ($result_set->all)
> > >   ];
> > >
> > > Or a bit more verbose:
> > >
> > > foreach my $result ($result_set->all) {
> > >   push(@{$c->stash->{json}}, { id => $result->id, label =>
> > > $result->name }); }
> > >
> > >`
> > >
> > >
> >
> > I've also had good luck using DBIx::Class::RsultClass::HashRefInflator
> > in the past. It doesn't give you quite as much control, but it may be
> > enough for your needs.
> >
> > http://search.cpan.org/~frew/DBIx-Class/lib/DBIx/Class/ResultClass/HashRefInflator.pm
> >
> >
>
> --
> Ben van Staveren
> phone: +62 81 70777529
> email: benvanstave...@gmail.com


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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 is session is expired

2010-04-16 Thread Alexander Hartmaier
You have to $c->detach() right after the redirect to stop further
execution of the current action.
If you're doing the redirect in an auto method you might also return a
false value.

--
Best regards, Alex


Am Freitag, den 16.04.2010, 11:51 +0200 schrieb David:
> Regarding session expiring, I am having a little problem.
>
> I want to redirecto to login page whenever session is expired. It
> works allright, but when I do the redirect in a Controller index
> method ( sub index :Path :Args(0){} ), I always get next error
> message:
>
> Caught exception in engine "Can't call method "as_string" on an
> undefined value at /usr/local/share/perl/5.8.8/Catalyst/Engine.pm line
> 95."
> Browser gets 404 HTTP Error, because instead of being redirect to
> login page, it is redirect to the same page, the page which is served
> int the index method.
>
> I have made tests, and the redirect doesn't seem to be working right
> in this case. Code is executed after redirect, instead of stopping
> executing.
>
> Redirect looks like: $c->response->redirect($c->uri_for('/'));
>
>
> David
>
>
>
>
> __
> De: Ben Hitz 
> Para: The elegant MVC web framework 
> Enviado: jue,15 abril, 2010 18:59
> Asunto: Re: [Catalyst] Check is session is expired
>
> $c->session->session_expires) returns 0 when the session is expired
> (and deletes the session).
>
> Caveat: I am brand new - never installed the sw, but I was JUST
> reading this in the docs.
>
> Ben
>
> On Apr 15, 2010, at 8:33 AM, David wrote:
>
> > Hi,
> >
> > Is there any method in order to check if user session has expired,
> so that user is redirect to login page?
> > Something like $c->session->is_expired which returns true or false?
> >
> > I've checked Catalyst Session Plugin, but I havem't found any method
> to check if session has expired.
> >
> > David
> >
> >
> > ___
> > 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/
>
> --
> Ben Hitz
> Senior Scientific Programmer ** Saccharomyces Genome Database ** GO
> Consortium
> Stanford University ** h...@genome.stanford.edu
>
>
>
>
> ___
> 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/
>
>


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Picking template type based on input

2010-03-30 Thread Alexander Hartmaier
Sounds like you want Catalyst::Action::Serialize.

--
Best regards, Alex


Am Freitag, den 26.03.2010, 10:43 +0100 schrieb Jon mailinglists:
> Hi all,
> I'm making a small catalyst application and I want to be able to serve
> different types of content based on parameters and/or request headers.
> I'm curious about where the "correct" location for that kind of code
> is, my current sollution is in the Root end like this:
>
> sub end : ActionClass('RenderView') {
> ...
> if ($c->stash->{json} || $c->request->params->{json} ||
> $c->req->header('accept') =~ /json/)
> {
>$c->stash->{template} = $c->action.'_json.tt';
>$c->res->headers->content_type( 'Application/json; charset=utf-8' );
> }
> ...
> }
>
> but it feels "wrong" to put it in the Root controller rather than the
> view.  Is this really the place where I'm supposed to have that kind
> of logic? Would that also be the place if I want to add pdf out to
> pick another View to forward to?
>
> Thanks in advance
> Jon
>
> ___
> 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/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] [ANNOUNCE] Call for testers: Compound Primary Key support in Catalyst::Authentication::Store::DBIx::Class

2010-03-30 Thread Alexander Hartmaier
Installed and tested on my notebook (Ubuntu 9.10 64bit) successfully.

--
Best regards, Alex


Am Montag, den 29.03.2010, 18:40 +0200 schrieb Florian Ragwitz:
> Short version:
>
>   If you're using Catalyst::Authentication::Store::DBIx::Class, install
>   FLORA/Catalyst-Authentication-Store-DBIx-Class-0.1100-TRIAL.tar.gz and
>   report any problems.
>
> Long version:
>
>   I just uploaded a development release of
>   Catalyst::Authentication::Store::DBIx::Class to CPAN. It adds support
>   for authenticating against a user table with a compound primary key.
>
>   In order to add that feature, a couple of internal changes had to be
>   made. Those changes also affect the usage of the module with a
>   single-column primary key in the user table. Therefore, it's important
>   that you test your existing applications using the DBIx::Class auth
>   store against the above development release, even if you don't care
>   about the new feature at all.
>
>   Please tell us about the results of your testing, both success and
>   failure, on the mailing list or in #catalyst-dev on irc.
>
>
> Thanks in advance
>
>


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Making a hash available across the application

2010-03-18 Thread Alexander Hartmaier
Am Donnerstag, den 18.03.2010, 00:08 +0100 schrieb Tomas Doran:
>
> In fact, generally - you don't want to be calling the generic ->search
> method in your controllers _at all_.
>
> The specific search functionality should instead be pushed down into
> your ResultSet classes, so that you say:
>
> $c->model('DB::Books')->find_all_books_by_author($author_name);
>
> Rather than $c->model('DB::Books')-
>  >search({ %stuff_including_author_name }, { %ordering_stuff });
>
> The former is your controller declaratively asking the domain model
> for what it wants. The latter is for controller manipulating the
> domain model directly by having knowledge of it's implementation.
>
> Which tables you join (and how you join / sort / order / filter them)
> to get a set of data _IS NOT_ something controller code should know or
> care about, as that takes away your ability to alter the data
> representation (e.g. changing the table structure) without changing
> every place that knows about that representation...
>
> When you need to change your schema (and this will happen!), then only
> having to change the implementation details in the model is
> significantly less work (and testing), especially when you have dozens
> of controllers!
>
> Cheers
> t0m
>

We should add that somewhere at the very top of some DBIC doc!

( no, I don't wanna hear a 'well volunteered' this time! )

--
Best regards, Alex


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Socket error when launching Catalyst server

2010-03-15 Thread Alexander Hartmaier
This means that another process is already listening on the tcp port the
catalyst server wants to use (default 3000).
Maybe you have already an instance of the cat webserver running.
If you need to run multiple cat apps at the same time specify the port
number by using the command line option -p(ort).

--
Best regards, Alex


Am Montag, den 15.03.2010, 16:32 +0100 schrieb David:
> Hello,
>
> recently I am getting next error message once I have launched Catalyst
> server:
>
> Couldn't create daemon: IO::Socket::INET: Address already in use
> at /usr/local/share/perl/5.8.8/Catalyst/Engine/HTTP.pm line 211.
>
>
> I never got this error message before. I don't know how to fix it. It
> is like if there where other server instances running, because my
> website works even if I shut down the server.
> I can't neither see server activity, as it seems website is running in
> another server instance.
>
>
> David
>
>
>


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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 session expiry without extending it

2010-03-04 Thread Alexander Hartmaier
My solution is to return an error message which includes the link to the
login form with Catalyst::Controller::DBIC::API.
My ExtJS store class has an exception handler that shows a MessageBox
with the error text:

exception:function(sender, type, action, options, response, arg) {
switch (type) {
case 'remote':
var errortext = 'server error occurred';
if (response.raw.errors.generic) {
errortext = response.raw.errors.generic.join('');
}
Ext.Msg.alert('Error', errortext);
break;
case 'response':
if (response.isTimeout) {
Ext.Msg.alert('Error', 'the request timed out');
}
else {
Ext.Msg.alert('Error', response.statusText);
}
break;
// that should never happen according to extjs docs
default:
Ext.Msg.alert('Error', 'unknown error occurred');
break;
}
}

--
Best regards, Alex


Am Donnerstag, den 04.03.2010, 16:05 +0100 schrieb Peter Karman:
> Bill Moseley wrote on 03/04/2010 08:39 AM:
>
> > The developer explained that the AJAX session check was needed to
> > prevent a user from making a lot of changes in the client that could not
> > be saved due to a an expires session.  Not sure I see the logic there.
>
> I've been solving that session-has-expired-so-ajax-call-fails problem by
> having a global listener on my ajax class that checks whether the
> session cookie has expired before every xhr request. I'm not completely
> happy with how this works (it feels kludgy; it assumes the cookie
> expiration time == session expiration time; and it relies on an alert()
> to halt the browser's progress (effectively making an async call
> synchronous)), but so far it's the most effective way I've found of
> preventing user meltdown when their carefully crafted request will be
> lost because the session has expired on the server end.
>
> // make sure we are logged in before every xhr request
> Ext.Ajax.on('beforerequest', function(conn, opts) {
> if (!AIR.Auth.isAuthenticated()) {
> AIR.Auth.login();
> return false;
> }
> return true;
> });
>
> // get session cookie. Returns false if the cookie is expired.
> AIR.Auth.isAuthenticated = function() {
> var auth_tkt = Ext.util.Cookies.get('auth_tkt');
> return auth_tkt;
> }
>
> // spawn a popup window to the login page, halting the browser's
> // XHR call with an alert()
> AIR.Auth.login = function() {
> // open a popup panel
> var winOpts =
> 'height=400,width=400,resizable=yes,scrollbars=yes,menubar=yes';
>
> // the closeWindow param tells the login script to generate
> // local page js on success that will close the popup window.
> var url = 'https://my.sso.url/login?back=closeWindow';
> AIR.Auth.window = window.open(url,'login-window',winOpts);
> if (window.focus) {
> AIR.Auth.window.focus();
> }
>
> // the alert is necessary to keep the browser from proceeding
> // with whatever request it was making.
> alert("Your session has expired. Login again and then click Ok.");
>
> }
>
>


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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 session expiry without extending it

2010-03-03 Thread Alexander Hartmaier
Why not return the datetime when the session expires with every page and
have a client-side js that does the redirect without hammering the
server?

--
Best regards, Alex


Am Dienstag, den 02.03.2010, 21:43 +0100 schrieb Steve Kleiman:
> Using Catalyst::Plugin::Session with Session::State::Cookie.
>
> Would like to be able to poll server if the user's session has expired 
> WITHOUT extending the session itself.
>
> The objective is to have a javascript periodical executor check if a session 
> is expired and redirect user to a "Your session has expired" page if 
> appropriate. Could do it in javascript but would prefer doing it on server.
>
> Anyone tried this?
>
> Thanks in advance.
>
> -Steve Kleiman
> ___
> 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/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] mod_fcgid on win32

2010-01-29 Thread Alexander Hartmaier
Is it still valid?

Copyright (c) 1995-1996 Open Market, Inc.

--
Best regards, Alex


Am Donnerstag, den 28.01.2010, 15:45 +0100 schrieb Hans Dieter Pearcey:
> Excerpts from Alexander Hartmaier's message of Thu Jan 28 09:29:42 -0500 2010:
> > I've looked *multiple* times for it, but not in the non-free repo.
> > Do you know why it is there?
>
> Probably because it has a weird license:
>
> http://packages.debian.org/changelogs/pool/non-free/liba/libapache-mod-fastcgi/libapache-mod-fastcgi_2.4.6-1/copyright
>
> hdp.
>
> ___
> 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/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] mod_fcgid on win32

2010-01-28 Thread Alexander Hartmaier
ARGH

I've looked *multiple* times for it, but not in the non-free repo.
Do you know why it is there?

--
Best regards, Alex


Am Donnerstag, den 28.01.2010, 15:14 +0100 schrieb Hans Dieter Pearcey:
> Excerpts from Alexander Hartmaier's message of Thu Jan 28 09:00:28 -0500 2010:
> > I'm running mod_fcgid on debian because it comes as a distro package
> > while mod_fastcgi doesn't.
>
> Yes it does:
>
> http://packages.debian.org/search?keywords=libapache2-mod-fastcgi
>
> hdp.
>
> ___
> 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/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] mod_fcgid on win32

2010-01-28 Thread Alexander Hartmaier
I'm running mod_fcgid on debian because it comes as a distro package
while mod_fastcgi doesn't.
Note that it took some time for me too to get it working.

I can mail or paste my setup if that helps you on win32.

--
Best regards, Alex


Am Donnerstag, den 28.01.2010, 13:19 +0100 schrieb Will Hawes:
> On 28 January 2010 09:44, Tomas Doran  wrote:
> >
> > On 28 Jan 2010, at 08:33, fREW Schmidt wrote:
> >>
> >> I'm afraid this might be a win32 issue :-/  Anyway, does anyone have any
> >> input on this?  I'd really like to get this working.
> >
> > Google suggests that use mod_fastcgi is the correct fix :)
>
> I'd second that, I've tried both mod_fastcgi and mod_fcgid pretty
> exhaustively on various versions of Apache on Win32 and only ever
> managed to get the former working. Not to say that mod_fcgid won't
> work of course, but mod_fastcgi is certainly the path of least
> resistance ;)
>
> ___
> 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/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] UTF-8 and mails

2010-01-25 Thread Alexander Hartmaier
Before testing end-to-end figure out if the chars from your database are
*really* utf-8.
I forgot to set an env var for the oracle client library to tell it I
want unicode which broke my app under fcgid.

If you're using DBIx::Class to access your database see
http://www.perlmonks.org/?node_id=736234.

--
Best regards, Alex


Am Montag, den 25.01.2010, 13:43 +0100 schrieb Jens Schwarz:
> Hi,
>
> first of all: I have read 
> http://dev.catalystframework.org/wiki/tutorialsandhowtos/Using_Unicode 
> (especially the "Tips for Troubleshooting Unicode in Perl Web Applications")
> Nevertheless I have a strange UTF-8 problem that I need help with:
>
> Concerning UTF-8 everything in my App seems to work correct - except my mail 
> action (I use Mail::Sender::Easy) in my Root controller:
>
> 
> (...)
> use Mail::Sender::Easy qw(email);
> use utf8;
> (...)
> sub mail :Private {
> (...)
> $mail_return = email({
>   (...)
>   'subject'=> (... something from the database ...),
>   '_text_info' => {
> charset  => 'utf-8',
> encoding => 'quoted-printable',
>   },
>   '_text'  => (... some text with literal UTF-8 characters NOT from the 
> database ...),
>   (...)
> });
> (...)
> }
> 
>
> This produces mails that have messed up UTF-8 characters although the charset 
> is set in the mail header, and the clients (right now tested with Thunderbird 
> 3 and Outlook 2003) are configured to treat incoming mails as utf-8 encoded 
> text. Strange: If I switch to ISO8859-1 in Thunderbird, the mails look 
> alright. Outlook however simply drops the UTF-8 characters, so that p.ex. the 
> German sentence "Nachricht für Herrn Müller" results in "Nachricht fr Herrn 
> Mller".
> If I remove the "use utf8", the UTF-8 characters that do NOT come from the 
> database look fine (in the example above: everything in '_text'), the ones 
> from the database are messed up (in the example above: everything in 
> 'subject'). Removing the "charset => 'utf-8'" flag of the mail subroutine 
> results in fine mails if I set the charset to ISO8859-1 in the clients.
>
> To summerize: I have UTF-8-tifized everything that I am aware of - i.e.:
> - Editor where the source code is produced
> - source code itself
> - in the MySQL database every table is set-up with UTF-8 Unicode charset and 
> utf8_general_ci collation.
> - the webbrowsers
> - the email clients
> - Catalyst ("use utf8", "UTF8Columns")
> - Template Toolkit ("View::TT => {ENCODING => 'UTF-8'} ")
> - FormFu ("tt_args => {ENCODING => 'UTF-8'}")
>
> Any hints on where the problem might be?
> Thanks
>
> Jens


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Limit Catalyst::Helper::Model::DBIC::Schema to a single table ...

2010-01-05 Thread Alexander Hartmaier
Why not do it the other way round?
Write the new class and deploy it to your db.

--
Best regards, Alex


Am Freitag, den 25.12.2009, 15:51 +0100 schrieb Kiffin Gish:
> Normally myapp_create.pl is run with the whole database given on the
> command line, e.g.
>
> script/myapp_create.pl model DB DBIC::Schema MyApp::Schema \
> create=static dbi:SQLite:myapp.db
>
> Can I restrict this to a single table or tables only? For example, I
> have an existing application and I add a new table I don't want to
> recreate Schema/Results with a bunch of .new files and have to delete
> them after-wards.
>


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] subclassing model classes

2009-12-16 Thread Alexander Hartmaier
DBIx::Class::Helper::SubClass fixes the relationships too!
I've spoken about the problem that rels stop working when subclassing a
result class in the irc channel but at that time there wasn't a solution
for it.

Thanks for the hint, I will try it out soon!

--
Best regards, Alex


Am Mittwoch, den 16.12.2009, 13:42 +0100 schrieb matthew couchman (JIC):
> I've just discovered DBIx::Class::Helper::SubClass which seems to have done 
> the trick. Thanks again for all your help.
>
> > -Original Message-
> > From: matthew couchman (JIC) [mailto:matthew.couch...@bbsrc.ac.uk]
> > Sent: 16 December 2009 10:54
> > To: The elegant MVC web framework
> > Subject: RE: [Catalyst] subclassing model classes
> >
> > Hi Wallace,
> >
> > Thanks for your reply. I'm using the perl debugger:
> >
> > Class::C3::Componentised::ensure_class_loaded(/home/couchman/catalyst/A
> > ntSpec/script/../lib/AntSpec/Schema/Result/Placemark.pm:10):
> > 10: __PACKAGE__-
> > >resultset_class('AntSpec::Schema::ResultSet::Placemark');
> >   DB<1> n
> > Class::C3::Componentised::ensure_class_loaded(/home/couchman/catalyst/A
> > ntSpec/script/../lib/AntSpec/Schema/Result/Placemark.pm:12):
> > 12: 1;
> >   DB<1> x __PACKAGE__
> > 0  'AntSpec::Schema::Result::Placemark'
> >   DB<2> x __PACKAGE__->resultset_class
> > 0  'AntSpec::Schema::ResultSet::Placemark'
> >   DB<3> c
> > Class::C3::Componentised::ensure_class_loaded(/home/couchman/catalyst/A
> > ntSpec/script/../lib/AntSpec/Schema/Result/Vertex.pm:10):
> > 10: __PACKAGE__-
> > >resultset_class('AntSpec::Schema::ResultSet::Vertex');
> >   DB<3> n
> > Class::C3::Componentised::ensure_class_loaded(/home/couchman/catalyst/A
> > ntSpec/script/../lib/AntSpec/Schema/Result/Vertex.pm:12):
> > 12: 1;
> >   DB<3> x __PACKAGE__
> > 0  'AntSpec::Schema::Result::Vertex'
> >   DB<4> x __PACKAGE__->resultset_class
> > 0  'AntSpec::Schema::ResultSet::Vertex'
> >   DB<5> x AntSpec::Schema::Result::Placemark->resultset_class
> > 0  'AntSpec::Schema::ResultSet::Vertex'
> >   DB<6> x AntSpec::Schema::Result::Point->resultset_class
> > 0  'AntSpec::Schema::ResultSet::Vertex'
> >
> >
> > Thanks again,
> >
> > Matt.
> >
> >
> >
> > > -Original Message-
> > > From: Wallace Reis [mailto:wall...@reis.org.br]
> > > Sent: 15 December 2009 23:13
> > > To: The elegant MVC web framework
> > > Subject: Re: [Catalyst] subclassing model classes
> > >
> > > On 15/12/2009, at 14:58, matthew couchman (JIC) wrote:
> > > > I now have a couple of subclasses of Point called Vertex and
> > > Placemark. I'm trying to associate them with my new ResultSet
> > > subclasses.
> > > >
> > > > In MyApp::Schema::Result::Vertex:
> > > >
> > > > use base 'MyApp::Schema::Result::Point';
> > > > __PACKAGE__->resultset_class('MyApp::Schema::ResultSet::Vertex');
> > > >
> > > >
> > > > And in MyApp::Schema::Result::Placemark:
> > > >
> > > > use base 'MyApp::Schema::Result::Point';
> > > > __PACKAGE__-
> > >resultset_class('MyApp::Schema::ResultSet::Placemark');
> > > >
> > > >
> > > > I think __PACKAGE__->resultset_class is calling the parent class
> > > MyApp::Schema::Result::Point->resultset_class in both cases so the
> > > second call overwrites the first. How do I avoid this?
> > >
> > >
> > > How are you identifying this behaviour? It shouldn't be like that.
> > > What does "print $schema->source($_)->resultset_class for qw(Vertex
> > > Placemark)" output?
> > >
> > > --
> > >wallace reis/wreis Catalyst and DBIx::Class consultancy
> > with
> > > a clue
> > >Software Engineer  and a commit bit:
> > > http://shadowcat.co.uk/catalyst/
> > > Shadowcat Systems Limited
> > > http://www.shadowcat.co.uk http://www.linkedin.com/in/wallacereis
> > > ___
> > > 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/
>
> ___
> 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/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sende

Re: [Catalyst] subclassing model classes

2009-12-15 Thread Alexander Hartmaier
Hi Matt!

You might want to take a look at
DBIx::Class::Schema::RestrictWithObject.

Normally I add a method to the ResultSet class of that Result class:

in ResultSet::Device:

=item search_active

Returns a resultset with all active devices.

=cut

sub search_active {
my $self = shift;

return $self->search_rs({
'me.fk_monitor' => { '!=' => 3 },
});
}

In Result::Device:

__PACKAGE__->resultset_class('NAC::Model::DBIC::ResultSet::Device');

--
Best regards, Alex


Am Dienstag, den 15.12.2009, 12:32 +0100 schrieb matthew couchman (JIC):
> Hi,
>
>
>
> I’m trying to subclass a model class so that when I search it only
> pulls out rows of a certain type. I thought that perhaps I could
> achieve that by overriding the search() function and adding a
> condition to the list of arguments as below:
>
>
>
> package MyApp::Schema::Result::Vertex;
>
>
>
> use strict;
>
> use warnings;
>
>
>
> use base 'MyApp::Schema::Result::Point';
>
>
>
> # override search
>
> sub search {
>
> my $self = shift;
>
> my $condition = { type => 'vertex' };
>
> return $self->next::method($condition, @_);
>
> }
>
>
>
> 1;
>
>
>
> I don’t think that my new search function is ever called though. Do I
> need to override anything else or am I just barking up the wrong tree
> completely?
>
>
>
> Thanks for your help,
>
>
>
> Matt.
>
>
>
>
>
>


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] [ANNOUNCE] Catalyst-Runtime 5.80016

2009-12-14 Thread Alexander Hartmaier
All app errors result in this cat error with the new version for me:

[error] Caught exception in engine "Can't use string
("508706d1a94648443fa31ffc8b2b5ccb") as a HASH ref while "strict refs"
in use at /home/ahartmai/perl5/lib/perl5/Catalyst/Engine.pm line 117."

Changing line 117 fixes the problem but I don't know if something else
is going wrong which changes $val so it isn't a hash.

local $val->{'__MOP__'} = "Stringified: "
. $val->{'__MOP__'} if ref $val eq 'HASH' && exists
$val->{'__MOP__'};


--
Best regards, Alex


Am Samstag, den 12.12.2009, 00:41 +0100 schrieb Tomas Doran:
> Evening (or insert relevant time zone here).
>
> I'm happy to announce the next release of Catalyst-Runtime (5.80016).
> This release mainly fixes regressions introduced with the new script
> system. Upgrading to the new scripts requires the latest Catalyst-
> Devel package (1.24), and choosing to regenerate your scripts.
>
> This release cures all issues reported with upgraded scripts (or
> applications generated with the latest release of Catalyst::Devel) and
> fixes Win32 issues introduced with the tests for encoding issues fixed
> in 5.80015.
>
> Full changelog included below as always.
>
> Cheers
> t0m
>
> --
>
> 5.80016 2009-12-11 23:23:33
>
>Bug fixes:
>
> - Fix slurping a file to work correctly with binary on Win32 in the
>   encoding test controller.
>
>Bug fixes in the new scripts (for applications which have been
> upgraded):
>
> - Allow --restartdirectory as an option for the Server script, for
>   backwards compatibility. (Dave Rolsky)
> - The --host option for the server script defaulted to localhost,
> rather
>   than listening on all interfaces, which was the previous
> default. (Dave
>   Rolsky)
> - Restore -p option for pid file in the FastCGI server script.
> - Fix the script environment variables MYAPP_PORT and MYAPP_RELOAD
> RT#52604
> - Fix aliasing applications under non-root paths with mod_rewrite in
>   some apache versions where %ENV{SCRIPT_NAME} is set to the real
> name of
>   the script, by using $ENV{REDIRECT_URL} which contains the non-
> rewritten
>   URI.
> - Fix usage display when myapp_create.pl is run with no arguments.
> RT#52630
>
>New features:
>
> - The __MOP__ hash element is suppressed from being dumped fully
>   (and instead stringified) when dumping the error screen to be
>   less packed with information of no use.
>
>Documentation:
>
> - Fix Pod nits (RT#52370)
>
>
>
>
> ___
> 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/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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::Plugin::Email not working

2009-12-03 Thread Alexander Hartmaier
You shouldn't use C::P::Email any more, there is no need for that
function to be a Catalyst plugin.

Take a look at Catalyst::View::Email(::Template) instead!

--
Best regards, Alex


Am Mittwoch, den 02.12.2009, 21:46 +0100 schrieb Meeko:
> Hi everyone.  I have been developing an app for quite some time on a
> local machine here (OS X 10.4) which at various times throughout its
> life it needs to send out e-mails.  I have been using
> Catalyst::Plugin::Email to send those e-mails, using authenticated
> SMTP from an e-mail account I have with Rackspace.  My configuration
> looks like this:
>
> __PACKAGE__->config->{email} = [
> 'SMTP',
> 'my.smtp.server',
> username => 'MyUsername',
> password => 'MyPassword',
> ];
>
> Then in my app, whenever I need to send an e-mail, I use:
>
> $c->email(
> header => [
> From=> ' Me',
> To  => 'em...@recipient.com',
> Subject => 'The Subject.',
> ],
> body => "$body",
> );
>
>
> It's been working great during development, I get all the e-mails when
> they are supposed to be going out. The problem is that now that I am
> getting close to finished, I have done a test deployment to my public
> web server (CentOS 5.2), and now e-mails no longer get sent.  I have
> verified that Catalyst::Plugin::Email is installed, and that I have
> the correct config information.  Everything else about the app runs,
> and when it comes to a place where an e-mail should go out, it gets by
> it with no problem, but yet I never receive the e-mails.  Also, I am
> unable to find any error log entry that might point me in the right
> direction.
>
> So my question is, first of all, is there something blindingly obvious
> I might be missing during deployment?  Is there anything else that
> needs to be installed for Catalyst::Plugin::Email to work that I might
> not have installed - but yet would not cause the app to fail at
> startup?  And finally, where should I look for any clues as to what is
> going on (like error logs, etc...)?
>
> Thanks for any help!


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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: Debian recommendation

2009-10-28 Thread Alexander Hartmaier
Is building a package for every perl module (not only cpan, private too)
really of help and not just a waste of time?

I'm using debian as server os since version 3 for running apps using POE
and webapps using Embperl and Catalyst and never managed to break it.
And yes I update almost every module by a script using cpanplus
excluding just some like mod_perl and Net::SNMP regularly.

--
best regards, Alex

Am Mittwoch, den 28.10.2009, 18:15 +0100 schrieb John Lee:
> Paul Makepeace wrote:
> > I recently have completely tossed using Debian's perl packages
> > because, while I do love Debian and all its package awesomeness, there
> > simply wasn't the package lib*-perl support in stable/lenny and even
> > testing/squeeze didn't have all the goods needed for a (what I think
> > is) fairly regular Catalyst install.
>
> ++ here.  I had to build a lot of missing modules, or upgrade modules,
> that we wanted / needed.  I actually didn't mind the headaches of
> chasing down dependencies when building my own packages using
> dh-make-perl, because it made it so much simpler system-side to
> distribute libraries (with dependencies!) with apt-get installs.
>
> The roadblock came when the packaged perl libraries needed to be
> upgraded in a manner inconsistent with the platform.  For example,
> running perl 5.8.8 in an Ubuntu LTS installation, when you wanted
> features found in perl 5.10.0.  When I started getting blocked on
> upgrades due to conflicts with, say, perl-base and perl-modules, or
> requirements for libperl5.10, I scrapped it and went with a source-built
> perl and CPAN.  I even went through the process of creating updated
> perl, perl-base, and perl-module packages based on 5.10, but eventually,
> systems dependencies on the old version catch up to you.
>
> > So my question then is: given you've presumably done this, which of
> > your quoted solutions do you like best? I tried dh-make-perl many
> > moons ago and gave up due to annoyances around following dependencies.
> > Maybe CPP::Dist::Deb or something else solves that.
>
> I didn't give CPP a try, but I had a lot of experience with
> dh-make-perl.  I found that it gave you a good start, but you have to be
> anal about creating packages for dependencies and setting descriptions.
>
> > I'm hoping local::lib + cpan + git solves this but curious how
> > Debian-integrated solutions work too.
>
> I'd be curious to see if this works well for folks too!  I'm especially
> interested in folks who do this with a perl installed to a separate
> location, e.g. /usr/local/bin/perl.  I worry about things like C library
> dependencies (ImageMagick comes to mind).
>
>
> - John
>
>
> ___
> 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/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] IE6 shows page cannot be displayed

2009-10-20 Thread Alexander Hartmaier
Maybe HTTP::Server::Simple?
The Changelog mentions win32 in the revisions from April.

Am Dienstag, den 20.10.2009, 16:44 +0200 schrieb Ascii King:
> Solved it. I had it working on my linux server, but not my windows
> server, so I assumed it had to be an out-of-date mod. I went through
> almost every mod I could find that was associated with Catalyst and
> Formfu and upgraded them to the newest version. That solved it for me.
>
> I don't know which mod it was that fixed the problem, but i do know it
> wasn't Catalyst::Devel, catalyst::Runtime or HTML::Formfu
>
> Thanks for the help.
>
> ___
> 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/
--
best regards, Alex


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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: Calling Controller Methods from inside begin or auto.

2009-09-30 Thread Alexander Hartmaier
Am Mittwoch, den 30.09.2009, 16:30 +0200 schrieb Derek Wueppelmann:
> On Wed, 2009-09-30 at 06:53 -0700, Bill Moseley wrote:
>
> > Does that approach provide you with enough fine-grained access
> > control?
> > I suppose you can check the action name in auth_required().
>
> It actually does. Basically either the entire class requires auth or
> not, and if I need to occasionally require auth to specific methods
> that's easy enough to take care of on a case by case basis.
>
> > There are a number of existing modules to consider, for example:
> >
> > Catalyst::Action::Role::ACL
> > Catalyst::Plugin::Authorization::ACL
>
> In order to use these I would have to rewrite significant portions of
> the code. At this point it's not worth while doing.
>
> > I've also used an approach where I check for roles in each
> > controller's auto method, and I've also used method attributes to
> > indicate the access level required for each action (which has the
> > benefit where I can require *every* dispatched action to have an
> > access level specified or be blocked).
> >
> > I also do not detach to a login page, rather I always redirect.  Not
> > sure I remember the details of that choice, but one reason might have
> > been I didn't want a URL for one resource to return a 200 yet not
> > return the response for that URL and instead return a login form.
>
> I'm actually doing forwards to my login page right now. So that when a
> user logs in they can still see the page they were originally trying to
> view. I capture the URL they were attempting to view in the login
> process.

You should redirect to your login page rather than displaying it under a
different url.
I store the previous url in the session and redirect to it after a
successful login, works like a charm.

--
best regards, Alex


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] best practice for a protocol mechanism?

2009-09-14 Thread Alexander Hartmaier
Sounds to me like an audit log which should be done by the model
regardless of where the model is used (e.g. Catalyst app, perl script
run by cron, ...).

That's the module you want imho:
http://search.cpan.org/~nuffin/DBIx-Class-Journal-0.91_02/lib/DBIx/Class/Journal.pm

Am Donnerstag, den 10.09.2009, 14:43 +0200 schrieb Jens Schwarz:
> Oh, *err* right. I meant 'logging' and not 'protocol' *douh*.
>
> Well, right now I have a proto^Wlogging action in my Root controller that I 
> call everytime I want something to be logged in my DB.
> P.ex.:
>
> package MyApp::Controller::Book;
> (...)
> sub create ... {
> ...
> $c->forward("MyApp::Controller::Root","myLoggingAction",["some message that 
> should be logged"]);
> }
>
> In addition to this, I have a logging controller, that simply displays the 
> list of logged messages from the DB.
>
> Think of something like:
>
> | Timestamp| User   | Action   |
> +--++--+
> | 2009-09-10 10:30 | foobar | created new book |
>
> So the question is: Is there a neater way of doing this? Some kind of best 
> practice?
>
>
>  Original-Nachricht 
> > Datum: Thu, 10 Sep 2009 01:41:29 +0100
> > Von: Tomas Doran 
> > An: The elegant MVC web framework 
> > Betreff: Re: [Catalyst] best practice for a protocol mechanism?
>
> > I'm guesstimating that he means 'I end up with this template code at
> > the end of loads of my actions, which forwards somewhere with various
> > params'...
>
> Now *I* am not entirely sure that I understand what you mean by this. :)
>
> Jens
>
--
LG Alex


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Accessing config parameters from Schema?

2009-08-24 Thread Alexander Hartmaier
I've needed that too and added it as an example to the
Catalyst::Model::DBIC::Schema docs on Friday.

You can find it under the following link until it's applied:
http://paste.scsys.co.uk/32786

Thanks @mst for the help with the schema accessor!

Am Freitag, den 21.08.2009, 22:43 +0200 schrieb fREW Schmidt:
> You probably shouldn't really be doing that.  Pass the path into the
> schema or something like that, but schema should be able to exist
> outside of a catalyst application.  If you really do want to read the
> conf check out Config::JFDI.  You can use it to parse the config.
>
> On Thu, Aug 20, 2009 at 5:01 PM, Kevin Monceaux 
> wrote:
> Catalyst Fans,
>
> 
>
> I've Googled and searched the list message archives but am
> having
> trouble zeroing in on the info I need.  I'm sure in all that
> searching
> the answer has been staring me right in the face somewhere.
>
> How does one access parameters stored in myapp.conf from a
> schema,
> for example if I wanted to configure a path in myapp.conf for
> saving
> uploaded photos?
>
>
> 
>
>
> --
>
> 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/
>
>
>
> --
> fREW Schmidt
> http://blog.afoolishmanifesto.com
--
BR Alex


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Recommended OS for Catalyst?

2009-08-12 Thread Alexander Hartmaier
I'm using debian stable since 3.0 after being pissed by RedHat shipping
unicode-horror perl 5.8.0 with custom + backported patches instead of
5.8.6 which was the newest stable version available at that time.

Never regretted it!

Am Donnerstag, den 06.08.2009, 12:50 +0200 schrieb Octavian Rasnita:
> Hi,
>
> Can you recommend a Linux distribution for production for Catalyst apps?
>
> ...and a version of Perl?
>
> Thanks.
>
> --
> Octavian
--
Alex


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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 Chain Actions

2009-07-17 Thread Alexander Hartmaier
Why not use the same uri and check the Accept header?

Am Donnerstag, den 16.07.2009, 21:22 +0200 schrieb Tomas Doran:
> On 16 Jul 2009, at 16:30, Derek Wueppelmann wrote:
> >
> > sub json : Chained('/') ChainedArgs(0) {
> > my ($self, $c) = @_;
> >
> > Is this something that is possible? Should I even be using Chaining
> > for
> > this? Any help would be appreciated.
>
> Call your top level path part root, then inherit (or apply as a role)
> the rest of the chain parts.
>
> e.g.
>
> package MyApp::Stuff;
> use Moose::Role -traits => 'MethodAttributes';
>
> sub thingie : Chained('root') PathPart('thingie') Args(0) {}
>
>
> package MyApp::Controller::Root;
> with 'MyApp::Stuff';
> sub root : Chained('/') PathPart('') CaptureArgs(0) {}
>
> package MyApp::Controller::JSON;
> with 'MyApp::Stuff';
> sub root : Chained('/') PathPart('json') CaptureArgs(0) {}
>
> Will give you:
>
> /thingie
> and
> /json/thingie
>
> 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/
--
LG Alex


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Error in subclassing Catalyst::Controller::DBIC::API::REST

2009-06-24 Thread Alexander Hartmaier
Please provide us with the debug output of your cat app at startup.
Have you tried removing sub create?
Also look at the RestTest app used for the tests to find possible bugs
in your code.

Am Mittwoch, den 24.06.2009, 02:39 +0200 schrieb Amiri Barksdale:
> I have a controller inheriting from a ControllerBase class that contains
> the following:
>
>package RestTest::ControllerBase::REST;
>
>use strict;
>use warnings;
>use base qw/Catalyst::Controller::DBIC::API::REST/;
>
>sub create :Private {
>my ($self, $c) = @_;
>$self->next::method($c);
>if ($c->stash->{created_object}) {
>%{$c->stash->{response}->{new_object}} =
>%$c->stash->{created_object}->get_columns;
>}
>}
>
>1;
>
>
> All the ControllerBase does is stash that object on create requests. I
> was following lukes's example at
> http://search.cpan.org/~lsaunders/Catalyst-Controller-DBIC-API-1.003000/lib/Catalyst/Controller/DBIC/API.pm#EXTENDING.
> The relevant part of the controller is:
>
>
>package RestTest::Controller::API::REST::Artist;
>
>use strict;
>use warnings;
>use base qw/RestTest::ControllerBase::REST/;
>use JSON::Syck;
>
>__PACKAGE__->config(
>action  =>  { setup => { PathPart => 'artist',
>Chained => '/api/rest/rest_base' } },
>...
>);
>
>
> Now for the problem. When I go to test this:
>
>my $mech = Test::WWW::Mechanize::Catalyst->new;
>ok(my $schema = DBICTest->init_schema(), 'got schema');
>
>  my $req = GET("http://localhost/api/rest/artist/list";, {
>  }, 'Accept' => 'text/x-json' );
>  $mech->request($req);
>  cmp_ok( $mech->status, '==', 200, 'open attempt okay' );
>
>
> I get the error:
>
>'Method GET not implemented for http' =>
>'//localhost/api/rest/artist/api/rest/artist/object'
>
> Somehow my request path gets all messed up. I dumped out the $mech, and it 
> tells
> me that $mech->base is indeed what I put. So is $mech->redirected_uri.
>
>
>
> Amiri
>
> ___
> 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/
--
LG Alex


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Final RFC for Press Release!

2009-04-28 Thread Alexander Hartmaier
Am Dienstag, den 28.04.2009, 17:44 +0200 schrieb Edmund von der Burg:
> I like that press release - it is short enough to get read and
> sufficiently light on detail not to make people feel that the learning
> curve will be too steep.
>
> 2009/4/28 John Napiorkowski :
> > and add their personal advocacy or howto stuff in the, "Blogs and third 
> > party discussions" section, which is looking thin.
>
> At the risk of showing my age I've always been a fan of the Be.com
> press releases:
>
>   http://web.archive.org/web/20010106174100/www2.be.com/aboutbe/pressinfo.html
>
> Those pages are from 2001 - the company subsequently folded.
>
> Anyhoo - I think that they set a good example of haw to do press. I
> especially like that at the end of each press release they had a
> 'About Be' section that set the scene.
>
> Perhaps we should add something similar to our press releases:
>
> -
>
> About Catalyst
>
> Catalyst is a framework for building web applications of all sizes. It
> allows clean separation of all the components and embodies most
> current best practices. Developed and maintained by a worldwide group
> of enthusiasts and professionals it is continually evolving. Written
> in Perl it is easy to work with and extend using code available on
> CPAN. It is stable and widely used in business critical applications.
> It is open source and free to use. Enjoy.
>
> -
>

That paragraph is awesome!
I vote for including it!

Cheers, Alex

> tweak at will :)
>
> Cheers,
>   Edmund.
>
>
>
>


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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 reuse Catalyst Schema for non-web purposes?

2009-04-22 Thread Alexander Hartmaier
I have a MyNamespace::Model::DBIC module containing all ResultSet,
ResultSource and Table classes.
This module is a requirement for my Cat apps and is used in the apps
schema:

package MyNamespace::Web::AppName::Schema::AppName;
use base qw/DBIx::Class::Schema/;

# load subclassed tables
__PACKAGE__->load_classes(qw/
Table3
/);

__PACKAGE__->load_classes({
'MyNamespace::Model::DBIC::Table' => [qw/
Table1
Table2
/]}
);

1;


--
BR Alex


Am Mittwoch, den 22.04.2009, 16:30 +0200 schrieb Simon Wilcox:
> On 22/4/09 14:52, Matt S Trout wrote:
> > On Wed, Apr 22, 2009 at 02:41:34PM +1000, kakim...@tpg.com.au wrote:
> >
> >>   I just looked at my app and found that I need to reuse the Schema
> >> files found in my 'Schema' directory.
> >
> > Your DBIC classes aren't connected to the Catalyst app at all.
>
> Unless you've fallen into the trap of putting business logic in your
> Controller classes.
>
> See this as a good opportunity to refactor the logic back into the
> Schema classes where it belongs (or to a set of business objects if that
> suits your application better).
>
> Your code will be better for it :-)
>
> S.
>
>
>
> ___
> 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/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] Application stallling problem

2009-03-26 Thread Alexander Hartmaier
The test server can only process one request per time!
Maybe your first request blocks the server cause a e.g. database query
takes long so the second query isn't handles by the server.

-
BR Alex


Am Donnerstag, den 26.03.2009, 14:17 +0100 schrieb Tomas Doran:
> kakim...@tpg.com.au wrote:
> > sorry, guys, some bad character encodings from my mail client.
> > Here's the mail again:
>
> > Any ideas??
>
> Not sure, but I think its something between the server you're using
> and
> the browser - if you're getting the request table, then as far as the
> Catalyst server is aware, then it has passed a page to your browser,
> and
> your browser hasn't requested another one..
>
> Probably trying to use tcpdump or a capturing proxy (parosproxy.org)
> to
> try and take apart the requests/responses to work out whats going on
> would be helpful?
>
> 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/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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 - any good AJAX tutes?

2009-03-06 Thread Alexander Hartmaier
I'd suggest ExtJS if you want something pretty good looking with great
out-of-the-box features or YUI/jQuery if you like to stick with
JS-enhanced HTML.

The Dojo features + docs sucked *very* much when I used it about a year
ago...

On the Catalyst side I use Catalyst::Controller::DBIC::API which will
support the full DBIC API for searches, pagination and prefetch in the
next version which should be on CPAN in 2-4 weeks if lukes and I find
time to finish it.
trunk already contains my json-style search and pagination patches but
lacks prefetch support cause we need to find a way to restrict/validate
the user input to prevent huge queries killing the DB and/or revealing
data that shouldn't be revealed.

Help welcome ;-) (yes, I mean you Matt! that json in cgi param idea of
yours just rocks!)

-
Alex


Am Freitag, den 06.03.2009, 06:43 +0100 schrieb kakim...@tpg.com.au:
> hello there,
>
>  I would like to use AJAX in my catalyst app. Any good references/tutes
> to recommend?
>
> thanks.
>
> K. akimoto
>
>
> ___
> 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/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] New version of InstantCRUD

2009-02-24 Thread Alexander Hartmaier
I've already done a module I load in the ResultSource class of all my
table classes which consists of a 'sub get_fvs_profile' which uses the
dbic metadata to generate a FormValidator::Simple profile for use with
DBIx::Class::Validation.

I'd say that should go into DBIx::Class::Validation.

-  Alex


Am Montag, den 23.02.2009, 11:33 +0100 schrieb Moritz Onken:
> Am 23.02.2009 um 10:53 schrieb Alexander Hartmaier:
>
> > I'm currently patching the hell out of Controller::DBIC::API.
> > Search by passing a json string and pagination is already in the repo,
> > prefetch support is done but needs some sort of controller side
> > restriction so that someone can't fetch the contents of the whole db
> > by
> > using the rels (api for that welcome).
> >
> > This should/could be the basis for ajax based LFB modules to load data
> > instead of relying on an LFB internal API.
> >
> > What I'd like to see is a more split up LFB so I could use the (extjs)
> > form generation on a per table (=controller) basis wherever I need it
> > (for tables where a customized form isn't needed).
> >
> > -  Alex
>
>
> Hi all,
>
> I'm following a different approach. My current project uses HTML::FormFu
> config files for both validating user input and generating json which
> contains the data of a resultset or result row. I do not use the html
> generation capabilities of FormFu, just validation, filters,
> transformers,
> inflators and deflators.
>
> I wrote http://search.cpan.org/~perler/DBIx-Class-AsObject-0.09_01/
> which
> is far from being stable. But it generates a perl object from a result
> row
> using a HTML::FormFu configuration file.
>
> I think Controller::DBIC::API lacks of the ability to do proper
> validation.
> Maybe we can join forces on that one and add a configuration file to
> each controller.
>
>
> 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/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] New version of InstantCRUD

2009-02-23 Thread Alexander Hartmaier
I'm currently patching the hell out of Controller::DBIC::API.
Search by passing a json string and pagination is already in the repo,
prefetch support is done but needs some sort of controller side
restriction so that someone can't fetch the contents of the whole db by
using the rels (api for that welcome).

This should/could be the basis for ajax based LFB modules to load data
instead of relying on an LFB internal API.

What I'd like to see is a more split up LFB so I could use the (extjs)
form generation on a per table (=controller) basis wherever I need it
(for tables where a customized form isn't needed).

-  Alex


Am Samstag, den 21.02.2009, 10:08 +0100 schrieb Oliver Gorwits:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Hi Zbigniew,
>
> Zbigniew Lukasiak wrote:
> > In short  I am open for collaboration - but I found it difficult
> > to express my expectations for the library without writing my own
> > code.
>
> I (author of the ListFramework Builder CRUD - LFB) couldn't agree
> more. All these CRUD systems are lovely and go a great job but it is
> painful to see everyone developing in different directions.
>
> This is what has kept me from working on re-engineering LFB (I've
> done some bug fixes only, in the last six months). I know what needs
> factoring out, where there needs to be an API etc, but to be honest
> I suck at API design, I thought I'd better wait for someone else's
> DBIC API :-)
>
>
> And as an aside...
>
> At the moment I am happy with the niche LFB fills (i.e. not a
> scaffolder) and am working on a new user interface in something more
> lightweight than ExtJS. It might also get renamed to something like
> Catalyst::Plugin::AutoCRUD (well, or...?).
>
> If you are not familiar with LFB, see here (feedback welcome):
>
>http://tinyurl.com/listframework
>http://dragonstaff.co.uk/oliverg/
>
> - --
> Oliver Gorwits, Network and Telecommunications Group,
> Oxford University Computing Services
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.7 (Darwin)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFJn8Sk2NPq7pwWBt4RAjGTAKC6wZwRm/JlLXioXGwBSScd319BWQCbBZVQ
> irNs/whuX90LqvKDvgJDYPI=
> =Wzug
> -END PGP SIGNATURE-
>
> ___
> 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/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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] New version of InstantCRUD

2009-02-17 Thread Alexander Hartmaier
Would be great if we could combine our efforts instead of creating even
more choices for the users of cat in form of InstantCRUD,
Controller::DBIC::API and so on
(http://dev.catalyst.perl.org/wiki/crud).

- Alex aka abraxxa


Am Montag, den 16.02.2009, 21:44 +0100 schrieb Zbigniew Lukasiak:
> Looks like we are again discussing CRUD in Catalyst - so I decided to
> finally update InstantCRUD and release it to CPAN.
>
> It is still experimental.
>
> It is a 'scaffolding' - like the Rails one - it generates a CRUD
> application for a given dsn.
>
> Some more random thoughs:
> http://dev.catalystframework.org/wiki/crud/instantcrud and
> http://dev.catalystframework.org/wiki/crud/crud_and_rest (one caveat I
> completely disagree with the  "Preliminary URI naming guidelines").
>
>
> --
> 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/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

___
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: The paradox of choice in web development

2009-02-16 Thread Alexander Hartmaier
I thought you refer to youporn.com ;-)

-  Alex


Am Sonntag, den 15.02.2009, 13:39 +0100 schrieb Dan Dascalescu:
> > Aye, that it is:
> >
> http://www.bbc.co.uk/blogs/bbcinternet/2008/12/iplayer_day_performance_tricks.html
>
> Thanks for the link. I added it as a support URL to
> http://www.appliedstacks.com/website/Bbc_Iplayer
>
> ___
> 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/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

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


  1   2   >