diff options
Diffstat (limited to 'src/main/webapp/wayf-ndn.jsp')
-rw-r--r-- | src/main/webapp/wayf-ndn.jsp | 434 |
1 files changed, 434 insertions, 0 deletions
diff --git a/src/main/webapp/wayf-ndn.jsp b/src/main/webapp/wayf-ndn.jsp new file mode 100644 index 0000000..00c1d0e --- /dev/null +++ b/src/main/webapp/wayf-ndn.jsp @@ -0,0 +1,434 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<%@ page contentType="text/html;charset=UTF-8" %> +<%@ page import="java.util.*" %> +<html> + +<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> +<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> + +<%request.setCharacterEncoding("UTF-8");%> +<%response.setCharacterEncoding("UTF-8");%> + + +<logic:present name="showComments" scope="Request"> + +<!-- TO CONFIGURE THIS FOR A SPECIFIC SITE + ===================================== + + Before you deploy this jsp you need to look for CONFIG below. + These mark places where you should make changes. + + If you want to make more profound changes but only to the jsp, + you should read the sections marked PROGRAMMING NOTE below.--> + +<!-- PROGRAMMING NOTE + + "requestURL" contains the URL that was specified to get the + WAYF going. The jsp uses it mostly for submitting result back to + the WAYF and error reporting --> + +</logic:present> + + <jsp:useBean id="requestURL" scope="request" class="java.lang.String"/> + +<logic:present name="showComments" scope="Request"> + +<!-- PROGRAMMING NOTE + + shire, target, provider and time are all part of the Shibboleth + 1.3 discovery protocol and need to be specified as parameters to the WAYF + + entityID, return, returnIDParam are all part of the + SAML Discovery protocol. + + +--> +</logic:present> + +<logic:notPresent name="entityID" scope="request"> +<logic:notPresent name="shire" scope="request"> + +<jsp:forward page = "wayferror.jsp"/> +</logic:notPresent> +</logic:notPresent> + + +<logic:present name="showComments" scope="Request"> + +<!-- PROGRAMMING NOTE + In addition to the above. The WAYF may also supply the following to + the jsp. + + "cookieList" If this exists it represents the contents of the + _saml_idp cookie (possibly filtered to remove IdPs which + cannot serve the SP). It is a Collection of IdPSite objects, + which themselves have the following properties: + + "name" The uri for the IdP, which needs to be returned to the + WAYF in the "origin" parameter. + + "displayName" User friendly name (taken from its alias) + + "addressFor" The (ungarnished) URL for the IdP. This could be + used to create a direct hyperlink to the IdP + + "sites" If this exists it contains all the possible IdPs for for + the SP (possibly filtered). It is a Collection of IdPSite + Objects which are described above. This is only present if + provideList was defined true in the configuration. + + "siteLists" If this exists it contains all the possible metadata + files which can service for the SP (possibly filtered). It + is a collection of IdPSiteSetEntry Objects which have two + properties: + + "name" This is the displayName from the Metadata element in + the WAYF configuration file + + "sites" This represents the IdPs. Again it is a collection + of IdPSite Objects + + It is only present if provideListOfList was defined true in + the configuration. + + "singleSiteList" if this is present, then there is only one + IdPSiteSetEntry Object in "siteLists". + + "searchresultempty" If this is present then it means that a + search was performed, but no suitable IdPs were returned. + + "searchresults" If this is present it represents the list of IdPs + which matched a previous search. It is a Collection of + IdPSite Objects. --> + +<!-- PROGRAMMING NOTE + + The jsp communicates back to the WAYF via the parameters listed + above, and: + + "action" what the WAYF has to do. Possible contents are: + + "lookup" - refresh the screen. + "search" - perform a search on the contents parameter "string" + "selection" - redirect to the IdP with the uri "origin" + + "cache" preserve any selection in the _saml_idp cookie. A + value of "session" makes the cookie last for the browser + session, "perm" gives it the lifetime specified in the + configuration file. + + The tabindex is hard wired. Fortunately the standard allows us to + have duplicate numbers and says the order is the order things + get emitted. We use these numbers + + 10 - Recently used sites hyperlinks + 20 - <clear button for above> + 25 - AutoSuggestion + 30 Federation selection + 40 IdP within Selection + 50 Select button + 60 How long to remember selector + 70 Search entry + 80 Search Button + 90 List of search results + 100 Select search result + 110 How long to remember search results + 120 Hyperlink to admin user. + +--> + +</logic:present> + +<head> + <link rel="stylesheet" type="text/css" href="NORDUnet.css"/> + <link type="text/css" href="css/base/jquery-ui.css" rel="stylesheet" /> + <!-- script type="text/javascript" src="js/jquery-1.6.2.js"></script> + <script type="text/javascript" src="js/jquery-ui.js"></script --> + <script src="js/jquery-1.5.1.js"></script> + <script src="js/jquery.ui.core.js"></script> + <script src="js/jquery.ui.position.js"></script> + <script src="js/jquery.ui.widget.js"></script> + <script src="js/jquery.ui.menu.js"></script> + <script src="js/jquery.ui.button.js"></script> + <title>Identity Provider Selection</title> + <script type="text/javascript"> + $(function() { + $("input:submit, input:reset, input:button, a",".button").button(); + $(".sitelist").menu(); + }); + </script> + <script type="text/javascript"> + $.widget( "ui.iosMenu", { + options: { + backText: 'Back', + slideDuration: 400, + slideEasing: 'linear' + }, + + _insertBackButtons: function() { + this.element.find( 'li ul, li ol' ).prepend( + $( '<li>' + + ' <span class="ui-icon ui-icon-carat-1-w"></span>' + + ' <a href="#menu-back" class="ios-menu-back-link">' + + this.options.backText + + ' </a>' + + '</li>' + ) ); + return this; + }, + + _create: function( options ) { + var iosMenu = this; + + iosMenu + ._insertBackButtons() + .element + .addClass( 'ios-style' ) + .menu({ + // When a submenu shows up, place it just to the right + // of the current menu. Later, we'll slide it into view. + position: { + my: 'left top', + at: 'right top', + of: iosMenu.element + } + }); + + var menu = iosMenu.element.data( 'menu' ); + + // Override menu#select to account for nesting and back buttons: + menu.select = function( event ) { + if ( menu.active && menu.active.find( '> .ios-menu-back-link' ).length ) { + // if you selected "back", go back: + menu.focus( event, menu.active ); + if ( menu.left( event ) ) { + event.stopImmediatePropagation(); + } + event.preventDefault(); + } else if ( menu.active && menu.active.find( '> ul' ).length ) { + // if you selected something with children, show the children: + menu.focus( event, menu.active ); + if ( menu.right( event ) ) { + event.stopImmediatePropagation(); + } + event.preventDefault(); + } else { + menu._trigger( 'select', event, { item: menu.active } ); + } + }; + + // Override menu#left to enable sliding behavior: + menu.left = function( event ) { + var newItem = this.active && this.active.parents( 'li:not(.ui-menubar-item) ').first(), + self = this, + parent; + if ( newItem && newItem.length ) { + newItem.find( '> a' ).addClass( 'ui-state-focus' ).removeClass( 'ui-state-active' ); + parent = this.active.parent(); + parent + .attr( 'aria-hidden', 'true' ) + .attr( 'aria-expanded', 'false' ) + .animate({ + left: self.element.css( 'width' ) + }, iosMenu.options.slideDuration, iosMenu.options.slideEasing, function() { + parent.hide(); + self.focus( event, newItem ); + }) + return true; + } else if ( event && event.which === $.ui.keyCode.ESCAPE ) { + // #left gets called both for left-arrow and escape. If it's the + // latter and we're at the top, fire a "close" event: + self._trigger( 'close', event ); + } + }; + + // Override menu#_open to enable sliding behavior: + var menuOpenWithoutSliding = menu._open; + menu._open = function ( submenu ) { + menuOpenWithoutSliding.call( this, submenu ); + submenu.animate({ + left: 0 + }, iosMenu.options.slideDuration, iosMenu.options.slideEasing); + }; + + // Override menu#_startOpening so that hovering doesn't + // initiate the sliding: + menu._startOpening = function() { + clearTimeout( this.timer ); + } + }, + + destroy: function() { + var menu = this.element && this.element.data( 'menu' ); + menu && menu.destroy(); + } + }); + + $(function() { + var list = $( '#sites' ); + var firstLI = list.find( 'li' ).first(); + list + .iosMenu() + .focus() + .menu( 'focus', {}, firstLI ) + .bind( 'menuselect', function( event, ui ) { + $('#origin').attr('value',$(ui.item).attr('rel')); + $('#selector').submit(); + }); + }); + </script> + <style> + .ios-style, .ios-style ul, .ios-style ol { background: #fff; height: 200px; padding: 2px; width: 420px; } + .ios-style { overflow-x: hidden; overflow-y: auto; } + //.ios-style::-webkit-scrollbar { width: 5px; height: 5px; } + //.ios-style::-webkit-scrollbar-thumb { background: rgba(128, 128, 128, 0.6); border-radius: 4px; } + .ios-style ul, .ios-style ol { overflow-y: visible; border: none; } + .ios-style.ui-menu-icons .ui-menu-item a { position: inherit; } + .ios-style .ui-menu-item a { cursor: pointer; outline: none; } + </style> +</head> + +<logic:present name="cookieList" scope="request"> +<%! + java.util.HashSet cl = new HashSet(); +%> + +<logic:iterate id="site" name="cookieList"> + <% + cl.add(site); + %> +</logic:iterate> + +</logic:present> + + +<body id="homepage"> + <div id="wrapper"> + <div id="top"> + <table id="top_table"> + <tr> + <td><img src="<%= request.getContextPath() %>/images/NORDUnet2.jpg" width="203" height="46" alt="" /></td> + </tr> + </table> + </div> + <div id="container"> + <ul class="ilist"> + <li style="vertical-align: top;"> + <div id="nav"> + <ul class="site_tree"> + <li class="level1"><strong class="level1">Resources</strong> + <ul> + <li class="level2"><a class="level2" href="http://www.nordu.net">NORDUnet Home</a></li> + <li class="level2"><a class="level2" href="http://www.nordu.net#aup">Acceptable Use Policy</a></li> + <li class="level2"><a class="level2" href="http://www.nordu.net#pii">Privacy Policy</a></li> + </ul> + </li> + </ul> + <div id="nav_pic"><img src="images/pipes.jpg" width="200px" height="395" alt="" /></div> + </div> + </li> + <li style="vertical-align: top; padding-left: 20px;"> + <h1>Select an identity provider</h1> + <p class="text">The service you are trying to use require that you identify yourself. Please select your identity provider below...</p> + + <ul class="ilist"> + <logic:present name="cl" scope="request"> + <li style="veritcal-align: top;"> + <h2>Recently Used</h2> + <ul class="sitelist" style="margin-bottom: 50px;"> + <logic:iterate id="site" name="cl"> + <li><a tabindex="10" href="#<jsp:getProperty name="site" property="name"/>"><jsp:getProperty name="site" property="displayName"/></a></li> + </logic:iterate> + </ul> + <form method="get" action="ClearCache.wayf" > + <logic:notPresent name="entityID" scope="request"> + <input type="hidden" name="shire" value="<bean:write name="shire" />" /> + <input type="hidden" name="target" value="<bean:write name="target" />" /> + <input type="hidden" name="providerId" value="<bean:write name="providerId" />" /> + <logic:present name="time" scope="request"> + <input type="hidden" name="time" value="<bean:write name="time" />" /> + </logic:present> + </logic:notPresent> + <logic:present name="entityID" scope="request"> + <input type="hidden" name="entityID" value="<bean:write name="entityID" />" /> + <input type="hidden" name="returnX" value="<bean:write name="returnX" />" /> + <input type="hidden" name="returnIDParam" value="<bean:write name="returnIDParam" />" /> + </logic:present> + <input tabindex="20" type="submit" value="Clear List" /> + </form> + </li> + <li style="vertical-align: top; border-right: 1px solid #CECECE; min-height: 300px; margin-right: 20px; padding-left: 20px;"> </li> + </logic:present> + <li style="vertical-align: top;"> + <h2>Full list of identity providers</h2> + <!-- form id="selector" method="get" action="<bean:write name="requestURL" />"> + <input type="hidden" name="action" value="selection"/> + <input type="hidden" name="origin" id="origin" value="" /> + <logic:notPresent name="entityID" scope="request"> + <input type="hidden" name="shire" value="<bean:write name="shire" />" /> + <input type="hidden" name="target" value="<bean:write name="target" />" /> + <input type="hidden" name="providerId" value="<bean:write name="providerId" />" /> + <logic:present name="time" scope="request"> + <input type="hidden" name="time" value="<bean:write name="time" />" /> + </logic:present> + </logic:notPresent> + <logic:present name="entityID" scope="request"> + <input type="hidden" name="entityID" value="<bean:write name="entityID" />" /> + <input type="hidden" name="returnX" value="<bean:write name="returnX" />" /> + <input type="hidden" name="returnIDParam" value="<bean:write name="returnIDParam" />" /> + </logic:present> + + <select name="cache" tabindex="60" > + <option value="false"> Do not remember</option> + <option value="session" selected="selected"> Remember for session</option> + <option value="perm"> Remember for a week</option> + </select> + <input tabindex="50" type="submit" value="Select"/> + </form --> + <logic:present name="siteLists" scope="request"> + <ul id="sites"> + <logic:iterate id="siteset" name="siteLists"> + <li> + <a href="#<jsp:getProperty name="siteset" property="name"/>"><jsp:getProperty name="siteset" property="name"/></a> + <ul> + <logic:iterate id="site" name="siteset" property="sites"> + <logic:present name="entityID" scope="request"> + <bean:define id="returnIDParam" name="returnIDParam"/> + <bean:define id="ei" name="entityID" /> + <bean:define id="re" name="returnX"/> + + <li><a tabindex="10" href="<bean:write name="requestURL" />?entityID=<%= java.net.URLEncoder.encode(ei.toString(), "utf-8") %>&return=<%= java.net.URLEncoder.encode(re.toString(), "utf-8") %>&returnIDxParam=<%= java.net.URLEncoder.encode( returnIDParam.toString(), "utf-8" ) %>&cache=perm&action=selection&origin=<jsp:getProperty name="site" property="name" />"> + <jsp:getProperty name="site" property="displayName" /> + </a></li> + </logic:present> + <logic:notPresent name="entityID" scope="request"> + <bean:define id="targ" name="target" /> + <bean:define id="shire" name="shire" /> + <bean:define id="pid" name="providerId" /> + <li><a tabindex="10" href="<bean:write name="requestURL" />?target=<%= java.net.URLEncoder.encode(targ.toString(),"utf-8") %>&shire=<%= java.net.URLEncoder.encode(shire.toString(),"utf-8") %>&providerId=<%= java.net.URLEncoder.encode(pid.toString(),"utf-8") %>&time=<bean:write name="time" />&cache=perm&action=selection&origin=<jsp:getProperty name="site" property="name" />"> + <jsp:getProperty name="site" + property="displayName" /> + </a></li> + </logic:notPresent> + </logic:iterate> + </ul> + </li> + </logic:iterate> + </ul> + </logic:present> + </li> + </ul> + + + </li> + </ul> + </div> + <div id="footer"> + <p>NORDUnet A/S | Kastruplundgade 22 | DK-2770 Kastrup | DENMARK | Phone +45 32 46 25 00 | Fax +45 45 76 23 66 | info@nordu.net</p> + </div> + </div> +</body> +</html> + |