Changeset 11


Ignore:
Timestamp:
10/09/11 23:01:47 (8 years ago)
Author:
philsmart
Message:
 
Location:
wayfless-url-generator/trunk/src/main
Files:
2 added
13 edited

Legend:

Unmodified
Added
Removed
  • wayfless-url-generator/trunk/src/main/java/uk/ac/cardiff/wayf/urlgenerator/metadata/AbstractSamlMetadataHandler.java

    r6 r11  
    1414import org.slf4j.LoggerFactory; 
    1515 
    16 public class AbstractSamlMetadataHandler implements SamlMetadataHandler { 
     16public abstract class AbstractSamlMetadataHandler implements SamlMetadataHandler { 
    1717 
    1818    /** class logger */ 
     
    2020 
    2121    /** Parser manager used to parse XML. */ 
    22     protected static BasicParserPool parser; 
     22    private static BasicParserPool parser; 
    2323 
    2424    /** ChainingMetadataProvider to allow 1..* types of metadata providers. */ 
    25     private ChainingMetadataProvider metadataProvider; 
     25    protected ChainingMetadataProvider metadataProvider; 
    2626 
    2727    /** Default constructor */ 
     
    8787    } 
    8888 
     89    /** 
     90     * @param metadataProvider the metadataProvider to set 
     91     */ 
     92    public void setMetadataProvider(ChainingMetadataProvider metadataProvider) { 
     93        this.metadataProvider = metadataProvider; 
     94    } 
     95 
     96    /** 
     97     * @return the metadataProvider 
     98     */ 
     99    public ChainingMetadataProvider getMetadataProvider() { 
     100        return metadataProvider; 
     101    } 
     102 
    89103} 
  • wayfless-url-generator/trunk/src/main/java/uk/ac/cardiff/wayf/urlgenerator/metadata/DefaultSamlMetadataHandler.java

    r6 r11  
    55package uk.ac.cardiff.wayf.urlgenerator.metadata; 
    66 
     7import java.util.List; 
     8 
     9import org.opensaml.saml2.metadata.EntitiesDescriptor; 
     10import org.opensaml.saml2.metadata.provider.MetadataProviderException; 
    711import org.slf4j.Logger; 
    812import org.slf4j.LoggerFactory; 
     
    1721    private final Logger log = LoggerFactory.getLogger(SamlMetadataHandler.class); 
    1822 
     23    public List getIdentityProviders() { 
     24        try { 
     25            EntitiesDescriptor descriptor = (EntitiesDescriptor) metadataProvider.getMetadata(); 
     26            List<EntitiesDescriptor> descriptors = descriptor.getEntitiesDescriptors(); 
     27            log.info("Has found {} Identity Provider(s) in all loaded SAML metadata files", descriptors.size()); 
     28            for (EntitiesDescriptor descript : descriptors) { 
     29                log.debug(descript.getName()); 
     30            } 
     31 
     32        } catch (MetadataProviderException e) { 
     33            log.error("Could not retrieve metadata", e); 
     34        } 
     35        return null; 
     36    } 
    1937} 
  • wayfless-url-generator/trunk/src/main/java/uk/ac/cardiff/wayf/urlgenerator/metadata/SamlMetadataHandler.java

    r6 r11  
    22package uk.ac.cardiff.wayf.urlgenerator.metadata; 
    33 
     4import java.util.List; 
     5 
    46public interface SamlMetadataHandler { 
    57 
     8    public List getIdentityProviders(); 
     9 
    610} 
  • wayfless-url-generator/trunk/src/main/java/uk/ac/cardiff/wayf/urlgenerator/metadata/SamlMetadataResolver.java

    r6 r11  
    22package uk.ac.cardiff.wayf.urlgenerator.metadata; 
    33 
     4import java.util.List; 
    45 
    56/** 
     
    1213 
    1314    private SamlMetadataHandler metadataHandler; 
     15 
     16    public List getIdentityProviders() { 
     17        return metadataHandler.getIdentityProviders(); 
     18    } 
    1419 
    1520    /** 
  • wayfless-url-generator/trunk/src/main/webapp/WEB-INF/config/wugen-core.xml

    r8 r11  
    3030        <property name="metadataResolver"><ref bean="samlMetadataResolver"/></property>  
    3131        </bean> 
     32     
     33    <bean id="metadataService" class="uk.ac.cardiff.wugen.generator.service.impl.MetadataServiceImpl"> 
     34        <property name="samlMetadataResolver"><ref bean="samlMetadataResolver"/></property>  
     35    </bean> 
    3236         
    3337        <bean id="samlMetadataResolver" class=" uk.ac.cardiff.wayf.urlgenerator.metadata.SamlMetadataResolver"> 
  • wayfless-url-generator/trunk/src/main/webapp/WEB-INF/flows/generate/generate-subflow.xml

    r10 r11  
    1 <flow start-state="wayfIdpSelector" 
    2         xmlns="http://www.springframework.org/schema/webflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    3         xsi:schemaLocation="http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> 
     1<flow start-state="wayfIdpSelector" xmlns="http://www.springframework.org/schema/webflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     2    xsi:schemaLocation="http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> 
    43 
    54 
    6      <view-state id="wayfIdpSelector" view="wayfIdpSelector.xhtml"> 
    7          
     5    <view-state id="wayfIdpSelector" view="wayfIdpSelector.xhtml"> 
     6         <on-entry> 
     7            <evaluate expression="metadataService.getIdentityProviders()" result="viewScope.idpSelection" /> 
     8        </on-entry> 
     9        <transition on="spSelectorTrans" to="spSelector" /> 
    810 
    911 
     
    1113 
    1214    <view-state id="spSelector" view="spSelector.xhtml"> 
     15        <transition on="resultsTrans" to="wugResults"/> 
    1316 
    1417 
     
    1720 
    1821    <view-state id="wugResults" view="wugResults.xhtml"> 
    19      
     22         <transition on="done" to="successfullCreate"/> 
     23 
    2024    </view-state> 
    2125 
    22          
    23         <end-state id="successfullCreate" /> 
     26 
     27    <end-state id="successfullCreate" /> 
    2428 
    2529</flow> 
  • wayfless-url-generator/trunk/src/main/webapp/WEB-INF/flows/generate/generatorStart.xhtml

    r10 r11  
    3232        your identity provider and a service provider. 
    3333         
    34         <rich:spacer height="20xpx"/> 
    35         <center> 
    36         <h:form id="buttonSelectForm"> 
    37             <h:commandButton value="Start" action="generateTrans" /> 
    38         </h:form> 
    39         </center> 
    40     </rich:panel> 
     34        <rich:spacer height="20xpx" /> 
     35                        <center> 
     36                                <h:form id="buttonSelectForm"> 
     37                                        <h:commandButton value="Start" action="generateTrans" /> 
     38                                </h:form> 
     39                        </center> 
     40                </rich:panel> 
    4141 
    42                  
     42 
    4343 
    4444        </ui:define> 
  • wayfless-url-generator/trunk/src/main/webapp/WEB-INF/flows/generate/main-flow.xml

    r10 r11  
    1818    <subflow-state id="generateSubflow" subflow="generate-sub-flow"> 
    1919         
    20         <transition on="successfullCreate" to="createStudent" /> 
    21         <transition on="cancelCreate" to="createUser"> 
    22             <evaluate expression="navigationBean.setSelectedTab('newUserTab')" /> 
    23         </transition> 
     20        <transition on="successfullCreate" to="generatorStart" /> 
     21         
    2422    </subflow-state> 
    2523 
  • wayfless-url-generator/trunk/src/main/webapp/WEB-INF/flows/generate/spSelector.xhtml

    r4 r11  
    1919 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    2020<ui:composition xmlns="http://www.w3.org/1999/xhtml" 
    21         xmlns:ui="http://java.sun.com/jsf/facelets" 
    22         xmlns:h="http://java.sun.com/jsf/html" 
    23         xmlns:f="http://java.sun.com/jsf/core" 
    24         xmlns:sf="http://www.springframework.org/tags/faces" 
    25         xmlns:a4j="http://richfaces.org/a4j" 
    26         xmlns:rich="http://richfaces.org/rich" 
    27         template="/templates/raptor/full.xhtml"> 
     21    xmlns:ui="http://java.sun.com/jsf/facelets" 
     22    xmlns:h="http://java.sun.com/jsf/html" 
     23    xmlns:f="http://java.sun.com/jsf/core" 
     24    xmlns:sf="http://www.springframework.org/tags/faces" 
     25    xmlns:a4j="http://richfaces.org/a4j" 
     26    xmlns:rich="http://richfaces.org/rich" template="/template/full.xhtml"> 
    2827 
    29         <ui:define name="content"> 
     28    <ui:define name="content"> 
     29 
     30        <rich:panel bodyClass="rich-laguna-panel-no-header"> 
     31        Please select the Service Provider you want to include in the Wayfless URL. 
     32         
     33        <rich:spacer height="20xpx" /> 
     34            <center> 
     35                <h:form id="buttonSelectForm"> 
     36                    <h:commandButton value="Next" action="resultsTrans" /> 
     37                </h:form> 
     38            </center> 
     39        </rich:panel> 
    3040 
    3141 
    32         </ui:define> 
     42    </ui:define> 
    3343</ui:composition> 
  • wayfless-url-generator/trunk/src/main/webapp/WEB-INF/flows/generate/wayfIdpSelector.xhtml

    r9 r11  
    2424        xmlns:sf="http://www.springframework.org/tags/faces" 
    2525        xmlns:a4j="http://richfaces.org/a4j" 
    26         xmlns:rich="http://richfaces.org/rich" 
    27         template="/template/full.xhtml"> 
     26        xmlns:rich="http://richfaces.org/rich" template="/template/full.xhtml"> 
    2827 
    2928        <ui:define name="content"> 
     29 
     30                <rich:panel bodyClass="rich-laguna-panel-no-header"> 
     31        Please select the Identity Provider you want to include in the Wayfless URL. 
     32         
     33        <rich:comboBox selectFirstOnUpdate="false" 
     34                                defaultLabel="Please Select Your IdP"> 
     35                                <!-- <f:selectItems value="none" /> --> 
     36                        </rich:comboBox> 
     37 
     38                        <rich:spacer height="20xpx" /> 
     39                        <center> 
     40                                <h:form id="buttonSelectForm"> 
     41                                        <h:commandButton value="Next" action="spSelectorTrans" /> 
     42                                </h:form> 
     43                        </center> 
     44                </rich:panel> 
    3045 
    3146 
  • wayfless-url-generator/trunk/src/main/webapp/WEB-INF/flows/generate/wugResults.xhtml

    r4 r11  
    2525        xmlns:a4j="http://richfaces.org/a4j" 
    2626        xmlns:rich="http://richfaces.org/rich" 
    27         template="/templates/raptor/full.xhtml"> 
     27        template="/template/full.xhtml"> 
    2828 
    2929        <ui:define name="content"> 
     30 
     31                <rich:panel bodyClass="rich-laguna-panel-no-header"> 
     32        Please find below the automatically generated Wayfless URL. 
     33         
     34        <rich:spacer height="20xpx" /> 
     35                        <center> 
     36                                <h:form id="buttonSelectForm"> 
     37                                        <h:commandButton value="Finish" action="done" /> 
     38                                </h:form> 
     39                        </center> 
     40                </rich:panel> 
    3041 
    3142 
  • wayfless-url-generator/trunk/src/main/webapp/template/full.xhtml

    r10 r11  
    5050                        <ul id="nav"> 
    5151                                <li><a href="logo"><img 
    52                                                 src="#{contextPath}/template/images/logo-clear-test.png" 
     52                                                src="#{contextPath}/template/images/logo-clear.png" 
    5353                                                height="50px" alt="WugenLogo" class="header" /> </a></li> 
    5454                                <li><a4j:commandLink value="Wayfless Constructor" action="generateTrans" /> 
Note: See TracChangeset for help on using the changeset viewer.