Re: [Catalyst] SOAP WSDL client

2011-03-06 Thread Morad IGMIR
Hi,

If you're trying to access a soap web service from within your catalyst app I 
suggest you take a look at Daniel Ruoso's Catalyst::Model::SOAP here : 

http://search.cpan.org/dist/Catalyst-Model-SOAP/lib/Catalyst/Model/SOAP.pm

It features an example.


Or you can build your own model lib using XML::Compile::SOAP and 
Catalyst::Model::Factory ( or ::Adaptor )

Cheers,

Morad Igmir.

Le 6 mars 2011 à 08:15, linuxsupport lin.supp...@gmail.com a écrit :

 Hi,
 
 Can any one provide me an example of using SOAP from Catalyst? basically I 
 want to access a web web service.
 
 Thanks in advance.
 ___
 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/


[Catalyst] Browser Detection?

2011-03-06 Thread John M. Dlugosz
 I'm supposing that there must be something in the request object that lets me know if 
I'm serving to particular browsers, in particular to whatever version of IE.  Then, in 
some single place in the app, automatically digest that and stick a flag in the stash.  
Now, the TT files can test for that flag and skip advanced features or serve alternative 
content.


Has this already been swept up into a nice module of some kind?

If not, can you give me some pointers on those two things: how to tell what the browser 
is, and where to put the code so it's executed on every action?


Thanks.

___
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] SOAP WSDL client

2011-03-06 Thread linuxsupport
I have already seen, but could not get it working, I could not really
understand that how to use it.

Is there any real example apart from what is in the below link?

On Sun, Mar 6, 2011 at 3:51 PM, Morad IGMIR mig...@alliancemca.com wrote:

 Hi,

 If you're trying to access a soap web service from within your catalyst app
 I suggest you take a look at Daniel Ruoso's Catalyst::Model::SOAP here :

 http://search.cpan.org/dist/Catalyst-Model-SOAP/lib/Catalyst/Model/SOAP.pm

 It features an example.


 Or you can build your own model lib using XML::Compile::SOAP and
 Catalyst::Model::Factory ( or ::Adaptor )

 Cheers,

 Morad Igmir.

 Le 6 mars 2011 à 08:15, linuxsupport lin.supp...@gmail.com a écrit :

  Hi,
 
  Can any one provide me an example of using SOAP from Catalyst? basically
 I want to access a web web service.
 
  Thanks in advance.
  ___
  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] Browser Detection?

2011-03-06 Thread Tobias Kremer
On 06.03.2011, at 11:56, John M. Dlugosz wrote:
 I'm supposing that there must be something in the request object that lets me 
 know if I'm serving to particular browsers, in particular to whatever version 
 of IE.  Then, in some single place in the app, automatically digest that and 
 stick a flag in the stash.  Now, the TT files can test for that flag and skip 
 advanced features or serve alternative content.
 Has this already been swept up into a nice module of some kind?


Let me CPAN this for you:
http://search.cpan.org/dist/Catalyst-TraitFor-Request-BrowserDetect/

--Toby
___
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] How to get uri_for something with a fragment?

2011-03-06 Thread John M. Dlugosz
 How do I call uri_for_action and pass it the '#id' part?  It's not an arg and it's not 
part of the query string.  This is called the fragment identifier in the final URL.




___
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 get uri_for something with a fragment?

2011-03-06 Thread Andrew Rodland
On Sunday, March 06, 2011 05:07:25 AM John M. Dlugosz wrote:
   How do I call uri_for_action and pass it the '#id' part?  It's not an arg
 and it's not part of the query string.  This is called the fragment
 identifier in the final URL.

uri_for returns a URI object, so you can always

my $uri = $c-uri_for_action(...);
$uri-fragment('id');
# Use $uri

Or, since you know that what it generates *doesn't* have a fragment you could 
always just $c-uri_for_action(...) . '#id' which will be perfectly valid 
(although no longer a URI object).

Andrew

___
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] Browser Detection?

2011-03-06 Thread John M. Dlugosz

 Thanks.  I guess everything is easy if you know what you're looking for!

I'd like to set flags based on what that contains, like send SVG images.  Where would I 
put that in MyApp so it gets called some time before rendering the view?


On 3/6/2011 5:00 AM, Tobias Kremer tobias.kremer-at-gmail.com |Catalyst/Allow 
to home| wrote:

