def _register_arcgis_url(url, name, username, password, owner=None, parent=None):
 baseurl = _clean_url(url)
 logger.info(('Fetching the ESRI url ' + url))
 if re.search('\\/MapServer\\/*(f=json)*', baseurl):
  try:
   arcserver = ArcMapService(baseurl)
  except Exception as e:
   logger.exception(e)
  if (isinstance(arcserver, ArcMapService) and (arcserver.spatialReference.wkid in [102100, 102113, 3785, 3857, 900913])):
   return_json = [_process_arcgis_service(arcserver, name, owner=owner, parent=parent)]
  else:
   return_json = [{'msg': _('Could not find any layers in a compatible projection.')}]
 else:
  arcserver = ArcFolder(baseurl)
  return_json = _process_arcgis_folder(arcserver, name, services=[], owner=owner, parent=parent)
 return HttpResponse(json.dumps(return_json), content_type='application/json', status=200)

def _register_arcgis_url ( url , name , username , password , owner = None , parent = None ) : baseurl = _clean_url ( url ) logger . info ( ( 'Fetching the ESRI url ' + url ) ) if re . search ( '\\/MapServer\\/*(f=json)*' , baseurl ) : try : arcserver = ArcMapService ( baseurl ) except Exception as e : logger . exception ( e ) if ( isinstance ( arcserver , ArcMapService ) and ( arcserver . spatialReference . wkid in [ 102100 , 102113 , 3785 , 3857 , 900913 ] ) ) : return_json = [ _process_arcgis_service ( arcserver , name , owner = owner , parent = parent ) ] else : return_json = [ { 'msg' : _ ( 'Could not find any layers in a compatible projection.' ) } ] else : arcserver = ArcFolder ( baseurl ) return_json = _process_arcgis_folder ( arcserver , name , services = [ ] , owner = owner , parent = parent ) return HttpResponse ( json . dumps ( return_json ) , content_type = 'application/json' , status = 200 )
register an arcgis rest service url .