On May 13, 2005, at 6:33 AM, Nathan Lai wrote:
Hi All,
A few weeks ago, I made a web mapping application with the Spring MVC using the MultiActionController that comes with the framework. The application features the following
(1) A user is able to retrieve the map image of a feature (say a garden) easily from the database by simply specifying the unique identifier of that feature in the URL. For instance, he can simply enter the URL http://xxxx/imageservice/service.do? op=getImage&id=12345&sizeoption=1 in the browser or embed it in the HTML as a link to retreive the image of the feature with id 1234 from the database. The parameter 'sizeoption' is optional.
(2) After retrieving the image, the user can navigation around the feature, say zoomin, zoomout and pan using just simple URLs. For instance , he can enter http://xxxx/imageservice/service.do? op=zoomin&zoomfactor=2 in the browser to get a more detailed map. He has no need to carry out any relevant coordinate calculations. Moreover, the 'zoomfactor' parameter is optional and defaults to the value of 1 if absent.
(3) The controller at the backend would perform validation against query parameters. For instance, it would check if the user wants to perform a getImage operation but forgets to supply the feature id in the request.
Now, I'm thinking the possibility of porting the application to Tapestry and wanting to know how hard it is. The following are my initial thoughts and doubts:
Initial thoughts :
I think that DirectLink is the component to use to accomplish the task. So, there should be different DirectLink listeners, say doGetImage, doZoomIn, doZoomOut, doPan, etc in the page to act for different map actions. Moreover, a visit object should also be used in order to track the user specific information such as the viewing extent of the map and the id of the feature in which the user is interested.All beans performing the mapping functions should be managed by Spring.
Doubts:
(1) Actually, is it the correct and best way to use DirectLink to do the job?
I recommend using ExternalLink instead. DirectLink is not suited for what you're after, in my opinion.
(4) Since the original application allows user to enter user friendly URLs (as described above) directly into the browser to get things done, and those URLs are so different from those recognized and generated by Tapestry, I need to make an conversion between them. I 'm thinking of using the URL Rewriter to get it done. Is it a good idea?
Yes, or a custom filter to do the mapping. I'm a big proponent of that technique.
I'm quite new to Tapestry, so sorry for any silly questions asked. I'm using Tapestry 3.0.3.
Not silly at all. Hackable - meaning user manipulatable - URL's are important to many including myself. Tapestry 3.0 requires ingenuity on top of it to get clean URL's. Tapestry 4.0 has some facilities to make it better that I have not yet explored.
Erik
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
