海派开源潮流社区

一起参与开源.共同打造海派开源潮流社区(Kernel/Fedora/CentOS/Perl/Drupal)

Installing Catalyst, Ext JS and REST on Vista & ActivePerl
in

From:http://perldev.blogspot.com/2007/08/installing-catalyst-ext-js-and-rest-on_2108.html

This post aims to provide beginners a leg up when getting started with Catalyst, please be patient if your a beginner you'll need it :)

It will also provide some important notes on Ext JS & XML connections to Catalyst-Action-Rest.

Resources

There is a wealth of information out there, go through at least the introductions, frequently asked questions and then examples where they are provided .

This will help you grapple with all the different piece of the Web 2.0 puzzle. Be warned documentation and examples can be all over the place.

Sometimes you'll need to try IRC and you'll get a good bopping and be told to read the documentation. As usual the answer is there, somewhere.

Go through the tutorials in this order, good stuff. My thanks to the Authors for writing up all the glorious documentation.


Description

Link

Catalyst Tutorial

http://search.cpan.org/~jrockway/Catalyst-Manual-5.700704/lib/Catalyst/Manual/Tutorial.pod

REST Article

http://www.catalystframework.org/calendar/2006/9

EXT JS

http://extjs.com/learn/Tutorial:Introduction_to_Ext

DBIX-class Doc Map

http://search.cpan.org/~ash/DBIx-Class-0.08006/lib/DBIx/Class/Manual/DocMap.pod

Ext JS IRC

Server - irc.freenode.net

Channel- extjs

Catalyst, DBIX-Class IRC

Server – perl.irc.org

Channels - dbix-class, catalyst

Ext JS Forum

http://extjs.com/forum/

Mailing lists

http://lists.scsys.co.uk/mailman/listinfo/catalyst

http://lists.scsys.co.uk/mailman/listinfo/dbix-class/

SQLLite3 http://www.sqlite.org/download.html

Installation and setup

Several web pages will say setting up catalyst is likely to be hard, though installing Catalyst could be really easy.

Especially if you know what your doing or you have specific install instructions for your operating system. In saying that in my experience setting up ModPerl and FastCGI on this system has been a pain and I've decided to use Ubuntu for my development from here on in.

This blog post is specific to my setup

  • Dell M1210
  • Vista Business 32bit
  • ActivePerl 5.8.8 [build 822]

Vista

 

As a general rule turn off UAC when your installing stuff on Vista. It stops those little boxes popping up asking you if you really want to do, what you are really wanting to do. If you don't turn it off your installations may not work as expected as well. After you've done all your installs you can turn it back on, if you really want to.

  1. Click on the windows button
  2. Type 'msconfig' and press enter
  3. Click Tools

  4. Click Disable UAC / Enable UAC

  5. Restart windows

p.s. blue screens are back in vogue and out of the box it unzips slower than I can download.

On top of that if you play music your network performance drops so I've read!

Download Links

Here are the versions of software I've installed and used during my implementation.


Software used

Link

Activeperl 5.8.8- 820

http://aspn.activestate.com/ASPN/Downloads/ActivePerl/

EXT JS 1.1

http://extjs.com/download

MYSQL 5.0.41 (community edition)

http://dev.mysql.com/downloads/mysql/5.0.html#win32

Postgres

http://www.postgresql.org/ftp/binary/v8.2.4/win32/

Catalyst and other wonderful ppms

http://perl-blog.googlecode.com/svn/trunk/ppm-cat-install.pl


Catalyst fix

When I initially installed Catalyst, I couldn't actually create my application server, everything just stopped, the Perl program was in an infinite loop.

If you have the same problem there is a fix for it here, but hopefully this has been fixed.

http://www.mail-archive.com/catalyst@lists.rawmode.org/msg06353.html

Catalyst tutorial

Hopefully you know the difference between the UNIX and DOS shells but if you don't for the tutorial here are the differences

The Catalyst tutorial has been written for UNIX users and is a very good tutorial

  • Instead of 'export DBIC_TRACE=1' use 'set DBIC_TRACE=1'
  • Shell commands require double quotes instead of UNIX single quotes

Ext JS Installation

Download ext js from the link provided and place it /MyApp/root/static/ext/

Postgres/MySQL

Download and follow the prompts, make sure you turn off UAC for these ones, otherwise they sometimes have trouble installing.
The Catalyst tutorial has been written to use sqllite and has some details for MySQL, it also works with Postgres.

REST - Ext JS and XML

If you want interact with your web pages you may want to use REST, it's pretty simple and comes with a full tutorial.
JSON is probably easier but I used XML and wouldn't budge.

Ext JS didn't provide a mechanisim to send text/xml in the header so I edited it.
I've posted to the Ext JS forum asking how to do this with a hack but for the moment the hack stands :) (3 days since this post)

ext-yui-adapters.js - Remove the if statement to init the header if(_3a.xmlData){CN.initHeader("Content-Type","text/xml",false);

yui-utlities.js - Modify header to be text/xml
default_post_header:"application/x-www-form-urlencoded"

Of course you can still keep the initHeader as something else and turn it off and on as required using the Ext JS Connection Object or AJAX Object using the defaultHeaders option in the API.

 

Reserved by www.17LAMP.net