Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2633)

Issue 67146: Sling Path Resolvable Resource Types

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 5 months ago by ianboston
Modified:
9 years, 11 months ago
Reviewers:
fmeschbe
Visibility:
Public.

Patch Set 1 #

Total comments: 2

Patch Set 2 : Removed changes to NonExistingResource to avoid API change some still required to allow extension. #

Patch Set 3 : Missed some scr statements. #

Patch Set 4 : Added Resource Resolver to the API to allow inspection of nodes. #

Messages

Total messages: 1
fmeschbe
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;
     }
  };
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b