<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean id="txProxyTemplate" abstract="true"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager" />
</property>
<property name="transactionAttributes">
<props>
<prop key="save*">PROPAGATION_REQUIRED</prop>
<prop key="add*">PROPAGATION_REQUIRED</prop>
<prop key="remove*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
<bean id="autorService" parent="txProxyTemplate">
<property name="target">
<bean
class=" br.ucsal.projeto.domain.services.impl.AutorServiceImpl">
<property name="autorDAO">
<ref bean="autorDAO" />
</property>
</bean>
</property>
</bean>
<bean id="cursoService" parent="txProxyTemplate">
<property name="target">
<bean
class=" br.ucsal.projeto.domain.services.impl.CursoServiceImpl">
<property name="cursoDAO">
<ref bean="cursoDAO" />
</property>
</bean>
</property>
</bean>
<bean id="documentoService" parent="txProxyTemplate">
<property name="target">
<bean
class=" br.ucsal.projeto.domain.services.impl.DocumentoServiceImpl">
<property name="documentoDAO">
<ref bean="documentoDAO" />
</property>
</bean>
</property>
</bean>
<bean id="instituicaoService" parent="txProxyTemplate">
<property name="target">
<bean
class=" br.ucsal.projeto.domain.services.impl.InstituicaoServiceImpl">
<property name="instituicaoDAO">
<ref bean="instituicaoDAO" />
</property>
</bean>
</property>
</bean>
</beans>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean id="dataSourceMonografias"
class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName"
value="org.gjt.mm.mysql.Driver" />
<property name="url"
value="jdbc:mysql://localhost:3306/monografias" />
<property name="username" value="root" />
<property name="password" value="popete" />
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSourceMonografias" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</prop>
<prop key="current_session_context_class">thread</prop>
<prop key="cache.provider_class">
org.hibernate.cache.NoCacheProvider
</prop>
<prop key="show_sql">true</prop>
<prop key="connection.pool_size">10</prop>
</props>
</property>
<property name="configLocation">
<value>WEB-INF/hibernate.cfg.xml</value>
</property>
<property name="configurationClass">
<value>org.hibernate.cfg.AnnotationConfiguration</value>
</property>
</bean>
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="daoTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="txAttributeSource"
class="org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource">
<property name="properties">
<props>
<prop key="add*">PROPAGATION_REQUIRED</prop>
<prop key="update*">PROPAGATION_REQUIRED</prop>
<prop key="remove*">PROPAGATION_REQUIRED</prop>
<prop key="send*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
<bean id="txInterceptor"
class="org.springframework.transaction.interceptor.TransactionInterceptor">
<property name="transactionManager">
<ref local="transactionManager" />
</property>
<property name="transactionAttributeSource">
<ref local="txAttributeSource" />
</property>
</bean>
<bean id="autoProxyCreator"
class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="interceptorNames">
<list>
<idref local="txInterceptor" />
</list>
</property>
<property name="beanNames">
<list>
<value>*Dao</value>
<value>*DAO</value>
</list>
</property>
</bean>
<bean id="instituicaoDAO"
class="br.ucsal.projeto.domain.dao.impl.InstituicaoDAOImpl"
parent="daoTemplate" />
<bean id="autorDAO"
class="br.ucsal.projeto.domain.dao.impl.AutorDAOImpl"
parent="daoTemplate" />
<bean id="cursoDAO"
class="br.ucsal.projeto.domain.dao.impl.CursoDAOImpl"
parent="daoTemplate" />
<bean id="documentoDAO"
class="br.ucsal.projeto.domain.dao.impl.DocumentoDAOImpl"
parent="daoTemplate" />
</beans>
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<description>Projeto Final</description>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext-view.xml,
/WEB-INF/applicationContext-persistence.xml,
/WEB-INF/applicationContext-service.xml</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.SKIN</param-name>
<param-value>blueSky</param-value>
</context-param>
<filter>
<display-name>RichFaces Filter</display-name>
<filter-name>richfaces</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
</filter>
<filter-mapping>
<filter-name>richfaces</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<filter>
<filter-name>MyFaces</filter-name>
<filter-class>
org.apache.myfaces.webapp.filter.ExtensionsFilter
</filter-class>
<init-param>
<param-name>maxFileSize</param-name>
<param-value>20m</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>MyFaces</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
<filter-mapping>
<filter-name>MyFaces</filter-name>
<url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>sessionFilter</filter-name>
<filter-class>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>sessionFilter</filter-name>
<url-pattern>*.jsf</url-pattern>
</filter-mapping>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener
</listener-class>
</listener>
<context-param>
<param-name>com.sun.faces.verifyObjects</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.validateXml</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.application.CONFIG_FILES</param-name>
<param-value></param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>myfaces_allow_javascript</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>myfaces_pretty_html</param-name>
<param-value>true</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
</web-app>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean id="cursoModel"
class="br.ucsal.projeto.domain.model.CursoModel" />
<bean id="cursoService"
class="br.ucsal.projeto.domain.services.CursoServiceImpl" />
<bean id="instituicaoService"
class="br.ucsal.projeto.domain.services.InstituicaoServiceImpl" />
<bean id="cadastroMapaFaces"
class="br.ucsal.projeto.faces.CadastroMapaFaces" scope="session" />
<bean id="baseFaces" class="br.ucsal.projeto.faces.BaseFaces">
<property name="cursoModel" ref="cursoModel" />
<property name="cursoService" ref="cursoService" />
<property name="instituicaoService" ref="instituicaoService" />
</bean>
</beans>
<application>
<variable-resolver>
org.springframework.web.jsf.DelegatingVariableResolver
</variable-resolver>
<locale-config>
<default-locale>pt_br</default-locale>
<supported-locale>pt_br</supported-locale>
</locale-config>
<message-bundle>messages</message-bundle>
</application>
