private void loadTemplateRefGroups ( Element parent ) { // Load template refs List templateRefGroups = DomUtils . getChildElementsByName ( parent , URL_TEMPLATE_REF_GROUP ) ; ; for ( int i = 0 ; i < templateRefGroups . size ( ) ; i ++ ) { Element refGroupElement = ( Element ) templateRefGroups . get ( i ) ; String refGroupName = getElementText ( refGroupElement , NAME ) ; if ( refGroupName == null ) { _log . error ( "Malformed URL template descriptor in " + _configFilePath + ". The url-template-ref-group name is missing." ) ; continue ; } HashMap refGroup = new HashMap ( ) ; List templateRefs = DomUtils . getChildElementsByName ( refGroupElement , URL_TEMPLATE_REF ) ; ; for ( int j = 0 ; j < templateRefs . size ( ) ; j ++ ) { Element templateRefElement = ( Element ) templateRefs . get ( j ) ; String key = getElementText ( templateRefElement , KEY ) ; if ( key == null ) { _log . error ( "Malformed URL template descriptor in " + _configFilePath + ". The url-template-ref key is missing in url-template-ref-group " + refGroupName ) ; continue ; } String name = getElementText ( templateRefElement , TEMPLATE_NAME ) ; if ( name != null ) { refGroup . put ( key , name ) ; if ( _log . isDebugEnabled ( ) ) { _log . debug ( "[" + refGroupName + " URLTemplate] " + key + " = " + name ) ; } } else { _log . error ( "Malformed URL template descriptor in " + _configFilePath + ". The url-template-ref template-name is missing in url-template-ref-group " + refGroupName ) ; } } if ( refGroup . size ( ) != 0 ) { _urlTemplates . addTemplateRefGroup ( refGroupName , refGroup ) ; } } }
Loads the template reference groups from a URL template config document .