On 06.03.2011, at 11:56, John M. Dlugosz wrote:

I'm supposing that there must be something in the request object that lets me 
know if I'm serving to particular browsers, in particular to whatever version 
of IE.  Then, in some single place in the app, automatically digest that and 
stick a flag in the stash.  Now, the TT files can test for that flag and skip 
advanced features or serve alternative content.
Has this already been swept up into a nice module of some kind?


Let me CPAN this for you:
http://search.cpan.org/dist/Catalyst-TraitFor-Request-BrowserDetect/

--Toby
___
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] How to get uri_for something with a fragment?

2011-03-06 Thread John M. Dlugosz
 On 3/6/2011 5:28 AM, Andrew Rodland andrew-at-cleverdomain.org |Catalyst/Allow to home| 
wrote:


Or, since you know that what it generates *doesn't* have a fragment you could
always just $c-uri_for_action(...) . '#id' which will be perfectly valid
(although no longer a URI object).

I considered that a hack until I knew better, since it won't work if there are query 
arguments.


This worked:

[% IF c.action != 'index' ;
   SET toplink = c.uri_for_action('/index') ;
   CALL toplink.fragment('galleries') %]
lia href=[%toplink%]Gallery Index/a/li
[% END %]

though I'd certainly be interested in hearing how I could do it better.

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


[Catalyst] Best form library?

2011-03-06 Thread John M. Dlugosz
 What's the best form-generating/processing library for Catalyst, assuming I don't need 
to worry about old baggage and can move forward with the latest and greatest stuff?


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


Re: [Catalyst] Browser Detection?

2011-03-06 Thread Charlie Garrison

Good morning,

On 6/03/11 at 5:36 AM -0600, John M. Dlugosz 
wxju46g...@snkmail.com wrote:


I'd like to set flags based on what that contains, like send 
SVG images.  Where would I put that in MyApp so it gets called 
some time before rendering the view?


I do browser detection (checking) in the `auto` method (so I can 
redirect to 'upgrade browser' page). But it could also be done 
in the `end` method if you just want to put stuff in stash for 
the view. If you've got a base method that all other actions 
chain from (which seems to be current best practices) then you 
could put it there too.



Charlie

--
   Ꮚ Charlie Garrison ♊ garri...@zeta.org.au

O ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt


___
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] Browser Detection?

2011-03-06 Thread John M. Dlugosz
 On 3/6/2011 8:06 AM, Charlie Garrison garrison-at-zeta.org.au |Catalyst/Allow to home| 
wrote:

Good morning,

On 6/03/11 at 5:36 AM -0600, John M. Dlugosz wxju46g...@snkmail.com wrote:

I'd like to set flags based on what that contains, like send SVG images.  Where would 
I put that in MyApp so it gets called some time before rendering the view?


I do browser detection (checking) in the `auto` method (so I can redirect to 'upgrade 
browser' page). But it could also be done in the `end` method if you just want to put 
stuff in stash for the view. If you've got a base method that all other actions chain 
from (which seems to be current best practices) then you could put it there too.



Charlie


Ah, I see: the 'end' is the end of the controller phase and is still done 
before calling TT.

My general policy is not to forbid older browsers, but to withhold the CSS and add a 
banner.  So, I did that in the page-wrapping template for the site.  I also plan to start 
using SVG, so a flag that tells the TT template to give the IMG or the OBJECT, based on 
whether the browser is on the list of those chosen to get SVG.


Looking toward the future, I'm hoping that IE9 will be a sea-change.  So as with normal 
programming languages, I'm thinking that a new project should use up-to-date features.


By chaining actions, you mean how http://site.com/foo/bar/baz will have a base action at 
foo, then more action at bar, etc?  I don't think my current project works well for that.  
Is the current trend to chain back to the root?  I don't see how that adds anything over 
'auto', but I'll re-read that section carefully.




___
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] Browser Detection?

2011-03-06 Thread Mike Raynham

On 06/03/11 14:45, John M. Dlugosz wrote:

On 3/6/2011 8:06 AM, Charlie Garrison garrison-at-zeta.org.au
|Catalyst/Allow to home| wrote:

Good morning,

On 6/03/11 at 5:36 AM -0600, John M. Dlugosz wxju46g...@snkmail.com
wrote:


I'd like to set flags based on what that contains, like send SVG
images. Where would I put that in MyApp so it gets called some time
before rendering the view?


