Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institut für Informatik
dbis
dbis-isochrone
isochrone-web
Commits
7ae867ba
Unverified
Commit
7ae867ba
authored
Oct 07, 2017
by
User expired
Browse files
improved error messages
parent
5cd90d73
Changes
7
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
7ae867ba
Upcoming version:
-----------------
-
improved error messages (Nikolaus Krismer)
-
fixed hill shading and meanCalculator (skewness part) (Nikolaus Krismer)
-
fixed time invariant isochrone computation (Nikolaus Krismer)
-
fixing findbugs warnings (Nikolaus Krismer)
...
...
src/main/webapp/js/isochrone/isoMap.js
View file @
7ae867ba
...
...
@@ -853,7 +853,7 @@ define(['jquery', 'leaflet', 'util/loggingUtils', 'isochrone/configuration', 'ma
controlWsWarning
.
hide
();
if
(
!
preventEventAttachment
)
{
$
(
document
).
on
(
'
websocket_error
'
,
warningIndicatorShow
);
//
$(document).on('websocket_error', warningIndicatorShow);
$
(
document
).
on
(
'
websocket_close
'
,
warningIndicatorShow
);
$
(
document
).
on
(
'
websocket_open
'
,
warningIndicatorHide
.
bind
(
this
,
true
));
}
...
...
src/main/webapp/js/service/serviceConfiguration.js
View file @
7ae867ba
/**
* @class ServiceConfiguration
*/
define
([
'
jquery
'
,
'
leaflet
'
,
'
util/loggingUtils
'
,
'
isochrone/configuration
'
,
'
util/geoUtils
'
,
'
util/stringUtils
'
],
function
(
$
,
L
,
logger
,
Configuration
,
GeoUtils
,
StringUtils
)
{
define
([
'
jquery
'
,
'
leaflet
'
,
'
util/loggingUtils
'
,
'
isochrone/configuration
'
,
'
util/geoUtils
'
,
'
util/stringUtils
'
,
'
util/jqueryUtils
'
],
function
(
$
,
L
,
logger
,
Configuration
,
GeoUtils
,
StringUtils
,
JQueryUtils
)
{
function
ServiceConfiguration
(
ws
)
{
var
actionName
=
'
getConfiguration
'
,
websocket
=
null
;
...
...
@@ -19,11 +19,24 @@ define(['jquery', 'leaflet', 'util/loggingUtils', 'isochrone/configuration', 'ut
this
.
sendRequest
=
function
()
{
websocket
.
sendWsMessage
({
action
:
actionName
},
onServerResponse
);
},
onServerResponse
,
onServerError
);
};
// Private methods
/**
* @private
* @method ServiceConfiguration#onServerError
*/
function
onServerError
(
e
)
{
var
errorCls
=
'
AlgorithmException:
'
,
i
=
e
.
message
.
indexOf
(
errorCls
);
if
(
e
.
httpState
===
500
)
{
JQueryUtils
.
dialog
(
i
>
0
?
e
.
message
.
substring
(
i
+
errorCls
.
length
)
:
e
.
message
);
}
}
/**
* Reads the enabled datasets and stores them in a client side configuration singleton
* each dataset contains:
...
...
src/main/webapp/js/service/serviceDebugInfo.js
View file @
7ae867ba
/**
* @class ServiceDebugInfo
*/
define
([
'
jquery
'
,
'
util/loggingUtils
'
,
'
util/languageUtils
'
,
'
jquery-ui-widgets/dialog
'
],
function
(
$
,
logger
,
LanguageUtils
)
{
define
([
'
jquery
'
,
'
util/loggingUtils
'
,
'
util/languageUtils
'
,
'
util/jqueryUtils
'
,
'
jquery-ui-widgets/dialog
'
],
function
(
$
,
logger
,
LanguageUtils
,
JQueryUtils
)
{
function
ServiceDebugInfo
(
ws
)
{
var
actionName
=
'
getDebugInfo
'
,
websocket
=
null
;
...
...
@@ -20,11 +20,24 @@ define(['jquery', 'util/loggingUtils', 'util/languageUtils', 'jquery-ui-widgets/
websocket
.
sendWsMessage
({
action
:
actionName
,
clearCache
:
true
},
onServerResponse
);
},
onServerResponse
,
onServerError
);
};
// Private methods
/**
* @private
* @method ServiceDebugInfo#onServerError
*/
function
onServerError
(
e
)
{
var
errorCls
=
'
AlgorithmException:
'
,
i
=
e
.
message
.
indexOf
(
errorCls
);
if
(
e
.
httpState
===
500
)
{
JQueryUtils
.
dialog
(
i
>
0
?
e
.
message
.
substring
(
i
+
errorCls
.
length
)
:
e
.
message
);
}
}
/**
* @private
* @method ServiceDebugInfo#onServerResponse
...
...
@@ -35,25 +48,8 @@ define(['jquery', 'util/loggingUtils', 'util/languageUtils', 'jquery-ui-widgets/
}
logger
.
debug
(
'
Successfully cleared cache... opening success message dialog
'
);
$
(
'
#debug-dialog
'
).
dialog
(
'
close
'
);
$
(
'
<div></div>
'
).
html
(
LanguageUtils
.
get
(
'
debug.successMessage
'
)).
dialog
({
closeOnEscape
:
true
,
dialogClass
:
'
dialog-no-close
'
,
modal
:
true
,
resizable
:
false
,
title
:
LanguageUtils
.
get
(
'
debug.successTitle
'
),
buttons
:
[{
text
:
LanguageUtils
.
get
(
'
btn.ok
'
),
click
:
function
()
{
$
(
this
).
dialog
(
'
close
'
);
}
}],
open
:
function
()
{
// focus first button (to prevent tooltip showing without hovering)
$
(
this
).
parent
().
find
(
'
button:eq(1)
'
).
focus
();
}
});
JQueryUtils
.
dialog
(
LanguageUtils
.
get
(
'
debug.successMessage
'
),
LanguageUtils
.
get
(
'
debug.successTitle
'
))
}
}
...
...
src/main/webapp/js/service/serviceFeatureInfo.js
View file @
7ae867ba
/**
* @class ServiceFeatureInfo
*/
define
([
'
jquery
'
,
'
util/loggingUtils
'
,
'
isochrone/geoJsonStyle
'
,
'
util/languageUtils
'
,
'
util/stringUtils
'
],
function
(
$
,
logger
,
GeoJsonStyle
,
LanguageUtils
,
StringUtils
)
{
define
([
'
jquery
'
,
'
util/loggingUtils
'
,
'
isochrone/geoJsonStyle
'
,
'
util/languageUtils
'
,
'
util/stringUtils
'
,
'
util/jqueryUtils
'
],
function
(
$
,
logger
,
GeoJsonStyle
,
LanguageUtils
,
StringUtils
,
JQueryUtils
)
{
function
ServiceFeatureInfo
(
ws
,
targetContainer
)
{
var
actionName
=
'
getFeatureInfo
'
,
target
=
null
,
...
...
@@ -24,11 +24,24 @@ define(['jquery', 'util/loggingUtils', 'isochrone/geoJsonStyle', 'util/languageU
dataset
:
dataset
,
direction
:
direction
,
stopId
:
stopId
},
onServerResponse
);
},
onServerResponse
,
onServerError
);
};
// Private methods
/**
* @private
* @method ServiceFeatureInfo#onServerError
*/
function
onServerError
(
e
)
{
var
errorCls
=
'
AlgorithmException:
'
,
i
=
e
.
message
.
indexOf
(
errorCls
);
if
(
e
.
httpState
===
500
)
{
JQueryUtils
.
dialog
(
i
>
0
?
e
.
message
.
substring
(
i
+
errorCls
.
length
)
:
e
.
message
);
}
}
/**
* @private
* @method ServiceFeatureInfo#onServerResponse
...
...
src/main/webapp/js/service/serviceIsochrone.js
View file @
7ae867ba
/**
* @class ServiceIsochrone
*/
define
([
'
jquery
'
,
'
leaflet
'
,
'
util/loggingUtils
'
,
'
spin.js
'
,
'
isochrone/isochrone
'
,
'
isochrone/configuration
'
,
'
util/geoUtils
'
],
function
(
$
,
L
,
logger
,
Spinner
,
Isochrone
,
Configuration
,
GeoUtils
)
{
define
([
'
jquery
'
,
'
leaflet
'
,
'
util/loggingUtils
'
,
'
spin.js
'
,
'
isochrone/isochrone
'
,
'
isochrone/configuration
'
,
'
util/geoUtils
'
,
'
util/jqueryUtils
'
],
function
(
$
,
L
,
logger
,
Spinner
,
Isochrone
,
Configuration
,
GeoUtils
,
JQueryUtils
)
{
function
ServiceIsochrone
(
ws
,
iMap
)
{
var
actionName
=
'
getIsochrone
'
,
actionNameIncremental
=
'
incrementalIsochrone
'
,
...
...
@@ -89,7 +89,7 @@ define(['jquery', 'leaflet', 'util/loggingUtils', 'spin.js', 'isochrone/isochron
$
(
document
).
on
(
actionNameIncremental
,
incrementalEventHandler
);
}
websocket
.
sendWsMessage
(
msg
,
successFn
,
stopSpinne
r
);
websocket
.
sendWsMessage
(
msg
,
successFn
,
onServerErro
r
);
};
// Private methods
...
...
@@ -106,6 +106,20 @@ define(['jquery', 'leaflet', 'util/loggingUtils', 'spin.js', 'isochrone/isochron
$
(
'
.dataset-limit-slider
'
).
slider
(
stateStr
);
}
/**
* @private
* @method ServiceIsochrone#onServerError
*/
function
onServerError
(
e
)
{
var
errorCls
=
'
AlgorithmException:
'
,
i
=
e
.
message
.
indexOf
(
errorCls
);
stopSpinner
();
if
(
e
.
httpState
===
500
)
{
JQueryUtils
.
dialog
(
i
>
0
?
e
.
message
.
substring
(
i
+
errorCls
.
length
)
:
e
.
message
);
}
}
/**
* @private
* @method ServiceIsochrone#onServerResponse
...
...
@@ -126,10 +140,6 @@ define(['jquery', 'leaflet', 'util/loggingUtils', 'spin.js', 'isochrone/isochron
incrementalEventHandler
=
null
;
}
// TODO: Implement buffer/surface client method coverage (if coverage is not delivered by server):
// - using https://github.com/bjornharrtell/jsts or
// - using http://turfjs.org/
stopSpinner
();
enableIsochroneElements
(
true
);
if
((
bBoxSize
.
x
+
bBoxSize
.
y
)
<=
0
)
{
...
...
src/main/webapp/js/util/jqueryUtils.js
0 → 100644
View file @
7ae867ba
/**
* @class JQueryUtils
*/
define
([
'
jquery
'
,
'
util/languageUtils
'
],
function
(
$
,
LanguageUtils
)
{
/**
* @private
* @constructor
*/
function
JQueryUtils
()
{
}
/**
* @public
* @method JQueryUtils.alert
*/
JQueryUtils
.
dialog
=
function
(
outputMsg
,
titleMsg
,
onCloseCallback
)
{
var
dialogId
=
'
jquery-isomap-dialog
'
,
element
=
$
(
'
#
'
+
dialogId
);
if
(
!
titleMsg
)
{
titleMsg
=
'
An error occurred
'
;
}
if
(
!
outputMsg
)
{
outputMsg
=
'
No message to display
'
;
}
if
(
element
.
length
<=
0
)
{
element
=
$
(
'
<div id="
'
+
dialogId
+
'
"></div>
'
);
}
element
.
html
(
outputMsg
).
dialog
({
closeOnEscape
:
true
,
dialogClass
:
'
dialog-no-close
'
,
modal
:
true
,
resizable
:
false
,
title
:
titleMsg
,
buttons
:
[{
text
:
LanguageUtils
.
get
(
'
btn.ok
'
),
click
:
function
()
{
$
(
this
).
dialog
(
'
close
'
);
}
}],
close
:
function
()
{
if
(
onCloseCallback
)
{
onCloseCallback
();
}
/* Cleanup node(s) from DOM */
$
(
this
).
dialog
(
'
destroy
'
).
remove
();
},
open
:
function
()
{
// focus first button (to prevent tooltip showing without hovering)
$
(
this
).
parent
().
find
(
'
button:eq(1)
'
).
focus
();
}
});
}
return
JQueryUtils
;
});
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment