Daniel Fagerstrom skrev:
Daniel Fagerstrom skrev:
I would like o.a.c.environment.[Request|Response|Session] to extend
javax.servlet.http.Http[ServletRequest|ServletResponse|Session]
respectively.
...
So I will implement my proposal with Alfred's deprecation scheme in the
beginning of next week.
I have commited the changes to the trunk. Everything compiles (removed
the cocoon artifacts in them maven rep first) and all tests runs (except
ZipSourceTestCase which is unrelated to this change). I tested a couple
of samples as well and they still works. But I modified a lot of code so
I would be surprised if I didn't miss anything. Please report if there
are any problems.
For the actual changes I followed Alfred's proposal. A small thing that
I missed concerning possibly incompatible changes is the former method:
org.apache.cocoon.environment.Cookie Response.createCookie(String
name, String value);
Which I replaced with:
javax.servlet.http.Cookie createCookie(String name, String value);
/*
* @deprecated use [EMAIL PROTECTED] #createCookie(String, String)} instead.
*/
org.apache.cocoon.environment.Cookie createCocoonCookie(String name,
String value);
But thinking about it having a factory method for
javax.servlet.http.Cookie seem quite pointless, we should probably just
deprecate the factory method and recomend them to use the constructor
instead:
/*
* @deprecated use <code>new [EMAIL PROTECTED] javax.servlet.http.Cookie(String,
String)}</code> instead.
*/
org.apache.cocoon.environment.Cookie createCocoonCookie(String name,
String value);
WDYT?
For all the javax.servlet.http methods that wasn't part of our
environment instructions I added methods that throws
UnsupportedOperationException to the AbstractRequest, AbstractRespose
and the AbstractSession classes. We can implement these methods later if
people need them.
For the back incompatibilities in the rest of the code I switched most
uses of Session to HttpSession and most uses of
org.apache.cocoon.environment.Cookie to javax.servlet.http.Cookie. In
the few cases where it would have affected the api of the classes I
downcasted getSession() to Session respectively used getCocoonCookie
instead.
I haven't fixed 2.1 yet. As I haven't worked on 2.1 for years I would
happy if someone volunteered to do it. Otherwise I'll fix it in a few
days when we are certain that the trunk works.
I saw that trunk/commons/status.xml hasn't been touched for nearly a
year. Should I document the change there or do we have some new place
for documenting changes in the trunk?
Do we have some special area in the 2.2 documentation for upgrade how to?
/Daniel