I do browser detection (checking) in the `auto` method (so I can
redirect to 'upgrade browser' page). But it could also be done in the
`end` method if you just want to put stuff in stash for the view. If
you've got a base method that all other actions chain from (which
seems to be current best practices) then you could put it there too.


Charlie


Ah, I see: the 'end' is the end of the controller phase and is still
done before calling TT.

My general policy is not to forbid older browsers, but to withhold the
CSS and add a banner. So, I did that in the page-wrapping template for
the site. I also plan to start using SVG, so a flag that tells the TT
template to give the IMG or the OBJECT, based on whether the browser is
on the list of those chosen to get SVG.

Looking toward the future, I'm hoping that IE9 will be a sea-change. So
as with normal programming languages, I'm thinking that a new project
should use up-to-date features.

By chaining actions, you mean how http://site.com/foo/bar/baz will have
a base action at foo, then more action at bar, etc? I don't think my
current project works well for that. Is the current trend to chain back
to the root? I don't see how that adds anything over 'auto', but I'll
re-read that section carefully.



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


It may be worth noting that browser detection is often considered to be 
a bad idea.  The thought being that if you want to affect content 
delivery based on browser capability, then it is browser capability that 
you should detect.


As far as I know, you usually need Javascript for this, as user agent 
strings can be unreliable.  Of course, using Javascript precludes 
detection where the user has Javascript disabled.


Here's some more information for you:

http://css-tricks.com/browser-detection-is-bad/
http://www.quirksmode.org/js/detect.html
http://www.quirksmode.org/js/support.html

Depending on your needs, another approach may be to use IE conditional 
comments to wrap a fake get request to your app, which your app can then 
use to determine the version of IE.  Something like the image tracker 
method used by Piwik:


http://piwik.org/docs/tracking-api/#toc-two-tracking-method-image-tracking-or-using-the-api

___
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 form library?

2011-03-06 Thread Octavian Rasnita
From: John M. Dlugosz wxju46g...@snkmail.com
  What's the best form-generating/processing library for Catalyst, assuming I 
 don't need 
 to worry about old baggage and can move forward with the latest and greatest 
 stuff?
 
 --John


It depends on what you prefer.
The best and most used seem to be HTML::FormFu and HTML::FormHandler.

Octavian


___
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 form library?

2011-03-06 Thread Tobias Kremer
On 06.03.2011, at 16:31, Octavian Rasnita wrote:
 From: John M. Dlugosz wxju46g...@snkmail.com
 What's the best form-generating/processing library for Catalyst, assuming I 
 don't need 
 to worry about old baggage and can move forward with the latest and greatest 
 stuff?
 
 It depends on what you prefer.
 The best and most used seem to be HTML::FormFu and HTML::FormHandler.

I'm quite happy with Rose::HTML::Form because I like having forms as classes. 
It also was one of the fastest form solutions back when we evaluated the 
candidates. Nowadays, I'd probably give HTML::FormHandler a try, mainly because 
it also follows the every form is a class approach (which IMHO is *much* 
better than having your forms defined in YAML files).

--Toby

___
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 form library?

2011-03-06 Thread Mark A. Stratman

On 3/6/11 9:45 AM, Tobias Kremer wrote:

On 06.03.2011, at 16:31, Octavian Rasnita wrote:

From: John M. Dlugoszwxju46g...@snkmail.com

What's the best form-generating/processing library for Catalyst, assuming I 
don't need
to worry about old baggage and can move forward with the latest and greatest 
stuff?


It depends on what you prefer.
The best and most used seem to be HTML::FormFu and HTML::FormHandler.


I'm quite happy with Rose::HTML::Form because I like having forms as classes. It also was 
one of the fastest form solutions back when we evaluated the candidates. Nowadays, I'd 
probably give HTML::FormHandler a try, mainly because it also follows the every 
form is a class approach (which IMHO is *much* better than having your forms 
defined in YAML files).



In addition to the documentation on CPAN, the wiki contains some 
information on those three form handlers too:


HTML::FormFu
http://wiki.catalystframework.org/wiki/howtos/forms/formfu
http://wiki.catalystframework.org/wiki/FormFu_FAQ

HTML::FormHandler
http://wiki.catalystframework.org/wiki/howtos/forms/hfh
http://wiki.catalystframework.org/wiki/hfh_faq

Rose::HTML
http://wiki.catalystframework.org/wiki/rhtmlo

