if (im == InputMethod.XML || im == InputMethod.SOAP)
{
String operation = request.getName();
CatalogService cs = lookUpService(operation);
if (cs == null)
throw new OperationNotSupportedEx(operation);
Log.info(Geonet.CSW, "Dispatching operation : "+ operation);
if (cswServiceSpecificContraint != null){
request.addContent(new Element(Geonet.Elem.FILTER).setText(cswServiceSpecificContraint));
}
return cs.execute(request, context);
}
else //--- GET or POST/www-encoded request
{
Map<String, String> params = extractParams(request);
String operation = params.get("request");
if (operation == null)
throw new MissingParameterValueEx("request");
CatalogService cs = lookUpService(operation);
if (cs == null)
throw new OperationNotSupportedEx(operation);
request = cs.adaptGetRequest(params);
if (cswServiceSpecificContraint != null){
request.addContent(new Element(Geonet.Elem.FILTER).setText(cswServiceSpecificContraint));
}
if(context.isDebugEnabled())
context.debug("Adapted GET request is:\n"+Xml.getString(request));
context.info("Dispatching operation : "+ operation);
return cs.execute(request, context);
}
}