Skip to content

Commit

Permalink
ouverture fonction Gp.Protocols.XHR.call()
Browse files Browse the repository at this point in the history
  • Loading branch information
gcebelieu committed May 18, 2016
1 parent 72db6f3 commit 7dcec5d
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 79 deletions.
154 changes: 78 additions & 76 deletions dist/GpServices-src.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* copyright IGN
* @author IGN
* @version 1.0.0-beta2
* @date 2016-04-22
* @date 2016-05-18
*
*/
/*!
Expand All @@ -32,7 +32,7 @@
}(this, function() {

/* BEGIN CODE */
var log4js, loggerCfg, UtilsLoggerByDefault, UtilsMessagesResources, ExceptionsErrorService, UtilsHelper, promise, ProtocolsXHR, ProtocolsJSONP, ProtocolsProtocol, ServicesDefaultUrlService, ServicesCommonService, ServicesAltiRequestModelAltiRequest, ServicesAltiRequestModelAltiElevationRequest, ServicesAltiRequestModelAltiProfilRequest, ServicesAltiRequestAltiRequestREST, FormatsWPS, ServicesAltiRequestAltiRequestWPS, ServicesAltiRequestAltiRequestFactory, FormatsXML, ServicesAltiResponseModelAltiResponse, ServicesAltiResponseModelElevation, ServicesAltiFormatsAltiResponseReader, ServicesAltiResponseAltiResponseFactory, ServicesAltiAlti, ServicesAutoConfResponseModelAutoConfResponse, ServicesAutoConfResponseModelConstraint, ServicesAutoConfResponseModelFormat, ServicesAutoConfResponseModelLayer, ServicesAutoConfResponseModelLegend, ServicesAutoConfResponseModelMetadata, ServicesAutoConfResponseModelOriginator, ServicesAutoConfResponseModelService, ServicesAutoConfResponseModelStyle, ServicesAutoConfResponseModelTerritory, ServicesAutoConfResponseModelThematic, ServicesAutoConfResponseModelTileMatrixSet, ServicesAutoConfResponseModelTileMatrix, ServicesAutoConfResponseModelTileMatrixLimit, ServicesAutoConfFormatsAutoConfResponseReader, ServicesAutoConfResponseAutoConfResponseFactory, ServicesAutoConfAutoConf, FormatsXLSRequestHeader, FormatsXLSRequest, FormatsXLSAbstractService, FormatsXLS, FormatsXLSLocationUtilityServiceModelAddress, FormatsXLSLocationUtilityServiceGeocodeFilterExtension, FormatsXLSLocationUtilityServiceGeocodeRequest, FormatsXLSLocationUtilityServiceModelPosition, FormatsXLSLocationUtilityServiceModelPreference, FormatsXLSLocationUtilityServiceReverseGeocodeRequest, FormatsXLSLocationUtilityService, ServicesGeocodeRequestGeocodeLocation, ServicesGeocodeRequestModelStreetAddress, ServicesGeocodeRequestModelPositionOfInterest, ServicesGeocodeRequestModelCadastralParcel, ServicesGeocodeRequestModelAdministratif, ServicesGeocodeRequestDirectGeocodeRequestFactory, ServicesGeocodeResponseModelGeocodeResponse, ServicesGeocodeResponseModelGeocodedLocation, ServicesGeocodeResponseModelDirectGeocodedLocation, ServicesGeocodeFormatsDirectGeocodeResponseReader, ServicesGeocodeResponseDirectGeocodeResponseFactory, ServicesGeocodeGeocode, ServicesGeocodeRequestReverseGeocodeRequestFactory, ServicesGeocodeResponseModelReverseGeocodedLocation, ServicesGeocodeFormatsReverseGeocodeResponseReader, ServicesGeocodeResponseReverseGeocodeResponseFactory, ServicesGeocodeReverseGeocode, ServicesAutoCompleteResponseModelAutoCompleteResponse, ServicesAutoCompleteResponseModelSuggestedLocation, ServicesAutoCompleteResponseAutoCompleteResponseFactory, ServicesAutoCompleteAutoComplete, FormatsXLSRouteServiceModelRoutePlan, FormatsXLSRouteServiceDetermineRouteRequest, FormatsXLSRouteServiceRouteRequestExtension, FormatsXLSRouteService, ServicesRouteRequestRouteRequestOLS, ServicesRouteRequestModelRouteParamREST, ServicesRouteRequestRouteRequestREST, ServicesRouteRequestRouteRequestFactory, FormatsWKT, ServicesRouteResponseModelRouteResponse, ServicesRouteResponseModelRouteInstruction, ServicesRouteFormatsRouteResponseRESTReader, ServicesRouteFormatsRouteResponseOLSReader, ServicesRouteResponseRouteResponseFactory, ServicesRouteRoute, ServicesProcessIsoCurveRequestModelProcessIsoCurveParam, ServicesProcessIsoCurveRequestProcessIsoCurveRequest, ServicesProcessIsoCurveResponseModelProcessIsoCurveResponse, ServicesProcessIsoCurveFormatsProcessIsoCurveResponseReader, ServicesProcessIsoCurveResponseProcessIsoCurveResponseFactory, ServicesProcessIsoCurveProcessIsoCurve, ServicesServices, Gp;
var log4js, loggerCfg, UtilsLoggerByDefault, UtilsHelper, promise, ProtocolsXHR, UtilsMessagesResources, ExceptionsErrorService, ProtocolsJSONP, ProtocolsProtocol, ServicesDefaultUrlService, ServicesCommonService, ServicesAltiRequestModelAltiRequest, ServicesAltiRequestModelAltiElevationRequest, ServicesAltiRequestModelAltiProfilRequest, ServicesAltiRequestAltiRequestREST, FormatsWPS, ServicesAltiRequestAltiRequestWPS, ServicesAltiRequestAltiRequestFactory, FormatsXML, ServicesAltiResponseModelAltiResponse, ServicesAltiResponseModelElevation, ServicesAltiFormatsAltiResponseReader, ServicesAltiResponseAltiResponseFactory, ServicesAltiAlti, ServicesAutoConfResponseModelAutoConfResponse, ServicesAutoConfResponseModelConstraint, ServicesAutoConfResponseModelFormat, ServicesAutoConfResponseModelLayer, ServicesAutoConfResponseModelLegend, ServicesAutoConfResponseModelMetadata, ServicesAutoConfResponseModelOriginator, ServicesAutoConfResponseModelService, ServicesAutoConfResponseModelStyle, ServicesAutoConfResponseModelTerritory, ServicesAutoConfResponseModelThematic, ServicesAutoConfResponseModelTileMatrixSet, ServicesAutoConfResponseModelTileMatrix, ServicesAutoConfResponseModelTileMatrixLimit, ServicesAutoConfFormatsAutoConfResponseReader, ServicesAutoConfResponseAutoConfResponseFactory, ServicesAutoConfAutoConf, FormatsXLSRequestHeader, FormatsXLSRequest, FormatsXLSAbstractService, FormatsXLS, FormatsXLSLocationUtilityServiceModelAddress, FormatsXLSLocationUtilityServiceGeocodeFilterExtension, FormatsXLSLocationUtilityServiceGeocodeRequest, FormatsXLSLocationUtilityServiceModelPosition, FormatsXLSLocationUtilityServiceModelPreference, FormatsXLSLocationUtilityServiceReverseGeocodeRequest, FormatsXLSLocationUtilityService, ServicesGeocodeRequestGeocodeLocation, ServicesGeocodeRequestModelStreetAddress, ServicesGeocodeRequestModelPositionOfInterest, ServicesGeocodeRequestModelCadastralParcel, ServicesGeocodeRequestModelAdministratif, ServicesGeocodeRequestDirectGeocodeRequestFactory, ServicesGeocodeResponseModelGeocodeResponse, ServicesGeocodeResponseModelGeocodedLocation, ServicesGeocodeResponseModelDirectGeocodedLocation, ServicesGeocodeFormatsDirectGeocodeResponseReader, ServicesGeocodeResponseDirectGeocodeResponseFactory, ServicesGeocodeGeocode, ServicesGeocodeRequestReverseGeocodeRequestFactory, ServicesGeocodeResponseModelReverseGeocodedLocation, ServicesGeocodeFormatsReverseGeocodeResponseReader, ServicesGeocodeResponseReverseGeocodeResponseFactory, ServicesGeocodeReverseGeocode, ServicesAutoCompleteResponseModelAutoCompleteResponse, ServicesAutoCompleteResponseModelSuggestedLocation, ServicesAutoCompleteResponseAutoCompleteResponseFactory, ServicesAutoCompleteAutoComplete, FormatsXLSRouteServiceModelRoutePlan, FormatsXLSRouteServiceDetermineRouteRequest, FormatsXLSRouteServiceRouteRequestExtension, FormatsXLSRouteService, ServicesRouteRequestRouteRequestOLS, ServicesRouteRequestModelRouteParamREST, ServicesRouteRequestRouteRequestREST, ServicesRouteRequestRouteRequestFactory, FormatsWKT, ServicesRouteResponseModelRouteResponse, ServicesRouteResponseModelRouteInstruction, ServicesRouteFormatsRouteResponseRESTReader, ServicesRouteFormatsRouteResponseOLSReader, ServicesRouteResponseRouteResponseFactory, ServicesRouteRoute, ServicesProcessIsoCurveRequestModelProcessIsoCurveParam, ServicesProcessIsoCurveRequestProcessIsoCurveRequest, ServicesProcessIsoCurveResponseModelProcessIsoCurveResponse, ServicesProcessIsoCurveFormatsProcessIsoCurveResponseReader, ServicesProcessIsoCurveResponseProcessIsoCurveResponseFactory, ServicesProcessIsoCurveProcessIsoCurve, ServicesServices, Gp;
log4js = undefined;
loggerCfg = {
loggers: [{
Expand Down Expand Up @@ -61,77 +61,6 @@ UtilsLoggerByDefault = function (Log4js, Config) {
};
return LoggerByDefault;
}(log4js, loggerCfg);
UtilsMessagesResources = function () {
var MessagesResources = {
PARAM_MISSING: 'Parameter(s) \'%var%\' missing',
PARAM_EMPTY: 'Parameter(s) \'%var%\' empty',
PARAM_TYPE: 'Wrong type(s) for parameter(s) \'%var%\'',
PARAM_FORMAT: 'Parameter(s) \'%var%\' not correctly formatted',
PARAM_NOT_SUPPORT: 'Value(s) for parameter(s) \'%var%\' not supported',
PARAM_UNKNOWN: 'Value(s) for parameter(s) \'%var%\' unknown',
SERVICE_REQUEST_BUILD: 'An error occurred during the request building of the service',
SERVICE_REQUEST_EMPTY: 'The request sent to the service is empty',
SERVICE_RESPONSE_EXCEPTION: 'The service returned an exception : \'%var%\'',
SERVICE_RESPONSE_EXCEPTION_2: 'The service returned an exception',
SERVICE_RESPONSE_ANALYSE: 'An error occurred while parsing the response \'%var%\' of the service',
SERVICE_RESPONSE_ANALYSE_2: 'An unknown error occurred while parsing the response',
SERVICE_RESPONSE_EMPTY: 'The response of the service is empty',
SERVICE_RESPONSE_EMPTY_2: 'The response from the service could not be analyzed or is empty',
SERVICE_RESPONSE_FORMAT: 'The format of the service response is not supported (handled format(s) : \'%var%\')',
SERVICE_RESPONSE_FORMAT_2: 'The format of the service response is not supported',
SERVICE_RESPONSE_FORMAT_3: 'No suggestion matching the search',
CLASS_CONSTRUCTOR: '\'%var%\' constructor cannot be called as a function.',
getMessage: function (clef, parametres) {
if (!arguments) {
return 'Message indefined !';
}
var params = Array.prototype.slice.call(arguments);
var key = params.shift();
var args = params;
var message = this[key];
try {
if (Array.isArray(args) && args.length > 0) {
message = message.replace('%var%', args.join(' - '));
} else {
message = message.replace('%var%', '%var% (not specified)');
}
} catch (e) {
}
return message;
}
};
return MessagesResources;
}();
ExceptionsErrorService = function () {
function ErrorService(error) {
if (!(this instanceof ErrorService)) {
throw new TypeError('ErrorService constructor cannot be called as a function.');
}
var e = error;
if (typeof error === 'string' || error instanceof String) {
this.message = error;
this.status = -1;
this.type = ErrorService.TYPE_UNKERR;
} else {
this.message = e.message || 'undefined!?';
this.type = e.type;
this.status = e.status || -1;
}
this.name = 'ErrorService';
this.stack = new Error().stack;
}
ErrorService.TYPE_SRVERR = 'SERVICE_ERROR';
ErrorService.TYPE_USEERR = 'USAGE_ERROR';
ErrorService.TYPE_UNKERR = 'UNKNOWN_ERROR';
ErrorService.prototype = Object.create(Error.prototype, {
constructor: {
value: ErrorService,
writable: true,
configurable: true
}
});
return ErrorService;
}();
UtilsHelper = function () {
var Helper = {
normalyzeParameters: function (params) {
Expand Down Expand Up @@ -864,6 +793,77 @@ ProtocolsXHR = function (Logger, Helper, ES6Promise) {
};
return XHR;
}(UtilsLoggerByDefault, UtilsHelper, promise);
UtilsMessagesResources = function () {
var MessagesResources = {
PARAM_MISSING: 'Parameter(s) \'%var%\' missing',
PARAM_EMPTY: 'Parameter(s) \'%var%\' empty',
PARAM_TYPE: 'Wrong type(s) for parameter(s) \'%var%\'',
PARAM_FORMAT: 'Parameter(s) \'%var%\' not correctly formatted',
PARAM_NOT_SUPPORT: 'Value(s) for parameter(s) \'%var%\' not supported',
PARAM_UNKNOWN: 'Value(s) for parameter(s) \'%var%\' unknown',
SERVICE_REQUEST_BUILD: 'An error occurred during the request building of the service',
SERVICE_REQUEST_EMPTY: 'The request sent to the service is empty',
SERVICE_RESPONSE_EXCEPTION: 'The service returned an exception : \'%var%\'',
SERVICE_RESPONSE_EXCEPTION_2: 'The service returned an exception',
SERVICE_RESPONSE_ANALYSE: 'An error occurred while parsing the response \'%var%\' of the service',
SERVICE_RESPONSE_ANALYSE_2: 'An unknown error occurred while parsing the response',
SERVICE_RESPONSE_EMPTY: 'The response of the service is empty',
SERVICE_RESPONSE_EMPTY_2: 'The response from the service could not be analyzed or is empty',
SERVICE_RESPONSE_FORMAT: 'The format of the service response is not supported (handled format(s) : \'%var%\')',
SERVICE_RESPONSE_FORMAT_2: 'The format of the service response is not supported',
SERVICE_RESPONSE_FORMAT_3: 'No suggestion matching the search',
CLASS_CONSTRUCTOR: '\'%var%\' constructor cannot be called as a function.',
getMessage: function (clef, parametres) {
if (!arguments) {
return 'Message indefined !';
}
var params = Array.prototype.slice.call(arguments);
var key = params.shift();
var args = params;
var message = this[key];
try {
if (Array.isArray(args) && args.length > 0) {
message = message.replace('%var%', args.join(' - '));
} else {
message = message.replace('%var%', '%var% (not specified)');
}
} catch (e) {
}
return message;
}
};
return MessagesResources;
}();
ExceptionsErrorService = function () {
function ErrorService(error) {
if (!(this instanceof ErrorService)) {
throw new TypeError('ErrorService constructor cannot be called as a function.');
}
var e = error;
if (typeof error === 'string' || error instanceof String) {
this.message = error;
this.status = -1;
this.type = ErrorService.TYPE_UNKERR;
} else {
this.message = e.message || 'undefined!?';
this.type = e.type;
this.status = e.status || -1;
}
this.name = 'ErrorService';
this.stack = new Error().stack;
}
ErrorService.TYPE_SRVERR = 'SERVICE_ERROR';
ErrorService.TYPE_USEERR = 'USAGE_ERROR';
ErrorService.TYPE_UNKERR = 'UNKNOWN_ERROR';
ErrorService.prototype = Object.create(Error.prototype, {
constructor: {
value: ErrorService,
writable: true,
configurable: true
}
});
return ErrorService;
}();
ProtocolsJSONP = function (Logger) {
var JSONP = {
uuid: function () {
Expand Down Expand Up @@ -7203,11 +7203,11 @@ ServicesServices = function (Alti, AutoConf, Geocode, ReverseGeocode, AutoComple
var bbox = {};
return Services;
}(ServicesAltiAlti, ServicesAutoConfAutoConf, ServicesGeocodeGeocode, ServicesGeocodeReverseGeocode, ServicesAutoCompleteAutoComplete, ServicesRouteRoute, ServicesProcessIsoCurveProcessIsoCurve);
Gp = function (Services, AltiResponse, Elevation, AutoCompleteResponse, SuggestedLocation, GetConfigResponse, Constraint, Format, Layer, Legend, Metadata, Originator, Service, Style, Territory, Thematic, TM, TMLimit, TMS, GeocodeResponse, GeocodedLocation, DirectGeocodedLocation, ReverseGeocodedLocation, IsoCurveResponse, RouteResponse, RouteInstruction, Error) {
Gp = function (XHR, Services, AltiResponse, Elevation, AutoCompleteResponse, SuggestedLocation, GetConfigResponse, Constraint, Format, Layer, Legend, Metadata, Originator, Service, Style, Territory, Thematic, TM, TMLimit, TMS, GeocodeResponse, GeocodedLocation, DirectGeocodedLocation, ReverseGeocodedLocation, IsoCurveResponse, RouteResponse, RouteInstruction, Error) {
var scope = typeof window !== 'undefined' ? window : {};
var Gp = scope.Gp || {
servicesVersion: '1.0.0-beta2',
servicesDate: '2016-04-22',
servicesDate: '2016-05-18',
extend: function (strNS, value) {
var parts = strNS.split('.');
var parent = this;
Expand All @@ -7226,6 +7226,8 @@ Gp = function (Services, AltiResponse, Elevation, AutoCompleteResponse, Suggeste
return this;
}
};
Gp.extend('Protocols', {});
Gp.extend('Protocols.XHR', XHR);
Gp.extend('Services', Services);
Gp.extend('Services.AltiResponse', AltiResponse);
Gp.extend('Services.Alti.Elevation', Elevation);
Expand Down Expand Up @@ -7255,7 +7257,7 @@ Gp = function (Services, AltiResponse, Elevation, AutoCompleteResponse, Suggeste
Gp.extend('Error', Error);
scope.Gp = Gp;
return scope.Gp;
}(ServicesServices, ServicesAltiResponseModelAltiResponse, ServicesAltiResponseModelElevation, ServicesAutoCompleteResponseModelAutoCompleteResponse, ServicesAutoCompleteResponseModelSuggestedLocation, ServicesAutoConfResponseModelAutoConfResponse, ServicesAutoConfResponseModelConstraint, ServicesAutoConfResponseModelFormat, ServicesAutoConfResponseModelLayer, ServicesAutoConfResponseModelLegend, ServicesAutoConfResponseModelMetadata, ServicesAutoConfResponseModelOriginator, ServicesAutoConfResponseModelService, ServicesAutoConfResponseModelStyle, ServicesAutoConfResponseModelTerritory, ServicesAutoConfResponseModelThematic, ServicesAutoConfResponseModelTileMatrix, ServicesAutoConfResponseModelTileMatrixLimit, ServicesAutoConfResponseModelTileMatrixSet, ServicesGeocodeResponseModelGeocodeResponse, ServicesGeocodeResponseModelGeocodedLocation, ServicesGeocodeResponseModelDirectGeocodedLocation, ServicesGeocodeResponseModelReverseGeocodedLocation, ServicesProcessIsoCurveResponseModelProcessIsoCurveResponse, ServicesRouteResponseModelRouteResponse, ServicesRouteResponseModelRouteInstruction, ExceptionsErrorService);
}(ProtocolsXHR, ServicesServices, ServicesAltiResponseModelAltiResponse, ServicesAltiResponseModelElevation, ServicesAutoCompleteResponseModelAutoCompleteResponse, ServicesAutoCompleteResponseModelSuggestedLocation, ServicesAutoConfResponseModelAutoConfResponse, ServicesAutoConfResponseModelConstraint, ServicesAutoConfResponseModelFormat, ServicesAutoConfResponseModelLayer, ServicesAutoConfResponseModelLegend, ServicesAutoConfResponseModelMetadata, ServicesAutoConfResponseModelOriginator, ServicesAutoConfResponseModelService, ServicesAutoConfResponseModelStyle, ServicesAutoConfResponseModelTerritory, ServicesAutoConfResponseModelThematic, ServicesAutoConfResponseModelTileMatrix, ServicesAutoConfResponseModelTileMatrixLimit, ServicesAutoConfResponseModelTileMatrixSet, ServicesGeocodeResponseModelGeocodeResponse, ServicesGeocodeResponseModelGeocodedLocation, ServicesGeocodeResponseModelDirectGeocodedLocation, ServicesGeocodeResponseModelReverseGeocodedLocation, ServicesProcessIsoCurveResponseModelProcessIsoCurveResponse, ServicesRouteResponseModelRouteResponse, ServicesRouteResponseModelRouteInstruction, ExceptionsErrorService);
/* END CODE */

return Gp;
Expand Down
Loading

0 comments on commit 7dcec5d

Please sign in to comment.