use of org.xwiki.script.service.ScriptService in project xwiki-platform by xwiki.
the class AnnotationVelocityContextInitializer method initialize.
@Override
public void initialize(VelocityContext context) {
try {
// create a wrapper of the annotation service for exposing its methods in velocity
ScriptService annotationsScriptService = componentManager.getInstance(ScriptService.class, ANNOTATION_SCRIPT_SERVICE_HINT);
context.put(VELOCITY_CONTEXT_KEY, annotationsScriptService);
} catch (ComponentLookupException e) {
this.logger.warn("Could not initialize the annotations velocity bridge, " + "annotations service will not be accessible in velocity context.");
}
}
Aggregations