use of au.org.emii.portal.javascript.OpenLayersJavascript in project spatial-portal by AtlasOfLivingAustralia.
the class SessionInitImpl method init.
@Override
public void init(Desktop desktop, Object request) throws Exception {
LOGGER.debug("* INIT Desktop");
Session session = desktop.getSession();
if (session == null) {
LOGGER.debug("user has a null session - no idea why (system coming up/going down - " + "concurrency ?) will redirect to error page");
redirectAndInvalidateSession(desktop.getSession(), ERROR_PAGE);
} else {
// user has a session...
// Sesssion is OK - do things we want to do before we start
// composing the page
PortalSession portalSession = (PortalSession) session.getAttribute(PORTAL_SESSION_ATTRIBUTE);
if (portalSession == null) {
init(session, null);
portalSession = (PortalSession) session.getAttribute(PORTAL_SESSION_ATTRIBUTE);
}
PortalSessionUtilities portalSessionUtilities = getPortalSessionUtilities(session);
OpenLayersJavascript openLayersJavascript = getApplicationContext(session).getBean(OpenLayersJavascript.class);
String script = openLayersJavascript.initialiseMap(portalSessionUtilities.getCurrentBoundingBox(portalSession)) + openLayersJavascript.getIFrameReferences() + openLayersJavascript.setBaseLayer(portalSession.getBaseLayer()) + openLayersJavascript.activateMapLayers(portalSession.getActiveLayers());
// remove all whitespace
script = openLayersJavascript.minify(script);
portalSession.setOnIframeMapFullyLoaded(script);
LOGGER.debug("onIframeMapFullyLoaded set to: " + script);
}
LOGGER.debug("...session init complete");
}
Aggregations