logo       

RE: How-to clone a whole project ?: msg#00223

web.mason.user

Subject: RE: How-to clone a whole project ?



> -----Original Message-----
> On Thu, 28 Aug 2003, Ken Williams wrote:
> > On Wednesday, August 27, 2003, at 09:56 PM, Oleg Bartunov wrote:
> > > Hi there,
> > >
> > > I have one project which I want to use as a project template for
> > > several other projects. This project contains is fully functional
> > > and rather mature application and does some generic work with
> > > complex logic, so I don't want to touch it very much. I
> could move
> > > it to separate component root and use autohandler,dhandler to
> > > develop specific project but I find it very difficult to use
> > > specific components instead of generic one if it (generic
> component)
> > > calls another component from generic project. For example (very
> > > simplified):
> > >
> > > /generic/
> > > a.html -> a.msn
> > > .....................
> > >
> > > /project1/ a.msn
> > >
> > >
> > > and I want to use a.msn specific for project1 instead of generic
> > > one. The problem is with dhandler behaviour which looks (after
> > > request /project1/a.html ) in current (/generic/) directory for
> > > a.msn.
> >
> > Nope - all component searches follow the order of the
> component roots
> > in the order you specify them, so if you specify 'project1' before
> > 'generic' things should work as desired.
>
> This is exactly what I tried first, but there is no
> /project1/a.html, so in /project1/dhandler I call
> /generic/a.html which in turn calls a.msn and mason find it
> in current (/generic/) directory, while I want to use /project1/a.msn

Oleg,
What Ken is suggesting (I think) is that you use Mason's
multiple component roots feature to achieve your "project template", not
autohandler/dhandler techniques.
If you specify multiple component roots (see
http://masonhq.com/docs/manual/Admin.html#component_root) then whenever
Mason searches for a component, it will automatically search the
component roots in order and use the first one it finds. Thus, if you
list your 'project1' component root first and your 'generic' component
root second, Mason will first attempt to load 'a.html' from 'project1',
then try 'generic' (where 'a.html' exists). Then, when 'a.html' calls
'a.msn', Mason will start searching in 'project1' for the component,
where it exists. This is all built into Mason if you use multiple
component roots.
Benjamin Turner



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise