Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-724

The API of the Resource Wrapper of the Rhino integration does not reflect the actual Resource interface

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Scripting JavaScript 2.0.2
    • Scripting
    • 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.

      Attachments

        Activity

          People

            fmeschbe Felix Meschberger
            fmeschbe Felix Meschberger
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: