NAME

RapidApp::Manual::Assets - Asset handling in RapidApp (CSS, JS, Images, etc.)

DESCRIPTION

RapidApp uses Catalyst::Controller::AutoAssets internally to manage and serve built-in asset files as well as provide mechanisms for additional user-defined and application-specific assets.

RapidApp automatically loads a set of Catalyst::Controller::AutoAssets controllers during startup, and associated html head/include tags are inserted in content/templates in appropriate locations as well.

Built-in, and optional local and custom asset controllers are automatically setup as described below.

BUILT-IN ASSETS

The built-in assets are the same for every RapidApp application. This list of controllers is for reference purposes only, as there is nothing that can be changed or configured about the built-in assets.

*::Controller::Assets::ExtJS (/assets/extjs)

Directory asset controller for the ExtJS sources.

*::Controller::Assets::RapidApp::CSS (/assets/rapidapp/css)

CSS asset controller for built-in RapidApp stylesheets.

*::Controller::Assets::RapidApp::JS (/assets/rapidapp/js)

JS asset controller for built-in RapidApp javascripts.

*::Controller::Assets::RapidApp::Icons (/assets/rapidapp/icons)

IconSet asset controller for built-in RapidApp icons. icon_name_prefix for the built-in icons is set to ra-icon-. See Catalyst::Controller::AutoAssets::Handler::IconSet for more info on the IconSet asset type.

Special asset handling RapidApp 'filelinks' (links embedded in various CMS/ HtmlEditor content locations) - will be removed/consolidated in the future.

*::Controller::Assets::RapidApp::Misc (/assets/rapidapp/misc)

Directory asset controller for additional, miscellaneous static files needed by RapidApp

LOCAL ASSETS

Additionally, the following asset controllers are also auto configured based on the existance of specific directories within the application root:

*::Controller::Assets::Local::CSS (/assets/local/css)

Setup if local directory exists: root/assets/css

CSS asset controller for local stylesheets.

*::Controller::Assets::Local::JS (/assets/local/js)

Setup if local directory exists: root/assets/js

JS asset controller for local javascripts.

*::Controller::Assets::Local::Icons (/assets/local/icons)

Setup if local directory exists: root/assets/icons

IconSet asset controller for local icons. icon_name_prefix is set to icon-. Each image file found within the local app directory root/assets/icons will be setup and available as a CSS icon class (compatible with the ExtJS config 'iconCls'). For example, the image 'apple.png' will get the CSS class name 'icon-apple'.

See Catalyst::Controller::AutoAssets::Handler::IconSet for more info on the IconSet asset type.

*::Controller::Assets::Local::Misc (/assets/local/misc)

Setup if local directory exists: root/assets/misc

Directory asset controller for additional, miscellaneous static files.

The allow_static_requests option is enabled so files within this directory can be accessed via static URL path /assets/local/misc/static/*. This is basically like Static::Simple but with the extra benefits of AutoAssets. Note that for deployment, this static URL prefix can be aliased (such as with the Alias Apache directive) in the web server config in exactly the same way as Catalyst docs describe for Static::Simple, if desired.

See Catalyst::Controller::AutoAssets::Handler::Directory for more info on the Directory asset type.

CUSTOM/ADDITIONAL ASSETS

Extra/custom AutoAsset controllers with specific configs can also be setup by specifying a list of controller configs in the Catalyst config param {'Plugin::AutoAssets'}->{assets}.

See Catalyst::Plugin::AutoAssets for details.

Also note that custom application controllers can also always be setup as normal Catalyst controllers. The above config options are just convenience mechanisms that cover 99% of cases. =head1 SEE ALSO