You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Help is available by sending an email to csf-support@mit.edu
Have any suggestion on how improve this wiki?  Please give us your feedback at csf-support@mit.edu

Hibernate Mappings and CSF version 2

The manner in which hibernate mappings are configured has changed from the manner in which hibernate mappings were configured in sais-common and in the CSF Version 1 series.  In sais-common and in CSF version 1, the sessionFactory's mappingResources property was used to configure hibernate mappings.  The use of the mappingResources property has been deprecated and will no longer be used except to support legacy applications.

With the release of the CSF version 2 series, the sessionFactory's mappingLocations property will be used to configure hibernate mappings.  The mappingLocations property allow for more flexibility when configuring hibernate mappings from several different sources.

The principal advantage of using the mappingLocations property is that you can specify a resource path to the mapping files as opposed to the absolute path to the mapping file.  This is all well and good but what does this actually mean.  Rather than specifying the individual hibernate mappings as shown below:

    <bean id="filterChainProxy" class="org.springframework.security.web.FilterChainProxy">
        <security:filter-chain-map path-type="ant">
            <security:filter-chain pattern="/css/**" filters="logoutFilter" />
            <security:filter-chain pattern="/images/**" filters="logoutFilter" />
            <security:filter-chain pattern="/js/**" filters="logoutFilter" />
            <security:filter-chain pattern="/docs/**" filters="logoutFilter" />
            <security:filter-chain pattern="/**" filters="ssoX509SecurityContextPersistenceFilter,
           		logoutFilter,
           		ssoX509AuthenticationProcessingFilter,
           		basicAuthenticationProcessingFilter,
           		exceptionTranslationFilter,
           		filterSecurityInterceptor,
           		switchUserProcessingFilter"
            />
        </security:filter-chain-map>
    </bean>

    <bean id="ssoX509SecurityContextPersistenceFilter" class="edu.mit.csf.security.spring.filter.SsoX509SecurityContextPersistenceFilter"/>
    
    <bean id="ssoX509AuthenticationProcessingFilter" class="edu.mit.csf.security.spring.filter.SsoX509AuthenticationProcessingFilter">
        <property name="authenticationManager" ref="authenticationManager"/>
        <property name="allowedEntities" ref="allowedEntities"/>
    </bean>
    <bean id="allowedEntities" class="edu.mit.csf.base.configuration.CompactApacheApplicationConfiguration" init-method="init">
        <property name="locations">
            <list>
                <value>file:${user.dir}/esapis/allowedEntities.properties</value>
                <value>file:${user.home}/allowedEntities.properties</value>
            </list>
        </property>
    </bean>
  • No labels