Grzegorz Kossakowski wrote:
Reinhard Pötz pisze:
As announced some weeks ago, I want to release
. cocoon-servlet-service-impl-1.1.0
A new minor release is necessary because after some refactorings
the dependency on SourceResolve is gone.
I thought that both SSF and Configurator are not back-compatible. Am I
wrong?
Here is the relevant change of ServletServiceContext#getResource(String
path)
old implementation:
-------------------
public URL getResource(String path) throws MalformedURLException {
// hack for getting a file protocol or other protocols that
// can be used as context
// path in the getResource method in the servlet context
if (!(contextPath.startsWith("file:") || contextPath.startsWith("/")
|| contextPath.indexOf(':') == -1)) {
SourceResolver resolver = null;
Source source = null;
try {
BeanFactory factory =
WebApplicationContextUtils.getRequiredWebApplicationContext(this);
resolver = (SourceResolver)
factory.getBean(SourceResolver.ROLE);
source = resolver.resolveURI(contextPath);
contextPath = source.getURI();
} catch (IOException e) {
throw new MalformedURLException("Could not resolve "
+ contextPath + " due to " + e);
} finally {
if (resolver != null) {
resolver.release(source);
}
}
}
// HACK: allow file:/ URLs for reloading of sitemaps
// during development
if (this.contextPath.startsWith("file:")) {
return new URL("file", null,
this.contextPath.substring("file:".length()) + path);
}
if (this.contextPath.length() != 0 && this.contextPath.charAt(0)
!= '/') {
throw new MalformedURLException("The contextPath must "
+ "be empty or start with '/' " + this.contextPath);
}
// prefix the path with the servlet context resolve and
// resolve in the embedding
// servlet context
return super.getResource(this.contextPath + path);
}
new implementation:
-------------------
public URL getResource(String path) throws MalformedURLException {
if (path == null || !path.startsWith("/")) {
throw new MalformedURLException("The path must begin " +
+ "with a '/' and is interpreted "
+ "as relative to the current context root.");
}
// lazy initialization of the base URL
synchronized (this) {
if (this.contextPathURL == null) {
this.contextPathURL = new URL(this.contextPath);
}
}
return new URL(this.contextPathURL, path.substring(1));
}
The problem with the old SSF was that it _only_ worked, if it was used
together with Cocoon 2.2. After this change the SSF completely relies on
the standard URL handling and can really be used now in every
environment and not only together with Cocoon 2.2.
This requires some changes in Cocoon (-> use JNet to resolve
blockcontext:/ URLs) but since we can be sure that nobody else than
Cocoon 2.2 was able to use the SSF 1.0, I think that a release of 1.1 is
appropriate in this case.
. cocoon-jnet-1.0.0
Dynamically register URLStreamHandler factories with your JVM.
This module has been donated to Apache Commons and will be deprecated
as soon as it is officially released from there.
Didn't know that there is some progress on this idea. Thanks for taking
care of it!
I will synchronize our refactorings of JNet with the code in Apache
Commons - I hope that somebody else has some time to cut the actual release.
. cocoon-block-deployment-1.0.0
Deployment utilities for Cocoon Blocks. That's the first release as
a separate module.
I guess one will have to add this dependency manually if sticks to
Cocoon Core 2.2.0, right?
yes
. cocoon-spring-configurator-2.0.0
Block-deployment has been moved into a separate module. This requires
a major release of this module because an upgrade of an application
that relies on this feature requires more than replacing the library.
If I have some more time, I will also release cocoon-it-fw-1.0.0. It
has proven to be very useful.
Makes sense, it might be useful not only in Cocoon.
yes, definitely. I use it in all web projects, not only in my Cocoon
based ones.
Is there anything left to do before I can create the release artifacts?
I've just committed missing entry describing ResourceFilter feature I've
introduced. The missing items are:
1. Migration document that describes briefly how to migrate to 2.0.0 of
Configurator.
2. Documentation of ResourceFilter.
Even if both of them are not blockers it would be nice if you could
prepare migration document and I'll take care of the second one. If you
are really busy, then I could write this migration document but that
would involve some research on what back-incompatibilities have been
introduced.
I can't promise too much but I will see what I can do.
In short: go ahead and thanks! :)
I will create the release artifacts tomorrow or on Tuesday.
--
Reinhard Pötz Managing Director, {Indoqa} GmbH
http://www.indoqa.com/en/people/reinhard.poetz/
Member of the Apache Software Foundation
Apache Cocoon Committer, PMC member [EMAIL PROTECTED]
________________________________________________________________________