Hi

The problem is with the Rhino Wrapper objects we have in the
scripting/javascript bundles: They have not been adapted to the new
Resource API (yet).

Patches welcome ;-)

Regards
Felix

--
Felix Meschberger | Principal Scientist | Adobe




On 23.04.13 15:56, "Fabian Christ" <[email protected]> wrote:

>Hi,
>
>I am using Sling 6 and according to the API (API Version 2.1.0) [1] it
>should be possible to call Resource.getName() which provides the last
>part of the path as the name of a resource. Like this in my ESP:
>
>var resource = request.getResourceResolver().resolve(resourcePath);
>out.print(resource.getName());
>
>However, I am getting
>
>org.mozilla.javascript.EcmaError: TypeError: Cannot find function getName.
>
>The resource is there and I can adapt it to a value map. But for some
>reason the getName does not work. I can get the name using the
>ResourceUtil class but why not via getName()?
>
>Any ideas?
>
>Best,
> - Fabian
>
>[1] 
>http://sling.apache.org/apidocs/sling6/index.html?org/apache/sling/api/res
>ource/Resource.html
>
>--
>Fabian
>http://twitter.com/fctwitt

Reply via email to