Server-side

There is a server-side listener available for the developer for customizing which templates are returned to the client. You can extend BaseTemplateResourceListener and adding a TemplateResourceListener annotation that accepts a modelLevelType . Here's a simple example listener whose methods are called for a templated page on SHOW.Task :

package com.onenetwork.showcase.rest;
 
/* imports not shown */
 
@TemplateResourceListener(modelLevelType="SHOW.Task")
public class TestTemplateResourceListener extends BaseTemplateResourceListener {
private static final PlatformLogger LOG = PlatformLogger.get(TestTemplateResourceListener.class);
@Override
public void beforeTemplateRetrieved(Long creationTemplateId, boolean isDetailTemplate, JSONObject jsonToReturn) {
LOG.info("beforeTemplateRetrieved called");
}
@Override
public void onTemplateRetrieved(JSONObject jsonToReturn) {
LOG.info("onTemplateRetrieved called");
}
}