|
|
|
@ -1,11 +1,5 @@
|
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
|
|
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
|
|
xmlns:p="http://www.springframework.org/schema/p"
|
|
|
|
|
xmlns:tx="http://www.springframework.org/schema/tx"
|
|
|
|
|
xmlns:aop="http://www.springframework.org/schema/aop"
|
|
|
|
|
xmlns:security="http://www.springframework.org/schema/security"
|
|
|
|
|
xmlns:context="http://www.springframework.org/schema/context"
|
|
|
|
|
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:security="http://www.springframework.org/schema/security" xmlns:context="http://www.springframework.org/schema/context"
|
|
|
|
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
|
|
|
|
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
|
|
|
|
|
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
|
|
|
|
@ -17,113 +11,105 @@
|
|
|
|
|
<context:annotation-config />
|
|
|
|
|
<context:component-scan base-package="info.bukova.isspst,org.zkoss.spring.beans.zkcomponents"></context:component-scan>
|
|
|
|
|
|
|
|
|
|
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
|
|
|
|
|
id="propertyConfigurer"
|
|
|
|
|
p:location="/WEB-INF/jdbc.properties"/>
|
|
|
|
|
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" id="propertyConfigurer" p:location="/WEB-INF/jdbc.properties" />
|
|
|
|
|
|
|
|
|
|
<!-- Database -->
|
|
|
|
|
<bean id="dataSource"
|
|
|
|
|
class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"
|
|
|
|
|
p:driverClassName="${jdbc.driverClassName}"
|
|
|
|
|
p:url="${jdbc.databaseurl}" p:username="${jdbc.username}"
|
|
|
|
|
p:password="${jdbc.password}"></bean>
|
|
|
|
|
|
|
|
|
|
<bean id="sessionFactory"
|
|
|
|
|
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
|
|
|
|
|
<property name="dataSource" ref="dataSource"></property>
|
|
|
|
|
<property name="configLocation">
|
|
|
|
|
<value>classpath:hibernate.cfg.xml</value>
|
|
|
|
|
</property>
|
|
|
|
|
<property name="hibernateProperties">
|
|
|
|
|
<props>
|
|
|
|
|
<prop key="hibernate.dialect">${jdbc.dialect}</prop>
|
|
|
|
|
<prop key="hibernate.show_sql">true</prop>
|
|
|
|
|
<prop key="hibernate.hbm2ddl.auto">update</prop>
|
|
|
|
|
</props>
|
|
|
|
|
</property>
|
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
|
|
<tx:annotation-driven transaction-manager="transactionManager"/>
|
|
|
|
|
<bean id="transactionManager"
|
|
|
|
|
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
|
|
|
|
|
<property name="sessionFactory" ref="sessionFactory"></property>
|
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
|
|
<!-- Security -->
|
|
|
|
|
<security:global-method-security secured-annotations="enabled" />
|
|
|
|
|
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" p:driverClassName="${jdbc.driverClassName}" p:url="${jdbc.databaseurl}" p:username="${jdbc.username}" p:password="${jdbc.password}"></bean>
|
|
|
|
|
|
|
|
|
|
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
|
|
|
|
|
<property name="dataSource" ref="dataSource"></property>
|
|
|
|
|
<property name="configLocation">
|
|
|
|
|
<value>classpath:hibernate.cfg.xml</value>
|
|
|
|
|
</property>
|
|
|
|
|
<property name="hibernateProperties">
|
|
|
|
|
<props>
|
|
|
|
|
<prop key="hibernate.dialect">${jdbc.dialect}</prop>
|
|
|
|
|
<prop key="hibernate.show_sql">true</prop>
|
|
|
|
|
<prop key="hibernate.hbm2ddl.auto">update</prop>
|
|
|
|
|
</props>
|
|
|
|
|
</property>
|
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
|
|
<tx:annotation-driven transaction-manager="transactionManager" />
|
|
|
|
|
<bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
|
|
|
|
|
<property name="sessionFactory" ref="sessionFactory"></property>
|
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
|
|
<!-- Security -->
|
|
|
|
|
<security:global-method-security secured-annotations="enabled" />
|
|
|
|
|
|
|
|
|
|
<security:http auto-config="true">
|
|
|
|
|
<security:intercept-url pattern="/app/**" access="ROLE_USER, ROLE_ADMIN"/>
|
|
|
|
|
<security:intercept-url pattern="/admin/**" access="ROLE_ADMIN"/>
|
|
|
|
|
<security:form-login login-page="/login.zhtml"
|
|
|
|
|
authentication-failure-handler-ref="loginFail"/>
|
|
|
|
|
<security:http-basic/>
|
|
|
|
|
<security:logout invalidate-session="true"/>
|
|
|
|
|
<security:intercept-url pattern="/app/**" access="ROLE_USER, ROLE_ADMIN" />
|
|
|
|
|
<security:intercept-url pattern="/admin/**" access="ROLE_ADMIN" />
|
|
|
|
|
<security:form-login login-page="/login.zhtml" authentication-failure-handler-ref="loginFail" />
|
|
|
|
|
<security:http-basic />
|
|
|
|
|
<security:logout invalidate-session="true" />
|
|
|
|
|
</security:http>
|
|
|
|
|
|
|
|
|
|
<security:authentication-manager>
|
|
|
|
|
<security:authentication-provider user-service-ref="userService">
|
|
|
|
|
<security:password-encoder ref="passwordEncoder">
|
|
|
|
|
<security:salt-source user-property="username"/>
|
|
|
|
|
<security:salt-source user-property="username" />
|
|
|
|
|
</security:password-encoder>
|
|
|
|
|
</security:authentication-provider>
|
|
|
|
|
</security:authentication-manager>
|
|
|
|
|
|
|
|
|
|
<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
|
|
|
|
|
<property name="targetClass" value="org.springframework.security.core.context.SecurityContextHolder"/>
|
|
|
|
|
<property name="targetMethod" value="setStrategyName"/>
|
|
|
|
|
<property name="arguments" value="MODE_INHERITABLETHREADLOCAL"/>
|
|
|
|
|
<property name="targetClass" value="org.springframework.security.core.context.SecurityContextHolder" />
|
|
|
|
|
<property name="targetMethod" value="setStrategyName" />
|
|
|
|
|
<property name="arguments" value="MODE_INHERITABLETHREADLOCAL" />
|
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
|
|
<bean id="passwordEncoder" class="org.springframework.security.authentication.encoding.ShaPasswordEncoder"/>
|
|
|
|
|
<bean id="passwordEncoder" class="org.springframework.security.authentication.encoding.ShaPasswordEncoder" />
|
|
|
|
|
|
|
|
|
|
<bean id="loginFail" class="info.bukova.isspst.LoginFailHandler"/>
|
|
|
|
|
<bean id="loginFail" class="info.bukova.isspst.LoginFailHandler" />
|
|
|
|
|
|
|
|
|
|
<!-- DAO -->
|
|
|
|
|
<bean id="userDao" class="info.bukova.isspst.dao.jpa.UserDaoJPA">
|
|
|
|
|
<property name="sessionFactory" ref="sessionFactory"/>
|
|
|
|
|
</bean>
|
|
|
|
|
<!-- DAO -->
|
|
|
|
|
<bean id="userDao" class="info.bukova.isspst.dao.jpa.UserDaoJPA">
|
|
|
|
|
<property name="sessionFactory" ref="sessionFactory" />
|
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
|
|
<bean id="roleDao" class="info.bukova.isspst.dao.jpa.RoleDaoJPA">
|
|
|
|
|
<property name="sessionFactory" ref="sessionFactory"/>
|
|
|
|
|
</bean>
|
|
|
|
|
<bean id="roleDao" class="info.bukova.isspst.dao.jpa.RoleDaoJPA">
|
|
|
|
|
<property name="sessionFactory" ref="sessionFactory" />
|
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
|
|
<bean id="buildingDao" class="info.bukova.isspst.dao.jpa.BuildingDaoJPA">
|
|
|
|
|
<property name="sessionFactory" ref="sessionFactory"/>
|
|
|
|
|
</bean>
|
|
|
|
|
<bean id="buildingDao" class="info.bukova.isspst.dao.jpa.BuildingDaoJPA">
|
|
|
|
|
<property name="sessionFactory" ref="sessionFactory" />
|
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
|
|
<bean id="addressDao" class="info.bukova.isspst.dao.jpa.AddressDaoJPA">
|
|
|
|
|
<property name="sessionFactory" ref="sessionFactory"/>
|
|
|
|
|
</bean>
|
|
|
|
|
<bean id="addressDao" class="info.bukova.isspst.dao.jpa.AddressDaoJPA">
|
|
|
|
|
<property name="sessionFactory" ref="sessionFactory" />
|
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
|
|
<!-- Business logic -->
|
|
|
|
|
<bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"/>
|
|
|
|
|
<!-- Business logic -->
|
|
|
|
|
<bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean" />
|
|
|
|
|
|
|
|
|
|
<bean id="userService" class="info.bukova.isspst.services.users.UserServiceImpl">
|
|
|
|
|
<property name="dao" ref="userDao"/>
|
|
|
|
|
<property name="encoder" ref="passwordEncoder"/>
|
|
|
|
|
<property name="dao" ref="userDao" />
|
|
|
|
|
<property name="encoder" ref="passwordEncoder" />
|
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
|
|
<bean id="roleService" class="info.bukova.isspst.services.users.RoleServiceImpl">
|
|
|
|
|
<property name="dao" ref="roleDao"/>
|
|
|
|
|
<property name="dao" ref="roleDao" />
|
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
|
|
<bean id="buildingService" class="info.bukova.isspst.services.BuildingServiceImpl">
|
|
|
|
|
<property name="dao" ref="buildingDao"/>
|
|
|
|
|
<bean id="buildingService" class="info.bukova.isspst.services.buildings.BuildingServiceImpl">
|
|
|
|
|
<property name="dao" ref="buildingDao" />
|
|
|
|
|
<property name="validator" ref="validator" />
|
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
|
|
<bean id="adbService" class="info.bukova.isspst.services.addressbook.AdbServiceImpl">
|
|
|
|
|
<property name="dao" ref="addressDao"/>
|
|
|
|
|
<property name="validator" ref="validator"/>
|
|
|
|
|
<property name="dao" ref="addressDao" />
|
|
|
|
|
<property name="validator" ref="validator" />
|
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
|
|
<bean id="addressFinderAres" class="info.bukova.isspst.services.addressbook.AddressFinderAres">
|
|
|
|
|
<property name="aresUrl" value="http://wwwinfo.mfcr.cz/cgi-bin/ares/darv_std.cgi"/>
|
|
|
|
|
<property name="unmarsheller" ref="unmarshallerAres"/>
|
|
|
|
|
<property name="aresUrl" value="http://wwwinfo.mfcr.cz/cgi-bin/ares/darv_std.cgi" />
|
|
|
|
|
<property name="unmarsheller" ref="unmarshallerAres" />
|
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
|
|
<bean id="addressFinderTaxID" class="info.bukova.isspst.services.addressbook.AddressFinderTaxID">
|
|
|
|
|
<property name="aresDicUrl" value="http://wwwinfo.mfcr.cz/cgi-bin/ares/darv_bas.cgi"/>
|
|
|
|
|
<property name="aresDicUrl" value="http://wwwinfo.mfcr.cz/cgi-bin/ares/darv_bas.cgi" />
|
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
|
|
<bean id="xmlCtxAres" class="org.castor.spring.xml.XMLContextFactoryBean">
|
|
|
|
@ -135,7 +121,7 @@
|
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
|
|
<bean id="unmarshallerAres" class="org.castor.spring.xml.CastorUnmarshallerFactoryBean">
|
|
|
|
|
<property name="xmlContext" ref="xmlCtxAres"/>
|
|
|
|
|
<property name="xmlContext" ref="xmlCtxAres" />
|
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
|
|
</beans>
|
|
|
|
|