*
*/
private void loadThumbnail (WxSLayerRegistry layer){
if(log.isDebugEnabled())
log.debug(" - Creating thumbnail for layer metadata: " + layer.name + " id: " + layer.id);
Set s = new org.fao.geonet.services.thumbnail.Set ();
try {
String filename = getMapThumbnail(layer);
if (filename != null) {
if(log.isDebugEnabled()) log.debug(" - File: " + filename);
Element par = new Element ("request");
par.addContent(new Element ("id").setText(layer.id));
par.addContent(new Element ("version").setText("10"));
par.addContent(new Element ("type").setText("large"));
Element fname = new Element ("fname").setText(filename);
fname.setAttribute("content-type", "image/png");
fname.setAttribute("type", "file");
fname.setAttribute("size", "");
par.addContent(fname);
par.addContent(new Element ("add").setText("Add"));
par.addContent(new Element ("createSmall").setText("on"));
par.addContent(new Element ("smallScalingFactor").setText("180"));
par.addContent(new Element ("smallScalingDir").setText("width"));
// Call the services
s.execOnHarvest(par, context, dataMan);
dataMan.flush();
result.thumbnails ++;
} else {