Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Scripting JavaScript 2.0.2
-
None
Description
The scripting/javascript module provides a Rhino JavaScript wrapper class for the Resource interface making it easier to be used in JavaScript scripts. Unfortunately this wrapper has slight differences in API to the actual Resource interface:
String getPath();
Mapped to path property and getPath() method. Correct.
String getResourceType();
Mapped to type property and getResourceType() method. Method is correct, but property should be called resourceType.
String getResourceSuperType();
Missing in the wrapper.
ResourceMetadata getResourceMetadata();
Mapped to meta property and getMetadata methods. Should map to resourceMetadata property and getResourceMetadata method.
ResourceResolver getResourceResolver();
Mapped to resourceResolver property and getResourceResolver() method. Correct.
<AdapterType> AdapterType adaptTo(Class<AdapterType> type);
Mapped to adaptTo method. Correct.
Will add missing mappings. Existing "wrong" mappings are being kept for backwards compatibility but documented to be deprecated. We will probably just keep these wrong mappings since they don't hurt here. In the future, we might log a message to the log about an deprecated method/property being used.