You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Chris Howe <cj...@yahoo.com> on 2006/07/01 05:01:03 UTC

Re: site-conf.xsd: Allowing intermixed view-maps and request-map

Separation is great.  I'm a big fan of separation and
I think it should remain the way it is for ofbiz core
applications.  However, allowing them to be intermixed
allows us to revisit the idea of importing xml
documents into the controller.xml.  Follow with me
now.

Last time we discussed this you brought up the very
valid poit of it being dificult to locate a request or
a view because you don't know from what file the
information came if you were importing incomplete
controller xml documents.  I'm not concerned about the
reuse of code controller elements this time inside of
Ofbiz, but rather the custom applications always being
in sync with one of ofbiz's core applications.

If for instance you took ecommerce's controller.xml
file and broke it up like so:

<?xml...?>
<site-conf ... >
<xi:include href="ecomController.xml"/> (i believe
this is the correct syntax)
</site-conf>

ecomController.xml was the rest of the file - ie:
<description..>
<owner..>
<errorpage..>
<handler..>
....
<request...>...</request>
...
<view-map.../>

Now in my custom app's controller.xml file i can
simply...
<?xml...?>
<site-conf ... >
<xi:include href="ecomController.xml"/>
<request...>...</request>
...
<view-map.../>
</site-conf>

now every request or view-map that I define in my
custom app will override the request or view-map found
in ecomController.xml. and any additional requests or
view maps that are added to the ecommerce web app will
automatically be handled.

Sound good?
--- "David E. Jones" <jo...@ofbiz.org> wrote:

> 
> Keeping them separated is very much intentional. It
> actually isn't hard to change the XSD to support
> intermixing, we have all sorts of stuff like that in
> other places.
> 
> I really don't want to do it for the project though.
> Having the view-map elements together is very nice
> to have a quick overview of a web site. Given that
> these files often get pretty large, keeping them
> separated makes it much easier to find things as
> well so that you don't have as much general stuff to
> search through and you can just search through
> requests or views.
> 
> -David
> 
> 
> Vinay Agarwal wrote:
> > Andrew,
> > 
> > I find that there a group of request-maps maps to
> a group of view-maps.
> > Since the controller.xml can be rather long, I
> would prefer to keep such
> > groups together. Ecommerce's controller.xml has
> 5-10 such groups. Of course,
> > xsd today gives an error for that.
> > 
> > Regards,
> > Vinay Agarwal
> > 
> > 
> > -----Original Message-----
> > From: Andrew Sykes
> [mailto:andrew@sykesdevelopment.com] 
> > Sent: Wednesday, June 28, 2006 9:01 AM
> > To: ofbiz-dev@incubator.apache.org
> > Subject: Re: site-conf.xsd: Allowing intermixed
> view-maps and request-map
> > 
> > Vinay,
> > 
> > This is really a personal preference thing I
> guess, my preference would be
> > to keep things the way they are, many requests can
> map to a single view, so
> > things might get rather confusing!
> > 
> > - Andrew
> > 
> > On Wed, 2006-06-28 at 08:48 -0700, Vinay Agarwal
> wrote:
> >> Hello,
> >>
> >>  
> >>
> >> For readability, it may be desirable (at least my
> preference) to allow 
> >> view-maps and request-maps be intermixed, i.e.,
> not require all the 
> >> request-maps to occur before view-maps. Is it
> worth doing? I tried 
> >> modifying xsd using "xs:choice" construct but
> couldn't make it work. 
> >> Anyone tried something like that?
> >>
> >>  
> >>
> >> Thanks in advance,
> >>
> >> Vinay Agarwal
> >>
> >>  
> >>
> > --
> > Kind Regards
> > Andrew Sykes <an...@sykesdevelopment.com> Sykes
> Development Ltd
> > http://www.sykesdevelopment.com
> > 
>