Looks basically good to me. Except that I consider the resource type of NonExistingResources fixed. ...
15 years, 5 months ago
(2009-06-03 13:19:59 UTC)
#1
Looks basically good to me. Except that I consider the resource type of
NonExistingResources fixed.
So either we just return a SyntheticResource using the generated resource type
or we create a NonExistingResource whose resource super type is set to the
generated resource type.
http://codereview.appspot.com/67146/diff/1/2
File
bundles/api/src/main/java/org/apache/sling/api/resource/NonExistingResource.java
(right):
http://codereview.appspot.com/67146/diff/1/2#newcode28
Line 28: String resourceURI, String resourceType) {
The resource type of a NonExistingResource is not intended to be different from
sling:nonexisting. This might break existing applications.
http://codereview.appspot.com/67146/diff/1/5
File
bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver2.java
(right):
http://codereview.appspot.com/67146/diff/1/5#newcode240
Line 240: res = new NonExistingResource(this, absRealPath,
getPathResourceType(absRealPath));
Considering the resource type of non existing resources should be fixed, I would
do something like this:
String type = getPathResourceType(absRealPath);
if (type == null) {
res = new NonExistingResource(this, absRealPath);
} else {
res = new SyntheticResource(this, absRealPath, type);
}
Alternatively instead of creating a plain SyntheticResource it could also be:
res = new NonExistingResource(this, absRealPath) {
public String getResourceSuperType() {
return type;
}
};
Issue 67146: Sling Path Resolvable Resource Types
Created 15 years, 5 months ago by ianboston
Modified 9 years, 11 months ago
Reviewers: fmeschbe
Base URL:
Comments: 2