Hi devs,
I was playing with the office preview script service when I discovered
that $services throws ScriptServiceNotFoundException when there's no
script service registered for the specified hint, e.g. $services.foo . I
was expecting $services to return null when it fails to locate a
service. I even wrote:
#if($services.officepreview)
{{html}}
$services.officepreview.preview(...)
{{/html}}
#else
{{error}}The office preview component has not been installed.{{/error}}
#end
What do you think it's best: to throw ScriptServiceNotFoundException or
to return null?
Anyway, I think there should be a method to check if a script service is
available (
http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-script/src/maiā¦
).
WDYT?
Thanks,
Marius