//---------------------------------------------------------------------------
public AbstractResponse execute(AbstractRequest request, ServiceContext context) throws Exception
{
ListMetadataFormatsRequest req = (ListMetadataFormatsRequest) request;
ListMetadataFormatsResponse res = new ListMetadataFormatsResponse();
GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME);
SchemaManager sm = gc.getBean(SchemaManager.class);
String uuid = req.getIdentifier();
if (uuid != null)
{
String schema = context.getBean(MetadataRepository.class).findOneByUuid(uuid).getDataInfo().getSchemaId();
res.addFormat(getSchemaInfo(context, sm, schema));
}
else
{
for (String schema : sm.getSchemas())
res.addFormat(getSchemaInfo(context, sm, schema));
}
for (MetadataFormat mdf : getConvertFormats(context)) {
res.addFormat(mdf);
}
return res;
}