Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
basic
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
xrm
basic
Commits
125e06e4
Commit
125e06e4
authored
4 years ago
by
Sebastian Listl
Browse files
Options
Downloads
Patches
Plain Diff
NominatimRequest documented
parent
913ef0dd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
process/WsValidation_lib/process.js
+38
-0
38 additions, 0 deletions
process/WsValidation_lib/process.js
with
38 additions
and
0 deletions
process/WsValidation_lib/process.js
+
38
−
0
View file @
125e06e4
...
...
@@ -215,6 +215,8 @@ WsValidationType.get = function(pKey)
this
.
additionalInfo
.
user
=
project
.
getPreferenceValue
(
"
custom.
"
+
this
.
webserviceName
+
"
.user
"
);
if
(
!
this
.
additionalInfo
.
password
)
this
.
additionalInfo
.
password
=
project
.
getPreferenceValue
(
"
custom.
"
+
this
.
webserviceName
+
"
.pw
"
);
if
(
this
.
additionalInfo
.
resultLimit
===
undefined
)
//can be explicitly null
this
.
additionalInfo
.
resultLimit
=
project
.
getPreferenceValue
(
"
custom.
"
+
this
.
webserviceName
+
"
.resultLimit
"
);
if
(
!
this
.
additionalInfo
.
url
)
throw
new
Error
(
"
if the webservice '
"
+
this
.
key
+
"
' is enabled, you have to provide the url
"
);
...
...
@@ -227,6 +229,9 @@ WsValidationType.get = function(pKey)
if
(
this
.
additionalInfo
.
user
&&
this
.
additionalInfo
.
password
)
nominatimRequest
.
setUser
(
this
.
additionalInfo
.
user
,
this
.
additionalInfo
.
password
);
if
(
this
.
additionalInfo
.
resultLimit
)
nominatimRequest
.
setResultLimit
(
this
.
additionalInfo
.
resultLimit
);
// call webservice
var
ret
=
nominatimRequest
.
get
();
...
...
@@ -506,6 +511,9 @@ WsValidationFieldUtils.wsOnValueChangeProcess = function(pWsType, pMainField)
}
}
/**
* Object for handling nominatim requests
*/
function
NominatimRequest
(
pUrl
)
{
this
.
url
=
pUrl
;
...
...
@@ -516,6 +524,12 @@ function NominatimRequest (pUrl)
};
}
/**
* Changes if additional address details should be loaded.
*
* @param {boolean} [pInclude=true] if the details should be included
* @return {NominatimRequest} current object
*/
NominatimRequest
.
prototype
.
includeAddressDetails
=
function
(
pInclude
)
{
if
(
pInclude
===
false
)
...
...
@@ -525,6 +539,13 @@ NominatimRequest.prototype.includeAddressDetails = function (pInclude)
return
this
;
}
/**
* Changes the user for the webservice auth.
*
* @param {String} pUser the username
* @param {String} pPassword the password of the user
* @return {NominatimRequest} current object
*/
NominatimRequest
.
prototype
.
setUser
=
function
(
pUser
,
pPassword
)
{
this
.
user
=
pUser
;
...
...
@@ -532,18 +553,35 @@ NominatimRequest.prototype.setUser = function (pUser, pPassword)
return
this
;
}
/**
* Adds parameters to the request.
*
* @param {Object} pParameters object containing the parameters that should be set
* @return {NominatimRequest} current object
*/
NominatimRequest
.
prototype
.
setParameters
=
function
(
pParameters
)
{
Object
.
assign
(
this
.
parameters
,
pParameters
);
return
this
;
}
/**
* Sets the result limit of the request.
*
* @param {Number} pLimit the max amount of rows the webservice should return (default is 10, max is 50)
* @return {NominatimRequest} current object
*/
NominatimRequest
.
prototype
.
setResultLimit
=
function
(
pLimit
)
{
this
.
parameters
.
limit
=
pLimit
.
toString
();
return
this
;
}
/**
* Calls the webservice and returns the result.
*
* @return {Object} webservice result
*/
NominatimRequest
.
prototype
.
get
=
function
()
{
var
restConf
=
net
.
createConfigForRestWebserviceCall
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment