*
* @return MetadataDocument response document
*/
public MetadataDocument getMetadata( GetMetadataDocument request )
{
MetadataConfiguration metadataConfig = getResourceContext( ).getResourceHome( ).getMetadataConfig( );
// prep the response
MetadataDocument responseDoc = createMetadataResponseDoc( );
MetadataDocument.Metadata responseMetadata = responseDoc.addNewMetadata( );
if ( metadataConfig != null )
{
// get the values from the request
GetMetadataDocument.GetMetadata requestMetadata = request.getGetMetadata( );
String dialect = requestMetadata.getDialect( );
String identifier = requestMetadata.getIdentifier( );
// get the metatdata from the config
// the map is keyed on dialect and keyed to a List of metadata
// this allows you to build a metadata section per dialect
Map metadataMap = metadataConfig.getMetadata( dialect, identifier );
// iterate the returned set and add metadata sections
Iterator iterator = metadataMap.keySet( ).iterator( );
while ( iterator.hasNext( ) )
{