By the way: As you begin using one of them if you run across anything 
you think those pages should have contained, feel free to edit them, or 
send me an email and I'll be happy to (they're on my radar to be better 
interlinked, and cleaned up a bit).


- Mark

___
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 form library?

2011-03-06 Thread Victor Churchill
Speaking here as a novice with the same questions as the OP:

I like the functionality of HTML::FormFu as deployed in the tutorial
example but also find the YAML a bit strange at first; I am, too,  a
bit stopped by the impression that the form does not become available
until after it is submitted. I have a client/boss who likes JavaScript
validation of an Ajax-y type and although I see hooks for JS in the
HTML::FormFu docs it is not very obvious how to utilise them. Having
the JavaScript in a file pulled in by the page template obviously goes
against DRY principles if the logic is also present on the server.

___
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 form library?

2011-03-06 Thread Devin Austin
On Sun, Mar 6, 2011 at 1:47 PM, Victor Churchill
victorchurch...@gmail.comwrote:

 Speaking here as a novice with the same questions as the OP:

 I like the functionality of HTML::FormFu as deployed in the tutorial
 example but also find the YAML a bit strange at first; I am, too,  a
 bit stopped by the impression that the form does not become available
 until after it is submitted. I have a client/boss who likes JavaScript
 validation of an Ajax-y type and although I see hooks for JS in the
 HTML::FormFu docs it is not very obvious how to utilise them. Having
 the JavaScript in a file pulled in by the page template obviously goes
 against DRY principles if the logic is also present on the server.

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


FormFu is pretty awful in my opinion.  Rose::HTML stuff isn't much better.
I recommend HTML::FormHandler or Form::Sensible, or if you don't want to
deal with creating your own forms by hand, just use
Form::Sensible::Reflector::DBIC and have it reflect off of your DBIC schema.

-- 
Devin Austin
http://www.codedright.net
9702906669 - Cell
___
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 form library?

2011-03-06 Thread Erez Schatz
On 6 March 2011 22:52, Devin Austin devin.aus...@gmail.com wrote:

 I like the functionality of HTML::FormFu as deployed in the tutorial
 example but also find the YAML a bit strange at first;

Carl should really put this in flashing bold at the top of the page:

all examples here are YAML, but you can use any format supported by
Config::Any

Which means XML, YAML, JSON, Apache-style configuration, Windows INI
files, and even Perl code

As for HTML::Formhandler, I dunno whether this has been addressed, but
when we used it (at my previous place of employment) we ran into some
severe issues of, and I quote again, misbehaviour due to modified
state after reset causing leaks and we ended up moving to FormFu,
which I should say was somewhat under utilized for what it did offer
us. Formhandler was also, to my taste, unwilling to allow any
out-of-the-ordinary configuration and we ended up overriding a lot of
form controls which makes the whole idea of a form generator a bit
silly.

-- 
Erez

La perfection soit atteinte non quand il n'ya plus rien à ajouter,
mais quand il n'ya plus rien à retrancher.

___
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 form library?

2011-03-06 Thread Roger Horne
On Sunday 06 March 2011 20:52:04 Devin Austin wrote:

 FormFu is pretty awful in my opinion.  Rose::HTML stuff isn't
 much better.

As an amateur I would be interested to know why. 

When I started learning about Catalyst about a year ago, the 
Tutorial at 
http://search.cpan.org/~zarquon/Catalyst-Manual-5.8005/lib/Catalyst/Manual/Tutorial/09_AdvancedCRUD.pod
 
only described FormFu and so I used it. For the trivial stuff I 
deal with it works (most of the time) so I have not tried any of 
the others. (If it ain't broke ... :-)

r.
-- 
Roger Horne
ro...@hrothgar.co.uk

___
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] Formhandler and Auth

2011-03-06 Thread Eric Berg

On 3/4/11 11:03 AM, Gerda Shank wrote:

On 3/4/11 8:23 AM, Eric Berg wrote:
I'm trying to do some progressive engagement by allowing one of my 
forms to be filled out before a user is required to log in, but once 
the form is filled, I need them to log in so that I can get the user 
ID, which is part of the record for that form's row in my db.
So after the form is submitted, you want to save the form contents 
somehow, then present a login form, then after the user logs in, save 
it to the database?
Yes.  What I did previously was just to save a hash of the values, but 
I'm not sure how to pass that to formhandler given that my db 
constraints currently require the values for this form to have a 
creator_id, which is just what I need from the login.  So, I'm thinking 
at this point that I need to find a way to pass a hash of form values 
back to formhandler..that's got to be possible, and must be done after I 
get the form submission or I'll have to loosen up the constraints on my 
db to allow me to insert rows without a creator ID.  I'm looking into 
that now.


