public Template findTemplate(String name,String contextTypeId){
  Assert.isNotNull(name);
  for (Iterator it=fTemplates.iterator(); it.hasNext(); ) {
    TemplatePersistenceData data=(TemplatePersistenceData)it.next();
    Template template=data.getTemplate();
    if (data.isEnabled() && !data.isDeleted() && (contextTypeId == null || contextTypeId.equals(template.getContextTypeId()))&& name.equals(template.getName()))     return template;
  }
  return null;
}

public Template findTemplate ( String name , String contextTypeId ) { Assert . isNotNull ( name ) ; for ( Iterator it = fTemplates . iterator ( ) ; it . hasNext ( ) ; ) { TemplatePersistenceData data = ( TemplatePersistenceData ) it . next ( ) ; Template template = data . getTemplate ( ) ; if ( data . isEnabled ( ) && ! data . isDeleted ( ) && ( contextTypeId == null || contextTypeId . equals ( template . getContextTypeId ( ) ) ) && name . equals ( template . getName ( ) ) ) return template ; } return null ; }
returns the first enabled template that matches both name and context type id .
