I am trying to access an OSGi service from a sightly javascript use function. Through the sling SlingScriptHelper. I can call the sling.getService(Service.class)
method from javascript, but I do not know how to specify the class in javascript.
It looks like it should be possible to reference java classes using the fully qualified name or using rhino's importPackage(..)
.
However, I get the following exception:
org.apache.sling.scripting.sightly.SightlyException:
org.mozilla.javascript.EvaluatorException: Can't find method
org.apache.sling.scripting.core.impl.InternalScriptHelper.getService(object).