Is the part you're not sure of how/where to save the form contents? 
There are the usual options for preserving data across several 
requests, i.e. stash, database, etc.
I've been stashing a hash of form params.  I have to test this out, but 
I have to figure out if I can validate the form without the creator_id's 
being present.  I added it to the form, because formhandler was barfing 
when I used the simple form of stashing the new_result({}), then 
returning $self-form($c) in my add().   I have to figure out how to 
validate the form wtihout having it submitted to teh db, because that 
causes an error when the creator_id is missing, or add the creator_id 
(hidden and empty) to the form and only validate after login.  I guess I 
just have to try a few things.  If any of you good folks have banged 
your head against this and have ideas, they'd certainly be welcome.


Then you'd have to decide how you want to save the data. You *could* 
use FormHandler to do that, but if you have an already validated set 
of data, it might be simpler to just save it to the database yourself.
May be.  Probably, since I'm trying to wrest control from formhandler so 
I can validate a form without the creator_id, then redirect to login, 
then take the values of the form and the logged-in user's id and commit 
that to the db.  One change that is causing me problems is that I moved 
from the approach of having the form be a simple attribute (has 'form') 
where I was doing all the processing in the show and add methods to the 
approach where I implemented $self-form() per the sample referenced in 
HTML::FormHandler::Manual::Catalyst.


Thinking through this in writing this, I believe that what I have to do 
is reimplement the form as a simple attribute and then handle the 
process() as needed in the add() method.  I think that's where I shot 
myself in the foot.


Thank you muchly.  I'll post my successful results for the benefit of 
those who follow.


Eric


I'm not quite sure if I addressed the particular issues you were 
having; if not, please clarify :)


Gerda


___
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] Formhandler and Auth

2011-03-06 Thread Eric Berg
Thanks, Dave.  the part that I'd missed int he docs was about how to 
tell if any params had been submitted.  I had done some coding around 
that problem before implementing formhandler.  Nice that I can leverage 
that.


Thanks again for pointing that out.

Eric

On 3/4/11 8:57 AM, David Schmidt wrote:


On Fri, Mar 4, 2011 at 2:23 PM, Eric Bergeb...@bergbrains.com  wrote:

I'm trying to do some progressive engagement by allowing one of my forms to
be filled out before a user is required to log in, but once the form is
filled, I need them to log in so that I can get the user ID, which is part
of the record for that form's row in my db.

I'm using  HTML::FormHandler::Model::DBIC and generally sticking to the
example here:
http://search.cpan.org/~gshank/HTML-FormHandler-0.32005/lib/HTML/FormHandler/Manual/Catalyst.pod#A_Controller_Example

The problem is that I don't know how to check to see if the form has been
submitted and validated so that I know when to forward to /login.

It feels to me like the approach laid out at the URL above is a bit simple
for this approach, but so far I haven't figured out how to do anything more
low-level.  Seems like setting the form as an attribute of the controller
and then doing the processing and validating in my methods/actions might be
the way to go.

Anyone have any examples or advice?

Thanks.

Eric

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



Been a while since I last used HFH but how about

$form-validated;

that should only return true if the form was validated and from
skimming through the docs validation is only done if form parameters
are present.

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/


Re: [Catalyst] Best form library?

2011-03-06 Thread Octavian Rasnita

From: Victor Churchill victorchurch...@gmail.com

Speaking here as a novice with the same questions as the OP:

I like the functionality of HTML::FormFu as deployed in the tutorial
example but also find the YAML a bit strange at first; I am, too,  a


I have used HTML::FormFu a lot, but I have never used YAML because I also 
don't like YAML.


HTML::FormFu can accept the forms to be created with any config type 
supported by Config::Any, like the Apache-style config format 
(Config::General), INI files, JSON, YAML or even a simple Perl hash.


I prefer to use the Apache style configuration.
The configuration style has nothing to do with HTML::FormFu.

In my opinion HTML::FormFu is better than HTML::FormHandler because it 
doesn't require writing as much Perl code, and it better separates the Perl 
code and the HTML code.


Octavian


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