Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users

"featurizing" a catalyst app

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


rodrigolive at gmail

Jun 25, 2009, 9:45 AM

Post #1 of 6 (810 views)
Permalink
"featurizing" a catalyst app

Hi all,
I have an application that has many "features" (or plugins, or extensions,
or bundles, or whatever, but I'll call it "feature" for uniqueness sake),
which are subsets of the app that may or may not be bundled into the
application, depending on the customer it will be shipped to.

What I'm looking for is to have a very Eclipse-like directory structure:

MyApp/features/my_first_feature_1.0.0/root/
MyApp/features/my_first_feature_1.0.0/lib/Controller
MyApp/features/my_first_feature_1.0.0/lib/Model
MyApp/features/my_first_feature_1.0.0/lib/View

MyApp/features/another_feature_1.2.0/root/
MyApp/features/another_feature_1.2.0/lib/Controller
MyApp/features/another_feature_1.2.0/lib/Model
MyApp/features/another_feature_1.2.0/lib/View

The idea is that modules contained in features should not be aware that they
are in a feature, but work like they are in the default /lib or /root.

I think the /lib part can probably be setup using this:

__PACKAGE__->config( setup_components => { search_extra => [ @features ] }
);

With a little bit of code to fillup @features correctly, and some @INC
tweaking...

But how about the /root part? Can mixed-up root dirs be seen as a single
root dir easily?

cheers,
rodrigo


rmb32 at cornell

Jun 28, 2009, 1:16 AM

Post #2 of 6 (735 views)
Permalink
Re: "featurizing" a catalyst app [In reply to]

Rodrigo wrote:
> But how about the /root part? Can mixed-up root dirs be seen as a
> single root dir easily?

I'm interested in making a pluggable app as well. Seems like you and I
would want the ability to specify an arrayref for MyApp->config->{root},
and have that work. Poking around cursorily, that doesn't seem to be
supported right now. Can somebody who knows what they're talking about
(i.e. not me) confirm?

Rob



_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


bobtfish at bobtfish

Jun 28, 2009, 8:08 AM

Post #3 of 6 (731 views)
Permalink
Re: "featurizing" a catalyst app [In reply to]

On 28 Jun 2009, at 09:16, Robert Buels wrote:

> Rodrigo wrote:
> > But how about the /root part? Can mixed-up root dirs be seen as a
> > single root dir easily?
>
> I'm interested in making a pluggable app as well. Seems like you
> and I would want the ability to specify an arrayref for MyApp-
> >config->{root}, and have that work. Poking around cursorily, that
> doesn't seem to be supported right now. Can somebody who knows
> what they're talking about (i.e. not me) confirm?

Assuming that you're mandating a TT view for your pluggable parts,
then you can just subclass View::TT to have an INCLUDE_PATH which
picks up the 'root' directories from all your loaded 'Components'.

Cheers
t0m


_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


peter at peknet

Jun 28, 2009, 8:42 AM

Post #4 of 6 (733 views)
Permalink
Re: "featurizing" a catalyst app [In reply to]

Tomas Doran wrote on 6/28/09 10:08 AM:
>
> On 28 Jun 2009, at 09:16, Robert Buels wrote:
>
>> Rodrigo wrote:
>> > But how about the /root part? Can mixed-up root dirs be seen as a
>> > single root dir easily?
>>
>> I'm interested in making a pluggable app as well. Seems like you and
>> I would want the ability to specify an arrayref for
>> MyApp->config->{root}, and have that work. Poking around cursorily,
>> that doesn't seem to be supported right now. Can somebody who knows
>> what they're talking about (i.e. not me) confirm?
>
> Assuming that you're mandating a TT view for your pluggable parts, then
> you can just subclass View::TT to have an INCLUDE_PATH which picks up
> the 'root' directories from all your loaded 'Components'.
>

fwiw, you can see an example of this on CPAN in CatalystX::CMS::View


--
Peter Karman . http://peknet.com/ . peter[at]peknet.com
gpg key: 37D2 DAA6 3A13 D415 4295 3A69 448F E556 374A 34D9

_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


rodrigolive at gmail

Jun 28, 2009, 10:11 AM

Post #5 of 6 (732 views)
Permalink
Re: "featurizing" a catalyst app [In reply to]

> Assuming that you're mandating a TT view for your pluggable parts, then you
> can just subclass View::TT to have an INCLUDE_PATH which picks up the 'root'
> directories from all your loaded 'Components'.
>

I usually have /static stuff too, mostly css and images.


peter at peknet

Jun 28, 2009, 11:21 AM

Post #6 of 6 (727 views)
Permalink
Re: "featurizing" a catalyst app [In reply to]

Rodrigo wrote on 6/28/09 12:11 PM:
>> Assuming that you're mandating a TT view for your pluggable parts, then you
>> can just subclass View::TT to have an INCLUDE_PATH which picks up the 'root'
>> directories from all your loaded 'Components'.
>>
>
> I usually have /static stuff too, mostly css and images.
>

Catalyst::Plugin::Static::Simple::ByClass is one way to deal with that.

CatalystX::CMS and CatalystX::CRUD::YUI both use it.

--
Peter Karman . http://peknet.com/ . peter[at]peknet.com
gpg key: 37D2 DAA6 3A13 D415 4295 3A69 448F E556 374A 34D9

_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.