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

Generate javascript wrapper methods from specific interfaces automatically

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • Scripting
    • None

    Description

      As discussed http://markmail.org/message/nrnuw2gad5z5wupx, it would be useful to have a way to autogenerate javascript wrappers, while allowing some methods to be customized.

      Here's the proposed method, from that thread:

      a) ScriptableNode (or any other javascript wrapper class) implements a finishInit() method that's called by ScriptableNode.defineClass [1] after all jsfunction_ etc. have been processed.

      b) finishInit uses reflection on the Node interface to define all methods that haven't been defined yet. The "not defined yet" condition looks a bit tricky but doable.

      This can probably be implemented in a base JavascriptWrapper class.

      Attachments

        1. SLING-397.patch
          10 kB
          Bertrand Delacretaz

        Issue Links

          Activity

            People

              bdelacretaz Bertrand Delacretaz
              bdelacretaz Bertrand Delacretaz
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: