On Mon, 19 Feb 2001, Santiago Gala wrote:

> I have a patch cooking, that affects DynamicURI, RelativeDynamicURI and 
> ContentURI. I just wanted to ask feed back about it.
> 
> 
> I arrived to this patch trying to solve the mess of different ways to 
> get internal URIs in Jetspeed.
> 
> While looking at Turbine's code, I noticed that DynamicURI, 
> RelativeDynamicURI and ContentURI had redundant code.
> 
> I also noticed that there are plans to use factories to deliver the 
> DynamicURI objects. This will make inconvenient inheriting from 
> DynamicURI, as it will be an interface and the factory code would be 
> messy again.
> 
> Thus, to simplify the code, I'm into:
> 
> - Add public methods toRelativeString(), toWebappRelativeString() and 
> getContentURI( path, absolute ) to DynamicURI
> - Simplify and deprecate classes RelativeDynamicURI and ContentURI.
> 
> The idea is that once we have a DynamicURI, we can ask it to give us the
> (absolute)URI string --> toString(), the (host)relative URI string --> 
> toRelativeString(), the (webapp)relative URI string --> 
> toWebappRelativeString(), or the translation of an argument path to an 
> absolute or webapp relative string (for images, static files, ...) --> 
> getContentURI( String path, boolean absolute).
> 
> When the new factory stuff in working, I think it is better to have a 
> simgle object to be produced by the factory than to have three of them. 
> Also, the internal workings of RelativeDynamicURI and ContentURI were 
> mostly redundant with code in DynamicURI.
> 
> I reorganized code internally in DynamicURI to have protected methods:
> 
> fillBase( StringBuffer ) --> scheme://host[:port]
> fillRelative( StringBuffer ) --> /context/script/[screen...]
> fillWebappRelative( StringBuffer ) --> /script/[screen...]
> 
> Those methods factor out the code, so that it only appears once in the 
> code base.
> 
> Problems, Ideas, things that do not fit?

The TurbineServletService is a place where all the information
about the servlet is available. You can probably use some of the
methods in there for what you are doing. I borrowed this
from Jetspeed, so it may be of use to you for this task?

I was trying to make the TurbineServletService the single
place to store info about the webapp. I haven't looked
at DynamicURI and friends, but would it be possible to
use the TurbineServletService in the DynamicURI class?

jvz.



------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to