Users - location parameter on the request-map in the controller.xml file

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Users - location parameter on the request-map in the controller.xml file

cjhowe
Let me preface this by making sure you understand that
I'm saying following Hans's suggestion makes it
difficult to follow the trail from
url->controller->request.  I am reccomending against
following Hans's suggestion unless you can overcome
this difficulty.

Hans's suggestion would create a virtual
controller.xml file or I suppose more appropriately
coined, a virtual request mapping set.  Virtual
meaning in this case that no complete document exists
for you to edit directly.

Currently you have a complete xml document
(controller.xml) to find the request for each web app.
 So, your request is not dificult to find.

Let me try an example of Hans's suggestion and what
ends up from the server's point of view.

============================
myapp/WEB-INF/controller.xml
============================
...
<request uri="main">
...
</request>
<request uri="*"
location="component://otherapp/webapp/otherapp/WEB-INF/controller.xml">
...
</request>
//end of myapp/WEB-INF/controller.xml
============================
otherapp/WEB-INF/controller.xml
============================
<request uri="myrequest">
...
</request>
//end of otherapp/WEB-INF/controller.xml


This is what the server sees
============================
controller.xml
============================
<request uri="main">
...
</request>
<request uri="myrequest">
...
</request>
//end of server's controller.xml
=========End of Example========

This is great, works great, easy to find the requests,
but provides very little benefit of reuse of code.
The example that provides enough code reuse follows.

============================
myapp/WEB-INF/controller.xml
============================
<request uri="main">
...
</request>
<request uri="*"
location="component://otherapp1/webapp/otherapp1/WEB-INF/controller.xml">
...
</request>
<request uri="*"
location="component://otherapp2/webapp/otherapp2/WEB-INF/controller.xml">
...
</request>
<request uri="*"
location="component://otherapp3/webapp/otherapp3/WEB-INF/controller.xml">
...
</request>
<request uri="*"
location="component://otherapp4/webapp/otherapp4/WEB-INF/controller.xml">
...
</request>
//End of myapp/WEB-INF/controller.xml
============================
otherapp1/WEB-INF/controller.xml
============================
<request uri="myrequest">
...
</request>
...15 other requests
//End of otherapp1/WEB-INF/controller.xml
============================
otherapp2/WEB-INF/contrller.xml
============================
<request uri="myrequest16"
...
</request>
...35 other requests

...Etc


Now assuming there is a request called foobar within
those outside controller.xml files, where is it?  The
only way to find it is if you systematically go
through each of the external request documents until
you find the first occurance.  

You can have external references for the view-maps and
for the screens and for the forms because you have a
starting point.  The request maps are the starting
point in the trail.  Without knowing where to start,
you cannot follow the trail.  Does this help clarify?
 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - location parameter on the request-map in the controller.xml file

Andrew Sykes
Chris,

I agree, if you interpret Hans suggestion as a global include, then
things would get real messy! Hopefully Hans will have some comments on
this...

I had a greater level of specificity in mind. I'll give an example as I
thought things should look...

============================
myapp/WEB-INF/controller.xml
============================
...
<request uri="main">
...
</request>
<request uri="request_with_same_or_different_name"
location="component://otherapp/webapp/otherapp/WEB-INF/controller.xml#myrequest">
...
</request>
//end of myapp/WEB-INF/controller.xml
============================
otherapp/WEB-INF/controller.xml
============================
<request uri="myrequest">
...
</request>
//end of otherapp/WEB-INF/controller.xml

This example means that you don't have to wade through all the
controller.xml files, because you are referring to a specific request
mapping in another file (#myrequest)

This is a bit limited though, in some cases, you may want to modify the
mapping for example mount on http instead of the https, perhaps
something like this would be better...

============================
myapp/WEB-INF/controller.xml
============================
...
<request uri="main">
...
</request>
<request uri="request_with_same_or_different_name"
extends="component://otherapp/webapp/otherapp/WEB-INF/controller.xml#myrequest">
    <security https="false"/>
</request>
//end of myapp/WEB-INF/controller.xml
============================
otherapp/WEB-INF/controller.xml
============================
<request-map uri="myrequest">
    <security https="true" auth="true"/>
    <response name="success" type="view" value="main"/>
</request-map>
//end of otherapp/WEB-INF/controller.xml

Note the attribute "location" has been replaced by "extends" and the
attribute https="false" over-rides the default of "true".

There is a problem with all of this, in that requests are present are
resolved via their own webapp root, for example if your mapping referred
to an FTL file contained within another webapp, you'd have to make sure
you handled this non-local context when you mounted the request. I guess
that could get a bit tricky...

I think I understand now the difference between our 2 interpretations of
the suggestion, please let me know if this is more clear...

Kind Regards
--
Andrew Sykes <[hidden email]>
Sykes Development Ltd

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - location parameter on the request-map in the controller.xml file

Hans Bakker
On Sunday 18 December 2005 16:39, Andrew Sykes wrote:
> Chris,
>
> I agree, if you interpret Hans suggestion as a global include, then
> things would get real messy! Hopefully Hans will have some comments on
> this...
>

this is primary meant to be used in a customized webapplication built on top
of the standard OFBiz application. In the ofbiz webapplication itself it will
be hardly used. At least i found that mostly only a limited number of
requests need to be modified and most will be used from the existing
webapplication. Especially now by using the 'mainDecoratorLocation' an
existing webapplication can be used with a completely different design
however the controller.xml need to be kept in sync and requarly copied when a
new version is installed.
This is not required when this change is implemented.

--
Regards,
Hans Bakker
ANT Websystems Co.,Ltd (http://www.antwebsystems.com)

If you want to verify that this message really originates from
from the above person, download the public key from:
http://www.antwebsystems.com/hbakkerAntwebsystems.asc

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users

attachment0 (196 bytes) Download Attachment