[Catalyst] CatalystX::CRUD::Tutorial...looking for missing pieces.

Peter Karman peter at peknet.com
Thu Jan 7 02:44:36 GMT 2010


Adam Mackler wrote on 1/6/10 11:56 AM:


> "Please download a copy of LiveGrid Javascript lib from
> http://code.google.com/p/ext-ux-livegrid/ and install it locally on a
> static web server. Then update your local root/crud/tt_config.tt file."
> 
> The page source shows references to javascript files on
> static.msi.unm.edu and yui.yahooapis.com, so I'm guessing the error
> dialogs are indicating that the javascript files will be coming from
> those two sites rather than my server.  In other words it shouldn't
> stop the application from working.  If I'm wrong here, please let me
> know.  Anyway, I would like to make those messages go away.

You are correct that the application will work with the .js files coming from 
those URLs. My idea was that the package should Just Work out of the box, but 
that (a) it was impractical to bundle all the .js dependencies with the .pm 
files and (b) it was impolite to just point at known-good URLs without an 
annoying warning that you should get your own copy and stop using someone else's 
bandwidth.

To get rid of those messages, just copy the installed tt_config.tt file to your 
local app and modify it. Example:

  % cd MyApp
  % perldoc -l CatalystX::CRUD::YUI::tt
[some/perl/path/to]/CatalystX/CRUD/YUI/tt.pm

  % cp [some/perl/path/to]/CatalystX/CRUD/YUI/tt/crud/tt_config.tt \
    root/crud/tt_config.tt

  % vi root/crud/tt_config.tt

and change the URL values to your own local copy of the .js libs. I typically 
put them either in the root/static dir so that I can serve them with the 
Static::Simple plugin, or on some known web server dedicated to serving static 
content. If you want to serve them with Static::Simple (the easiest, but not 
what you want to do when you deploy to production), change the URL values to 
something like:

  ExtBaseURL      = c.uri_for('/static/extjs');
  LGBaseURL       = c.uri_for('/static/livegrid');

and unpack the .js stuff into root/static/extjs and root/static/livegrid.

> 
> I downloaded the two menioned items, ExtJS and LiveGRid, with no
> problems, but my certainty ends there.  (BTW I have zero experience
> with Javascript, and my only expeience with TT is from Catalyst
> Tutorials--I've been happily using Mason for years.)  My confusion
> here has several bases: First, the term "update" with regard to the
> tt_config.tt, since I have no such file.  I'm taking that to mean
> "create" rather than update.

Yes, there is poor documentation around the tt_config.tt file. The assumption is 
that you have already copied it over and now need to modify it. But that's a 
poor assumption.

Doc patches welcome.

> 
> Next, based on reading the pod for Rose::DBx::Garden::Catalyst::View,
> I've concluded the error messages above mean to say "update your local
> root/rdgc..." when they say "root/crud..."  If I'm wrong here, please
> let me know.

'crud' is correct. The CatalystX::CRUD::YUI package is descended from RDGC, and 
RDGC is now mostly a wrapper around CXCY. RDGC just provides the bootstrapping 
code generation; CXCY is the actual Catalyst application.


-- 
Peter Karman  .  http://peknet.com/  .  peter at peknet.com



More information about the Catalyst mailing list