[java-identity-provider COMMIT] in /trunk/idp-conf/src/main/resources: conf/messages.properties views/error.vm

noreply at shibboleth.net noreply at shibboleth.net
Fri Nov 21 10:31:56 EST 2014


Author: scantor
Date: Fri Nov 21 10:31:56 2014
New Revision: 6987

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=6987&view=rev
Log:
Complete message-ization of error view.

Modified:
    trunk/idp-conf/src/main/resources/conf/messages.properties
    trunk/idp-conf/src/main/resources/views/error.vm

Modified: trunk/idp-conf/src/main/resources/conf/messages.properties
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/conf/messages.properties?rev=6987&r1=6986&r2=6987&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/conf/messages.properties (original)
+++ trunk/idp-conf/src/main/resources/conf/messages.properties Fri Nov 21 10:31:56 2014
@@ -1,21 +1,23 @@
+# Title / Message mappings for error view
+
+# General strings
+idp.title = Web Login Service
+idp.title.suffix = Error
+idp.logo.alt-text = Replace or remove this logo
+idp.message = An unidentified error occurred.
+idp.footer = Insert your footer text here.
+
 # Event to error key mappings
 
 AccessDenied = access
-
 ContextCheckDenied = context-check-denied
-
 AsyncLogout = async-logout
-
 EndpointResolutionFailed = endpoint
-
 InvalidProfileConfiguration = relying-party
-
 InvalidSecurityConfiguration = security-cfg
-
 MessageReplay = stale
 MessageExpired = stale
 UnableToDecode = stale
-
 AccountError = authn
 AuthenticationException = authn
 InvalidCredentials = authn
@@ -23,7 +25,6 @@
 NoPotentialFlow = authn
 RequestUnsupported = authn
 SubjectCanonicalizationError = authn
-
 InvalidAttributeContext = unexpected
 InvalidAuthenticationContext = unexpected
 InvalidSubjectContext = unexpected
@@ -37,10 +38,8 @@
 UnableToEncode = unexpected
 UnableToSign = unexpected
 UnableToEncrypt = unexpected
-
 AttributeReleaseRejected = no-release
 TermsRejected = no-terms
-
 RuntimeException = runtime-error
 
 # Exception to error key mappings

Modified: trunk/idp-conf/src/main/resources/views/error.vm
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/views/error.vm?rev=6987&r1=6986&r2=6987&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/views/error.vm (original)
+++ trunk/idp-conf/src/main/resources/views/error.vm Fri Nov 21 10:31:56 2014
@@ -7,14 +7,19 @@
 ## request - HttpServletRequest
 ## response - HttpServletResponse
 
+#set ($springContext = $flowRequestContext.getActiveFlow().getApplicationContext())
+#set ($locale = $flowRequestContext.getExternalContext().getLocale())
+#set ($title = $springContext.getMessage("idp.title", null, "Web Login Service", $locale))
+#set ($footer = $springContext.getMessage("idp.footer", null, "Insert your footer text here.", $locale))
+#set ($logoAltText = $springContext.getMessage("idp.logo.alt-text", null, "logo", $locale))
+#set ($defaultTitleSuffix = $springContext.getMessage("idp.title.suffix", null, "Error", $locale))
+
 #if ($flowRequestContext)
 	## This handles flow events, the most common case.
     #set ($eventId = $flowRequestContext.getCurrentEvent().getId())
-    #set ($springContext = $flowRequestContext.getActiveFlow().getApplicationContext())
-    #set ($locale = $flowRequestContext.getExternalContext().getLocale())
     #set ($eventKey = $springContext.getMessage($eventId, null, "error", $locale))
-    #set ($titleSuffix = $springContext.getMessage("${eventKey}.title", null, "Error", $locale))
-    #set ($message = $springContext.getMessage("${eventKey}.message", null, "ERROR: $eventId", $locale))
+    #set ($titleSuffix = $springContext.getMessage("${eventKey}.title", null, $defaultTitleSuffix, $locale))
+    #set ($message = $springContext.getMessage("${eventKey}.message", null, "$defaultTitleSuffix: $eventId", $locale))
     
     #if ($eventId == "AccessDenied" or $eventId == "ContextCheckDenied")
         $response.setStatus(403)
@@ -27,18 +32,18 @@
 	## This handles exceptions that reach the Spring-MVC exception handler.
     #set ($eventId = $exception.getClass().getSimpleName())
     #set ($eventKey = $springContext.getMessage($eventId, null, "error", $request.getLocale()))
-    #set ($titleSuffix = $springContext.getMessage("${eventKey}.title", null, "Error", $request.getLocale()))
-    #set ($message = $springContext.getMessage("${eventKey}.message", null, "ERROR: $eventId", $request.getLocale()))
+    #set ($titleSuffix = $springContext.getMessage("${eventKey}.title", null, $defaultTitleSuffix, $request.getLocale()))
+    #set ($message = $springContext.getMessage("${eventKey}.message", null, "$defaultTitleSuffix: $eventId", $request.getLocale()))
 #else
 	## This is a catch-all that theoretically shouldn't happen?
-    #set ($titleSuffix = "Error")
-    #set ($message = "No specific error available")
+    #set ($titleSuffix = $defaultTitleSuffix)
+    #set ($message = $springContext.getMessage("idp.message", null, "An unidentified error occurred.", $locale))
 #end
 

[... 30 lines stripped ...]


More information about the commits mailing list