Tipo de recurso:
Manual El directorio en el que se descomprimió pentaho lo llamaremos de aquí en adelante $PENTAHO_FUENTE.
Para configurar nuestro pentaho debemos seguir los siguientes pasos:
1. Ir al directorio $PENTAHO_FUENTE\custom-pentaho-webapp\META-INF y crear el fichero context.xml. Luego de su creación, debemos agregar lo siguiente en el:
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/pentaho" docbase="webapps/pentaho/">
<Resource name="jdbc/Hibernate" auth="Container" type="javax.sql.DataSource"
factory="org.apache.commons.dbcp.BasicDataSourceFactory" maxActive="20"
maxIdle="5"maxWait="10000" username="hibuser" password="password"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/hibernate"validationQuery="/* ping */ select 1"/>
<Resource name="jdbc/Quartz" auth="Container" type="javax.sql.DataSource"
factory="org.apache.commons.dbcp.BasicDataSourceFactory" maxActive="20"
maxIdle="5"maxWait="10000" username="pentaho_user" password="password"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/quartz"validationQuery="/* ping */ select 1"/>
</Context>2. Descargar el Cas Client (URL: http://www.ja-sig.org/downloads/casclients/ descomprimirlo y copiar el fichero cas-client-core-3.1.10.jar) y colocarlo en el directorio $PENTAHO_FUENTE\pentaho-third-party
3. Copiar el fichero spring-security-cas-client-2.0.4.jar de la carpeta lib de CAS y colocarlo en el directorio $PENTAHO_FUENTE\pentaho-third-party
4. Crear el directorio $PENTAHO_FUENTE\build
5. Ir al directorio $PENTAHO_FUENTE y construir el paquete de pentaho utilizando Ant (Es parte de las librerías de Java así como lo es keytool de la sección de SSL) de la siguiente forma:
ant war-pentaho-tomcat
6. Esto colocara nuestro .war en el directorio $PENTAHO_FUENTE\build\pentaho-wars\tomcat, el cual debemos colocar en el directorio webapps de Tomcat así como el pentaho-style.war.7. Es necesario configurar pentaho-solutions para mysql
8. Crear las bases de datos de hibernate y quartz en mysql, utilizando los ficheros que se encuentran en el directorio $PENTAHO_FUENTE\pentahodata\mysql5 (create_quartz_mysql.sql, create_reporsitory_mysql.sql,create_sample_datasource_mysql.sql)
9. Abrir el fichero pentaho-spring-beans.xml ubicado en $PENTAHO_FUENTE\pentaho-solutions\system y editarlo para que quede de la siguiente forma:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springsource.org/dtd/spring-beans.dtd">
<!--+
| This should be the only file specified in web.xml's contextConfigLocation. It should only contain imports.
+-->
<beans>
<import resource="pentahoSystemConfig.xml" />
<import resource="adminPlugins.xml" />
<import resource="systemListeners.xml" />
<import resource="sessionStartupActions.xml" />
<import resource="applicationContext-spring-security.xml" />
<import resource="applicationContext-common-authorization.xml" />
<import resource="pentahoObjects.spring.xml" />
<import resource="applicationContext-spring-security-jdbc.xml"/>
<import resource="applicationContext-pentaho-security-jdbc.xml"/>
<import resource="applicationContext-spring-security-cas.xml"/>
</beans>10. Crear el archivo applicationContext-spring-security-cas.xml en la ruta $PENTAHO_FUENTE\pentaho-solutions\system con la siguiente configuración:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--+
| Application context containing FilterChainProxy. This version overrides
| certain beans from applicationContext-spring-security.xml to enable CAS.
+--><!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd"><beans default-autowire="no" default-dependency-check="none" default-lazy-init="false">
<!-- ======================== FILTER CHAIN ======================= -->
<!-- overridden from applicationContext-spring-security.xml to enable CAS -->
<bean autowire="default" class="org.springframework.security.util.FilterChainProxy" dependencycheck="default" id="filterChainProxy" lazy-init="default">
<property name="filterInvocationDefinitionSource">
<value>
<![CDATA[CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON PATTERN_TYPE_APACHE_ANT
/**=securityContextHolderAwareRequestFilter,httpSessionContextIntegrationFilter,logoutFilter,casProcessingFilter,basicProcessingFilter,requestParameterProcessingFilter,anonymousProcessingFilter,pentahoSecurit yStartupFilter,exceptionTranslationFilter,filterInvocationInterceptor]]>
</value>
</property>
</bean><!-- ===================== HTTP REQUEST SECURITY ==================== -->
<bean autowire="default" class="org.springframework.security.ui.cas.ServiceProperties"dependency-check="default" id="serviceProperties" lazy-init="default">
<property name="service"
value="http://localhost:8080/pentaho/j_spring_cas_security_check"/><property name="sendRenew" value="false"/>
</bean>
<!-- replaces authenticationProcessingFilter in filterChainProxy above -->
<bean autowire="default" class="org.springframework.security.ui.cas.CasProcessingFilter"dependency-check="default" id="casProcessingFilter" lazy-init="default">
<property name="authenticationManager">
<ref bean="authenticationManager"/>
</property>
<property name="authenticationFailureUrl" value="/public/casFailed"/>
<property name="defaultTargetUrl" value="/"/>
<property name="filterProcessesUrl" value="/j_spring_cas_security_check"/>
</bean>
<!-- overridden from applicationContext-spring-security.xml -->
<bean autowire="default" class="org.springframework.security.ui.ExceptionTranslationFilter"dependency-check="default" id="exceptionTranslationFilter" lazy-init="default">
<property name="authenticationEntryPoint">
<ref local="casProcessingFilterEntryPoint"/>
</property>
<property name="accessDeniedHandler">
<bean autowire="default"
class="org.springframework.security.ui.AccessDeniedHandlerImpl" dependency-check="default" lazyIntegración init="default"/></property>
</bean>
<bean autowire="default" class="org.springframework.security.ui.cas.CasProcessingFilterEntryPoint"dependency-check="default" id="casProcessingFilterEntryPoint" lazy-init="default">
<property name="loginUrl" value="https://localhost:8443/cas/login"/>
<property name="serviceProperties">
<ref local="serviceProperties"/>
</property>
</bean>
<!-- overridden from applicationContext-spring-security.xml -->
<bean autowire="default" class="org.springframework.security.providers.ProviderManager"dependency-check="default" id="authenticationManager" lazy-init="default">
<property name="providers">
<list>
<!--ref bean="daoAuthenticationProvider" /-->
<ref bean="anonymousAuthenticationProvider"/>
<ref bean="casAuthenticationProvider"/>
</list>
</property>
</bean>
<bean autowire="default"
class="org.springframework.security.providers.cas.CasAuthenticationProvider" dependency-check="default"id="casAuthenticationProvider" lazy-init="default"><property name="userDetailsService">
<ref bean="userDetailsService"/>
</property>
<property name="serviceProperties">
<ref local="serviceProperties"/>
</property>
<property name="ticketValidator">
<ref local="ticketValidator"/>
</property>
<property name="key" value="my_password_for_this_auth_provider_only"/>
</bean>
<bean autowire="default" class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator"dependency-check="default" id="ticketValidator" lazy-init="default">
</bean>
<!-- overridden from applicationContext-spring-security.xml to specify logoutSuccessUrl as CAS logout page -->
<bean autowire="default" class="org.springframework.security.ui.logout.LogoutFilter" dependencycheck="default" id="logoutFilter" lazy-init="default">
<constructor-arg
value="https://localhost:8443/cas/logout?url=http://localhost:8080/pentaho/Home"/><!-- URL redirected to after logout -->
<constructor-arg>
<list>
<bean autowire="default"
class="org.pentaho.platform.web.http.security.PentahoLogoutHandler" dependency-check="default" lazyinit="default"/><bean autowire="default"
class="org.springframework.security.ui.logout.SecurityContextLogoutHandler" dependency-check="default"lazy-init="default"/></list>
</constructor-arg>
<property name="filterProcessesUrl" value="/Logout"/>
</bean>
11. Editar el fichero pentaho.xml ubicado en la ruta $PENTAHO_FUENTE\pentaho-solutions\system, reemplazando “Admin” por “Administrator” en todas las ocurrencias del archivo y “User” por “Authenticated”
12. Editar el fichero applicationContext-spring-security-jdbc.xml ubicado en la ruta $PENTAHO_FUENTE\pentaho-solutions\system que debe quedar de la siguiente forma:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springsource.org/dtd/spring-beans.dtd">
<!--+
| Application context containing JDBC AuthenticationProvider
| implementation.
+-->
<bean id="daoAuthenticationProvider"
class="org.springframework.security.providers.dao.DaoAuthenticationProvider"
><property name="userDetailsService">
<ref bean="userDetailsService" />
</property>
<property name="passwordEncoder">
<ref bean="passwordEncoder" />
</property>
</bean>
<bean id="userDetailsService"
class="org.springframework.security.userdetails.jdbc.JdbcDaoImpl">
<property name="dataSource">
<ref local="dataSource" />
</property>
<property name="authoritiesByUsernameQuery">
<value>
<![CDATA[SELECT user_.screenname as username, role_.name as authority FROM role_, user_, users_roles where role_.roleId = users_roles.roleId AND user_.userId = users_roles.userId AND user_.screenname = ? ORDER by role_.name]]>
</value>
</property>
<property name="usersByUsernameQuery">
<value>
<![CDATA[select screenname as username, password_ as password, 1 as enabled from user_ where screenname = ? order by username]]>
</value>
</property>
</bean>
<!-- This is only for Hypersonic. Please update this section for any other database you are using -->
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url"
value="jdbc:mysql://localhost:3306/lportal" />
<property name="username" value="lportal" />
<property name="password" value="lportal" />
</bean>
<bean id="passwordEncoder"
class="org.springframework.security.providers.encoding.PlaintextPasswordEncoder"/></beans>
13. Editar el fichero applicationContext-pentaho-security-jdbc.xml ubicado en la ruta $PENTAHO_FUENTE\pentaho-solutions\system que debe quedar de la siguiente forma:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springsource.org/dtd/spring-beans.dtd">
<!--+
| Application context containing JDBC UserRoleListService
| implementation.
+-->
<bean id="jdbcUserRoleListService"
class="org.pentaho.platform.plugin.services.security.userrole.jdbc.JdbcUserR oleListService">
<constructor-arg index="0" ref="userDetailsService" />
<property name="allAuthoritiesQuery">
<value>
<![CDATA[select distinct(name) as authority from role_order by authority]]>
</value>
</property>
<property name="allUsernamesInRoleQuery">
<value>
<![CDATA[SELECT user_.screenname as username FROM role_,user_, users_roles where role_.roleId = users_roles.roleId AND user_.userId =users_roles.userId AND role_.name = ? ORDER by role_.name]]>
</value>
</property>
<property name="allUsernamesQuery">
<value>
<![CDATA[SELECT distinct(user_.screenname) as username from user_ order by username]]>
</value>
</property>
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="pentahoUserRoleListService" class="org.pentaho.platform.engine.security.userrole.UserDetailsRoleListService"><property name="userRoleListService">
<ref local="jdbcUserRoleListService" />
</property>
</bean>
</beans>14. Editar el fichero applicationContext-spring-security.xml ubicado en la ruta $PENTAHO_FUENTE\pentaho-solutions\system, reemplazando “Admin” por “Administrator” en todas las ocurrencias del archivo y “Authenticated” por “User”
15. Copiar el directorio pentaho-solutions de $PENTAHO_FUENTE y colocarlo en $DIRECTORIO_PACK
16. Iniciar Tomcat e ir a la dirección http://localhost:8080/pentaho, la cual deberia redirigirnos a la página de inicio de sesión de CAS y luego de iniciar sesión a la pantalla principal de Pentaho
No hay comentarios:
Publicar un comentario