@Override
public void write(OutputStream stream) throws IOException, WebApplicationException {
final AlertDefinitionCriteria criteria = new AlertDefinitionCriteria();
criteria.addFilterResourceOnly(true);
criteria.fetchGroupAlertDefinition(true);
criteria.fetchResource(true);
// TODO figure out why resourceType is not getting fetched
// The resource type id is needed for the parent url when we have a
// template alert definition. I previously tried accessing the resource
// type id via AlertDefinition.resourceType.id, but resourceType is null
// even though fetchResourceType is set to true in the critera.