Using locations in the Loginapp (JSP)

The default Loginapp page templates search for maintenance messages without a "Location" parameter. Thus, when adding a maintenance message with a "Location", the out-of-the-box Loginapp (JSP) will never display it.

To make the Loginapp to use a location parameter, you need to change the Loginapp (JSP) template files. More information on how to customize the Loginapp (JSP) pages can be found here: Customizing UI (look and feel) of the JSP-Loginapp .

Example using the Loginapp (JSP) template set 1.0

login.jsp Excerpt using Location "bottom" (template set 1.0)

...
<jsp:useBean id="medusaSessionBean" class="com.airlock.iam.login.app.misc.SessionBean" scope="session"/>
<jsp:useBean id="loginServletBean" class="com.airlock.iam.login.app.misc.LoginServletBean" scope="request"/>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
...
		<div id="lowermessage">
			<% if (StringUtils.isNotBlank(medusaSessionBean.getMaintenanceMessage("bottom"))) { %>
			<div id="maintenancemessage">
				<%=medusaSessionBean.getMaintenanceMessage("bottom")%>
			</div>
			<% } %>
		</div>
...
</

Example using the Loginapp (JSP) template set 2.0

footer-custom.jsp Excerpt using Location "bottom" (template set 2.0)

<jsp:useBean id="medusaSessionBean" class="com.airlock.iam.login.app.misc.SessionBean" scope="session" />
<jsp:useBean id="loginServletBean" class="com.airlock.iam.login.app.misc.LoginServletBean" scope="request" />
<div class="text-message text-message--maintenance" id ="maintMsg">
	<%=medusaSessionBean.getMaintenanceMessage("bottom")%>
</div>

Using Locations in the REST API

The example below shows a maintenance message call that filters for a location named "REST":

HTTP Request - location filter

GET https://iam-host.com/auth-login/rest/public/maintenance-messages?filter=location==REST

With this query, the response will only return a maintenance message with a location parameter "REST":

HTTP Response - location filter

200 OK{
    "meta": {
        "type": "jsonapi.metadata.document",
        "timestamp": "2018-12-18T15:21:33.873+01:00"
    },
    "data": [
        {
            "type": "maintenance-message.current",
            "id": "REST_test",
            "attributes": {
                "systemAvailable": true,
                "location": "REST",
                "validFrom": "2018-12-16T09:00:00.000+01:00",
                "validTo": "2018-12-22T14:00:00.000+01:00",
                "language": "de",
                "text": "test for REST"
            }
        }
    ]
}